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

PL/I syntax error missed on nested blocks #397

Open
1 of 5 tasks
luisitoortiz opened this issue Mar 27, 2024 · 2 comments
Open
1 of 5 tasks

PL/I syntax error missed on nested blocks #397

luisitoortiz opened this issue Mar 27, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@luisitoortiz
Copy link

luisitoortiz commented Mar 27, 2024

Development environment used

  • Z Open Editor version:
  • Editor Platform
    • Visual Studio Code
    • Red Hat CodeReady Workspaces
    • Eclipse Che
    • Standalone Theia
  • Editor Platform Version:
Version: 1.86.2 (system setup)
Commit: 903b1e9d8990623e3d7da1df3d33db3e42d80eda
Date: 2024-02-13T19:40:56.878Z
Electron: 27.2.3
ElectronBuildId: 26908389
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
  • Operating System (on which VS Code runs such as Windows 10 2004, otherwise name and version of platform such as OpenShift v4.3):
Microsoft Windows 11 Pro 10.0.22631 Build 22631
  • Java Version (when using VS Code or Theia, execute java -version and paste the details here):
openjdk version "17.0.8.1" 2023-08-24
IBM Semeru Runtime Open Edition 17.0.8.1 (build 17.0.8.1+1)
Eclipse OpenJ9 VM 17.0.8.1 (build openj9-0.40.0, JRE 17 Windows 11 amd64-64-Bit Compressed References 20230824_503 (JIT enabled, AOT enabled)
OpenJ9   - d12d10c9e
OMR      - e80bff83b
JCL      - 8ecf238a124 based on jdk-17.0.8.1+1)
  • Related to RSE API?
    • RSE API Plugin version:
    • Zowe CLI version:
    • Node.js version:
  • Logs attached (see here how to get them): yes/no

Problem Description

The PL/I block below won't throw a syntax error on the missing END; for the SELECT block below. If I remove any other random END; line it works, but in the example below it doesn't which leads then to a compiler error with the NOMULTICLOSE rule enforced. I'll venture to guess the syntax checker in iDZ is one in the same because it behaves identically with the code below. Just to note, the editor does know what END; belongs to what SELECT, DO, etc. (Click on END;); but then it simply chooses to ignore the fact that one missing below is a problem. Note that you can make the code even more generic to avoid the other 2 syntax error, but it doesn't change the outcome.

PROCESS_INPUT_FILE: PROCEDURE;
  DO WHILE(FILE_EOF = '0');
     SELECT(MATCH_KEYS());
        WHEN (-1) DO;
        END;

        WHEN (+1) DO;
        END;

        WHEN (0) DO;
        END;

        OTHERWISE DO;
        END;
  END;
END;

Observed behavior

Syntax error ignored for the missing END; for the SELECT block.

Expected behavior

Syntax error flagged for missing END; for the SELECT block.

@Russell-May
Copy link
Member

The example provided produces an error on line 1 'The block does not have an END statement'. If you modify the final END statement to be labeled with PROCESS_INPUT_FILE it will multiclose the missing end statement and the syntax error will no longer be shown. The compiler option NOMULTICLOSE is not currently supported in the parser. This is why you are not getting a syntax error where you are expecting. This should be labeled as an enhancement request.

@phaumer phaumer added the enhancement New feature or request label Mar 28, 2024
@luisitoortiz
Copy link
Author

I actually cleaned up the code a bit too much from details because the PROCESS_INPUT_FILE line is in the original, but yes, it would be nice if the syntax checker enforced the NOMULTICLOSE option since it's a default flag in newer versions of PL/I.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants