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:
josh11b
2023-11-10 01:32:32 +00:00
committed by GitHub
parent 6d5e62974c
commit 11ca083855
140 changed files with 1076 additions and 1114 deletions
+11 -11
View File
@@ -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