Fix for math expression parsing
This commit is contained in:
parent
bf24824660
commit
35a5539185
@ -153,7 +153,7 @@ Tree("Block", {
|
||||
return nomsu
|
||||
end
|
||||
})
|
||||
local math_expression = re.compile([[ "%" (" " [*/^+-] " %")+ ]])
|
||||
local math_expression = re.compile([[ "%" (" " [*/^+-] " %")+ !. ]])
|
||||
Tree("Action", {
|
||||
as_lua = function(self, nomsu)
|
||||
local stub = self:get_stub()
|
||||
|
@ -103,7 +103,7 @@ Tree "Block",
|
||||
nomsu\append "\n"
|
||||
return nomsu
|
||||
|
||||
math_expression = re.compile [[ "%" (" " [*/^+-] " %")+ ]]
|
||||
math_expression = re.compile [[ "%" (" " [*/^+-] " %")+ !. ]]
|
||||
Tree "Action",
|
||||
as_lua: (nomsu)=>
|
||||
stub = @get_stub!
|
||||
|
@ -40,7 +40,7 @@ with {%z:nil, %x:999}
|
||||
assume (%x = 1) or barf "'with' scoping failed"
|
||||
assume (%z = (nil)) or barf "'with' scoping failed"
|
||||
|
||||
assume ((1+2*3-4/2^2) = 6) or barf "math expressions not working properly"
|
||||
assume ((1 + 2*3 - 4/2^2) = 6) or barf "math expressions not working properly"
|
||||
assume ((5 wrapped around 2) = 1) or barf "mod not working"
|
||||
assume (1 <= 2 < 3) or barf "chained operator fail."
|
||||
%value <- -999
|
||||
|
Loading…
Reference in New Issue
Block a user