diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-07-14 17:59:00 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-07-14 17:59:00 +0800 |
commit | 5bb66bb4edf816367caa39d40ea194c4abf1e7e6 (patch) | |
tree | 34d5ddd8c3edbdc2725a99b37543bcc268e4999c /script | |
parent | a00010ff44dff173a6eb5fdd6dc51f47e2b1fbf3 (diff) | |
download | lua-language-server-5bb66bb4edf816367caa39d40ea194c4abf1e7e6.zip |
Revert "fix #597"
This reverts commit a00010ff44dff173a6eb5fdd6dc51f47e2b1fbf3.
Diffstat (limited to 'script')
-rw-r--r-- | script/parser/ast.lua | 22 | ||||
-rw-r--r-- | script/parser/grammar.lua | 7 |
2 files changed, 3 insertions, 26 deletions
diff --git a/script/parser/ast.lua b/script/parser/ast.lua index aa02ae3d..e92e3e16 100644 --- a/script/parser/ast.lua +++ b/script/parser/ast.lua @@ -4,9 +4,9 @@ local utf8Char = utf8.char local tableUnpack = table.unpack local mathType = math.type local tableRemove = table.remove +local pairs = pairs local tableSort = table.sort local print = print -local tostring = tostring _ENV = nil @@ -613,26 +613,6 @@ local Defs = { end lastNumber[1] = 0 end, - Integer2 = function (start, word) - if State.version ~= 'LuaJIT' then - PushError { - type = 'UNSUPPORT_SYMBOL', - start = start, - finish = start + 1, - version = 'LuaJIT', - info = { - version = State.version, - } - } - end - local num = 0 - for i = 1, #word do - if word:sub(i, i) == '1' then - num = num | (1 << (i - 1)) - end - end - return tostring(num) - end, Name = function (start, str, finish) local isKeyWord if RESERVED[str] then diff --git a/script/parser/grammar.lua b/script/parser/grammar.lua index 5120df20..2c046f0e 100644 --- a/script/parser/grammar.lua +++ b/script/parser/grammar.lua @@ -270,10 +270,10 @@ StringClose <- ']' =eq ']' ]] grammar 'Number' [[ -Number <- Sp ({} {~ '-'? NumberDef ~} {}) -> Number +Number <- Sp ({} {'-'? NumberDef} {}) -> Number NumberSuffix? ErrNumber? -NumberDef <- Number16 / Integer2 / Number10 +NumberDef <- Number16 / Number10 NumberSuffix<- ({} {[uU]? [lL] [lL]}) -> FFINumber / ({} {[iI]}) -> ImaginaryNumber ErrNumber <- ({} {([0-9a-zA-Z] / '.')+}) -> UnknownSymbol @@ -293,9 +293,6 @@ Float16 <- '.' X16+ / '.' ({} {Word*}) -> MustX16 Float16Exp <- [pP] [+-]? [0-9]+ / ({} [pP] [+-]? {}) -> MissExponent - -Integer2 <- ({} '0' [bB] {[01]+}) - -> Integer2 ]] grammar 'Name' [[ |