Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
591ff1e0
Commit
591ff1e0
authored
26 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1999-01-15 17:20:15 by sof]
Tweaked to accept empty declarations (again.)
parent
4e6d0831
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/parser/hsparser.y
+22
-24
22 additions, 24 deletions
ghc/compiler/parser/hsparser.y
with
22 additions
and
24 deletions
ghc/compiler/parser/hsparser.y
+
22
−
24
View file @
591ff1e0
...
...
@@ -274,10 +274,10 @@ BOOLEAN pat_check=TRUE;
gcon gconk gtycon itycon qop1 qvarop1
ename iname
%type <ubinding> topdecl topdecls
topdecls1
letdecls
%type <ubinding> topdecl topdecls letdecls
typed datad newtd classd instd defaultd foreignd
decl decls
decls1
fixdecl fix_op fix_ops valdef
maybe_where type_and_maybe_id
decl decls fixdecl fix_op fix_ops valdef
maybe_where
with_where where_body
type_and_maybe_id
%type <uttype> polytype
conargatype conapptype
...
...
@@ -433,10 +433,9 @@ iname : var { $$ = mknoqual($1); }
* *
**********************************************************************/
topdecls: topdecls1 opt_semi { $$ = $1; }
topdecls1: topdecl
| topdecls1 SEMI topdecl
topdecls : topdecl
| topdecls SEMI { $$ = $1; }
| topdecls SEMI topdecl
{
if($1 != NULL)
if($3 != NULL)
...
...
@@ -536,10 +535,9 @@ unsafe_flag: UNSAFE { $$ = 1; }
| /*empty*/ { $$ = 0; }
;
decls : decls1 opt_semi { $$ = $1; }
decls1 : decl
| decls1 SEMI decl
decls : decl
| decls SEMI { $$ = $1; }
| decls SEMI decl
{
if(SAMEFN)
{
...
...
@@ -551,10 +549,6 @@ decls1 : decl
}
;
opt_semi : /*empty*/
| SEMI
;
/*
Note: if there is an iclasop_pragma here, then we must be
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)); }
| gd EQUAL get_line_no exp gdrhs { $$ = mklcons(mkpgdexp($1,$3,$4),$5); }
;
maybe_where:
WHERE ocurly decls ccurly { $$ = $3; }
| WHERE vocurly decls vccurly { $$ = $3; }
/* A where containing no decls is OK */
| WHERE { $$ = mknullbind(); }
| WHERE ocurly ccurly { $$ = mknullbind(); }
| /* empty */ { $$ = mknullbind(); }
;
maybe_where: /* empty */ { $$ = mknullbind(); }
| WHERE with_where { $$ = $2; }
;
with_where : /* empty */ { $$ = mknullbind(); }
| where_body { $$ = $1; }
;
where_body : ocurly decls ccurly { $$ = $2; }
| vocurly decls vccurly { $$ = $2; }
| ocurly ccurly { $$ = mknullbind(); }
;
gd : VBAR quals { $$ = $2; }
;
...
...
@@ -1128,7 +1126,7 @@ 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; }
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment