diff options
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/ast.lua | 2 | ||||
-rw-r--r-- | script/parser/guide.lua | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/script/parser/ast.lua b/script/parser/ast.lua index 40b5788e..bd8a66cf 100644 --- a/script/parser/ast.lua +++ b/script/parser/ast.lua @@ -547,7 +547,7 @@ local Defs = { local n = tonumber(number) if n then State.LastNumber = { - type = 'number', + type = mathType(n) == 'integer' and 'integer' or 'number', start = start, finish = finish - 1, [1] = n, diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 1c6b9e81..e6501f12 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -183,6 +183,7 @@ function m.isLiteral(obj) or tp == 'boolean' or tp == 'string' or tp == 'number' + or tp == 'integer' or tp == 'table' or tp == 'function' end @@ -198,6 +199,8 @@ function m.getLiteral(obj) return obj[1] elseif tp == 'number' then return obj[1] + elseif tp == 'integer' then + return obj[1] end return nil end @@ -818,6 +821,11 @@ function m.getKeyNameOfLiteral(obj) if n then return ('%s'):format(formatNumber(obj[1])) end + elseif tp == 'integer' then + local n = obj[1] + if n then + return ('%s'):format(formatNumber(obj[1])) + end elseif tp == 'boolean' then local b = obj[1] if b then @@ -883,6 +891,8 @@ function m.getKeyTypeOfLiteral(obj) return 'string' elseif tp == 'number' then return 'number' + elseif tp == 'integer' then + return 'integer' elseif tp == 'boolean' then return 'boolean' end |