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
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
Alexander Kaznacheev
GHC
Commits
5eb1e883
Commit
5eb1e883
authored
1 year ago
by
Alexander Kaznacheev
Browse files
Options
Downloads
Patches
Plain Diff
fix MultilineStrings with let
parent
d44f1741
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
compiler/GHC/Driver/MultilineStrings.hs
+16
-14
16 additions, 14 deletions
compiler/GHC/Driver/MultilineStrings.hs
with
16 additions
and
14 deletions
compiler/GHC/Driver/MultilineStrings.hs
+
16
−
14
View file @
5eb1e883
...
@@ -3,30 +3,32 @@ module GHC.Driver.MultilineStrings where
...
@@ -3,30 +3,32 @@ module GHC.Driver.MultilineStrings where
import
GHC.Prelude
import
GHC.Prelude
convertMultilineStrings
::
String
->
String
convertMultilineStrings
::
String
->
String
convertMultilineStrings
s
=
go
s
WaitingForString
convertMultilineStrings
s
=
go
s
WaitingForString
0
where
where
go
s
state
=
case
state
of
go
s
state
charCnt
=
case
state
of
WaitingForString
->
case
s
of
WaitingForString
->
case
s
of
""
->
""
""
->
""
'-'
:
'-'
:
s
->
'-'
:
'-'
:
skipOneLineComment
s
'-'
:
'-'
:
s
->
'-'
:
'-'
:
skipOneLineComment
s
'{'
:
'-'
:
s
->
'{'
:
'-'
:
skipComment
s
'{'
:
'-'
:
s
->
'{'
:
'-'
:
skipComment
s
'"'
:
'"'
:
'"'
:
'
\n
'
:
'"'
:
'"'
:
'"'
:
s
->
'"'
:
'"'
:
go
s
state
'"'
:
'"'
:
'"'
:
'
\n
'
:
'"'
:
'"'
:
'"'
:
s
->
'"'
:
'"'
:
go
s
state
3
'"'
:
'"'
:
'"'
:
'
\n
'
:
s
->
'
\n
'
:
' '
:
'"'
:
go
s
InString
'"'
:
'"'
:
'"'
:
'
\n
'
:
s
->
'
\n
'
:
' '
:
'"'
:
go
s
InString
charCnt
c
:
s
->
c
:
go
s
state
'
\n
'
:
s
->
'
\n
'
:
go
s
state
0
c
:
s
->
c
:
go
s
state
(
charCnt
+
1
)
InString
->
case
s
of
InString
->
case
s
of
""
->
error
"we are in a mutline string, but text ended unexpectedly"
""
->
error
"we are in a mutline string, but text ended unexpectedly"
'
\n
'
:
'"'
:
'"'
:
'"'
:
s
->
'"'
:
'
\n
'
:
go
s
WaitingForString
'
\n
'
:
'"'
:
'"'
:
'"'
:
s
->
'"'
:
'
\n
'
:
go
s
WaitingForString
0
'"'
:
s
->
'
\\
'
:
'"'
:
go
s
state
'"'
:
s
->
'
\\
'
:
'"'
:
go
s
state
charCnt
'
\\
'
:
s
->
'
\\
'
:
'
\\
'
:
go
s
state
'
\\
'
:
s
->
'
\\
'
:
'
\\
'
:
go
s
state
charCnt
'
\n
'
:
s
->
'
\\
'
:
'n'
:
'"'
:
'
\n
'
:
' '
:
'+'
:
'+'
:
' '
:
'"'
:
go
s
state
-- '\n':s -> '\\':'n':'"':'\n':' ':'+':'+':' ':'"' : go s state charCnt
c
:
s
->
c
:
go
s
state
'
\n
'
:
s
->
"
\\
n
\"\n
"
++
replicate
charCnt
' '
++
" ++
\"
"
++
go
s
state
charCnt
c
:
s
->
c
:
go
s
state
charCnt
where
where
skipOneLineComment
""
=
go
""
state
skipOneLineComment
""
=
go
""
state
charCnt
skipOneLineComment
s
@
(
'
\n
'
:
_
)
=
go
s
state
skipOneLineComment
s
@
(
'
\n
'
:
_
)
=
go
s
state
charCnt
skipOneLineComment
(
c
:
s
)
=
c
:
skipOneLineComment
s
skipOneLineComment
(
c
:
s
)
=
c
:
skipOneLineComment
s
skipComment
""
=
go
""
state
skipComment
""
=
go
""
state
charCnt
skipComment
(
'-'
:
'}'
:
s
)
=
'-'
:
'}'
:
go
s
state
skipComment
(
'-'
:
'}'
:
s
)
=
'-'
:
'}'
:
go
s
state
charCnt
skipComment
(
c
:
s
)
=
c
:
skipComment
s
skipComment
(
c
:
s
)
=
c
:
skipComment
s
data
State
data
State
...
...
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