Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
ee2dad13
Commit
ee2dad13
authored
Nov 25, 2011
by
waern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep unicode characters in Haddock comments and comments in the token stream.
parent
98091a84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
compiler/parser/Lexer.x
compiler/parser/Lexer.x
+12
-12
No files found.
compiler/parser/Lexer.x
View file @
ee2dad13
...
...
@@ -785,7 +785,7 @@ ifExtension pred bits _ _ _ = pred bits
multiline_doc_comment :: Action
multiline_doc_comment span buf _len = withLexedDocType (worker "")
where
worker commentAcc input docType oneLine = case alexGetChar input of
worker commentAcc input docType oneLine = case alexGetChar
'
input of
Just ('\n', input')
| oneLine -> docCommentEnd input commentAcc docType buf span
| otherwise -> case checkIfCommentLine input' of
...
...
@@ -796,15 +796,15 @@ multiline_doc_comment span buf _len = withLexedDocType (worker "")
checkIfCommentLine input = check (dropNonNewlineSpace input)
where
check input = case alexGetChar input of
Just ('-', input) -> case alexGetChar input of
Just ('-', input) -> case alexGetChar input of
check input = case alexGetChar
'
input of
Just ('-', input) -> case alexGetChar
'
input of
Just ('-', input) -> case alexGetChar
'
input of
Just (c, _) | c /= '-' -> Just input
_ -> Nothing
_ -> Nothing
_ -> Nothing
dropNonNewlineSpace input = case alexGetChar input of
dropNonNewlineSpace input = case alexGetChar
'
input of
Just (c, input')
| isSpace c && c /= '\n' -> dropNonNewlineSpace input'
| otherwise -> input
...
...
@@ -829,13 +829,13 @@ nested_comment cont span _str _len = do
if b
then docCommentEnd input commentAcc ITblockComment _str span
else cont
go commentAcc n input = case alexGetChar input of
go commentAcc n input = case alexGetChar
'
input of
Nothing -> errBrace input span
Just ('-',input) -> case alexGetChar input of
Just ('-',input) -> case alexGetChar
'
input of
Nothing -> errBrace input span
Just ('\125',input) -> go commentAcc (n-1) input
Just (_,_) -> go ('-':commentAcc) n input
Just ('\123',input) -> case alexGetChar input of
Just ('\123',input) -> case alexGetChar
'
input of
Nothing -> errBrace input span
Just ('-',input) -> go ('-':'\123':commentAcc) (n+1) input
Just (_,_) -> go ('\123':commentAcc) n input
...
...
@@ -844,14 +844,14 @@ nested_comment cont span _str _len = do
nested_doc_comment :: Action
nested_doc_comment span buf _len = withLexedDocType (go "")
where
go commentAcc input docType _ = case alexGetChar input of
go commentAcc input docType _ = case alexGetChar
'
input of
Nothing -> errBrace input span
Just ('-',input) -> case alexGetChar input of
Just ('-',input) -> case alexGetChar
'
input of
Nothing -> errBrace input span
Just ('\125',input) ->
docCommentEnd input commentAcc docType buf span
Just (_,_) -> go ('-':commentAcc) input docType False
Just ('\123', input) -> case alexGetChar input of
Just ('\123', input) -> case alexGetChar
'
input of
Nothing -> errBrace input span
Just ('-',input) -> do
setInput input
...
...
@@ -872,7 +872,7 @@ withLexedDocType lexDocComment = do
'#' -> lexDocComment input ITdocOptionsOld False
_ -> panic "withLexedDocType: Bad doc type"
where
lexDocSection n input = case alexGetChar input of
lexDocSection n input = case alexGetChar
'
input of
Just ('*', input) -> lexDocSection (n+1) input
Just (_, _) -> lexDocComment input (ITdocSection n) True
Nothing -> do setInput input; lexToken -- eof reached, lex it normally
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment