parse case exprs

This commit is contained in:
crumbtoo
2024-02-06 13:04:36 -07:00
parent 57f5206b16
commit 15884336f1
3 changed files with 48 additions and 9 deletions

View File

@@ -85,6 +85,7 @@ $white_no_nl+ ;
<0>
{
"let" { constToken TokenLet `thenBeginPush` layout_let }
"of" { constToken TokenOf `thenBeginPush` layout_of }
}
-- scan various identifiers and reserved words. order is important here!
@@ -124,18 +125,19 @@ $white_no_nl+ ;
() { doBol }
}
<layout_let>
<layout, layout_let, layout_of>
{
\n { beginPush bol }
"{" { explicitLBrace `thenDo` popLexState }
"in" { constToken TokenIn `thenDo` (popLexState *> popLayout) }
() { doLayout }
}
<layout_top>
<layout_let>
{
"in" { constToken TokenIn `thenDo` (popLexState *> popLayout) }
}
<layout, layout_top, layout_let, layout_of>
{
\n ;
"{" { explicitLBrace `thenDo` popLexState }
() { doLayout }
}
@@ -157,6 +159,7 @@ lexReservedOp = \case
"=" -> TokenEquals
"::" -> TokenHasType
"|" -> TokenPipe
"->" -> TokenArrow
-- | @andBegin@, with the subtle difference that the start code is set
-- /after/ the action