Accept multiple consecutive periods as empty statements. Accept
undocumented $END-IF under -dialect mf without comment.
gcc/cobol/ChangeLog:
PR cobol/126495
PR cobol/126496
* gcobol.1: Update manual to reflect new syntax.
* parse.y: Allow void sentence and increment s/r expected count to 7.
* scan.l: Lex $END-IF, optionally, as $END.
to indicate MicroFocus syntax:
.Bl -bullet -compact
.It
+CDF
+.Sy $IF , $ELSE , $END , Sy $END-IF , Li and Sy $SET
+.It
.Sy BINARY-LONG-LONG
.It
.Sy CALL ... GIVING
// https://savannah.gnu.org/forum/forum.php?forum_id=9735
%token YYEOF 0 "end of file"
-%type <number> sentence statements statement
+%type <number> statements statement
%type <number> star_cbl_opt close_how
%type <number> test_before usage_clause1 might_be alphanational
%locations
%token-table
%define parse.error verbose // custom
-%expect 6
+%expect 7
%require "3.5.1" // 3.8.2 also works, but not 3.8.0
%%
| NUMSTR { $$ = $1.string; }
;
-sentence: statements '.'
+sentence: '.'
+ | statements '.'
| statements YYEOF
{
if( ! goodnight_gracie() ) {
yy_push_state(cdf_state); return CDF_IF; }
^[ ]*[$]{OBLANK}ELSE { dialect_ok(yylloc, MfCdfDollar, yytext);
return CDF_ELSE; }
- ^[ ]*[$]{OBLANK}END { dialect_ok(yylloc, MfCdfDollar, yytext);
+ ^[ ]*[$]{OBLANK}END(-IF)? { dialect_ok(yylloc, MfCdfDollar, yytext);
return CDF_END_IF; }
^[ ]*[$]{OBLANK}SET({SPC}CONSTANT)? {