Skip to content
Snippets Groups Projects
Commit 591ff1e0 authored by sof's avatar sof
Browse files

[project @ 1999-01-15 17:20:15 by sof]

Tweaked to accept empty declarations (again.)
parent 4e6d0831
No related branches found
No related tags found
No related merge requests found
...@@ -274,10 +274,10 @@ BOOLEAN pat_check=TRUE; ...@@ -274,10 +274,10 @@ BOOLEAN pat_check=TRUE;
gcon gconk gtycon itycon qop1 qvarop1 gcon gconk gtycon itycon qop1 qvarop1
ename iname ename iname
%type <ubinding> topdecl topdecls topdecls1 letdecls %type <ubinding> topdecl topdecls letdecls
typed datad newtd classd instd defaultd foreignd typed datad newtd classd instd defaultd foreignd
decl decls decls1 fixdecl fix_op fix_ops valdef decl decls fixdecl fix_op fix_ops valdef
maybe_where type_and_maybe_id maybe_where with_where where_body type_and_maybe_id
%type <uttype> polytype %type <uttype> polytype
conargatype conapptype conargatype conapptype
...@@ -433,10 +433,9 @@ iname : var { $$ = mknoqual($1); } ...@@ -433,10 +433,9 @@ iname : var { $$ = mknoqual($1); }
* * * *
**********************************************************************/ **********************************************************************/
topdecls: topdecls1 opt_semi { $$ = $1; } topdecls : topdecl
| topdecls SEMI { $$ = $1; }
topdecls1: topdecl | topdecls SEMI topdecl
| topdecls1 SEMI topdecl
{ {
if($1 != NULL) if($1 != NULL)
if($3 != NULL) if($3 != NULL)
...@@ -536,10 +535,9 @@ unsafe_flag: UNSAFE { $$ = 1; } ...@@ -536,10 +535,9 @@ unsafe_flag: UNSAFE { $$ = 1; }
| /*empty*/ { $$ = 0; } | /*empty*/ { $$ = 0; }
; ;
decls : decls1 opt_semi { $$ = $1; } decls : decl
| decls SEMI { $$ = $1; }
decls1 : decl | decls SEMI decl
| decls1 SEMI decl
{ {
if(SAMEFN) if(SAMEFN)
{ {
...@@ -551,10 +549,6 @@ decls1 : decl ...@@ -551,10 +549,6 @@ decls1 : decl
} }
; ;
opt_semi : /*empty*/
| SEMI
;
/* /*
Note: if there is an iclasop_pragma here, then we must be Note: if there is an iclasop_pragma here, then we must be
doing a class-op in an interface -- unless the user is up doing a class-op in an interface -- unless the user is up
...@@ -911,14 +905,18 @@ gdrhs : gd EQUAL get_line_no exp { $$ = lsing(mkpgdexp($1,$3,$4)); } ...@@ -911,14 +905,18 @@ gdrhs : gd EQUAL get_line_no exp { $$ = lsing(mkpgdexp($1,$3,$4)); }
| gd EQUAL get_line_no exp gdrhs { $$ = mklcons(mkpgdexp($1,$3,$4),$5); } | gd EQUAL get_line_no exp gdrhs { $$ = mklcons(mkpgdexp($1,$3,$4),$5); }
; ;
maybe_where: maybe_where: /* empty */ { $$ = mknullbind(); }
WHERE ocurly decls ccurly { $$ = $3; } | WHERE with_where { $$ = $2; }
| WHERE vocurly decls vccurly { $$ = $3; } ;
/* A where containing no decls is OK */
| WHERE { $$ = mknullbind(); } with_where : /* empty */ { $$ = mknullbind(); }
| WHERE ocurly ccurly { $$ = mknullbind(); } | where_body { $$ = $1; }
| /* empty */ { $$ = mknullbind(); } ;
;
where_body : ocurly decls ccurly { $$ = $2; }
| vocurly decls vccurly { $$ = $2; }
| ocurly ccurly { $$ = mknullbind(); }
;
gd : VBAR quals { $$ = $2; } gd : VBAR quals { $$ = $2; }
; ;
...@@ -1128,7 +1126,7 @@ list_rest : exp { $$ = lsing($1); } ...@@ -1128,7 +1126,7 @@ list_rest : exp { $$ = lsing($1); }
at it, it *will* do the wrong thing [WDP 94/06]) at it, it *will* do the wrong thing [WDP 94/06])
*/ */
letdecls: LET { pat_check = TRUE; } ocurly decls ccurly { $$ = $4; } letdecls: LET { pat_check = TRUE; } ocurly decls ccurly { $$ = $4; }
| LET { pat_check = TRUE; } vocurly decls vccurly { $$ = $4; } | LET { pat_check = TRUE; } vocurly decls vccurly { $$ = $4; }
; ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment