Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Formater does not understand TRY-CATCH-END Constructs #115

Open
Larrylaswell opened this issue Jun 29, 2020 · 1 comment
Open

[BUG] Formater does not understand TRY-CATCH-END Constructs #115

Larrylaswell opened this issue Jun 29, 2020 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Larrylaswell
Copy link

OpenQMx64 3_4_19
VSCODE 1.46.1 Date 2020-06-17
Windows NTx64 10.0.18363
MV Basic / MV Extentions 2.08

The formater does not handle the TRY - CATCH- END CONSTRUCT

For example this is what a TRY-CATCH-END construct should look like

 TRY
      GOSUB READ.RECORD
 CATCH IOERROR
      GOSUB HANDLE.IO.ERROR
 CATCH SYS$ANY
      GOSUB HANDLE.SYSTEM.ERROR
 END

 makeWritableCmd = 'attrib -r ':sysPath:'\':toLibrary:'\':toProgram
 setReadOnlyCmd = 'attrib +r ':sysPath:'\':toLibrary:'\':toProgram
 delFromFileCmd = 'DEL ':sysPath:'\':fromLibrary:'\':fromProgram

However when you format it it comes out as:

   TRY
   GOSUB READ.RECORD
   CATCH IOERROR
   GOSUB HANDLE.IO.ERROR
   CATCH SYS$ANY
   GOSUB HANDLE.SYSTEM.ERROR

END

makeWritableCmd = 'attrib -r ':sysPath:'':toLibrary:'':toProgram
setReadOnlyCmd = 'attrib +r ':sysPath:'':toLibrary:'':toProgram
delFromFileCmd = 'DEL ':sysPath:'':fromLibrary:'':fromProgram

Note that the GOSUBS are not indented. The CATCH statement is not outdented to match the TRY statement and the END statement gets outdented and its outdent becomes the base line indent for all future statements. The END statemement and all following statements should match the indent of the TRY statement.

@kpowick kpowick changed the title [BUG] MV Basic Extention - Formater does not understand TRY-CATCH-END Constructs [BUG] Formater does not understand TRY-CATCH-END Constructs Jun 29, 2020
@kpowick kpowick added the bug Something isn't working label Jun 29, 2020
@itsxallwater itsxallwater added the help wanted Extra attention is needed label Aug 11, 2020
@itsxallwater
Copy link
Member

Similar note here, will ultimately relate to #14 and #114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants