Skip to content

Statement across copy wrongly detected  #1244

@smedilol

Description

@smedilol

Describe the bug
Our check "A Cobol statement cannot be across 2 sources files (eg. Main program and a COPY)" have a problem with replace inside COPY.

The following code should be ok for our parser and doesn't mix a statement across source file.

To Reproduce
(Type)Cobol code that cause the bug :

       IDENTIFICATION division.
       PROGRAM-ID. MyPGM.
       data division.
       working-storage section.
       01 Var1-foo pic X.
      
       procedure division.
      
              replace ==:field:== by ==foo==.
              copy MyCopy.
      
           goback.
       end program MyPGM.

MyCopy.cpy

000070     if Var1-:field: not = space
000080         display "hello"
000590     end-if                                                       

We get the error
"A Cobol statement cannot be across 2 sources files (eg. Main program and a COPY)"
Expected behavior
No error

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugCobolUser VisibleVisible by the end user. Useful to priorize issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions