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
2c57b27c
Commit
2c57b27c
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-08-25 21:43:38 by sof]
New constructors: DoOrListComp.Guard, HsExpr.RecRecordConOut
parent
5085876e
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/hsSyn/HsExpr.lhs
+12
-6
12 additions, 6 deletions
ghc/compiler/hsSyn/HsExpr.lhs
with
12 additions
and
6 deletions
ghc/compiler/hsSyn/HsExpr.lhs
+
12
−
6
View file @
2c57b27c
...
...
@@ -113,10 +113,13 @@ data HsExpr tyvar uvar id pat
-- direct from the components
-- Record construction
| RecordCon (HsExpr tyvar uvar id pat) -- Always (HsVar id) until type checker,
-- but the latter adds its type args too
| RecordCon id
(HsRecordBinds tyvar uvar id pat)
| RecordConOut id -- The constructor
(HsExpr tyvar uvar id pat) -- The constructor applied to type/dict args
(HsRecordBinds tyvar uvar id pat)
-- Record update
| RecordUpd (HsExpr tyvar uvar id pat)
(HsRecordBinds tyvar uvar id pat)
...
...
@@ -296,8 +299,10 @@ pprExpr sty (ExplicitListOut ty exprs)
pprExpr sty (ExplicitTuple exprs)
= parens (sep (punctuate comma (map (pprExpr sty) exprs)))
pprExpr sty (RecordCon con
rbinds)
pprExpr sty (RecordCon con rbinds)
= pp_rbinds sty (ppr sty con) rbinds
pprExpr sty (RecordConOut con_id con_expr rbinds)
= pp_rbinds sty (ppr sty con_expr) rbinds
pprExpr sty (RecordUpd aexp rbinds)
= pp_rbinds sty (pprParendExpr sty aexp) rbinds
...
...
@@ -413,13 +418,14 @@ pp_rbinds sty thing rbinds
%************************************************************************
\begin{code}
data DoOrListComp = DoStmt | ListComp
data DoOrListComp = DoStmt | ListComp
| Guard
pprDo DoStmt sty stmts
= hang (ptext SLIT("do")) 2 (vcat (map (ppr sty) stmts))
pprDo ListComp sty stmts
= hang (hsep [lbrack, pprExpr sty expr, char '|'])
4 (sep [interpp'SP sty quals, rbrack])
= brackets $
hang (pprExpr sty expr <+> char '|')
4 (interpp'SP sty quals)
where
ReturnStmt expr = last stmts -- Last stmt should be a ReturnStmt for list comps
quals = init stmts
...
...
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