BBx-Kitchen / bbj-language-server

BBj Language Server
MIT License
7 stars 6 forks source link

Multiline statement #30

Closed dhuebner closed 1 year ago

dhuebner commented 1 year ago

Following is a valid multiline addition and should be supported.

rem multiline statement
X! = "TEST"+
: "TEST123"+
: "jhgjgj"

Note: : is used in the LabelDecl parser rule LabelDecl: ID ':' ; and in StringMask expression rule.

@StephanWald Could you point to the corresponding BBx/BBj documentation? I wonder if it only works with + operator or just for all expressions.

StephanWald commented 1 year ago

This is not explicitly documented, but the rule is: A colon ":" at the beginning of the line means that the line is appended to the previous line "as is"

e.g., the following would be correct (but admittedly silly):

P
:R
:INT
: "Hel
:lo World
:"

It's equivalent to writing

PRINT "Hello World"

in one single line.