mirror of
https://github.com/notwa/lips
synced 2024-11-14 15:09:02 -08:00
fix parsing of 0 in expressions
This commit is contained in:
parent
ab493693a9
commit
6bae5647c8
1 changed files with 5 additions and 2 deletions
|
@ -154,9 +154,12 @@ function Expression:lex1(str, tokens)
|
|||
num = tonumber(considered, 2)
|
||||
elseif consider('0x[0-9A-Fa-f]+') then
|
||||
num = tonumber(considered, 16)
|
||||
elseif consider('0[0-7]+') then
|
||||
elseif consider('0[0-9]+') then
|
||||
if considered:match('[89]') then
|
||||
return "bad octal number: "..considered..here
|
||||
end
|
||||
num = tonumber(considered, 8)
|
||||
elseif consider('[1-9][0-9]*') then
|
||||
elseif consider('[0-9]*') then
|
||||
num = tonumber(considered)
|
||||
end
|
||||
if num == nil then
|
||||
|
|
Loading…
Reference in a new issue