mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 21:31:04 +01: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:
@@ -6,6 +6,10 @@
|
||||
|
||||
namespace Carbon {
|
||||
|
||||
CARBON_DIAGNOSTIC(
|
||||
OperatorRequiresParentheses, Error,
|
||||
"Parentheses are required to disambiguate operator precedence.");
|
||||
|
||||
auto ParserHandleExpression(ParserContext& context) -> void {
|
||||
auto state = context.PopState();
|
||||
|
||||
@@ -209,6 +213,8 @@ auto ParserHandleExpressionStatementFinish(ParserContext& context) -> void {
|
||||
}
|
||||
|
||||
if (!state.has_error) {
|
||||
CARBON_DIAGNOSTIC(ExpectedSemiAfterExpression, Error,
|
||||
"Expected `;` after expression.");
|
||||
context.emitter().Emit(*context.position(), ExpectedSemiAfterExpression);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user