Log In  
Log In  

x=x+shl(
  1,
  y
)

Works fine.

x+=shl(
  1,
  y
)

Syntax error: unclosed (

x+=shl(1,
  y
)

Syntax error: unexpected symbol near ')'

P#60249 2018-12-22 15:47

Yeah, this is an invisible shortcoming of how the += language extension is implemented. x+=y isn't a part of Lua, so Pico-8 adds it by replacing x+=y with x=x+(y) before giving it to Lua.

In these cases, it sees

x+=shl(

and replaces it with

x=x+(shl()

which produces the "unclosed (" error. When it sees

x+=shl(1,

it replaces it with

x=x+(shl(1,)

which produces the "unexpected symbol near ')'" error.

It'd be a big change to fix it, I think. Pico-8 would have to be much smarter about doing its own parsing around the += operator.

P#60283 2018-12-23 05:32 ( Edited 2018-12-23 18:10)

Good to know.

P#60293 2018-12-23 12:34

[Please log in to post a comment]

X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-03-23 12:33 | 0.015s | 2097k | Q:14