unexpected symbol 287 (ğ) when evaluating expression #74

Closed
opened 2020-08-11 16:36:15 +00:00 by jplwill · 3 comments
jplwill commented 2020-08-11 16:36:15 +00:00 (Migrated from github.com)

In normal Lua, the interpreter will evaluate an expression:

$ lua
> 1 + 1
2

In LuaJ, evaluating a bare expression like 1 + 1 results in a LuaError with this message: unexpected symbol 287 (ğ). This happens whether I'm loading the expression using the Java API or I'm running LuaJ as an interactive REPL.

This is clearly a bug, as there's no such character in the input.

In normal Lua, the interpreter will evaluate an expression: ``` $ lua > 1 + 1 2 ``` In LuaJ, evaluating a bare expression like `1 + 1` results in a LuaError with this message: `unexpected symbol 287 (ğ)`. This happens whether I'm loading the expression using the Java API or I'm running LuaJ as an interactive REPL. This is clearly a bug, as there's no such character in the input.
jplwill commented 2020-08-14 17:08:38 +00:00 (Migrated from github.com)

In LexState.java, 287 is the integer code for TK_NUMBER. This error seems to indicate that the compiler is looking for more input, and is (by default at least) expecting to see a number. The error is thrown in LexState.java in the primaryexp() method.

In LexState.java, 287 is the integer code for `TK_NUMBER`. This error seems to indicate that the compiler is looking for more input, and is (by default at least) expecting to see a number. The error is thrown in LexState.java in the `primaryexp()` method.
jplwill commented 2020-08-14 17:10:45 +00:00 (Migrated from github.com)

The script mytab = { results in a similar error, with unexpected symbol 286. Symbol 286 is TK_EOS, meaning end of string.

The script `mytab = {` results in a similar error, with `unexpected symbol 286`. Symbol 286 is TK_EOS, meaning end of string.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-autonomous-connection/luaj#74