mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-01 20:45:53 +01:00
Use abbreviation "expr" instead of "expression" (#3375)
Part of switching to the [abbreviations we've decided to use](https://docs.google.com/document/d/1RRYMm42osyqhI2LyjrjockYCutQ5dOf8Abu50kTrkX0/edit?resourcekey=0-kHyqOESbOHmzZphUbtLrTw#heading=h.pph7i5m5un7q). I will rename files in a follow-up PR.
This commit is contained in:
@@ -10,40 +10,40 @@
|
||||
|
||||
namespace Carbon::Parse {
|
||||
|
||||
auto HandleArrayExpression(Context& context) -> void {
|
||||
auto HandleArrayExpr(Context& context) -> void {
|
||||
auto state = context.PopState();
|
||||
state.state = State::ArrayExpressionSemi;
|
||||
context.AddLeafNode(NodeKind::ArrayExpressionStart,
|
||||
state.state = State::ArrayExprSemi;
|
||||
context.AddLeafNode(NodeKind::ArrayExprStart,
|
||||
context.ConsumeChecked(Lex::TokenKind::OpenSquareBracket),
|
||||
state.has_error);
|
||||
context.PushState(state);
|
||||
context.PushState(State::Expression);
|
||||
context.PushState(State::Expr);
|
||||
}
|
||||
|
||||
auto HandleArrayExpressionSemi(Context& context) -> void {
|
||||
auto HandleArrayExprSemi(Context& context) -> void {
|
||||
auto state = context.PopState();
|
||||
auto semi = context.ConsumeIf(Lex::TokenKind::Semi);
|
||||
if (!semi) {
|
||||
context.AddNode(NodeKind::ArrayExpressionSemi, *context.position(),
|
||||
context.AddNode(NodeKind::ArrayExprSemi, *context.position(),
|
||||
state.subtree_start, true);
|
||||
CARBON_DIAGNOSTIC(ExpectedArraySemi, Error, "Expected `;` in array type.");
|
||||
context.emitter().Emit(*context.position(), ExpectedArraySemi);
|
||||
state.has_error = true;
|
||||
} else {
|
||||
context.AddNode(NodeKind::ArrayExpressionSemi, *semi, state.subtree_start,
|
||||
context.AddNode(NodeKind::ArrayExprSemi, *semi, state.subtree_start,
|
||||
state.has_error);
|
||||
}
|
||||
state.state = State::ArrayExpressionFinish;
|
||||
state.state = State::ArrayExprFinish;
|
||||
context.PushState(state);
|
||||
if (!context.PositionIs(Lex::TokenKind::CloseSquareBracket)) {
|
||||
context.PushState(State::Expression);
|
||||
context.PushState(State::Expr);
|
||||
}
|
||||
}
|
||||
|
||||
auto HandleArrayExpressionFinish(Context& context) -> void {
|
||||
auto HandleArrayExprFinish(Context& context) -> void {
|
||||
auto state = context.PopState();
|
||||
context.ConsumeAndAddCloseSymbol(*(Lex::TokenIterator(state.token)), state,
|
||||
NodeKind::ArrayExpression);
|
||||
NodeKind::ArrayExpr);
|
||||
}
|
||||
|
||||
} // namespace Carbon::Parse
|
||||
|
||||
Reference in New Issue
Block a user