mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-18 20:50:29 +00:00
Refactor diagnostics out of parser_context.h (#2834)
This is addressing an issue left behind by the context switch, removing a few diagnostics that had been in the header rather than figuring out proper homes. I'm splitting one for semis a little further, sharing one, and then the other two are actually able to be moved into more specific homes as-is (one is only used in one place, clearly an oversight that it wasn't there already).
This commit is contained in:
1 parent
75f1ac3a08
commit
8ad08e34e2
17 files changed
+43
-40
No files matched your search
@@ -422,4 +422,14 @@ auto ParserContext::RecoverFromDeclarationError(StateStackEntry state,
|
||||
/*has_error=*/true);
|
||||
}
|
||||
|
||||
auto ParserContext::EmitExpectedDeclarationSemiOrDefinition(
|
||||
TokenKind expected_kind) -> void {
|
||||
CARBON_DIAGNOSTIC(ExpectedDeclarationSemiOrDefinition, Error,
|
||||
"`{0}` should either end with a `;` for a declaration or "
|
||||
"have a `{{ ... }` block for a definition.",
|
||||
TokenKind);
|
||||
emitter().Emit(*position(), ExpectedDeclarationSemiOrDefinition,
|
||||
expected_kind);
|
||||
}
|
||||
|
||||
} // namespace Carbon
|
||||
Reference in new issue
Block a user