From 4bba92f93b88e15f0e0f23732d2cfa540acb737b Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 2 Mar 2010 20:58:15 +0000 Subject: [PATCH 1/1] Add handling for | to the transitional alternative layout rule --- compiler/parser/Lexer.x | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- 1.7.10.4