mirror of
https://github.com/notwa/lips
synced 2024-11-14 14:49:03 -08:00
allow _ in expr vars; tweak number matching
This commit is contained in:
parent
63644df1bc
commit
b80fb49a22
1 changed files with 3 additions and 3 deletions
|
@ -174,9 +174,9 @@ function Expression:lex1(str, tokens)
|
|||
return "bad octal number: "..considered..here
|
||||
end
|
||||
num = tonumber(considered:sub(2), 8)
|
||||
elseif consider('#[0-9]*') then
|
||||
elseif consider('#[0-9]+') then
|
||||
num = tonumber(considered:sub(2))
|
||||
elseif consider('[0-9]*') then
|
||||
elseif consider('[0-9]+') then
|
||||
num = tonumber(considered)
|
||||
end
|
||||
if num == nil then
|
||||
|
@ -193,7 +193,7 @@ function Expression:lex1(str, tokens)
|
|||
elseif consider_operator() then
|
||||
insert(tokens, {type='operator', value=considered})
|
||||
consume(#considered)
|
||||
elseif consider('%w+') then
|
||||
elseif consider('[%w_]+') then
|
||||
local num = self.variables[considered]
|
||||
if num == nil then
|
||||
return 'undefined variable "'..considered..'"'
|
||||
|
|
Loading…
Reference in a new issue