diff --git a/src/main/jflex/chocopy/pa1/ChocoPy.jflex b/src/main/jflex/chocopy/pa1/ChocoPy.jflex index ccb7187..9cc41de 100644 --- a/src/main/jflex/chocopy/pa1/ChocoPy.jflex +++ b/src/main/jflex/chocopy/pa1/ChocoPy.jflex @@ -39,7 +39,7 @@ import java.util.ArrayList; /** Return a terminal symbol of syntactic category TYPE and no * semantic value at the current source location. */ private Symbol symbol(int type) { - return symbol(type); + return symbol(type, null); } /** Return a terminal symbol of syntactic category TYPE and semantic @@ -142,8 +142,9 @@ if True: if(top()< currIndent) { /* - If current indentation is more than indents current level should have, - start a new level which will have `currIndent' spaces. + If current indentation is more than the number of indents + current level should have, start a new level which will have + `currIndent' indents. */ push(currIndent); return symbol(ChocoPyTokens.INDENT, currIndent); @@ -153,7 +154,7 @@ if True: { /* Delimiters. */ - {LineBreak} { return symbol(ChocoPyTokens.NEWLINE); yybegin(YYINITIAL); currIndent = 0;} + {LineBreak} { yybegin(YYINITIAL); currIndent = 0;return symbol(ChocoPyTokens.NEWLINE);} ":" { return symbol(ChocoPyTokens.COLON); } "," { return symbol(ChocoPyTokens.COMMA); }