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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
alexbiehl-gc
GHC
Commits
e9062334
Commit
e9062334
authored
27 years ago
by
Simon Marlow
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-10-06 09:52:41 by simonm]
fix for qualified Prelude / () bug
parent
6b971238
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/reader/ReadPrefix.lhs
+12
-4
12 additions, 4 deletions
ghc/compiler/reader/ReadPrefix.lhs
with
12 additions
and
4 deletions
ghc/compiler/reader/ReadPrefix.lhs
+
12
−
4
View file @
e9062334
...
...
@@ -33,7 +33,7 @@ import FiniteMap ( elemFM, FiniteMap )
import Name ( OccName(..), SYN_IE(Module) )
import Lex ( isLexConId )
import Outputable ( Outputable(..), PprStyle(..) )
import PrelMods
import PrelMods
( pRELUDE )
import Pretty
import SrcLoc ( mkGeneratedSrcLoc, noSrcLoc, SrcLoc )
import Util ( nOfThem, pprError, panic )
...
...
@@ -75,14 +75,22 @@ wlkEntId = wlkQid (\occ -> if isLexConId occ
else VarOcc occ)
wlkQid :: (FAST_STRING -> OccName) -> U_qid -> UgnM RdrName
-- There are three kinds of qid:
-- qualified name (noqual) A.x
-- unqualified name (aqual) x
-- special name (gid) [], (), ->, (,,,)
-- The special names always mean "Prelude.whatever"; that's why
-- they are distinct. So if you write "()", it's just as if you
-- had written "Prelude.()". NB: The (qualified) prelude is always in scope,
-- so the renamer will find it.
wlkQid mk_occ_name (U_noqual name)
= returnUgn (Unqual (mk_occ_name name))
wlkQid mk_occ_name (U_aqual mod name)
= returnUgn (Qual mod (mk_occ_name name) HiFile)
-- I don't understand this one! It is what shows up when we meet (), [], or (,,,).
wlkQid mk_occ_name (U_gid n name)
= returnUgn (
Unqual
(mk_occ_name name))
= returnUgn (
Qual pRELUDE
(mk_occ_name name))
rdTCId pt = rdU_qid pt `thenUgn` \ qid -> wlkTCId qid
rdVarId pt = rdU_qid pt `thenUgn` \ qid -> wlkVarId qid
...
...
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