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

fix: fix variable definitions inside embedded copybooks #2418

Merged

Conversation

ap891843
Copy link
Contributor

@ap891843 ap891843 commented Aug 5, 2024

fix variable definitions inside embedded copybooks.
For below program .

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ABCDEF.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       copy AMAZE.
       copy AMAZE2.
       PROCEDURE DIVISION.

copy AMAZE

       01  CHK-PARMS.
P#1325         07  CHECK    PIC 9(09) COMP SYNC.

copybook AMAZE2

001600 01  META-TABLE.
001700     05  META-FIELD OCCURS 12500 TIMES.
FMC    COPY AMAZE3.
       01  TEST-ULTI pic x.

copybook AMAZE3

         10  META-FIELD-NAME               PIC  X(35).

The produced AST should be like

 
 COPYNODE AMAZE
      | -----> VAR NODE IN SIDE AMAZE COPYBOOK
 COPYNODE AMAZE2
     |-------> VAR NODE IN SIDE AMAZE2 COPYBOOK
     |-------> COPYNODE AMAZE 3
                     |-----> VAR NODE IN SIDE AMAZE3 COPYBOOK
     |-------->  VAR NODE IN SIDE AMAZE2 COPYBOOK

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Check the Use case tests or the PR description

Checklist:

  • Each of my commits contains one meaningful change
  • I have performed rebase of my branch on top of the development
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

fix variable definitions inside embedded copybooks.
So, for below program . Check the copybook content from the added usecase test
       IDENTIFICATION DIVISION.
       PROGRAM-ID. ABCDEF.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       copy AMAZE.
       copy AMAZE2.
       PROCEDURE DIVISION.

 The produced AST should be like
 COPYNODE AMAZE
      | -----> VAR NODE IN SIDE AMAZE COPYBOOK
 COPYNODE AMAZE2
     |-------> VAR NODE IN SIDE AMAZE2 COPYBOOK
     |-------> COPYNODE AMAZE 3
     |                  |-----> VAR NODE IN SIDE AMAZE3 COPYBOOK
     |-------->  VAR NODE IN SIDE AMAZE2 COPYBOOK

Signed-off-by: ap891843 <aman.prashant@broadcom.com>
@ap891843 ap891843 marked this pull request as ready for review August 5, 2024 10:35
@ap891843 ap891843 merged commit 4a97756 into eclipse-che4z:development Aug 7, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants