From 27b46f386d1bee3457d4c93fca9f208e399d7939 Mon Sep 17 00:00:00 2001 From: bill Date: Sat, 20 Feb 2021 04:04:06 +0800 Subject: [PATCH] Lexer will pass the original tokens even if it can be inferred to match the type of terminal defined in .cup file. --- src/main/jflex/chocopy/pa1/ChocoPy.jflex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/jflex/chocopy/pa1/ChocoPy.jflex b/src/main/jflex/chocopy/pa1/ChocoPy.jflex index 9cc41de..8ecbb02 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, null); + return symbol(type, yytext()); } /** Return a terminal symbol of syntactic category TYPE and semantic