apollo-rs icon indicating copy to clipboard operation
apollo-rs copied to clipboard

Error recovery in the parser

Open goto-bus-stop opened this issue 2 years ago • 0 comments

The parser does its best with any invalid input it gets. We have a few cases where it could be better.

type A {
  field1: Int
  |||garbage|||
  field2: Int
}

A parse error on line 3 here causes the parser to "unwind" all the way back to the root node before continuing to parse. Here the ideal way to do it would be to eat the garbage and continue parsing the fields definition.

(add more examples as necessary?)

goto-bus-stop avatar Feb 08 '23 09:02 goto-bus-stop