tests(cst): Add regression tests for "not followed by IdentifierStart" rules#642
Conversation
|
| # This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
|
||
| Source: > | ||
| 1 │ "foo"bar │ 0..8 |
There was a problem hiding this comment.
perhaps not related to this PR, but I'm not sure I understand why this error is Expected AsciiStringLiteral, based on the grammar in dsl.rs .. the first AsciiStringLiteral token we parsed and created correctly .. the following token is not a valid AsciiStringLiteral (based on the first letter b alone) .. so I would have expected to see a full/correct AsciiStringLiteralsList parent node, some SKIPPED text for bar, and an error like Expected end of input.
Thoughts?
There was a problem hiding this comment.
If I recall correctly, the way this currently works is that we enter this parser, accumulate the first result but enter the recovery mode for this parser (such that we can recover from unexpected tokens between the list items). Then, we hit EOF, which is where we wrap up the recovering parser.
We could tweak the ER mechanism such that if only the suffix is skipped, we move the skipped tokens alongside the recovered parse rule (rather than them being a descendent of the rule) but I think that the 'expected' bit is correct/intuitive, as we do in fact expected an AsciiStringLiteral but got some unexpected tokens, instead?
See #641