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
Las Safin
GHC
Commits
75ae6b53
Commit
75ae6b53
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-09-04 20:17:37 by sof]
lex M.-> properly
parent
3793ad1d
Branches
wip/T19847
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/reader/Lex.lhs
+18
-6
18 additions, 6 deletions
ghc/compiler/reader/Lex.lhs
with
18 additions
and
6 deletions
ghc/compiler/reader/Lex.lhs
+
18
−
6
View file @
75ae6b53
...
...
@@ -563,7 +563,7 @@ is_id_char (C# c#) =
0# -> False
1# -> True
--is_id_char c@(C# c#) = isAlphanum c || is_sym c#
--
OLD:
is_id_char c@(C# c#) = isAlphanum c || is_sym c#
is_sym c#=
case c# of {
...
...
@@ -655,11 +655,13 @@ lex_id cont buf =
lex_id2 cont module_dot buf =
-- _trace ("lex_id2: "++[C# (currentChar# buf)]) $
case currentChar# buf of
'['# ->
'['# -> -- Special case for []
case lookAhead# buf 1# of
']'# -> end_lex_id cont module_dot (ITconid SLIT("[]")) (stepOnBy# buf 2#)
_ -> lex_id3 cont module_dot buf
'('# ->
'('# -> -- Special case for (,,,)
case lookAhead# buf 1# of
')'# -> end_lex_id cont module_dot (ITconid SLIT("()")) (stepOnBy# buf 2#)
','# -> lex_tuple cont module_dot (stepOnBy# buf 2#)
...
...
@@ -685,7 +687,7 @@ lex_id3 cont module_dot buf =
buf' ->
case module_dot of
Just _ ->
end_lex_id cont module_dot (mk_var_token lexeme)
(stepOverLexeme
buf
')
end_lex_id cont module_dot (mk_var_token lexeme)
new_
buf
Nothing ->
case _scc_ "Lex.haskellKeyword" lookupUFM haskellKeywordsFM lexeme of
Just kwd_token -> cont kwd_token new_buf
...
...
@@ -748,8 +750,18 @@ end_lex_id cont (Just (m,hif)) token buf =
ITconid n -> cont (ITqconid (m,n,hif)) buf
ITvarid n -> cont (ITqvarid (m,n,hif)) buf
ITconsym n -> cont (ITqconsym (m,n,hif)) buf
-- Special case for ->
-- "->" by itself is a special token (ITrarrow),
-- but M.-> is a ITqconid
ITvarsym n | n == SLIT("->")
-> cont (ITqconsym (m,n,hif)) buf
ITvarsym n -> cont (ITqvarsym (m,n,hif)) buf
ITbang -> cont (ITqvarsym (m,SLIT("!"),hif)) buf
-- ITbang can't happen here I think
-- ITbang -> cont (ITqvarsym (m,SLIT("!"),hif)) buf
_ -> cont (ITunknown (show token)) buf
------------
...
...
@@ -814,7 +826,7 @@ haskellKeywordsFM = listToUFM $
]
-- doDiscard rips along really fast looking for a double semicolon,
-- doDiscard rips along really fast
,
looking for a double semicolon,
-- indicating the end of the pragma we're skipping
doDiscard inStr buf =
-- _trace (show (C# (currentChar# buf))) $
...
...
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