Page 1 of 1

Line continuation

Posted: Thu Oct 02, 2014 6:34 am
by Danilo
Shouldn't the line continuation only be allowed for the next line, not for all empty lines, and comments?

Code: Select all

OpenWindow(0,
           0,
           



0,

            200,

; comment
            
200, "", #PB_Window_ScreenCentered|
         

#PB_Window_SystemMenu)

;SetWindowLong_(WindowID(0), #GWL_EXSTYLE, GetWindowLong_(WindowID(0), #GWL_EXSTYLE) |
                                          



;#WS_EX_LAYERED)



Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
Found by udg in german forum

Re: Line continuation

Posted: Thu Oct 02, 2014 7:13 am
by Demivec
No bug.

White-space is white-space and comments are always ignored.

I think it would be a feature request to require the lines to not have blank lines in between. If you overlook the ability to place comments on a blank line between the parts of the line, I think it makes sense that the lines should follow each other without blank lines in between.

Re: Line continuation

Posted: Thu Oct 02, 2014 7:47 am
by Danilo
Demivec wrote:White-space is white-space
That's true for other languages, like the C-family of languages.

In PB input is line-based. The end of a line ends an statement, not ';'.
The exception is now with operators and separators, so input continues
on the next line.
In my opinion the compiler should give an error if the next line is not a valid
continuation of the last line, because the end of the next line is the end of the statement in PB,
if there is no line continuation char at the end of the next line.
That's the reason I reported it. I think it is wrong according to PB's line-ending rules.
But to be honest, I don't care that much about it. Maybe it is an exception, a feature.