mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 01:50:27 +00:00
Validate parse nodes correspond to expected tokens (#3295)
Can specify which tokens are allowed generally, and any additional tokens that only occur when the parse node has an error. --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
1 parent
95a1cc8cba
commit
a112f2e802
16 files changed
+312
-113
No files matched your search
@@ -33,7 +33,8 @@ static auto HandleDeclarationNameAndParams(Context& context, State after_name)
|
||||
context.emitter().Emit(*context.position(), ExpectedDeclarationName,
|
||||
context.tokens().GetKind(state.token));
|
||||
context.ReturnErrorOnState();
|
||||
context.AddLeafNode(NodeKind::InvalidParse, *context.position());
|
||||
context.AddLeafNode(NodeKind::InvalidParse, *context.position(),
|
||||
/*has_error=*/true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user