BBx-Kitchen / bbj-language-server

BBj Language Server
MIT License
7 stars 6 forks source link

err= can be used pretty much anywhere in method calls #54

Closed StephanWald closed 1 year ago

StephanWald commented 1 year ago
orderDetailRecordSet! = BBJAPI().createSQLRecordSet(database$,modes$,select$)
if !(orderDetailRecordSet!.isEmpty()) then
    orderDetailRecordSet!.first()
    while 1
        orderDetailRecordSet!.next(err=*break)
    wend
endif

err= is flagged as error. It's a general rule that err= can also be put in something like

use java.util.HashMap
hm! = new HashMap()
hm!.get("test",err=*next)
dhuebner commented 1 year ago

In the first example the cause seem to be break in orderDetailRecordSet!.next(err=*break). The second example already works. I think we allow err= as a last parameter in all procedure calls.

@StephanWald What rules apply for the expression after err=? I already saw *next and *break, I think you also mentioned the label references can be placed there?

StephanWald commented 1 year ago

They are called "symbolic labels": https://documentation.basis.cloud/BASISHelp/WebHelp/usr/BBj_Enhancements/err_dom_end_syntax.htm

dhuebner commented 1 year ago

@StephanWald Should work better now.

Symbolic labels are defined here now: https://github.com/BBx-Kitchen/bbj-language-server/blob/main/bbj-vscode/src/language/lib/labels.ts