Fix for math expression parsing

This commit is contained in:
Bruce Hill 2018-04-30 14:50:25 -07:00
parent bf24824660
commit 35a5539185
3 changed files with 3 additions and 3 deletions

View File

@ -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()

View File

@ -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!

View File

@ -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