Remove sometimes-inappropriate error recovery on unexpected semicolon. Closes #5
This commit is contained in:
parent
3904c626c9
commit
46bafa9501
|
@ -134,23 +134,10 @@ export class LaxReader implements IterableIterator<Item> {
|
|||
case TokenType.SPACE:
|
||||
case TokenType.NEWLINE:
|
||||
case TokenType.ATOM:
|
||||
this.drop();
|
||||
if (g === null) {
|
||||
this.drop();
|
||||
return t;
|
||||
}
|
||||
if (t.text === ';') {
|
||||
while ('(['.indexOf(g.open.text) >= 0) {
|
||||
this.stack.pop();
|
||||
const outer = this.stackTop();
|
||||
if (outer === null) {
|
||||
// do not drop the semicolon here
|
||||
return finishGroup(g, t.start);
|
||||
}
|
||||
outer.items.push(finishGroup(g, t.start));
|
||||
g = outer;
|
||||
}
|
||||
}
|
||||
this.drop();
|
||||
g.items.push(t);
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue