Commit aa9682cc authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Implement non-decreasing do indentation in the alternative layout rule

parent 767eb829
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment