fix top-level layout
This commit is contained in:
@@ -125,6 +125,12 @@ $white_no_nl+ ;
|
|||||||
() { doBol }
|
() { doBol }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<layout_top>
|
||||||
|
{
|
||||||
|
\n ;
|
||||||
|
"{" { explicitLBrace `thenDo` popLexState }
|
||||||
|
}
|
||||||
|
|
||||||
<layout, layout_let, layout_of>
|
<layout, layout_let, layout_of>
|
||||||
{
|
{
|
||||||
\n { beginPush bol }
|
\n { beginPush bol }
|
||||||
@@ -153,6 +159,7 @@ lexReservedName = \case
|
|||||||
"infix" -> TokenInfix
|
"infix" -> TokenInfix
|
||||||
"infixl" -> TokenInfixL
|
"infixl" -> TokenInfixL
|
||||||
"infixr" -> TokenInfixR
|
"infixr" -> TokenInfixR
|
||||||
|
s -> error (show s)
|
||||||
|
|
||||||
lexReservedOp :: Text -> RlpToken
|
lexReservedOp :: Text -> RlpToken
|
||||||
lexReservedOp = \case
|
lexReservedOp = \case
|
||||||
@@ -160,6 +167,7 @@ lexReservedOp = \case
|
|||||||
"::" -> TokenHasType
|
"::" -> TokenHasType
|
||||||
"|" -> TokenPipe
|
"|" -> TokenPipe
|
||||||
"->" -> TokenArrow
|
"->" -> TokenArrow
|
||||||
|
s -> error (show s)
|
||||||
|
|
||||||
-- | @andBegin@, with the subtle difference that the start code is set
|
-- | @andBegin@, with the subtle difference that the start code is set
|
||||||
-- /after/ the action
|
-- /after/ the action
|
||||||
@@ -325,7 +333,7 @@ doBol :: LexerAction (Located RlpToken)
|
|||||||
doBol inp l = do
|
doBol inp l = do
|
||||||
off <- cmpLayout
|
off <- cmpLayout
|
||||||
i <- indentLevel
|
i <- indentLevel
|
||||||
traceM $ "i: " <> show i
|
-- traceM $ "i: " <> show i
|
||||||
-- important that we pop the lex state lest we find our lexer diverging
|
-- important that we pop the lex state lest we find our lexer diverging
|
||||||
popLexState
|
popLexState
|
||||||
case off of
|
case off of
|
||||||
|
|||||||
Reference in New Issue
Block a user