OCamlPro / superbol-studio-oss

Open-Source part of SuperBOL Studio, including the Visual Studio Code extension and its LSP server
https://superbol.eu
Other
20 stars 12 forks source link

Relax order of paragraphs in the `ENVIRONMENT DIVISION` #269

Closed nberth closed 1 month ago

nberth commented 5 months ago

The only other problems concerning world cities are the >>D compiler directive and the order of the paragraphs in the environment division (worldcities uses repository before special-names which is not allowed by our parser).

Originally posted by @emilienlemaire in https://github.com/OCamlPro/superbol-studio-oss/issues/267#issuecomment-2066729585

GitMensch commented 5 months ago

Just to add: worldcities should be adjusted as "in any order" is an extension, per COBOL standards all entries in CONFIGURATION SECTION are optional, but the order is fixed (in other places the standard allows "any order"). The "lax order" in this place is a common extension though and also used in programs, so it definitely is useful to tweak the parser for allowing it.

GitMensch commented 1 month ago

You may want to check if the LSP can correctly parse https://github.com/jnicholson/ITP-Advanced-COBOL-FINAL/blob/master/workspace/COBOL%20Final%20Project/G3-BLD-VFX-WISH.cbl now.

nberth commented 1 month ago

You may want to check if the LSP can correctly parse https://github.com/jnicholson/ITP-Advanced-COBOL-FINAL/blob/master/workspace/COBOL%20Final%20Project/G3-BLD-VFX-WISH.cbl now.

Yes that file is now parsed correctly.