#47 Problem with inspect statement parsing

unclassified
accepted
nobody
None
4
2014-07-28
2013-04-23
Denis Hugonnard
No

Hi,
First of all thank you for the great job you're all doing.
I think i found a problem on the inspect statement parsing ...
This program is compiling without any error

       IDENTIFICATION DIVISION.
       PROGRAM-ID. TESTSTUFF.
      *----------------------------------------------------------------*
       ENVIRONMENT DIVISION.
      *--------------------*
      *
       DATA DIVISION.
      *-------------*
      *
       WORKING-STORAGE SECTION.
      *-----------------------*
      *
      *
       01  W01-VARIABLES.
      *------------------*
      *
           05  W01-I                      PIC S9(04) BINARY .
           05  W01-STRING                 PIC X(32)         .
      *
       PROCEDURE DIVISION .
      *-----------------------------------------*
      *
       A00-MAINLINE.
      *------------*
      *

           INSPECT W01-STRING TALLYING W01-I FOR  .
      *
           INSPECT W01-STRING TALLYING W01-I FOR  LEADING.
      *
           GOBACK .

Discussion

  • Simon Sobisch
    Simon Sobisch
    2014-01-10

    • status: open --> accepted
    • Priority: 1 --> 4
     
  • Simon Sobisch
    Simon Sobisch
    2014-01-10

    You're right, the parser should raise an error.
    The problem persists since years and still occurs in 2.x.

     
  • Simon Sobisch
    Simon Sobisch
    2014-01-16

    Just found another one: missing identifier/literal for CANCEL

                CANCEL
                DISPLAY 'Do we get here' END-DISPLAY
    

    This was fixed in 2.0 (still persists in 1.1).

    TODO: we should add test suite entries for checking missing identifier/literals for all statements.

    Simon