Adam Cameron
i=1
do {
x = randRange(1,10)
if (x > 5) {
continue
}
writeOutput(x)
} while(++i <= 10)
Syntax Error, Invalid Construct
If one puts a semi-colon after the continue
, it works. It works as one would expect on CF.
https://trycf.com/gist/063a476b5ab7d0e67300fab8e2e55802/lucee5?theme=monokai
Looks to me like it doesn't occur to Lucee that }
can be considered the end of the previous statement, as much as ;
could be.
I thought this had been raised previously, but didn't find anything in Jira. I might have been thinking of another situation where behaviour is similarly bung/unexpected. I def know I raised a ticket about break
, but I was wrong with that one cos there was some legit uncertainty about whether or not the statement had ended with that one.bdw429s
11/10/2022, 3:02 PMbdw429s
11/10/2022, 3:03 PMAdam Cameron
cfcontinue
is a thing in CFScript" thing y/dayAdam Cameron
}
😉Adam Cameron
cfcontinue
does NOT need a semicolon. This is how I got onto this. One of my devs used cfcontinue
rather than continue
cos he didn't want to use a semicolon (not the way I would have gone with that, but NVM)Adam Cameron