Any reason this is not just a bug in Lucee? ```i=...
# lucee
a
Any reason this is not just a bug in Lucee?
Copy code
i=1
do {
    x = randRange(1,10)
    if (x > 5) {
        continue
    }
    writeOutput(x)
} while(++i <= 10)
Copy code
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.
b
cfcontinue accepts an attribute https://docs.lucee.org/reference/tags/continue.html but I agree with you, the sending curly brace should be able to clue in the compiler that the statement is over.
I'd ticket it
1
a
Yeah I had a "TIL
cfcontinue
is a thing in CFScript" thing y/day
but yeah I know it can take a label. But the label can't start with a
}
😉
And I hasten to add that
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)