Uploaded image for project: 'SonarCOBOL'
  1. SonarCOBOL
  2. SONARCOBOL-1261

Support REPLACING clause separated by a comma which is not followed by a white space

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8
    • Fix Version/s: 3.0
    • Component/s: Preprocessor
    • Labels:
      None

      Description

      The REPLACING clause in a COPY statement can contain several replacements. The COBOL plugin seems to accept such clauses when they are separated by a comma, but only when the comma is followed by a white space.

      The following code should not trigger a parsing error, as it is accepted by some IBM compilers (I tested it with IBM ILE COBOL).

             ID DIVISION.
             PROGRAM-ID. replacing1.
             data division.
             working-storage section.
             copy copy1 replacing ==x(9)== by ==x(10)== ,==data1== by 
             ==data11==.
             procedure division.
                 display data11, data2, "--";
                 goback.
      

        Attachments

          Activity

            People

            • Assignee:
              elena.vilchik Elena Vilchik
              Reporter:
              pierre-yves.nicolas Pierre-Yves Nicolas
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: