This fix (re/ab)uses the s :: BracketStyle argument to p_hsExpr' in order to decide whether we are in a do expression: even though this particular case has nothing to do with brackets, it points to the same underlying problem (some stuff has to be indented only in do blocks). This could be potentially confusing for future readers of this code, but the diff is really small, so the effect is not huge in any case.
A slightly more principled fix could look like this: Introduce
data InDoBlock = InDoBlock | NotInDoBlock
and change p_hsExpr''s signature to
p_hsExpr' :: InDoBlock -> HsExpr GhcPs -> R ()
as well as provide a function InDoBlock -> BracketStyle.
Closes #925
This fix (re/ab)uses the
s :: BracketStyle
argument top_hsExpr'
in order to decide whether we are in ado
expression: even though this particular case has nothing to do with brackets, it points to the same underlying problem (some stuff has to be indented only indo
blocks). This could be potentially confusing for future readers of this code, but the diff is really small, so the effect is not huge in any case.A slightly more principled fix could look like this: Introduce
and change
p_hsExpr'
's signature toas well as provide a function
InDoBlock -> BracketStyle
.