X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fparser%2FLexer.x;h=6cb2c3b7ca2c40f8f9c8c10b9f13be4d33432af9;hp=5df5e4ea2549fe9c83ada1910af5ce6366350b98;hb=4bba92f93b88e15f0e0f23732d2cfa540acb737b;hpb=8dbd52c7606588ab7fc7ffd3a54641b7cadc4431 diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 5df5e4e..6cb2c3b 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -2054,6 +2054,18 @@ alternativeLayoutRuleToken t -- Note that we use lastLoc, as we may need to close -- more layouts, or give a semicolon return (L lastLoc ITccurly) + -- This next case is to handle a transitional issue: + (ITvbar, ALRLayout _ col : ls, _) + | newLine && thisCol == col && transitional -> + do addWarning Opt_WarnAlternativeLayoutRuleTransitional + thisLoc + (transitionalAlternativeLayoutWarning + "`|' at the same depth as implicit layout block") + setALRContext ls + setNextToken t + -- Note that we use lastLoc, as we may need to close + -- more layouts, or give a semicolon + return (L lastLoc ITccurly) (_, ALRLayout _ col : ls, _) | newLine && thisCol == col -> do setNextToken t