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
04a12a3d
Commit
04a12a3d
authored
Nov 24, 2010
by
Ian Lynagh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add another GHC layout rule relaxation to RelaxedLayout
parent
1e70cb6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
compiler/parser/Lexer.x
compiler/parser/Lexer.x
+14
-1
No files found.
compiler/parser/Lexer.x
View file @
04a12a3d
...
...
@@ -211,7 +211,7 @@ $tab+ { warn Opt_WarnTabs (text "Warning: Tab character") }
-- context if the curly brace is missing.
-- Careful! This stuff is quite delicate.
<layout, layout_do> {
\{ / { notFollowedBy '-' } {
pop_and
open_brace }
\{ / { notFollowedBy '-' } {
hopefully_
open_brace }
-- we might encounter {-# here, but {- has been handled already
\n ;
^\# (line)? { begin line_prag1 }
...
...
@@ -757,6 +757,19 @@ pop :: Action
pop _span _buf _len = do _ <- popLexState
lexToken
hopefully_open_brace :: Action
hopefully_open_brace span buf len
= do relaxed <- extension relaxedLayout
ctx <- getContext
(AI l _) <- getInput
let offset = srcLocCol l
isOK = relaxed ||
case ctx of
Layout prev_off : _ -> prev_off < offset
_ -> True
if isOK then pop_and open_brace span buf len
else failSpanMsgP span (text "Missing block")
pop_and :: Action -> Action
pop_and act span buf len = do _ <- popLexState
act span buf len
...
...
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