1
0
Fork 0
mirror of https://github.com/Reuh/candran.git synced 2025-10-27 09:59:29 +00:00

Fixed assignemnt operators priority bug

accidentaly added AST dumping to canc in the process
This commit is contained in:
Étienne Fildadut 2017-08-24 17:32:20 +02:00
parent 006099a57c
commit 025a55f708
5 changed files with 133 additions and 84 deletions

View file

@ -205,6 +205,22 @@ a = "hello"
a ..=.. " world " assert(a == "hello world hello", "..=..")
]], nil)
test("left assigments operators priority", [[
local a = 5
a *= 2 + 3
return a
]], 25)
test("right assigments operators priority", [[
local a = 5
a =/ 2 + 3
return a
]], 1)
test("left+right assigments operators priority", [[
local a = 5
a *=/ 2 + 3
return a
]], 5)
-- Default function parameters
test("default parameters", [[
local function test(hey, def="re", no, foo=("bar"):gsub("bar", "batru"))