diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/src/parser/ast.lua | 9 | ||||
-rw-r--r-- | server/src/parser/grammar.lua | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua index 508252ae..8bb12959 100644 --- a/server/src/parser/ast.lua +++ b/server/src/parser/ast.lua @@ -298,12 +298,15 @@ local Defs = { start = pos-1, finish = pos, } - return '' + return char end return string_char(tonumber(char, 16)) end, CharUtf8 = function (pos, char) - if State.Version ~= 'Lua 5.3' and State.Version ~= 'Lua 5.4' then + if State.Version ~= 'Lua 5.3' + and State.Version ~= 'Lua 5.4' + and State.Version ~= 'LuaJIT' + then pushError { type = 'ERR_ESC', start = pos-3, @@ -425,8 +428,8 @@ local Defs = { version = State.Version, } } - State.LastNumber[1] = 0 end + State.LastNumber[1] = 0 end, Name = function (start, str, finish) local isKeyWord diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua index 656f98da..d0a2baaf 100644 --- a/server/src/parser/grammar.lua +++ b/server/src/parser/grammar.lua @@ -255,10 +255,11 @@ StringClose <- ']' =eq ']' grammar 'Number' [[ Number <- Sp ({} {NumberDef} {}) -> Number NumberSuffix? + ErrNumber? NumberDef <- Number16 / Number10 NumberSuffix<- ({} {[uU]? [lL] [lL]}) -> FFINumber / ({} {[iI]}) -> ImaginaryNumber - / ({} {([0-9a-zA-Z] / '.')+}) -> UnknownSymbol +ErrNumber <- ({} {([0-9a-zA-Z] / '.')+}) -> UnknownSymbol Number10 <- Float10 Float10Exp? / Integer10 Float10? Float10Exp? |