Menu ▾ ▴

#138 INSPECT statement with TALLYING needs better check for tallying-phrase

GC 2.2
duplicate
None
5 - default
2020-03-27
2015-05-28
No

GnuCOBOL allows (for some years now)

::cobolfree
INSPECT identifier-1 TALLYING identifier-2 FOR !stupid-combination! [ after-before-phrase ]

where !stupid-combination! may be a combination of ALL, LEADING, TRAILING - even without an identifier/literal

Example:

::cobolfree
INSPECT identifier-1 TALLYING identifier-2 FOR ALL LEADING TRAILING ALL ALL ALL TRAILING

This definitely needs a better check in the compiler

Discussion

  • Edward Hart

    Edward Hart - 2016-05-23
    • assigned_to: Edward Hart
     
  • Edward Hart

    Edward Hart - 2016-05-24
    • status: accepted --> duplicate
     
  • Edward Hart

    Edward Hart - 2016-05-24

    This is a duplicate of [bugs:#47].

     

    Related

    Bugs: #47

  • Jonathan Beit-Aharon

    Stupid combinations aside, something as normal as:
    INSPECT S1 TALLYING N1 FOR CHARACTERS LEADING 'ABC'.
    isn't supported either!

     
  • Simon Sobisch

    Simon Sobisch - 2020-03-27

    Ah, I see now - the before-after-phrase is optional.
    @edward-h Thanks for reopening (I hope you're fine).

     
  • Edward Hart

    Edward Hart - 2020-03-27

    Thanks for reporting that Jonathan! That is standard COBOL syntax (from at least COBOL-74 onwards), which GnuCOBOL should support. I'll re-open [bugs:#47] now.

     

    Related

    Bugs: #47


Log in to post a comment.