Collapses nodes to 'abc' ?
Closed this issue · 2 comments
AndrewRayCode commented
This line
prettier-plugin-pegjs/src/libs/printer.js
Line 261 in 181102a
Is for some reason triggering with this production:
switch_statement
= switchSymbol:SWITCH
l:LEFT_PAREN
expr:expression
r:RIGHT_PAREN
body:(
lb:LEFT_BRACE stmts:statement_list? rb:RIGHT_BRACE {
return { lb, stmts, rb };
}
) {
const { lb, stmts rb } = body;
return node(switchSymbol.name); }
When I format this, it collapses to
switch_statement = abc
siefkenj commented
It looks like your Javascript is invalid....try
switch_statement
= switchSymbol:SWITCH
l:LEFT_PAREN
expr:expression
r:RIGHT_PAREN
body:(
lb:LEFT_BRACE stmts:statement_list? rb:RIGHT_BRACE {
return { lb, stmts, rb };
}
) {
const { lb, stmts, rb } = body;
return node(switchSymbol.name); }
The lack of error is very misleading, though!