Invalid escape sequences in string literals not raising errors (e.g. \q) #122

Closed
opened 2025-12-10 12:02:57 +00:00 by tupesanket1999 · 1 comment
tupesanket1999 commented 2025-12-10 12:02:57 +00:00 (Migrated from github.com)

Hi,
I noticed that luaj does not throw an error for invalid string escape sequences.
Example:

local s = "bad\qescape"
print(s)

Expected behavior (based on standard Lua):
The parser should raise an error for invalid escape sequences like \q.

Actual behavior in luaj:
No error is thrown. The escape sequence is silently treated as a literal character.

Hi, I noticed that luaj does not throw an error for invalid string escape sequences. Example: local s = "bad\qescape" print(s) Expected behavior (based on standard Lua): The parser should raise an error for invalid escape sequences like \q. Actual behavior in luaj: No error is thrown. The escape sequence is silently treated as a literal character.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-autonomous-connection/luaj#122