potential line continuation bug
Posted: 25 Jan 2019, 08:24
Speaking of if-statement and short-circuit alternatives, when I was creating some long expression, I accidentally found a new conundrum.
For the example, I simplified it to the smallest possible arrangement that keeps raising an error. The next syntax is correct at _load time_ (if statement's expression is split to 2 lines):
And when I replace it with && expression:
It gives error: Missing ")"
if I join 2 lines in 1:
the expression's syntax is accepted.
2nd line starting with , is correct itself (it is accepted in first variant with if statement). arrangement of parenthesis is not changed.
For the example, I simplified it to the smallest possible arrangement that keeps raising an error. The next syntax is correct at _load time_ (if statement's expression is split to 2 lines):
Code: Select all
if(r:=DllCall(a, 'int',n
, 'ptr',p)) ;syntax accepted
d++
Code: Select all
(r:=DllCall(a, 'int',n
, 'ptr',p)) ;error at load-time
&& d++
if I join 2 lines in 1:
Code: Select all
(r:=DllCall(a, 'int',n, 'ptr',p)) ;syntax accepted
&& d++
2nd line starting with , is correct itself (it is accepted in first variant with if statement). arrangement of parenthesis is not changed.