Teach the alternative layout rule about mdo and rec
[ghc-hetmet.git] / compiler / parser / Lexer.x
index b3502b8..51aa2f3 100644 (file)
@@ -1954,6 +1954,8 @@ lexTokenAlr = do mPending <- popPendingImplicitToken
                      ITlet   -> setAlrExpectingOCurly (Just ALRLayoutLet)
                      ITof    -> setAlrExpectingOCurly (Just ALRLayoutOf)
                      ITdo    -> setAlrExpectingOCurly (Just ALRLayoutDo)
+                     ITmdo   -> setAlrExpectingOCurly (Just ALRLayoutDo)
+                     ITrec   -> setAlrExpectingOCurly (Just ALRLayoutDo)
                      _       -> return ()
                  return t
 
@@ -2065,14 +2067,15 @@ alternativeLayoutRuleToken t
              (_, _, _) -> return t
 
 isALRopen :: Token -> Bool
-isALRopen ITcase   = True
-isALRopen ITif     = True
-isALRopen IToparen = True
-isALRopen ITobrack = True
-isALRopen ITocurly = True
+isALRopen ITcase        = True
+isALRopen ITif          = True
+isALRopen IToparen      = True
+isALRopen ITobrack      = True
+isALRopen ITocurly      = True
 -- GHC Extensions:
-isALRopen IToubxparen = True
-isALRopen _        = False
+isALRopen IToubxparen   = True
+isALRopen ITparenEscape = True
+isALRopen _             = False
 
 isALRclose :: Token -> Bool
 isALRclose ITof     = True