boolangery / py-lua-parser

A Lua parser and AST builder written in Python.
MIT License
117 stars 36 forks source link

Fail to reject an invalid escape sequence #30

Closed bendrissou closed 1 year ago

bendrissou commented 1 year ago

The parser fails to reject the following invalid input:

return "\u{XYZ}"

Only hexadecimal digits should be allowed in the escape sequence, which is not the case in the example above.

From the Lua specification, we have:

The UTF-8 encoding of a Unicode character can be inserted in a literal string with the escape sequence \u{XXX} (note the mandatory enclosing brackets), where XXX is a sequence of one or more hexadecimal digits representing the character code point.

Can you provide feedback on this issue please.

boolangery commented 1 year ago

Resolved thanks to @alkino