Commit 4ff49f0a authored by sof's avatar sof

[project @ 1999-03-10 18:50:24 by sof]

Last commit made empty where bodies illegal, i.e.,

  x = 2 where

Re-added support for this "feature".
parent 090f8411
......@@ -281,7 +281,7 @@ BOOLEAN pat_check=TRUE;
%type <ubinding> topdecl topdecls letdecls
typed datad newtd classd instd defaultd foreignd
decl decls fixdecl fix_op fix_ops valdef
decl decls non_empty_decls fixdecl fix_op fix_ops valdef
maybe_where where_body type_and_maybe_id
%type <uttype> polytype
......@@ -557,6 +557,20 @@ decls : /* empty */ { $$ = mknullbind(); }
}
;
non_empty_decls : decl
| non_empty_decls SEMI { $$ = $1; }
| non_empty_decls SEMI decl
{
if(SAMEFN)
{
extendfn($1,$3);
$$ = $1;
}
else
$$ = mkabind($1,$3);
}
;
/*
Note: if there is an iclasop_pragma here, then we must be
doing a class-op in an interface -- unless the user is up
......@@ -915,10 +929,11 @@ gdrhs : gd EQUAL get_line_no exp { $$ = lsing(mkpgdexp($1,$3,$4)); }
maybe_where: /* empty */ { $$ = mknullbind(); }
| WHERE where_body { $$ = $2; }
| WHERE { $$ = mknullbind(); }
;
where_body : ocurly decls ccurly { $$ = $2; }
| vocurly decls vccurly { $$ = $2; }
| vocurly non_empty_decls vccurly { $$ = $2; }
;
gd : VBAR quals { $$ = $2; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment