Răsfoiți Sursa

Amelioration parseList

Arthur Brandao 6 ani în urmă
părinte
comite
fdc88a3689
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      src/migl/lisp/LispImpl.java

+ 2 - 1
src/migl/lisp/LispImpl.java

@@ -58,7 +58,7 @@ public class LispImpl implements Lisp {
 						result.add(str.substring(1));
 					}
 				} else if(str.charAt(str.length() - 1) == ')'){
-					result.add(str.substring(0, str.length() - 2));
+					result.add(str.substring(0, str.length() - 1));
 					result.add("" + str.charAt(str.length() - 1));
 				} else {
 					result.add(str);
@@ -100,6 +100,7 @@ public class LispImpl implements Lisp {
 		String val = pile.remove(0);
 		while(pile.size() > 0 && !val.equals(")")) {
 			if(val.equals("(")) {
+				//list = list.append(this.parse("(" + val));
 				list = list.append(this.parseList(pile));
 			} else {
 				list = list.append(this.parseElement(val));