-
Notifications
You must be signed in to change notification settings - Fork 172
Closed
Labels
Milestone
Description
This parses in haskell but not in a suitable grammar using BNFC's layout
mechanism:
f = 5 + g where {
g = 3 + h where
h = 2 }
The problem seems to be that implicit blocks are dropped from the layout stack without emitting layoutClose
tokens, see:
bnfc/source/src/BNFC/Backend/Haskell/CFtoLayout.hs
Lines 127 to 128 in 71ebcee
, " | isLayoutClose t0 = " | |
, " let st' = drop 1 (dropWhile isImplicit st)" |
I am using this grammar:
layout toplevel;
separator nonempty Decl ";" ;
Empty. Decl ::= ;
FunClause. Decl ::= Ident "=" Expr WhereOpt;
layout "where";
YesWhere. WhereOpt ::= "where" "{" [Decl] "}";
NoWhere. WhereOpt ::= ;
EId. Expr1 ::= Ident;
EInt. Expr1 ::= Integer;
EPlus. Expr ::= Expr "+" Expr1;
coercions Expr 1;