franko / luajit-lang-toolkit

A Lua bytecode compiler written in Lua itself for didactic purposes or for new language implementations
Other
654 stars 91 forks source link

Parenthesis dropped in generated Lua #27

Closed gnois closed 9 years ago

gnois commented 9 years ago
print(("hi"):rep(3))

gives

print("hi":rep(3))

Output:
lua: run.lua:70: [string "print("\..."]:3: ')' expected near ':'

Due to the parenthesis were dropped.

franko commented 9 years ago

Fixed in git HEAD with commit franko@8ddc901ac48c. I've also added a few test cases.

Thank you for reporting that.