Closed 9468305 closed 7 years ago
Most probably an encoding issue in the typescriptdef.lex
file. Il looks like the rule line 192, acts like []
was meaning something else such as a Chinese character... Not sure what to do here... you could try to remove/replace the rule and see what happens...
Hello, it sounds like you have an encoding issue or a wrong char, see this line in typescriptdef.lex:
[锘縘 { /* ignore */ }
it should be []
I double check this charactor typo issue. I am sure its not my local env encoding issue. It also has no relation to Windows Console GBK encoding.
When I replace it with [], build success. But left a warning as below.
[java] Warning in file "src\main\java\org\jsweet\input\typescriptdef\parser
\typescriptdef.lex" (line 192):
[java] Rule can never be matched:
[java] [] { /* ignore */ }
by @lgrignon 's opinion, this should be OK, so I send a PR to you.
[java] Building parse tables...
[java] Computing non-terminal nullability...
[java] Computing first sets...
[java] Building state machine...
[java] Filling in tables...
[java] Checking for non-reduced productions...
[java] Writing parser...
[java] Closing files...
[java] ------- CUP v0.10k Parser Generation Summary -------
[java] 0 errors and 25 warnings
[java] 75 terminals, 75 non-terminals, and 175 productions declared,
[java] producing 357 unique parse states.
[java] 25 terminals declared but not used.
[java] 0 non-terminals declared but not used.
[java] 0 productions never reduced.
[java] 0 conflicts detected (0 expected).
[java] Code written to "TypescriptDefParser.java", and "sym.java".
[java] ---------------------------------------------------- (v0.10k)
[move] Moving 1 file to D:\jsweet-2.0.0-rc1\candy-generator\src\main\java\o
rg\jsweet\input\typescriptdef\parser
[move] Moving 1 file to D:\jsweet-2.0.0-rc1\candy-generator\src\main\java\o
rg\jsweet\input\typescriptdef\parser
[echo] Generating TSDef API lexer...
[java] Reading "src\main\java\org\jsweet\input\typescriptdef\parser\typescr
iptdef.lex"
[java]
[java] Warning : Macro "StringText" has been declared but never used.
[java]
[java] Warning : Macro "DecFloatLiteral" has been declared but never used.
[java] Constructing NFA : 1291 states in NFA
[java] Converting NFA to DFA :
[java] ....................................................................
................................................................................
................................................................................
................................................................................
................................................................................
..........................................................................
[java]
[java] Warning in file "src\main\java\org\jsweet\input\typescriptdef\parser
\typescriptdef.lex" (line 192):
[java] Rule can never be matched:
[java] [] { /* ignore */ }
[java] 472 states before minimization, 370 states in minimized DFA
[java] Writing code to "src\main\java\org\jsweet\input\typescriptdef\parser
\TypescriptDefScanner.java"
[INFO] Executed tasks
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.066 s
[INFO] Finished at: 2017-08-14T20:32:17+08:00
[INFO] Final Memory: 10M/245M
[INFO] ------------------------------------------------------------------------
I suspect that some special character was once inside the []
but it got removed or hidden because of encoding, maybe because of saving or committing... I shall investigate the history when possible.
Hello,
branch develop src\main\java\org\jsweet\input\typescriptdef\parser\typescriptdef.lex#193 special char still there
My editor default encoding is utf8, when i copy the line typescriptdef.lex#193 into my editor from github web page, the special char apear.
can you PR a fix if simple please?
I use jsweet-2.0.0-rc1, try to build candy-generator. But failed, output log as below: My env is Win7, maven 3.5.0, node.js 6.11.0, npm 3.10.10