From: sof Date: Sat, 23 Jan 1999 17:34:37 +0000 (+0000) Subject: [project @ 1999-01-23 17:34:37 by sof] X-Git-Tag: Approx_2487_patches~18 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=fd2d74d63f2a1229b3e4debe11316b4aa3b975d6;p=ghc-hetmet.git [project @ 1999-01-23 17:34:37 by sof] Parser didn't accept the (all-important) empty module. Does now. --- diff --git a/ghc/compiler/parser/hsparser.y b/ghc/compiler/parser/hsparser.y index 4bd6d8b..f2fc70d 100644 --- a/ghc/compiler/parser/hsparser.y +++ b/ghc/compiler/parser/hsparser.y @@ -279,7 +279,7 @@ BOOLEAN pat_check=TRUE; gcon gconk gtycon itycon qop1 qvarop1 ename iname -%type topdecl topdecls letdecls +%type topdecl topdecls topdecls1 letdecls typed datad newtd classd instd defaultd foreignd decl decls fixdecl fix_op fix_ops valdef maybe_where with_where where_body type_and_maybe_id @@ -438,9 +438,13 @@ iname : var { $$ = mknoqual($1); } * * **********************************************************************/ -topdecls : topdecl - | topdecls SEMI { $$ = $1; } - | topdecls SEMI topdecl +topdecls : /* empty */ { $$ = mknullbind(); } + | topdecls1 + ; + +topdecls1: topdecl + | topdecls1 SEMI { $$ = $1; } + | topdecls1 SEMI topdecl { if($1 != NULL) if($3 != NULL) @@ -1132,8 +1136,9 @@ list_rest : exp { $$ = lsing($1); } 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 /* empty */ { $$ = mknullbind(); } ; /*