X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fparser%2FLexer.x;h=e131e962cd712e7984c20d3bd54f9734add328d9;hp=de0ccb6d34de78044da52d1fe310f14d60ecd6de;hb=aa9682ccc5521d367d76ae7abba7af03bfee3a68;hpb=767eb8299091381d0193337116ec3c7a3a5e5eef diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index de0ccb6..e131e96 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -1991,7 +1991,9 @@ alternativeLayoutRuleToken t setNextToken t lexTokenAlr (_, ALRLayout _ col : ls, Just expectingOCurly) - | thisCol > col -> + | (thisCol > col) || + (thisCol == col && + isNonDecreasingIntentation expectingOCurly) -> do setAlrExpectingOCurly Nothing setALRContext (ALRLayout expectingOCurly thisCol : context) setNextToken t @@ -2089,6 +2091,10 @@ isALRclose ITccurly = True isALRclose ITcubxparen = True isALRclose _ = False +isNonDecreasingIntentation :: ALRLayout -> Bool +isNonDecreasingIntentation ALRLayoutDo = True +isNonDecreasingIntentation _ = False + containsCommas :: Token -> Bool containsCommas IToparen = True containsCommas ITobrack = True