Lexer will pass the original tokens even if it can be inferred to match the type of terminal defined in .cup file.

This commit is contained in:
bill
2021-02-20 04:04:06 +08:00
parent 2ab3fddc66
commit 27b46f386d
+1 -1
View File
@@ -39,7 +39,7 @@ import java.util.ArrayList;
/** Return a terminal symbol of syntactic category TYPE and no /** Return a terminal symbol of syntactic category TYPE and no
* semantic value at the current source location. */ * semantic value at the current source location. */
private Symbol symbol(int type) { private Symbol symbol(int type) {
return symbol(type, null); return symbol(type, yytext());
} }
/** Return a terminal symbol of syntactic category TYPE and semantic /** Return a terminal symbol of syntactic category TYPE and semantic