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
This is a duplicate of [bugs:#47].
Related
Bugs: #47
Stupid combinations aside, something as normal as:
INSPECT S1 TALLYING N1 FOR CHARACTERS LEADING 'ABC'.
isn't supported either!
Ah, I see now - the before-after-phrase is optional.
@edward-h Thanks for reopening (I hope you're fine).
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