A naturally line breaking is preferred, like:
The Or clearly indicate there is more, if the parser sees a line break following or a ; comment (any whitespaces before end of line is obviously ignored as well)
the parser looks at the next line, if the two lines concatenated does not produce an error then it's likely correct,
if it causes an error then the coder did a mistake most likely.
Similar with this:
Code: Select all
Define.i event=#Null,window=#Null,gadget=#Null,menu=#Null,type=#Null,
quit=#False,timer=#Null,result=#False,selected,id,i,text$
Again the line is incomplete (broken) so the parser concatenates with the following line.
In 99.99% (!) of all code there is a "natural" break, like a , or + or | or - and so on.
Only issue might be really long text strings, but then you could always use "blah" + "blah" in those cases I guess.
Again the example above, but this time coded wrong intentionally obviously (Define line appears complete):
Code: Select all
Define.i event=#Null,window=#Null,gadget=#Null,menu=#Null,type=#Null,quit=#False
,timer=#Null,result=#False,selected,id,i,text$
Or this which is also wrong (missing , ):
Code: Select all
Define.i event=#Null,window=#Null,gadget=#Null,menu=#Null,type=#Null,quit=#False
timer=#Null,result=#False,selected,id,i,text$
Here the parser has no indicator that it's incomplete and it wont throw an error on the 2nd line at all, which could be an issue, but...
My suggestion Fred is to ONLY allow this natural line breaking to be used if EnableExplicit is ALSO used,
as EnableExplicit will catch the mistake above (since timer is not defined previously).
If EnableEplicit is not used then do not allow natural line breaks and throw the error it would currently throw if you try the second to last example above,
the last example however would be ok without EnableExplict, but again if those who wish to use natural break points in statements is told they also need to use EnableExplicit such errors will get caught.
PS! Regarding EnableExplicit, it would also be nice to have a way to enable it by default in compiler options somewhere. But that's just me nitpicking

(or make it default always and add a DisableExplicit maybe)
Edit:
Just a quick rundown on how the parser would handle it:
1. The parser strips off any comment at the end if found, it also trims whitespace (I'm assuming this is how it currently does it)
2. The line seems to end with a , or some other operator like + Or And | & and so on that can act as a natural break point for a line.
3. If EnableExplicit is on then check if the next line concatenated with current line is syntactically right and a syntax error if not, and if EnableExplicit is off throw a syntax error immediately.
Unfortunately there is no easy way to check both EnableExplicit is off and something like the last example is encountered, then again, with EnableExplicit off a lot of weird bugs are possible anyway, like text="test" when you intended to type text$="test" etc.
I see no point in introducing a line continuation character at all,
no matter how tempting it might be,
it's also more natural to use "natural" break points,
like in this paragraph where I've used , as the natural break point of a long line.