From 0944200e41f83f825b05750fbe4a9e50b8c4a939 Mon Sep 17 00:00:00 2001 From: Gil Ben-Shachar Date: Tue, 21 Nov 2023 11:46:17 +0200 Subject: [PATCH] Change token names to represent the character instead of the operation. --- .../src/node_properties.rs | 22 +- .../src/semantic_highlighting/token_kind.rs | 10 +- .../cairo-lang-lowering/src/test_data/match | 1 - .../cairo-lang-parser/src/colored_printer.rs | 12 +- crates/cairo-lang-parser/src/lexer.rs | 20 +- crates/cairo-lang-parser/src/lexer_test.rs | 38 +- crates/cairo-lang-parser/src/operators.rs | 16 +- crates/cairo-lang-parser/src/parser.rs | 40 +- .../src/parser_test_data/diagnostics/match | 2 +- .../src/parser_test_data/full_trees/test1 | 60 +- .../src/parser_test_data/full_trees/test2 | 24 +- .../src/parser_test_data/full_trees/test3 | 30 +- .../src/parser_test_data/partial_trees/expr | 4 +- .../partial_trees/inline_macro | 2 +- .../partial_trees/item_inline_macro | 14 +- .../src/parser_test_data/partial_trees/match | 8 +- .../src/parser_test_data/partial_trees/op_eq | 6 +- .../partial_trees/unary_only_operators | 2 +- crates/cairo-lang-parser/src/recovery.rs | 6 +- .../src/cairo_spec.rs | 48 +- crates/cairo-lang-syntax/src/node/ast.rs | 1040 +++++++++-------- .../cairo-lang-syntax/src/node/key_fields.rs | 40 +- crates/cairo-lang-syntax/src/node/kind.rs | 80 +- 23 files changed, 769 insertions(+), 756 deletions(-) diff --git a/crates/cairo-lang-formatter/src/node_properties.rs b/crates/cairo-lang-formatter/src/node_properties.rs index 700617d3343..ce3f3178a86 100644 --- a/crates/cairo-lang-formatter/src/node_properties.rs +++ b/crates/cairo-lang-formatter/src/node_properties.rs @@ -19,7 +19,7 @@ impl SyntaxNodeFormat for SyntaxNode { | SyntaxKind::TokenRBrack | SyntaxKind::TokenLBrack | SyntaxKind::TokenSingleLineComment => true, - SyntaxKind::TokenNot + SyntaxKind::TokenBang if matches!( grandparent_kind(db, self), Some(SyntaxKind::ExprInlineMacro | SyntaxKind::ItemInlineMacro) @@ -75,8 +75,8 @@ impl SyntaxNodeFormat for SyntaxNode { fn force_no_space_after(&self, db: &dyn SyntaxGroup) -> bool { match self.kind(db) { SyntaxKind::TokenDot - | SyntaxKind::TokenNot - | SyntaxKind::TokenBitNot + | SyntaxKind::TokenBang + | SyntaxKind::TokenTilde | SyntaxKind::TokenAt | SyntaxKind::TokenColonColon | SyntaxKind::TokenLParen @@ -111,7 +111,7 @@ impl SyntaxNodeFormat for SyntaxNode { { true } - SyntaxKind::TokenMinus | SyntaxKind::TokenMul => { + SyntaxKind::TokenMinus | SyntaxKind::TokenStar => { matches!(grandparent_kind(db, self), Some(SyntaxKind::ExprUnary)) } SyntaxKind::TokenPlus @@ -473,7 +473,9 @@ impl SyntaxNodeFormat for SyntaxNode { true, )) } - SyntaxKind::TerminalMul if parent_kind(db, self) != Some(SyntaxKind::ExprUnary) => { + SyntaxKind::TerminalStar + if parent_kind(db, self) != Some(SyntaxKind::ExprUnary) => + { BreakLinePointsPositions::Leading(BreakLinePointProperties::new( 9, BreakLinePointIndentation::Indented, @@ -481,7 +483,7 @@ impl SyntaxNodeFormat for SyntaxNode { true, )) } - SyntaxKind::TerminalDiv => { + SyntaxKind::TerminalSlash => { BreakLinePointsPositions::Leading(BreakLinePointProperties::new( 9, BreakLinePointIndentation::Indented, @@ -523,7 +525,7 @@ impl SyntaxNodeFormat for SyntaxNode { true, )) } - SyntaxKind::TerminalXor => { + SyntaxKind::TerminalCaret => { BreakLinePointsPositions::Leading(BreakLinePointProperties::new( 14, BreakLinePointIndentation::Indented, @@ -542,9 +544,9 @@ impl SyntaxNodeFormat for SyntaxNode { SyntaxKind::TokenEq | SyntaxKind::TokenPlusEq | SyntaxKind::TokenMinusEq - | SyntaxKind::TokenMulEq - | SyntaxKind::TokenDivEq - | SyntaxKind::TokenModEq => { + | SyntaxKind::TokenStarEq + | SyntaxKind::TokenSlashEq + | SyntaxKind::TokenPercentEq => { BreakLinePointsPositions::Trailing(BreakLinePointProperties::new( 16, BreakLinePointIndentation::Indented, diff --git a/crates/cairo-lang-language-server/src/semantic_highlighting/token_kind.rs b/crates/cairo-lang-language-server/src/semantic_highlighting/token_kind.rs index a29060318c5..35f3f77ff81 100644 --- a/crates/cairo-lang-language-server/src/semantic_highlighting/token_kind.rs +++ b/crates/cairo-lang-language-server/src/semantic_highlighting/token_kind.rs @@ -50,7 +50,7 @@ impl SemanticTokenKind { SyntaxKind::TokenIdentifier => {} _ if kind.is_keyword_token() => return Some(SemanticTokenKind::Keyword), SyntaxKind::TokenLiteralNumber => return Some(SemanticTokenKind::Number), - SyntaxKind::TokenNot + SyntaxKind::TokenBang if matches!( grandparent_kind(syntax_db, &node), Some(SyntaxKind::ExprInlineMacro | SyntaxKind::ItemInlineMacro) @@ -76,12 +76,12 @@ impl SemanticTokenKind { | SyntaxKind::TokenGT | SyntaxKind::TokenLE | SyntaxKind::TokenLT - | SyntaxKind::TokenNot + | SyntaxKind::TokenBang | SyntaxKind::TokenPlus | SyntaxKind::TokenMinus - | SyntaxKind::TokenMul - | SyntaxKind::TokenDiv - | SyntaxKind::TokenMod => return Some(SemanticTokenKind::Operator), + | SyntaxKind::TokenStar + | SyntaxKind::TokenSlash + | SyntaxKind::TokenPercent => return Some(SemanticTokenKind::Operator), SyntaxKind::TokenSingleLineComment => return Some(SemanticTokenKind::Comment), SyntaxKind::TokenShortString | SyntaxKind::TokenString => { return Some(SemanticTokenKind::String); diff --git a/crates/cairo-lang-lowering/src/test_data/match b/crates/cairo-lang-lowering/src/test_data/match index d2099956c78..3b609b029bc 100644 --- a/crates/cairo-lang-lowering/src/test_data/match +++ b/crates/cairo-lang-lowering/src/test_data/match @@ -775,4 +775,3 @@ error: Enum variant `Four` not covered. //! > lowering_flat Parameters: v0: test::A - diff --git a/crates/cairo-lang-parser/src/colored_printer.rs b/crates/cairo-lang-parser/src/colored_printer.rs index f819b3c1c72..888aed5a4aa 100644 --- a/crates/cairo-lang-parser/src/colored_printer.rs +++ b/crates/cairo-lang-parser/src/colored_printer.rs @@ -61,9 +61,9 @@ fn set_color(text: SmolStr, kind: SyntaxKind) -> ColoredString { SyntaxKind::TokenIdentifier => text.truecolor(255, 255, 100), // Yellow SyntaxKind::TokenPlus | SyntaxKind::TokenMinus - | SyntaxKind::TokenMul - | SyntaxKind::TokenDiv - | SyntaxKind::TokenMod + | SyntaxKind::TokenStar + | SyntaxKind::TokenSlash + | SyntaxKind::TokenPercent | SyntaxKind::TokenDot => text.bright_magenta(), SyntaxKind::TokenLiteralNumber | SyntaxKind::TokenFalse @@ -90,7 +90,7 @@ fn set_color(text: SmolStr, kind: SyntaxKind) -> ColoredString { | SyntaxKind::TokenMut | SyntaxKind::TokenNoPanic => text.bright_blue(), SyntaxKind::TokenArrow - | SyntaxKind::TokenMatchArrow + | SyntaxKind::TokenFatArrow | SyntaxKind::TokenColon | SyntaxKind::TokenColonColon | SyntaxKind::TokenDotDot @@ -99,8 +99,8 @@ fn set_color(text: SmolStr, kind: SyntaxKind) -> ColoredString { | SyntaxKind::TokenAndAnd | SyntaxKind::TokenOr | SyntaxKind::TokenOrOr - | SyntaxKind::TokenXor - | SyntaxKind::TokenNot + | SyntaxKind::TokenCaret + | SyntaxKind::TokenBang | SyntaxKind::TokenQuestionMark | SyntaxKind::TokenUnderscore | SyntaxKind::TokenHash => text.truecolor(255, 180, 255), // Pink diff --git a/crates/cairo-lang-parser/src/lexer.rs b/crates/cairo-lang-parser/src/lexer.rs index 722d2a40bf4..827ac310516 100644 --- a/crates/cairo-lang-parser/src/lexer.rs +++ b/crates/cairo-lang-parser/src/lexer.rs @@ -459,25 +459,25 @@ fn token_kind_to_terminal_syntax_kind(kind: TokenKind) -> SyntaxKind { TokenKind::At => SyntaxKind::TerminalAt, TokenKind::Or => SyntaxKind::TerminalOr, TokenKind::OrOr => SyntaxKind::TerminalOrOr, - TokenKind::Xor => SyntaxKind::TerminalXor, + TokenKind::Xor => SyntaxKind::TerminalCaret, TokenKind::EqEq => SyntaxKind::TerminalEqEq, TokenKind::Neq => SyntaxKind::TerminalNeq, TokenKind::GE => SyntaxKind::TerminalGE, TokenKind::GT => SyntaxKind::TerminalGT, TokenKind::LE => SyntaxKind::TerminalLE, TokenKind::LT => SyntaxKind::TerminalLT, - TokenKind::Not => SyntaxKind::TerminalNot, - TokenKind::BitNot => SyntaxKind::TerminalBitNot, + TokenKind::Not => SyntaxKind::TerminalBang, + TokenKind::BitNot => SyntaxKind::TerminalTilde, TokenKind::Plus => SyntaxKind::TerminalPlus, TokenKind::PlusEq => SyntaxKind::TerminalPlusEq, TokenKind::Minus => SyntaxKind::TerminalMinus, TokenKind::MinusEq => SyntaxKind::TerminalMinusEq, - TokenKind::Mul => SyntaxKind::TerminalMul, - TokenKind::MulEq => SyntaxKind::TerminalMulEq, - TokenKind::Div => SyntaxKind::TerminalDiv, - TokenKind::DivEq => SyntaxKind::TerminalDivEq, - TokenKind::Mod => SyntaxKind::TerminalMod, - TokenKind::ModEq => SyntaxKind::TerminalModEq, + TokenKind::Mul => SyntaxKind::TerminalStar, + TokenKind::MulEq => SyntaxKind::TerminalStarEq, + TokenKind::Div => SyntaxKind::TerminalSlash, + TokenKind::DivEq => SyntaxKind::TerminalSlashEq, + TokenKind::Mod => SyntaxKind::TerminalPercent, + TokenKind::ModEq => SyntaxKind::TerminalPercentEq, TokenKind::Colon => SyntaxKind::TerminalColon, TokenKind::ColonColon => SyntaxKind::TerminalColonColon, TokenKind::Comma => SyntaxKind::TerminalComma, @@ -497,7 +497,7 @@ fn token_kind_to_terminal_syntax_kind(kind: TokenKind) -> SyntaxKind { TokenKind::Ref => SyntaxKind::TerminalRef, TokenKind::Mut => SyntaxKind::TerminalMut, TokenKind::Arrow => SyntaxKind::TerminalArrow, - TokenKind::MatchArrow => SyntaxKind::TerminalMatchArrow, + TokenKind::MatchArrow => SyntaxKind::TerminalFatArrow, TokenKind::BadCharacters => SyntaxKind::TerminalBadCharacters, TokenKind::EndOfFile => SyntaxKind::TerminalEndOfFile, } diff --git a/crates/cairo-lang-parser/src/lexer_test.rs b/crates/cairo-lang-parser/src/lexer_test.rs index 02fe67cce20..0619eac8960 100644 --- a/crates/cairo-lang-parser/src/lexer_test.rs +++ b/crates/cairo-lang-parser/src/lexer_test.rs @@ -67,10 +67,10 @@ fn terminal_kind_to_text(kind: SyntaxKind) -> Vec<&'static str> { SyntaxKind::TerminalColon => vec![":"], SyntaxKind::TerminalColonColon => vec!["::"], SyntaxKind::TerminalComma => vec![","], - SyntaxKind::TerminalDiv => vec!["/"], - SyntaxKind::TerminalDivEq => vec!["/="], - SyntaxKind::TerminalMod => vec!["%"], - SyntaxKind::TerminalModEq => vec!["%="], + SyntaxKind::TerminalSlash => vec!["/"], + SyntaxKind::TerminalSlashEq => vec!["/="], + SyntaxKind::TerminalPercent => vec!["%"], + SyntaxKind::TerminalPercentEq => vec!["%="], SyntaxKind::TerminalDot => vec!["."], SyntaxKind::TerminalDotDot => vec![".."], SyntaxKind::TerminalEq => vec!["="], @@ -81,14 +81,14 @@ fn terminal_kind_to_text(kind: SyntaxKind) -> Vec<&'static str> { SyntaxKind::TerminalLT => vec!["<"], SyntaxKind::TerminalMinus => vec!["-"], SyntaxKind::TerminalMinusEq => vec!["-="], - SyntaxKind::TerminalMul => vec!["*"], - SyntaxKind::TerminalMulEq => vec!["*="], + SyntaxKind::TerminalStar => vec!["*"], + SyntaxKind::TerminalStarEq => vec!["*="], SyntaxKind::TerminalNeq => vec!["!="], - SyntaxKind::TerminalNot => vec!["!"], - SyntaxKind::TerminalBitNot => vec!["~"], + SyntaxKind::TerminalBang => vec!["!"], + SyntaxKind::TerminalTilde => vec!["~"], SyntaxKind::TerminalOr => vec!["|"], SyntaxKind::TerminalOrOr => vec!["||"], - SyntaxKind::TerminalXor => vec!["^"], + SyntaxKind::TerminalCaret => vec!["^"], SyntaxKind::TerminalPlus => vec!["+"], SyntaxKind::TerminalPlusEq => vec!["+="], SyntaxKind::TerminalSemicolon => vec![";"], @@ -101,7 +101,7 @@ fn terminal_kind_to_text(kind: SyntaxKind) -> Vec<&'static str> { SyntaxKind::TerminalLParen => vec!["("], SyntaxKind::TerminalRParen => vec![")"], SyntaxKind::TerminalArrow => vec!["->"], - SyntaxKind::TerminalMatchArrow => vec!["=>"], + SyntaxKind::TerminalFatArrow => vec!["=>"], SyntaxKind::TerminalEndOfFile => vec![], _ => { assert!(!kind.is_terminal()); @@ -141,24 +141,24 @@ fn terminal_kinds() -> Vec { SyntaxKind::TerminalAt, SyntaxKind::TerminalOr, SyntaxKind::TerminalOrOr, - SyntaxKind::TerminalXor, + SyntaxKind::TerminalCaret, SyntaxKind::TerminalEqEq, SyntaxKind::TerminalNeq, SyntaxKind::TerminalGE, SyntaxKind::TerminalGT, SyntaxKind::TerminalLE, SyntaxKind::TerminalLT, - SyntaxKind::TerminalNot, + SyntaxKind::TerminalBang, SyntaxKind::TerminalPlus, SyntaxKind::TerminalPlusEq, SyntaxKind::TerminalMinus, SyntaxKind::TerminalMinusEq, - SyntaxKind::TerminalMul, - SyntaxKind::TerminalMulEq, - SyntaxKind::TerminalDiv, - SyntaxKind::TerminalDivEq, - SyntaxKind::TerminalMod, - SyntaxKind::TerminalModEq, + SyntaxKind::TerminalStar, + SyntaxKind::TerminalStarEq, + SyntaxKind::TerminalSlash, + SyntaxKind::TerminalSlashEq, + SyntaxKind::TerminalPercent, + SyntaxKind::TerminalPercentEq, SyntaxKind::TerminalColon, SyntaxKind::TerminalColonColon, SyntaxKind::TerminalComma, @@ -175,7 +175,7 @@ fn terminal_kinds() -> Vec { SyntaxKind::TerminalLParen, SyntaxKind::TerminalRParen, SyntaxKind::TerminalArrow, - SyntaxKind::TerminalMatchArrow, + SyntaxKind::TerminalFatArrow, SyntaxKind::TerminalEndOfFile, SyntaxKind::TerminalShortString, SyntaxKind::TerminalString, diff --git a/crates/cairo-lang-parser/src/operators.rs b/crates/cairo-lang-parser/src/operators.rs index ef9a4a2ffe4..2176363aa5e 100644 --- a/crates/cairo-lang-parser/src/operators.rs +++ b/crates/cairo-lang-parser/src/operators.rs @@ -3,9 +3,9 @@ use cairo_lang_syntax::node::kind::SyntaxKind; pub fn get_unary_operator_precedence(kind: SyntaxKind) -> Option { match kind { SyntaxKind::TerminalAt - | SyntaxKind::TerminalNot - | SyntaxKind::TerminalBitNot - | SyntaxKind::TerminalMul + | SyntaxKind::TerminalBang + | SyntaxKind::TerminalTilde + | SyntaxKind::TerminalStar | SyntaxKind::TerminalMinus => Some(2), _ => None, } @@ -16,10 +16,10 @@ pub fn get_post_operator_precedence(kind: SyntaxKind) -> Option { SyntaxKind::TerminalQuestionMark // [] Operator. | SyntaxKind::TerminalLBrack => Some(1), - SyntaxKind::TerminalMul | SyntaxKind::TerminalDiv | SyntaxKind::TerminalMod => Some(2), + SyntaxKind::TerminalStar | SyntaxKind::TerminalSlash | SyntaxKind::TerminalPercent => Some(2), SyntaxKind::TerminalPlus | SyntaxKind::TerminalMinus => Some(3), SyntaxKind::TerminalAnd => Some(4), - SyntaxKind::TerminalXor => Some(5), + SyntaxKind::TerminalCaret => Some(5), SyntaxKind::TerminalOr => Some(6), SyntaxKind::TerminalEqEq | SyntaxKind::TerminalNeq @@ -32,9 +32,9 @@ pub fn get_post_operator_precedence(kind: SyntaxKind) -> Option { SyntaxKind::TerminalEq | SyntaxKind::TerminalPlusEq | SyntaxKind::TerminalMinusEq - | SyntaxKind::TerminalMulEq - | SyntaxKind::TerminalDivEq - | SyntaxKind::TerminalModEq => Some(10), + | SyntaxKind::TerminalStarEq + | SyntaxKind::TerminalSlashEq + | SyntaxKind::TerminalPercentEq => Some(10), _ => None, } } diff --git a/crates/cairo-lang-parser/src/parser.rs b/crates/cairo-lang-parser/src/parser.rs index c5ca37ef27f..5048af382bb 100644 --- a/crates/cairo-lang-parser/src/parser.rs +++ b/crates/cairo-lang-parser/src/parser.rs @@ -235,7 +235,7 @@ impl<'a> Parser<'a> { // TODO(Gil): Consider adding a lookahead capability to the lexer to avoid this. let ident = self.take_raw(); match self.peek().kind { - SyntaxKind::TerminalNot => { + SyntaxKind::TerminalBang => { // Complete the `take`ing of the identifier. let macro_name = self.add_trivia_to_terminal::(ident); Ok(self.expect_item_inline_macro(attributes, macro_name).into()) @@ -260,7 +260,7 @@ impl<'a> Parser<'a> { .parse_item_inline_macro_given_bang( attributes, macro_name, - TerminalNot::missing(self.db), + TerminalBang::missing(self.db), ) .into()) } @@ -940,13 +940,13 @@ impl<'a> Parser<'a> { } } - /// Assumes the current token is TerminalNot. + /// Assumes the current token is TerminalBang. fn expect_item_inline_macro( &mut self, attributes: AttributeListGreen, name: TerminalIdentifierGreen, ) -> ItemInlineMacroGreen { - let bang = self.parse_token::(); + let bang = self.parse_token::(); self.parse_item_inline_macro_given_bang(attributes, name, bang) } @@ -955,7 +955,7 @@ impl<'a> Parser<'a> { &mut self, attributes: AttributeListGreen, name: TerminalIdentifierGreen, - bang: TerminalNotGreen, + bang: TerminalBangGreen, ) -> ItemInlineMacroGreen { let arguments = self.parse_wrapped_arg_list(); let semicolon = self.parse_token::(); @@ -988,12 +988,12 @@ impl<'a> Parser<'a> { // `get_post_operator_precedence`. match self.peek().kind { SyntaxKind::TerminalDot => self.take::().into(), - SyntaxKind::TerminalMul => self.take::().into(), - SyntaxKind::TerminalMulEq => self.take::().into(), - SyntaxKind::TerminalDiv => self.take::().into(), - SyntaxKind::TerminalDivEq => self.take::().into(), - SyntaxKind::TerminalMod => self.take::().into(), - SyntaxKind::TerminalModEq => self.take::().into(), + SyntaxKind::TerminalStar => self.take::().into(), + SyntaxKind::TerminalStarEq => self.take::().into(), + SyntaxKind::TerminalSlash => self.take::().into(), + SyntaxKind::TerminalSlashEq => self.take::().into(), + SyntaxKind::TerminalPercent => self.take::().into(), + SyntaxKind::TerminalPercentEq => self.take::().into(), SyntaxKind::TerminalPlus => self.take::().into(), SyntaxKind::TerminalPlusEq => self.take::().into(), SyntaxKind::TerminalMinus => self.take::().into(), @@ -1009,7 +1009,7 @@ impl<'a> Parser<'a> { SyntaxKind::TerminalAndAnd => self.take::().into(), SyntaxKind::TerminalOrOr => self.take::().into(), SyntaxKind::TerminalOr => self.take::().into(), - SyntaxKind::TerminalXor => self.take::().into(), + SyntaxKind::TerminalCaret => self.take::().into(), _ => unreachable!(), } } @@ -1018,10 +1018,10 @@ impl<'a> Parser<'a> { fn expect_unary_operator(&mut self) -> UnaryOperatorGreen { match self.peek().kind { SyntaxKind::TerminalAt => self.take::().into(), - SyntaxKind::TerminalNot => self.take::().into(), - SyntaxKind::TerminalBitNot => self.take::().into(), + SyntaxKind::TerminalBang => self.take::().into(), + SyntaxKind::TerminalTilde => self.take::().into(), SyntaxKind::TerminalMinus => self.take::().into(), - SyntaxKind::TerminalMul => self.take::().into(), + SyntaxKind::TerminalStar => self.take::().into(), _ => unreachable!(), } } @@ -1110,7 +1110,7 @@ impl<'a> Parser<'a> { SyntaxKind::TerminalLBrace if lbrace_allowed == LbraceAllowed::Allow => { Ok(self.expect_constructor_call(path).into()) } - SyntaxKind::TerminalNot => Ok(self.expect_macro_call(path).into()), + SyntaxKind::TerminalBang => Ok(self.expect_macro_call(path).into()), _ => Ok(path.into()), } } @@ -1199,10 +1199,10 @@ impl<'a> Parser<'a> { ExprFunctionCall::new_green(self.db, func_name, parenthesized_args) } - /// Assumes the current token is TerminalNot. + /// Assumes the current token is TerminalBang. /// Expected pattern: `!` fn expect_macro_call(&mut self, path: ExprPathGreen) -> ExprInlineMacroGreen { - let bang = self.take::(); + let bang = self.take::(); let macro_name = path; let wrapped_expr_list = self.parse_wrapped_arg_list(); ExprInlineMacro::new_green(self.db, macro_name, bang, wrapped_expr_list) @@ -1569,7 +1569,7 @@ impl<'a> Parser<'a> { let pattern_list = self .parse_separated_list_inner::( Self::try_parse_pattern, - is_of_kind!(match_arrow, rparen, block, rbrace, top_level), + is_of_kind!(fat_arrow, rparen, block, rbrace, top_level), "pattern",Some(ParserDiagnosticKind::DisallowedTrailingSeparatorOr), ); if pattern_list.is_empty() { @@ -1578,7 +1578,7 @@ impl<'a> Parser<'a> { let pattern_list_green = PatternListOr::new_green(self.db, pattern_list); - let arrow = self.parse_token::(); + let arrow = self.parse_token::(); let expr = self.parse_expr(); Ok(MatchArm::new_green(self.db, pattern_list_green, arrow, expr)) } diff --git a/crates/cairo-lang-parser/src/parser_test_data/diagnostics/match b/crates/cairo-lang-parser/src/parser_test_data/diagnostics/match index 323932546b7..3e282c03df8 100644 --- a/crates/cairo-lang-parser/src/parser_test_data/diagnostics/match +++ b/crates/cairo-lang-parser/src/parser_test_data/diagnostics/match @@ -29,7 +29,7 @@ error: Skipped tokens. Expected: pattern. match MyStruct{a: 1} { ^ -error: Missing token TerminalMatchArrow. +error: Missing token TerminalFatArrow. --> dummy_file.cairo:2:24 match MyStruct{a: 1} { ^ diff --git a/crates/cairo-lang-parser/src/parser_test_data/full_trees/test1 b/crates/cairo-lang-parser/src/parser_test_data/full_trees/test1 index b5906a8197d..8bda8de3f80 100644 --- a/crates/cairo-lang-parser/src/parser_test_data/full_trees/test1 +++ b/crates/cairo-lang-parser/src/parser_test_data/full_trees/test1 @@ -126,11 +126,11 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ ├── rhs (kind: ExprUnary) │ │ │ │ │ ├── op (kind: TokenMinus): '-' │ │ │ │ │ └── expr (kind: ExprUnary) - │ │ │ │ │ ├── op (kind: TokenNot): '!' + │ │ │ │ │ ├── op (kind: TokenBang): '!' │ │ │ │ │ └── expr (kind: ExprUnary) │ │ │ │ │ ├── op (kind: TokenMinus): '-' │ │ │ │ │ └── expr (kind: ExprUnary) - │ │ │ │ │ ├── op (kind: TokenNot): '!' + │ │ │ │ │ ├── op (kind: TokenBang): '!' │ │ │ │ │ └── expr (kind: TokenLiteralNumber): '8' │ │ │ │ └── semicolon (kind: TokenSemicolon): ';' │ │ │ ├── child #2 (kind: StatementLet) @@ -161,7 +161,7 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ ├── item #0 (kind: MatchArm) │ │ │ │ │ │ │ ├── patterns (kind: PatternListOr) │ │ │ │ │ │ │ │ └── item #0 (kind: TokenLiteralNumber): '0' - │ │ │ │ │ │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ │ │ │ │ │ └── expression (kind: ExprBlock) │ │ │ │ │ │ │ ├── lbrace (kind: TokenLBrace): '{' │ │ │ │ │ │ │ ├── statements (kind: StatementList) @@ -174,7 +174,7 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ ├── item #1 (kind: MatchArm) │ │ │ │ │ │ │ ├── patterns (kind: PatternListOr) │ │ │ │ │ │ │ │ └── item #0 (kind: TokenUnderscore): '_' - │ │ │ │ │ │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ │ │ │ │ │ └── expression (kind: TokenLiteralNumber): '0' │ │ │ │ │ │ └── separator #1 (kind: TokenComma): ',' │ │ │ │ │ └── rbrace (kind: TokenRBrace): '}' @@ -258,7 +258,7 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ │ │ │ ├── lparen (kind: TokenLParen): '(' │ │ │ │ │ │ │ │ │ ├── pattern (kind: TokenUnderscore): '_' │ │ │ │ │ │ │ │ │ └── rparen (kind: TokenRParen): ')' - │ │ │ │ │ │ │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ │ │ │ │ │ │ └── expression (kind: TokenLiteralNumber): '4' │ │ │ │ │ │ │ ├── separator #0 (kind: TokenComma): ',' │ │ │ │ │ │ │ └── item #1 (kind: MatchArm) @@ -274,7 +274,7 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ │ │ ├── lparen (kind: TokenLParen): '(' │ │ │ │ │ │ │ │ ├── pattern (kind: TokenUnderscore): '_' │ │ │ │ │ │ │ │ └── rparen (kind: TokenRParen): ')' - │ │ │ │ │ │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ │ │ │ │ │ └── expression (kind: TokenLiteralNumber): '2' │ │ │ │ │ │ └── rbrace (kind: TokenRBrace): '}' │ │ │ │ │ ├── op (kind: TokenMinus): '-' @@ -713,7 +713,7 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ │ ├── lparen (kind: TokenLParen): '(' │ │ │ │ │ │ │ ├── pattern (kind: TokenUnderscore): '_' │ │ │ │ │ │ │ └── rparen (kind: TokenRParen): ')' - │ │ │ │ │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ │ │ │ │ └── expression (kind: TokenLiteralNumber): '1' │ │ │ │ │ ├── separator #0 (kind: TokenComma): ',' │ │ │ │ │ ├── item #1 (kind: MatchArm) @@ -731,7 +731,7 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ │ │ └── item #0 (kind: PathSegmentSimple) │ │ │ │ │ │ │ │ └── ident (kind: TokenIdentifier): 'x' │ │ │ │ │ │ │ └── rparen (kind: TokenRParen): ')' - │ │ │ │ │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ │ │ │ │ └── expression (kind: TokenLiteralNumber): '2' │ │ │ │ │ ├── separator #1 (kind: TokenComma): ',' │ │ │ │ │ ├── item #2 (kind: MatchArm) @@ -744,7 +744,7 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ │ │ └── item #1 (kind: PathSegmentSimple) │ │ │ │ │ │ │ │ └── ident (kind: TokenIdentifier): 'VEmpty' │ │ │ │ │ │ │ └── pattern (kind: OptionPatternEnumInnerPatternEmpty) [] - │ │ │ │ │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ │ │ │ │ └── expression (kind: TokenLiteralNumber): '0' │ │ │ │ │ └── separator #2 (kind: TokenComma): ',' │ │ │ │ └── rbrace (kind: TokenRBrace): '}' @@ -802,7 +802,7 @@ error: Missing tokens. Expected an item after attributes. │ ├── child #11 (kind: ItemInlineMacro) │ │ ├── attributes (kind: AttributeList) [] │ │ ├── name (kind: TokenIdentifier): 'inline_item_macro' - │ │ ├── bang (kind: TokenNot): '!' + │ │ ├── bang (kind: TokenBang): '!' │ │ ├── arguments (kind: ArgListParenthesized) │ │ │ ├── lparen (kind: TokenLParen): '(' │ │ │ ├── arguments (kind: ArgList) @@ -1103,9 +1103,9 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ ├── token (kind: TokenMinus): '-' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) [] │ │ │ │ │ └── expr (kind: ExprUnary) - │ │ │ │ │ ├── op (kind: TerminalNot) + │ │ │ │ │ ├── op (kind: TerminalBang) │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ ├── token (kind: TokenNot): '!' + │ │ │ │ │ │ ├── token (kind: TokenBang): '!' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) [] │ │ │ │ │ └── expr (kind: ExprUnary) │ │ │ │ │ ├── op (kind: TerminalMinus) @@ -1113,9 +1113,9 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ ├── token (kind: TokenMinus): '-' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) [] │ │ │ │ │ └── expr (kind: ExprUnary) - │ │ │ │ │ ├── op (kind: TerminalNot) + │ │ │ │ │ ├── op (kind: TerminalBang) │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ ├── token (kind: TokenNot): '!' + │ │ │ │ │ │ ├── token (kind: TokenBang): '!' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) [] │ │ │ │ │ └── expr (kind: TerminalLiteralNumber) │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] @@ -1206,9 +1206,9 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ │ │ ├── token (kind: TokenLiteralNumber): '0' │ │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). - │ │ │ │ │ │ │ ├── arrow (kind: TerminalMatchArrow) + │ │ │ │ │ │ │ ├── arrow (kind: TerminalFatArrow) │ │ │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ │ │ ├── token (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ │ │ ├── token (kind: TokenFatArrow): '=>' │ │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ │ │ └── expression (kind: ExprBlock) @@ -1243,9 +1243,9 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ │ │ ├── token (kind: TokenUnderscore): '_' │ │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). - │ │ │ │ │ │ │ ├── arrow (kind: TerminalMatchArrow) + │ │ │ │ │ │ │ ├── arrow (kind: TerminalFatArrow) │ │ │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ │ │ ├── token (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ │ │ ├── token (kind: TokenFatArrow): '=>' │ │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ │ │ └── expression (kind: TerminalLiteralNumber) @@ -1476,9 +1476,9 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ │ │ │ ├── token (kind: TokenRParen): ')' │ │ │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). - │ │ │ │ │ │ │ │ ├── arrow (kind: TerminalMatchArrow) + │ │ │ │ │ │ │ │ ├── arrow (kind: TerminalFatArrow) │ │ │ │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ │ │ │ ├── token (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ │ │ │ ├── token (kind: TokenFatArrow): '=>' │ │ │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ │ │ │ └── expression (kind: TerminalLiteralNumber) @@ -1522,9 +1522,9 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ │ │ ├── token (kind: TokenRParen): ')' │ │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). - │ │ │ │ │ │ │ ├── arrow (kind: TerminalMatchArrow) + │ │ │ │ │ │ │ ├── arrow (kind: TerminalFatArrow) │ │ │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ │ │ ├── token (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ │ │ ├── token (kind: TokenFatArrow): '=>' │ │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ │ │ └── expression (kind: TerminalLiteralNumber) @@ -2639,9 +2639,9 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ │ ├── token (kind: TokenRParen): ')' │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). - │ │ │ │ │ │ ├── arrow (kind: TerminalMatchArrow) + │ │ │ │ │ │ ├── arrow (kind: TerminalFatArrow) │ │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ │ ├── token (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ │ ├── token (kind: TokenFatArrow): '=>' │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ │ └── expression (kind: TerminalLiteralNumber) @@ -2688,9 +2688,9 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ │ ├── token (kind: TokenRParen): ')' │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). - │ │ │ │ │ │ ├── arrow (kind: TerminalMatchArrow) + │ │ │ │ │ │ ├── arrow (kind: TerminalFatArrow) │ │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ │ ├── token (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ │ ├── token (kind: TokenFatArrow): '=>' │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ │ └── expression (kind: TerminalLiteralNumber) @@ -2723,9 +2723,9 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ │ │ └── pattern (kind: OptionPatternEnumInnerPatternEmpty) [] - │ │ │ │ │ │ ├── arrow (kind: TerminalMatchArrow) + │ │ │ │ │ │ ├── arrow (kind: TerminalFatArrow) │ │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ │ ├── token (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ │ ├── token (kind: TokenFatArrow): '=>' │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ │ └── expression (kind: TerminalLiteralNumber) @@ -2889,9 +2889,9 @@ error: Missing tokens. Expected an item after attributes. │ │ │ │ └── child #0 (kind: TokenNewline). │ │ │ ├── token (kind: TokenIdentifier): 'inline_item_macro' │ │ │ └── trailing_trivia (kind: Trivia) [] - │ │ ├── bang (kind: TerminalNot) + │ │ ├── bang (kind: TerminalBang) │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ ├── token (kind: TokenNot): '!' + │ │ │ ├── token (kind: TokenBang): '!' │ │ │ └── trailing_trivia (kind: Trivia) [] │ │ ├── arguments (kind: ArgListParenthesized) │ │ │ ├── lparen (kind: TerminalLParen) diff --git a/crates/cairo-lang-parser/src/parser_test_data/full_trees/test2 b/crates/cairo-lang-parser/src/parser_test_data/full_trees/test2 index 2cb296dad6f..a21a6b1bcde 100644 --- a/crates/cairo-lang-parser/src/parser_test_data/full_trees/test2 +++ b/crates/cairo-lang-parser/src/parser_test_data/full_trees/test2 @@ -107,12 +107,12 @@ skipped tokens │ │ │ │ │ │ ├── lhs (kind: ExprPath) │ │ │ │ │ │ │ └── item #0 (kind: PathSegmentSimple) │ │ │ │ │ │ │ └── ident (kind: TokenIdentifier): 'x' - │ │ │ │ │ │ ├── op (kind: TokenMul): '*' + │ │ │ │ │ │ ├── op (kind: TokenStar): '*' │ │ │ │ │ │ └── rhs (kind: TokenLiteralNumber): '2' │ │ │ │ │ ├── op (kind: TokenPlus): '+' │ │ │ │ │ └── rhs (kind: ExprBinary) │ │ │ │ │ ├── lhs (kind: TokenLiteralNumber): '3' - │ │ │ │ │ ├── op (kind: TokenMul): '*' + │ │ │ │ │ ├── op (kind: TokenStar): '*' │ │ │ │ │ └── rhs (kind: TokenLiteralNumber): '5' │ │ │ │ └── semicolon (kind: TokenSemicolon): ';' │ │ │ ├── child #2 (kind: StatementLet) @@ -316,7 +316,7 @@ skipped tokens │ │ │ │ │ │ │ └── rhs (kind: ExprPath) │ │ │ │ │ │ │ └── item #0 (kind: PathSegmentSimple) │ │ │ │ │ │ │ └── ident (kind: TokenIdentifier): 'a' - │ │ │ │ │ │ ├── op (kind: TokenMul): '*' + │ │ │ │ │ │ ├── op (kind: TokenStar): '*' │ │ │ │ │ │ └── rhs: Missing [] │ │ │ │ │ ├── op (kind: TokenPlus): '+' │ │ │ │ │ └── rhs (kind: ExprBinary) @@ -333,7 +333,7 @@ skipped tokens │ │ │ │ │ │ └── rhs (kind: ExprPath) │ │ │ │ │ │ └── item #0 (kind: PathSegmentSimple) │ │ │ │ │ │ └── ident (kind: TokenIdentifier): 's' - │ │ │ │ │ ├── op (kind: TokenMul): '*' + │ │ │ │ │ ├── op (kind: TokenStar): '*' │ │ │ │ │ └── rhs (kind: ExprFunctionCall) │ │ │ │ │ ├── path (kind: ExprPath) │ │ │ │ │ │ └── item #0 (kind: PathSegmentSimple) @@ -586,9 +586,9 @@ skipped tokens │ │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] │ │ │ │ │ │ │ ├── token (kind: TokenIdentifier): 'x' │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) [] - │ │ │ │ │ │ ├── op (kind: TerminalMul) + │ │ │ │ │ │ ├── op (kind: TerminalStar) │ │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ │ ├── token (kind: TokenMul): '*' + │ │ │ │ │ │ │ ├── token (kind: TokenStar): '*' │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) [] │ │ │ │ │ │ └── rhs (kind: TerminalLiteralNumber) │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] @@ -605,9 +605,9 @@ skipped tokens │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] │ │ │ │ │ │ ├── token (kind: TokenLiteralNumber): '3' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) [] - │ │ │ │ │ ├── op (kind: TerminalMul) + │ │ │ │ │ ├── op (kind: TerminalStar) │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ ├── token (kind: TokenMul): '*' + │ │ │ │ │ │ ├── token (kind: TokenStar): '*' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) [] │ │ │ │ │ └── rhs (kind: TerminalLiteralNumber) │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] @@ -1126,9 +1126,9 @@ skipped tokens │ │ │ │ │ │ │ ├── token (kind: TokenIdentifier): 'a' │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). - │ │ │ │ │ │ ├── op (kind: TerminalMul) + │ │ │ │ │ │ ├── op (kind: TerminalStar) │ │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ │ ├── token (kind: TokenMul): '*' + │ │ │ │ │ │ │ ├── token (kind: TokenStar): '*' │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) [] │ │ │ │ │ │ └── rhs: Missing [] │ │ │ │ │ ├── op (kind: TerminalPlus) @@ -1166,9 +1166,9 @@ skipped tokens │ │ │ │ │ │ ├── token (kind: TokenIdentifier): 's' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). - │ │ │ │ │ ├── op (kind: TerminalMul) + │ │ │ │ │ ├── op (kind: TerminalStar) │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ ├── token (kind: TokenMul): '*' + │ │ │ │ │ │ ├── token (kind: TokenStar): '*' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ └── rhs (kind: ExprFunctionCall) diff --git a/crates/cairo-lang-parser/src/parser_test_data/full_trees/test3 b/crates/cairo-lang-parser/src/parser_test_data/full_trees/test3 index f65ff24d37f..28d5387ca03 100644 --- a/crates/cairo-lang-parser/src/parser_test_data/full_trees/test3 +++ b/crates/cairo-lang-parser/src/parser_test_data/full_trees/test3 @@ -153,7 +153,7 @@ false │ │ │ │ │ ├── path (kind: ExprPath) │ │ │ │ │ │ └── item #0 (kind: PathSegmentSimple) │ │ │ │ │ │ └── ident (kind: TokenIdentifier): 'some_macro' - │ │ │ │ │ ├── bang (kind: TokenNot): '!' + │ │ │ │ │ ├── bang (kind: TokenBang): '!' │ │ │ │ │ └── arguments (kind: ArgListParenthesized) │ │ │ │ │ ├── lparen (kind: TokenLParen): '(' │ │ │ │ │ ├── arguments (kind: ArgList) [] @@ -171,7 +171,7 @@ false │ │ │ │ │ ├── item #0 (kind: MatchArm) │ │ │ │ │ │ ├── patterns (kind: PatternListOr) │ │ │ │ │ │ │ └── item #0 (kind: TokenLiteralNumber): '0' - │ │ │ │ │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ │ │ │ │ └── expression (kind: ExprFunctionCall) │ │ │ │ │ │ ├── path (kind: ExprPath) │ │ │ │ │ │ │ ├── item #0 (kind: PathSegmentSimple) @@ -193,7 +193,7 @@ false │ │ │ │ │ ├── item #1 (kind: MatchArm) │ │ │ │ │ │ ├── patterns (kind: PatternListOr) │ │ │ │ │ │ │ └── item #0 (kind: TokenUnderscore): '_' - │ │ │ │ │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ │ │ │ │ └── expression (kind: ExprFunctionCall) │ │ │ │ │ │ ├── path (kind: ExprPath) │ │ │ │ │ │ │ └── item #0 (kind: PathSegmentSimple) @@ -339,7 +339,7 @@ false │ │ │ │ ├── item #0 (kind: MatchArm) │ │ │ │ │ ├── patterns (kind: PatternListOr) │ │ │ │ │ │ └── item #0 (kind: TokenLiteralNumber): '0' - │ │ │ │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ │ │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ │ │ │ └── expression (kind: ExprListParenthesized) │ │ │ │ │ ├── lparen (kind: TokenLParen): '(' │ │ │ │ │ ├── expressions (kind: ExprList) @@ -383,7 +383,7 @@ false │ │ │ │ ├── item #1 (kind: MatchArm) │ │ │ │ │ ├── patterns (kind: PatternListOr) │ │ │ │ │ │ └── item #0 (kind: TokenUnderscore): '_' - │ │ │ │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ │ │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ │ │ │ └── expression (kind: ExprFunctionCall) │ │ │ │ │ ├── path (kind: ExprPath) │ │ │ │ │ │ └── item #0 (kind: PathSegmentSimple) @@ -753,9 +753,9 @@ false │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ │ ├── token (kind: TokenIdentifier): 'some_macro' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) [] - │ │ │ │ │ ├── bang (kind: TerminalNot) + │ │ │ │ │ ├── bang (kind: TerminalBang) │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ ├── token (kind: TokenNot): '!' + │ │ │ │ │ │ ├── token (kind: TokenBang): '!' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) [] │ │ │ │ │ └── arguments (kind: ArgListParenthesized) │ │ │ │ │ ├── lparen (kind: TerminalLParen) @@ -802,9 +802,9 @@ false │ │ │ │ │ │ │ ├── token (kind: TokenLiteralNumber): '0' │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). - │ │ │ │ │ │ ├── arrow (kind: TerminalMatchArrow) + │ │ │ │ │ │ ├── arrow (kind: TerminalFatArrow) │ │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ │ ├── token (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ │ ├── token (kind: TokenFatArrow): '=>' │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ │ └── expression (kind: ExprFunctionCall) @@ -855,9 +855,9 @@ false │ │ │ │ │ │ │ ├── token (kind: TokenUnderscore): '_' │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). - │ │ │ │ │ │ ├── arrow (kind: TerminalMatchArrow) + │ │ │ │ │ │ ├── arrow (kind: TerminalFatArrow) │ │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ │ ├── token (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ │ ├── token (kind: TokenFatArrow): '=>' │ │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ │ └── expression (kind: ExprFunctionCall) @@ -1201,9 +1201,9 @@ false │ │ │ │ │ │ ├── token (kind: TokenLiteralNumber): '0' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). - │ │ │ │ │ ├── arrow (kind: TerminalMatchArrow) + │ │ │ │ │ ├── arrow (kind: TerminalFatArrow) │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ ├── token (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ ├── token (kind: TokenFatArrow): '=>' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ └── expression (kind: ExprListParenthesized) @@ -1304,9 +1304,9 @@ false │ │ │ │ │ │ ├── token (kind: TokenUnderscore): '_' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). - │ │ │ │ │ ├── arrow (kind: TerminalMatchArrow) + │ │ │ │ │ ├── arrow (kind: TerminalFatArrow) │ │ │ │ │ │ ├── leading_trivia (kind: Trivia) [] - │ │ │ │ │ │ ├── token (kind: TokenMatchArrow): '=>' + │ │ │ │ │ │ ├── token (kind: TokenFatArrow): '=>' │ │ │ │ │ │ └── trailing_trivia (kind: Trivia) │ │ │ │ │ │ └── child #0 (kind: TokenWhitespace). │ │ │ │ │ └── expression (kind: ExprFunctionCall) diff --git a/crates/cairo-lang-parser/src/parser_test_data/partial_trees/expr b/crates/cairo-lang-parser/src/parser_test_data/partial_trees/expr index 28d8970f9d4..9f5f430cad0 100644 --- a/crates/cairo-lang-parser/src/parser_test_data/partial_trees/expr +++ b/crates/cairo-lang-parser/src/parser_test_data/partial_trees/expr @@ -22,7 +22,7 @@ StatementExpr │ ├── lhs (kind: ExprUnary) │ │ ├── op (kind: TokenMinus): '-' │ │ └── expr (kind: TokenLiteralNumber): '3' - │ ├── op (kind: TokenMul): '*' + │ ├── op (kind: TokenStar): '*' │ └── rhs (kind: TokenLiteralNumber): '5' └── semicolon (kind: OptionTerminalSemicolonEmpty) [] @@ -54,6 +54,6 @@ StatementExpr │ │ └── expr (kind: ExprPath) │ │ └── item #0 (kind: PathSegmentSimple) │ │ └── ident (kind: TokenIdentifier): 'a' - │ ├── op (kind: TokenMul): '*' + │ ├── op (kind: TokenStar): '*' │ └── rhs (kind: TokenLiteralNumber): '5' └── semicolon (kind: OptionTerminalSemicolonEmpty) [] diff --git a/crates/cairo-lang-parser/src/parser_test_data/partial_trees/inline_macro b/crates/cairo-lang-parser/src/parser_test_data/partial_trees/inline_macro index 0ab9262ee9e..fd835175b55 100644 --- a/crates/cairo-lang-parser/src/parser_test_data/partial_trees/inline_macro +++ b/crates/cairo-lang-parser/src/parser_test_data/partial_trees/inline_macro @@ -20,7 +20,7 @@ ExprInlineMacro ├── path (kind: ExprPath) │ └── item #0 (kind: PathSegmentSimple) │ └── ident (kind: TokenIdentifier): 'println' - ├── bang (kind: TokenNot): '!' + ├── bang (kind: TokenBang): '!' └── arguments (kind: ArgListParenthesized) ├── lparen (kind: TokenLParen): '(' ├── arguments (kind: ArgList) diff --git a/crates/cairo-lang-parser/src/parser_test_data/partial_trees/item_inline_macro b/crates/cairo-lang-parser/src/parser_test_data/partial_trees/item_inline_macro index b0672a7cd6f..d1ee66b6ed4 100644 --- a/crates/cairo-lang-parser/src/parser_test_data/partial_trees/item_inline_macro +++ b/crates/cairo-lang-parser/src/parser_test_data/partial_trees/item_inline_macro @@ -17,7 +17,7 @@ ItemInlineMacro └── Top level kind: ItemInlineMacro ├── attributes (kind: AttributeList) [] ├── name (kind: TokenIdentifier): 'inline_macro' - ├── bang (kind: TokenNot): '!' + ├── bang (kind: TokenBang): '!' ├── arguments (kind: ArgListParenthesized) │ ├── lparen (kind: TokenLParen): '(' │ ├── arguments (kind: ArgList) @@ -54,7 +54,7 @@ ItemInlineMacro └── Top level kind: ItemInlineMacro ├── attributes (kind: AttributeList) [] ├── name (kind: TokenIdentifier): 'inline_macro' - ├── bang (kind: TokenNot): '!' + ├── bang (kind: TokenBang): '!' ├── arguments (kind: ArgListBracketed) │ ├── lbrack (kind: TokenLBrack): '[' │ ├── arguments (kind: ArgList) @@ -91,7 +91,7 @@ ItemInlineMacro └── Top level kind: ItemInlineMacro ├── attributes (kind: AttributeList) [] ├── name (kind: TokenIdentifier): 'inline_macro' - ├── bang (kind: TokenNot): '!' + ├── bang (kind: TokenBang): '!' ├── arguments (kind: ArgListBraced) │ ├── lbrace (kind: TokenLBrace): '{' │ ├── arguments (kind: ArgList) @@ -137,7 +137,7 @@ ItemInlineMacro │ ├── arguments (kind: OptionArgListParenthesizedEmpty) [] │ └── rbrack (kind: TokenRBrack): ']' ├── name (kind: TokenIdentifier): 'inline_macro' - ├── bang (kind: TokenNot): '!' + ├── bang (kind: TokenBang): '!' ├── arguments (kind: ArgListParenthesized) │ ├── lparen (kind: TokenLParen): '(' │ ├── arguments (kind: ArgList) @@ -356,7 +356,7 @@ macro! ├── child #0 (kind: ItemInlineMacro) │ ├── attributes (kind: AttributeList) [] │ ├── name (kind: TokenIdentifier): 'macro' - │ ├── bang (kind: TokenNot): '!' + │ ├── bang (kind: TokenBang): '!' │ ├── arguments: Missing [] │ └── semicolon: Missing └── child #1 (kind: FunctionWithBody) @@ -394,7 +394,7 @@ identifier!(1,2 ├── child #0 (kind: ItemInlineMacro) │ ├── attributes (kind: AttributeList) [] │ ├── name (kind: TokenIdentifier): 'identifier' - │ ├── bang (kind: TokenNot): '!' + │ ├── bang (kind: TokenBang): '!' │ ├── arguments (kind: ArgListParenthesized) │ │ ├── lparen (kind: TokenLParen): '(' │ │ ├── arguments (kind: ArgList) @@ -439,7 +439,7 @@ identifier!(1,2) ├── child #0 (kind: ItemInlineMacro) │ ├── attributes (kind: AttributeList) [] │ ├── name (kind: TokenIdentifier): 'identifier' - │ ├── bang (kind: TokenNot): '!' + │ ├── bang (kind: TokenBang): '!' │ ├── arguments (kind: ArgListParenthesized) │ │ ├── lparen (kind: TokenLParen): '(' │ │ ├── arguments (kind: ArgList) diff --git a/crates/cairo-lang-parser/src/parser_test_data/partial_trees/match b/crates/cairo-lang-parser/src/parser_test_data/partial_trees/match index 2febd9f9199..1da7c78bb2e 100644 --- a/crates/cairo-lang-parser/src/parser_test_data/partial_trees/match +++ b/crates/cairo-lang-parser/src/parser_test_data/partial_trees/match @@ -30,13 +30,13 @@ ExprMatch │ ├── item #0 (kind: MatchArm) │ │ ├── patterns (kind: PatternListOr) │ │ │ └── item #0 (kind: TokenLiteralNumber): '0' - │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ └── expression (kind: TokenLiteralNumber): '1' │ ├── separator #0 (kind: TokenComma): ',' │ ├── item #1 (kind: MatchArm) │ │ ├── patterns (kind: PatternListOr) │ │ │ └── item #0 (kind: TokenUnderscore): '_' - │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ └── expression (kind: TokenLiteralNumber): '2' │ └── separator #1 (kind: TokenComma): ',' └── rbrace (kind: TokenRBrace): '}' @@ -77,13 +77,13 @@ ExprMatch │ │ │ ├── item #0 (kind: TokenLiteralNumber): '0' │ │ │ ├── separator #0 (kind: TokenOr): '|' │ │ │ └── item #1 (kind: TokenLiteralNumber): '1' - │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ └── expression (kind: TokenLiteralNumber): '1' │ ├── separator #0 (kind: TokenComma): ',' │ ├── item #1 (kind: MatchArm) │ │ ├── patterns (kind: PatternListOr) │ │ │ └── item #0 (kind: TokenUnderscore): '_' - │ │ ├── arrow (kind: TokenMatchArrow): '=>' + │ │ ├── arrow (kind: TokenFatArrow): '=>' │ │ └── expression (kind: TokenLiteralNumber): '2' │ └── separator #1 (kind: TokenComma): ',' └── rbrace (kind: TokenRBrace): '}' diff --git a/crates/cairo-lang-parser/src/parser_test_data/partial_trees/op_eq b/crates/cairo-lang-parser/src/parser_test_data/partial_trees/op_eq index cf0826e9365..fae2af3d5f1 100644 --- a/crates/cairo-lang-parser/src/parser_test_data/partial_trees/op_eq +++ b/crates/cairo-lang-parser/src/parser_test_data/partial_trees/op_eq @@ -49,7 +49,7 @@ StatementLet │ │ ├── lhs (kind: ExprPath) │ │ │ └── item #0 (kind: PathSegmentSimple) │ │ │ └── ident (kind: TokenIdentifier): 'x' - │ │ ├── op (kind: TokenMulEq): '*=' + │ │ ├── op (kind: TokenStarEq): '*=' │ │ └── rhs (kind: TokenLiteralNumber): '5' │ └── semicolon (kind: TokenSemicolon): ';' ├── child #4 (kind: StatementExpr) @@ -58,7 +58,7 @@ StatementLet │ │ ├── lhs (kind: ExprPath) │ │ │ └── item #0 (kind: PathSegmentSimple) │ │ │ └── ident (kind: TokenIdentifier): 'x' - │ │ ├── op (kind: TokenDivEq): '/=' + │ │ ├── op (kind: TokenSlashEq): '/=' │ │ └── rhs (kind: TokenLiteralNumber): '5' │ └── semicolon (kind: TokenSemicolon): ';' ├── child #5 (kind: StatementExpr) @@ -67,7 +67,7 @@ StatementLet │ │ ├── lhs (kind: ExprPath) │ │ │ └── item #0 (kind: PathSegmentSimple) │ │ │ └── ident (kind: TokenIdentifier): 'x' - │ │ ├── op (kind: TokenModEq): '%=' + │ │ ├── op (kind: TokenPercentEq): '%=' │ │ └── rhs (kind: TokenLiteralNumber): '5' │ └── semicolon (kind: TokenSemicolon): ';' └── child #6 (kind: StatementExpr) diff --git a/crates/cairo-lang-parser/src/parser_test_data/partial_trees/unary_only_operators b/crates/cairo-lang-parser/src/parser_test_data/partial_trees/unary_only_operators index 48073dcde99..3eb1b455ee5 100644 --- a/crates/cairo-lang-parser/src/parser_test_data/partial_trees/unary_only_operators +++ b/crates/cairo-lang-parser/src/parser_test_data/partial_trees/unary_only_operators @@ -30,7 +30,7 @@ StatementList ├── child #1 (kind: StatementExpr) │ ├── attributes (kind: AttributeList) [] │ ├── expr (kind: ExprUnary) - │ │ ├── op (kind: TokenNot): '!' + │ │ ├── op (kind: TokenBang): '!' │ │ └── expr (kind: TokenLiteralNumber): '2' │ └── semicolon (kind: TokenSemicolon): ';' ├── child #2 (kind: StatementExpr) diff --git a/crates/cairo-lang-parser/src/recovery.rs b/crates/cairo-lang-parser/src/recovery.rs index 014fbf72d2b..43a3e18e756 100644 --- a/crates/cairo-lang-parser/src/recovery.rs +++ b/crates/cairo-lang-parser/src/recovery.rs @@ -13,12 +13,12 @@ macro_rules! is_of_kind { } pub(crate) use is_of_kind; -macro_rules! match_arrow { +macro_rules! fat_arrow { () => { - SyntaxKind::TerminalMatchArrow + SyntaxKind::TerminalFatArrow }; } -pub(crate) use match_arrow; +pub(crate) use fat_arrow; macro_rules! lbrace { () => { diff --git a/crates/cairo-lang-syntax-codegen/src/cairo_spec.rs b/crates/cairo-lang-syntax-codegen/src/cairo_spec.rs index 050a00ee5af..f944b29cfc6 100644 --- a/crates/cairo-lang-syntax-codegen/src/cairo_spec.rs +++ b/crates/cairo-lang-syntax-codegen/src/cairo_spec.rs @@ -79,11 +79,11 @@ pub fn get_spec() -> Vec { ) .add_struct(StructBuilder::new("ExprUnary").node("op", "UnaryOperator").node("expr", "Expr")) .add_enum(EnumBuilder::new("UnaryOperator") - .node_with_explicit_kind("Not", "TerminalNot") - .node_with_explicit_kind("BitNot", "TerminalBitNot") + .node_with_explicit_kind("Not", "TerminalBang") + .node_with_explicit_kind("BitNot", "TerminalTilde") .node_with_explicit_kind("Minus", "TerminalMinus") .node_with_explicit_kind("At", "TerminalAt") - .node_with_explicit_kind("Desnap", "TerminalMul") + .node_with_explicit_kind("Desnap", "TerminalStar") ) .add_struct(StructBuilder::new("ExprBinary") .node("lhs", "Expr") @@ -92,13 +92,13 @@ pub fn get_spec() -> Vec { ) .add_enum(EnumBuilder::new("BinaryOperator") .node_with_explicit_kind("Dot", "TerminalDot") - .node_with_explicit_kind("Not", "TerminalNot") - .node_with_explicit_kind("Mul", "TerminalMul") - .node_with_explicit_kind("MulEq", "TerminalMulEq") - .node_with_explicit_kind("Div", "TerminalDiv") - .node_with_explicit_kind("DivEq", "TerminalDivEq") - .node_with_explicit_kind("Mod", "TerminalMod") - .node_with_explicit_kind("ModEq", "TerminalModEq") + .node_with_explicit_kind("Not", "TerminalBang") + .node_with_explicit_kind("Mul", "TerminalStar") + .node_with_explicit_kind("MulEq", "TerminalStarEq") + .node_with_explicit_kind("Div", "TerminalSlash") + .node_with_explicit_kind("DivEq", "TerminalSlashEq") + .node_with_explicit_kind("Mod", "TerminalPercent") + .node_with_explicit_kind("ModEq", "TerminalPercentEq") .node_with_explicit_kind("Plus", "TerminalPlus") .node_with_explicit_kind("PlusEq", "TerminalPlusEq") .node_with_explicit_kind("Minus", "TerminalMinus") @@ -110,7 +110,7 @@ pub fn get_spec() -> Vec { .node_with_explicit_kind("AndAnd", "TerminalAndAnd") .node_with_explicit_kind("Or", "TerminalOr") .node_with_explicit_kind("OrOr", "TerminalOrOr") - .node_with_explicit_kind("Xor", "TerminalXor") + .node_with_explicit_kind("Xor", "TerminalCaret") .node_with_explicit_kind("LE", "TerminalLE") .node_with_explicit_kind("GE", "TerminalGE") .node_with_explicit_kind("LT", "TerminalLT") @@ -156,7 +156,7 @@ pub fn get_spec() -> Vec { .add_separated_list("MatchArms", "MatchArm", "TerminalComma") .add_struct(StructBuilder::new("MatchArm") .node("patterns", "PatternListOr") - .node("arrow", "TerminalMatchArrow") + .node("arrow", "TerminalFatArrow") .node("expression", "Expr") ) .add_struct(StructBuilder::new("ExprIf") @@ -187,7 +187,7 @@ pub fn get_spec() -> Vec { ) .add_struct(StructBuilder::new("ExprInlineMacro") .node("path", "ExprPath") - .node("bang", "TerminalNot") + .node("bang", "TerminalBang") .node("arguments", "WrappedArgList") ) // --- Struct ctor --- @@ -526,7 +526,7 @@ pub fn get_spec() -> Vec { ).add_struct(StructBuilder::new("ItemInlineMacro") .node("attributes" ,"AttributeList") .node("name", "TerminalIdentifier") - .node("bang", "TerminalNot") + .node("bang", "TerminalBang") .node("arguments", "WrappedArgList") .node("semicolon", "TerminalSemicolon") ) @@ -747,8 +747,8 @@ pub fn get_spec() -> Vec { .add_token_and_terminal("Colon") .add_token_and_terminal("ColonColon") .add_token_and_terminal("Comma") - .add_token_and_terminal("Div") - .add_token_and_terminal("DivEq") + .add_token_and_terminal("Slash") + .add_token_and_terminal("SlashEq") .add_token_and_terminal("Dot") .add_token_and_terminal("DotDot") .add_token_and_terminal("EndOfFile") @@ -762,16 +762,16 @@ pub fn get_spec() -> Vec { .add_token_and_terminal("LE") .add_token_and_terminal("LParen") .add_token_and_terminal("LT") - .add_token_and_terminal("MatchArrow") + .add_token_and_terminal("FatArrow") .add_token_and_terminal("Minus") .add_token_and_terminal("MinusEq") - .add_token_and_terminal("Mod") - .add_token_and_terminal("ModEq") - .add_token_and_terminal("Mul") - .add_token_and_terminal("MulEq") + .add_token_and_terminal("Percent") + .add_token_and_terminal("PercentEq") + .add_token_and_terminal("Star") + .add_token_and_terminal("StarEq") .add_token_and_terminal("Neq") - .add_token_and_terminal("Not") - .add_token_and_terminal("BitNot") + .add_token_and_terminal("Bang") + .add_token_and_terminal("Tilde") .add_token_and_terminal("Or") .add_token_and_terminal("OrOr") .add_token_and_terminal("Plus") @@ -782,7 +782,7 @@ pub fn get_spec() -> Vec { .add_token_and_terminal("RParen") .add_token_and_terminal("Semicolon") .add_token_and_terminal("Underscore") - .add_token_and_terminal("Xor") + .add_token_and_terminal("Caret") // --- Meta --- .add_struct(StructBuilder::new("SyntaxFile") .node("items", "ItemList") diff --git a/crates/cairo-lang-syntax/src/node/ast.rs b/crates/cairo-lang-syntax/src/node/ast.rs index 5c01fa8df5c..3d5a24410c9 100644 --- a/crates/cairo-lang-syntax/src/node/ast.rs +++ b/crates/cairo-lang-syntax/src/node/ast.rs @@ -1811,11 +1811,11 @@ impl TypedSyntaxNode for ExprUnary { } #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub enum UnaryOperator { - Not(TerminalNot), - BitNot(TerminalBitNot), + Not(TerminalBang), + BitNot(TerminalTilde), Minus(TerminalMinus), At(TerminalAt), - Desnap(TerminalMul), + Desnap(TerminalStar), } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] pub struct UnaryOperatorPtr(pub SyntaxStablePtrId); @@ -1827,13 +1827,13 @@ impl UnaryOperatorPtr { UnaryOperator::from_syntax_node(db, self.0.lookup(db)) } } -impl From for UnaryOperatorPtr { - fn from(value: TerminalNotPtr) -> Self { +impl From for UnaryOperatorPtr { + fn from(value: TerminalBangPtr) -> Self { Self(value.0) } } -impl From for UnaryOperatorPtr { - fn from(value: TerminalBitNotPtr) -> Self { +impl From for UnaryOperatorPtr { + fn from(value: TerminalTildePtr) -> Self { Self(value.0) } } @@ -1847,18 +1847,18 @@ impl From for UnaryOperatorPtr { Self(value.0) } } -impl From for UnaryOperatorPtr { - fn from(value: TerminalMulPtr) -> Self { +impl From for UnaryOperatorPtr { + fn from(value: TerminalStarPtr) -> Self { Self(value.0) } } -impl From for UnaryOperatorGreen { - fn from(value: TerminalNotGreen) -> Self { +impl From for UnaryOperatorGreen { + fn from(value: TerminalBangGreen) -> Self { Self(value.0) } } -impl From for UnaryOperatorGreen { - fn from(value: TerminalBitNotGreen) -> Self { +impl From for UnaryOperatorGreen { + fn from(value: TerminalTildeGreen) -> Self { Self(value.0) } } @@ -1872,8 +1872,8 @@ impl From for UnaryOperatorGreen { Self(value.0) } } -impl From for UnaryOperatorGreen { - fn from(value: TerminalMulGreen) -> Self { +impl From for UnaryOperatorGreen { + fn from(value: TerminalStarGreen) -> Self { Self(value.0) } } @@ -1889,16 +1889,18 @@ impl TypedSyntaxNode for UnaryOperator { fn from_syntax_node(db: &dyn SyntaxGroup, node: SyntaxNode) -> Self { let kind = node.kind(db); match kind { - SyntaxKind::TerminalNot => UnaryOperator::Not(TerminalNot::from_syntax_node(db, node)), - SyntaxKind::TerminalBitNot => { - UnaryOperator::BitNot(TerminalBitNot::from_syntax_node(db, node)) + SyntaxKind::TerminalBang => { + UnaryOperator::Not(TerminalBang::from_syntax_node(db, node)) + } + SyntaxKind::TerminalTilde => { + UnaryOperator::BitNot(TerminalTilde::from_syntax_node(db, node)) } SyntaxKind::TerminalMinus => { UnaryOperator::Minus(TerminalMinus::from_syntax_node(db, node)) } SyntaxKind::TerminalAt => UnaryOperator::At(TerminalAt::from_syntax_node(db, node)), - SyntaxKind::TerminalMul => { - UnaryOperator::Desnap(TerminalMul::from_syntax_node(db, node)) + SyntaxKind::TerminalStar => { + UnaryOperator::Desnap(TerminalStar::from_syntax_node(db, node)) } _ => panic!("Unexpected syntax kind {:?} when constructing {}.", kind, "UnaryOperator"), } @@ -1920,11 +1922,11 @@ impl UnaryOperator { #[allow(clippy::match_like_matches_macro)] pub fn is_variant(kind: SyntaxKind) -> bool { match kind { - SyntaxKind::TerminalNot => true, - SyntaxKind::TerminalBitNot => true, + SyntaxKind::TerminalBang => true, + SyntaxKind::TerminalTilde => true, SyntaxKind::TerminalMinus => true, SyntaxKind::TerminalAt => true, - SyntaxKind::TerminalMul => true, + SyntaxKind::TerminalStar => true, _ => false, } } @@ -2014,13 +2016,13 @@ impl TypedSyntaxNode for ExprBinary { #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub enum BinaryOperator { Dot(TerminalDot), - Not(TerminalNot), - Mul(TerminalMul), - MulEq(TerminalMulEq), - Div(TerminalDiv), - DivEq(TerminalDivEq), - Mod(TerminalMod), - ModEq(TerminalModEq), + Not(TerminalBang), + Mul(TerminalStar), + MulEq(TerminalStarEq), + Div(TerminalSlash), + DivEq(TerminalSlashEq), + Mod(TerminalPercent), + ModEq(TerminalPercentEq), Plus(TerminalPlus), PlusEq(TerminalPlusEq), Minus(TerminalMinus), @@ -2032,7 +2034,7 @@ pub enum BinaryOperator { AndAnd(TerminalAndAnd), Or(TerminalOr), OrOr(TerminalOrOr), - Xor(TerminalXor), + Xor(TerminalCaret), LE(TerminalLE), GE(TerminalGE), LT(TerminalLT), @@ -2053,38 +2055,38 @@ impl From for BinaryOperatorPtr { Self(value.0) } } -impl From for BinaryOperatorPtr { - fn from(value: TerminalNotPtr) -> Self { +impl From for BinaryOperatorPtr { + fn from(value: TerminalBangPtr) -> Self { Self(value.0) } } -impl From for BinaryOperatorPtr { - fn from(value: TerminalMulPtr) -> Self { +impl From for BinaryOperatorPtr { + fn from(value: TerminalStarPtr) -> Self { Self(value.0) } } -impl From for BinaryOperatorPtr { - fn from(value: TerminalMulEqPtr) -> Self { +impl From for BinaryOperatorPtr { + fn from(value: TerminalStarEqPtr) -> Self { Self(value.0) } } -impl From for BinaryOperatorPtr { - fn from(value: TerminalDivPtr) -> Self { +impl From for BinaryOperatorPtr { + fn from(value: TerminalSlashPtr) -> Self { Self(value.0) } } -impl From for BinaryOperatorPtr { - fn from(value: TerminalDivEqPtr) -> Self { +impl From for BinaryOperatorPtr { + fn from(value: TerminalSlashEqPtr) -> Self { Self(value.0) } } -impl From for BinaryOperatorPtr { - fn from(value: TerminalModPtr) -> Self { +impl From for BinaryOperatorPtr { + fn from(value: TerminalPercentPtr) -> Self { Self(value.0) } } -impl From for BinaryOperatorPtr { - fn from(value: TerminalModEqPtr) -> Self { +impl From for BinaryOperatorPtr { + fn from(value: TerminalPercentEqPtr) -> Self { Self(value.0) } } @@ -2143,8 +2145,8 @@ impl From for BinaryOperatorPtr { Self(value.0) } } -impl From for BinaryOperatorPtr { - fn from(value: TerminalXorPtr) -> Self { +impl From for BinaryOperatorPtr { + fn from(value: TerminalCaretPtr) -> Self { Self(value.0) } } @@ -2173,38 +2175,38 @@ impl From for BinaryOperatorGreen { Self(value.0) } } -impl From for BinaryOperatorGreen { - fn from(value: TerminalNotGreen) -> Self { +impl From for BinaryOperatorGreen { + fn from(value: TerminalBangGreen) -> Self { Self(value.0) } } -impl From for BinaryOperatorGreen { - fn from(value: TerminalMulGreen) -> Self { +impl From for BinaryOperatorGreen { + fn from(value: TerminalStarGreen) -> Self { Self(value.0) } } -impl From for BinaryOperatorGreen { - fn from(value: TerminalMulEqGreen) -> Self { +impl From for BinaryOperatorGreen { + fn from(value: TerminalStarEqGreen) -> Self { Self(value.0) } } -impl From for BinaryOperatorGreen { - fn from(value: TerminalDivGreen) -> Self { +impl From for BinaryOperatorGreen { + fn from(value: TerminalSlashGreen) -> Self { Self(value.0) } } -impl From for BinaryOperatorGreen { - fn from(value: TerminalDivEqGreen) -> Self { +impl From for BinaryOperatorGreen { + fn from(value: TerminalSlashEqGreen) -> Self { Self(value.0) } } -impl From for BinaryOperatorGreen { - fn from(value: TerminalModGreen) -> Self { +impl From for BinaryOperatorGreen { + fn from(value: TerminalPercentGreen) -> Self { Self(value.0) } } -impl From for BinaryOperatorGreen { - fn from(value: TerminalModEqGreen) -> Self { +impl From for BinaryOperatorGreen { + fn from(value: TerminalPercentEqGreen) -> Self { Self(value.0) } } @@ -2263,8 +2265,8 @@ impl From for BinaryOperatorGreen { Self(value.0) } } -impl From for BinaryOperatorGreen { - fn from(value: TerminalXorGreen) -> Self { +impl From for BinaryOperatorGreen { + fn from(value: TerminalCaretGreen) -> Self { Self(value.0) } } @@ -2301,18 +2303,26 @@ impl TypedSyntaxNode for BinaryOperator { let kind = node.kind(db); match kind { SyntaxKind::TerminalDot => BinaryOperator::Dot(TerminalDot::from_syntax_node(db, node)), - SyntaxKind::TerminalNot => BinaryOperator::Not(TerminalNot::from_syntax_node(db, node)), - SyntaxKind::TerminalMul => BinaryOperator::Mul(TerminalMul::from_syntax_node(db, node)), - SyntaxKind::TerminalMulEq => { - BinaryOperator::MulEq(TerminalMulEq::from_syntax_node(db, node)) + SyntaxKind::TerminalBang => { + BinaryOperator::Not(TerminalBang::from_syntax_node(db, node)) + } + SyntaxKind::TerminalStar => { + BinaryOperator::Mul(TerminalStar::from_syntax_node(db, node)) + } + SyntaxKind::TerminalStarEq => { + BinaryOperator::MulEq(TerminalStarEq::from_syntax_node(db, node)) } - SyntaxKind::TerminalDiv => BinaryOperator::Div(TerminalDiv::from_syntax_node(db, node)), - SyntaxKind::TerminalDivEq => { - BinaryOperator::DivEq(TerminalDivEq::from_syntax_node(db, node)) + SyntaxKind::TerminalSlash => { + BinaryOperator::Div(TerminalSlash::from_syntax_node(db, node)) } - SyntaxKind::TerminalMod => BinaryOperator::Mod(TerminalMod::from_syntax_node(db, node)), - SyntaxKind::TerminalModEq => { - BinaryOperator::ModEq(TerminalModEq::from_syntax_node(db, node)) + SyntaxKind::TerminalSlashEq => { + BinaryOperator::DivEq(TerminalSlashEq::from_syntax_node(db, node)) + } + SyntaxKind::TerminalPercent => { + BinaryOperator::Mod(TerminalPercent::from_syntax_node(db, node)) + } + SyntaxKind::TerminalPercentEq => { + BinaryOperator::ModEq(TerminalPercentEq::from_syntax_node(db, node)) } SyntaxKind::TerminalPlus => { BinaryOperator::Plus(TerminalPlus::from_syntax_node(db, node)) @@ -2339,7 +2349,9 @@ impl TypedSyntaxNode for BinaryOperator { SyntaxKind::TerminalOrOr => { BinaryOperator::OrOr(TerminalOrOr::from_syntax_node(db, node)) } - SyntaxKind::TerminalXor => BinaryOperator::Xor(TerminalXor::from_syntax_node(db, node)), + SyntaxKind::TerminalCaret => { + BinaryOperator::Xor(TerminalCaret::from_syntax_node(db, node)) + } SyntaxKind::TerminalLE => BinaryOperator::LE(TerminalLE::from_syntax_node(db, node)), SyntaxKind::TerminalGE => BinaryOperator::GE(TerminalGE::from_syntax_node(db, node)), SyntaxKind::TerminalLT => BinaryOperator::LT(TerminalLT::from_syntax_node(db, node)), @@ -2386,13 +2398,13 @@ impl BinaryOperator { pub fn is_variant(kind: SyntaxKind) -> bool { match kind { SyntaxKind::TerminalDot => true, - SyntaxKind::TerminalNot => true, - SyntaxKind::TerminalMul => true, - SyntaxKind::TerminalMulEq => true, - SyntaxKind::TerminalDiv => true, - SyntaxKind::TerminalDivEq => true, - SyntaxKind::TerminalMod => true, - SyntaxKind::TerminalModEq => true, + SyntaxKind::TerminalBang => true, + SyntaxKind::TerminalStar => true, + SyntaxKind::TerminalStarEq => true, + SyntaxKind::TerminalSlash => true, + SyntaxKind::TerminalSlashEq => true, + SyntaxKind::TerminalPercent => true, + SyntaxKind::TerminalPercentEq => true, SyntaxKind::TerminalPlus => true, SyntaxKind::TerminalPlusEq => true, SyntaxKind::TerminalMinus => true, @@ -2404,7 +2416,7 @@ impl BinaryOperator { SyntaxKind::TerminalAndAnd => true, SyntaxKind::TerminalOr => true, SyntaxKind::TerminalOrOr => true, - SyntaxKind::TerminalXor => true, + SyntaxKind::TerminalCaret => true, SyntaxKind::TerminalLE => true, SyntaxKind::TerminalGE => true, SyntaxKind::TerminalLT => true, @@ -3207,7 +3219,7 @@ impl MatchArm { pub fn new_green( db: &dyn SyntaxGroup, patterns: PatternListOrGreen, - arrow: TerminalMatchArrowGreen, + arrow: TerminalFatArrowGreen, expression: ExprGreen, ) -> MatchArmGreen { let children: Vec = vec![patterns.0, arrow.0, expression.0]; @@ -3222,8 +3234,8 @@ impl MatchArm { pub fn patterns(&self, db: &dyn SyntaxGroup) -> PatternListOr { PatternListOr::from_syntax_node(db, self.children[0].clone()) } - pub fn arrow(&self, db: &dyn SyntaxGroup) -> TerminalMatchArrow { - TerminalMatchArrow::from_syntax_node(db, self.children[1].clone()) + pub fn arrow(&self, db: &dyn SyntaxGroup) -> TerminalFatArrow { + TerminalFatArrow::from_syntax_node(db, self.children[1].clone()) } pub fn expression(&self, db: &dyn SyntaxGroup) -> Expr { Expr::from_syntax_node(db, self.children[2].clone()) @@ -3251,7 +3263,7 @@ impl TypedSyntaxNode for MatchArm { details: GreenNodeDetails::Node { children: vec![ PatternListOr::missing(db).0, - TerminalMatchArrow::missing(db).0, + TerminalFatArrow::missing(db).0, Expr::missing(db).0, ], width: TextWidth::default(), @@ -3892,7 +3904,7 @@ impl ExprInlineMacro { pub fn new_green( db: &dyn SyntaxGroup, path: ExprPathGreen, - bang: TerminalNotGreen, + bang: TerminalBangGreen, arguments: WrappedArgListGreen, ) -> ExprInlineMacroGreen { let children: Vec = vec![path.0, bang.0, arguments.0]; @@ -3907,8 +3919,8 @@ impl ExprInlineMacro { pub fn path(&self, db: &dyn SyntaxGroup) -> ExprPath { ExprPath::from_syntax_node(db, self.children[0].clone()) } - pub fn bang(&self, db: &dyn SyntaxGroup) -> TerminalNot { - TerminalNot::from_syntax_node(db, self.children[1].clone()) + pub fn bang(&self, db: &dyn SyntaxGroup) -> TerminalBang { + TerminalBang::from_syntax_node(db, self.children[1].clone()) } pub fn arguments(&self, db: &dyn SyntaxGroup) -> WrappedArgList { WrappedArgList::from_syntax_node(db, self.children[2].clone()) @@ -3936,7 +3948,7 @@ impl TypedSyntaxNode for ExprInlineMacro { details: GreenNodeDetails::Node { children: vec![ ExprPath::missing(db).0, - TerminalNot::missing(db).0, + TerminalBang::missing(db).0, WrappedArgList::missing(db).0, ], width: TextWidth::default(), @@ -11095,7 +11107,7 @@ impl ItemInlineMacro { db: &dyn SyntaxGroup, attributes: AttributeListGreen, name: TerminalIdentifierGreen, - bang: TerminalNotGreen, + bang: TerminalBangGreen, arguments: WrappedArgListGreen, semicolon: TerminalSemicolonGreen, ) -> ItemInlineMacroGreen { @@ -11114,8 +11126,8 @@ impl ItemInlineMacro { pub fn name(&self, db: &dyn SyntaxGroup) -> TerminalIdentifier { TerminalIdentifier::from_syntax_node(db, self.children[1].clone()) } - pub fn bang(&self, db: &dyn SyntaxGroup) -> TerminalNot { - TerminalNot::from_syntax_node(db, self.children[2].clone()) + pub fn bang(&self, db: &dyn SyntaxGroup) -> TerminalBang { + TerminalBang::from_syntax_node(db, self.children[2].clone()) } pub fn arguments(&self, db: &dyn SyntaxGroup) -> WrappedArgList { WrappedArgList::from_syntax_node(db, self.children[3].clone()) @@ -11147,7 +11159,7 @@ impl TypedSyntaxNode for ItemInlineMacro { children: vec![ AttributeList::missing(db).0, TerminalIdentifier::missing(db).0, - TerminalNot::missing(db).0, + TerminalBang::missing(db).0, WrappedArgList::missing(db).0, TerminalSemicolon::missing(db).0, ], @@ -20090,13 +20102,13 @@ impl TypedSyntaxNode for TerminalComma { } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TokenDiv { +pub struct TokenSlash { node: SyntaxNode, } -impl Token for TokenDiv { +impl Token for TokenSlash { fn new_green(db: &dyn SyntaxGroup, text: SmolStr) -> Self::Green { - TokenDivGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TokenDiv, + TokenSlashGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TokenSlash, details: GreenNodeDetails::Token(text), }))) } @@ -20109,28 +20121,28 @@ impl Token for TokenDiv { } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenDivPtr(pub SyntaxStablePtrId); -impl TokenDivPtr { +pub struct TokenSlashPtr(pub SyntaxStablePtrId); +impl TokenSlashPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenDiv { - TokenDiv::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenSlash { + TokenSlash::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenDivGreen(pub GreenId); -impl TokenDivGreen { +pub struct TokenSlashGreen(pub GreenId); +impl TokenSlashGreen { pub fn text(&self, db: &dyn SyntaxGroup) -> SmolStr { extract_matches!(&db.lookup_intern_green(self.0).details, GreenNodeDetails::Token).clone() } } -impl TypedSyntaxNode for TokenDiv { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenDiv); - type StablePtr = TokenDivPtr; - type Green = TokenDivGreen; +impl TypedSyntaxNode for TokenSlash { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenSlash); + type StablePtr = TokenSlashPtr; + type Green = TokenSlashGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TokenDivGreen(db.intern_green(Arc::new(GreenNode { + TokenSlashGreen(db.intern_green(Arc::new(GreenNode { kind: SyntaxKind::TokenMissing, details: GreenNodeDetails::Token("".into()), }))) @@ -20139,7 +20151,7 @@ impl TypedSyntaxNode for TokenDiv { match db.lookup_intern_green(node.0.green).details { GreenNodeDetails::Token(_) => Self { node }, GreenNodeDetails::Node { .. } => { - panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenDiv) + panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenSlash) } } } @@ -20147,27 +20159,27 @@ impl TypedSyntaxNode for TokenDiv { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TokenDivPtr(self.node.0.stable_ptr) + TokenSlashPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TerminalDiv { +pub struct TerminalSlash { node: SyntaxNode, children: Arc>, } -impl Terminal for TerminalDiv { - const KIND: SyntaxKind = SyntaxKind::TerminalDiv; - type TokenType = TokenDiv; +impl Terminal for TerminalSlash { + const KIND: SyntaxKind = SyntaxKind::TerminalSlash; + type TokenType = TokenSlash; fn new_green( db: &dyn SyntaxGroup, leading_trivia: TriviaGreen, - token: <::TokenType as TypedSyntaxNode>::Green, + token: <::TokenType as TypedSyntaxNode>::Green, trailing_trivia: TriviaGreen, ) -> Self::Green { let children: Vec = vec![leading_trivia.0, token.0, trailing_trivia.0]; let width = children.iter().copied().map(|id| db.lookup_intern_green(id).width()).sum(); - TerminalDivGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalDiv, + TerminalSlashGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalSlash, details: GreenNodeDetails::Node { children, width }, }))) } @@ -20175,40 +20187,40 @@ impl Terminal for TerminalDiv { self.token(db).text(db) } } -impl TerminalDiv { +impl TerminalSlash { pub fn leading_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[0].clone()) } - pub fn token(&self, db: &dyn SyntaxGroup) -> TokenDiv { - TokenDiv::from_syntax_node(db, self.children[1].clone()) + pub fn token(&self, db: &dyn SyntaxGroup) -> TokenSlash { + TokenSlash::from_syntax_node(db, self.children[1].clone()) } pub fn trailing_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[2].clone()) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalDivPtr(pub SyntaxStablePtrId); -impl TerminalDivPtr { +pub struct TerminalSlashPtr(pub SyntaxStablePtrId); +impl TerminalSlashPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalDiv { - TerminalDiv::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalSlash { + TerminalSlash::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalDivGreen(pub GreenId); -impl TypedSyntaxNode for TerminalDiv { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalDiv); - type StablePtr = TerminalDivPtr; - type Green = TerminalDivGreen; +pub struct TerminalSlashGreen(pub GreenId); +impl TypedSyntaxNode for TerminalSlash { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalSlash); + type StablePtr = TerminalSlashPtr; + type Green = TerminalSlashGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TerminalDivGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalDiv, + TerminalSlashGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalSlash, details: GreenNodeDetails::Node { children: vec![ Trivia::missing(db).0, - TokenDiv::missing(db).0, + TokenSlash::missing(db).0, Trivia::missing(db).0, ], width: TextWidth::default(), @@ -20219,10 +20231,10 @@ impl TypedSyntaxNode for TerminalDiv { let kind = node.kind(db); assert_eq!( kind, - SyntaxKind::TerminalDiv, + SyntaxKind::TerminalSlash, "Unexpected SyntaxKind {:?}. Expected {:?}.", kind, - SyntaxKind::TerminalDiv + SyntaxKind::TerminalSlash ); let children = db.get_children(node.clone()); Self { node, children } @@ -20231,17 +20243,17 @@ impl TypedSyntaxNode for TerminalDiv { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TerminalDivPtr(self.node.0.stable_ptr) + TerminalSlashPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TokenDivEq { +pub struct TokenSlashEq { node: SyntaxNode, } -impl Token for TokenDivEq { +impl Token for TokenSlashEq { fn new_green(db: &dyn SyntaxGroup, text: SmolStr) -> Self::Green { - TokenDivEqGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TokenDivEq, + TokenSlashEqGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TokenSlashEq, details: GreenNodeDetails::Token(text), }))) } @@ -20254,28 +20266,28 @@ impl Token for TokenDivEq { } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenDivEqPtr(pub SyntaxStablePtrId); -impl TokenDivEqPtr { +pub struct TokenSlashEqPtr(pub SyntaxStablePtrId); +impl TokenSlashEqPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenDivEq { - TokenDivEq::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenSlashEq { + TokenSlashEq::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenDivEqGreen(pub GreenId); -impl TokenDivEqGreen { +pub struct TokenSlashEqGreen(pub GreenId); +impl TokenSlashEqGreen { pub fn text(&self, db: &dyn SyntaxGroup) -> SmolStr { extract_matches!(&db.lookup_intern_green(self.0).details, GreenNodeDetails::Token).clone() } } -impl TypedSyntaxNode for TokenDivEq { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenDivEq); - type StablePtr = TokenDivEqPtr; - type Green = TokenDivEqGreen; +impl TypedSyntaxNode for TokenSlashEq { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenSlashEq); + type StablePtr = TokenSlashEqPtr; + type Green = TokenSlashEqGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TokenDivEqGreen(db.intern_green(Arc::new(GreenNode { + TokenSlashEqGreen(db.intern_green(Arc::new(GreenNode { kind: SyntaxKind::TokenMissing, details: GreenNodeDetails::Token("".into()), }))) @@ -20284,7 +20296,7 @@ impl TypedSyntaxNode for TokenDivEq { match db.lookup_intern_green(node.0.green).details { GreenNodeDetails::Token(_) => Self { node }, GreenNodeDetails::Node { .. } => { - panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenDivEq) + panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenSlashEq) } } } @@ -20292,27 +20304,27 @@ impl TypedSyntaxNode for TokenDivEq { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TokenDivEqPtr(self.node.0.stable_ptr) + TokenSlashEqPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TerminalDivEq { +pub struct TerminalSlashEq { node: SyntaxNode, children: Arc>, } -impl Terminal for TerminalDivEq { - const KIND: SyntaxKind = SyntaxKind::TerminalDivEq; - type TokenType = TokenDivEq; +impl Terminal for TerminalSlashEq { + const KIND: SyntaxKind = SyntaxKind::TerminalSlashEq; + type TokenType = TokenSlashEq; fn new_green( db: &dyn SyntaxGroup, leading_trivia: TriviaGreen, - token: <::TokenType as TypedSyntaxNode>::Green, + token: <::TokenType as TypedSyntaxNode>::Green, trailing_trivia: TriviaGreen, ) -> Self::Green { let children: Vec = vec![leading_trivia.0, token.0, trailing_trivia.0]; let width = children.iter().copied().map(|id| db.lookup_intern_green(id).width()).sum(); - TerminalDivEqGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalDivEq, + TerminalSlashEqGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalSlashEq, details: GreenNodeDetails::Node { children, width }, }))) } @@ -20320,40 +20332,40 @@ impl Terminal for TerminalDivEq { self.token(db).text(db) } } -impl TerminalDivEq { +impl TerminalSlashEq { pub fn leading_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[0].clone()) } - pub fn token(&self, db: &dyn SyntaxGroup) -> TokenDivEq { - TokenDivEq::from_syntax_node(db, self.children[1].clone()) + pub fn token(&self, db: &dyn SyntaxGroup) -> TokenSlashEq { + TokenSlashEq::from_syntax_node(db, self.children[1].clone()) } pub fn trailing_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[2].clone()) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalDivEqPtr(pub SyntaxStablePtrId); -impl TerminalDivEqPtr { +pub struct TerminalSlashEqPtr(pub SyntaxStablePtrId); +impl TerminalSlashEqPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalDivEq { - TerminalDivEq::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalSlashEq { + TerminalSlashEq::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalDivEqGreen(pub GreenId); -impl TypedSyntaxNode for TerminalDivEq { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalDivEq); - type StablePtr = TerminalDivEqPtr; - type Green = TerminalDivEqGreen; +pub struct TerminalSlashEqGreen(pub GreenId); +impl TypedSyntaxNode for TerminalSlashEq { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalSlashEq); + type StablePtr = TerminalSlashEqPtr; + type Green = TerminalSlashEqGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TerminalDivEqGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalDivEq, + TerminalSlashEqGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalSlashEq, details: GreenNodeDetails::Node { children: vec![ Trivia::missing(db).0, - TokenDivEq::missing(db).0, + TokenSlashEq::missing(db).0, Trivia::missing(db).0, ], width: TextWidth::default(), @@ -20364,10 +20376,10 @@ impl TypedSyntaxNode for TerminalDivEq { let kind = node.kind(db); assert_eq!( kind, - SyntaxKind::TerminalDivEq, + SyntaxKind::TerminalSlashEq, "Unexpected SyntaxKind {:?}. Expected {:?}.", kind, - SyntaxKind::TerminalDivEq + SyntaxKind::TerminalSlashEq ); let children = db.get_children(node.clone()); Self { node, children } @@ -20376,7 +20388,7 @@ impl TypedSyntaxNode for TerminalDivEq { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TerminalDivEqPtr(self.node.0.stable_ptr) + TerminalSlashEqPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] @@ -22265,13 +22277,13 @@ impl TypedSyntaxNode for TerminalLT { } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TokenMatchArrow { +pub struct TokenFatArrow { node: SyntaxNode, } -impl Token for TokenMatchArrow { +impl Token for TokenFatArrow { fn new_green(db: &dyn SyntaxGroup, text: SmolStr) -> Self::Green { - TokenMatchArrowGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TokenMatchArrow, + TokenFatArrowGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TokenFatArrow, details: GreenNodeDetails::Token(text), }))) } @@ -22284,28 +22296,28 @@ impl Token for TokenMatchArrow { } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenMatchArrowPtr(pub SyntaxStablePtrId); -impl TokenMatchArrowPtr { +pub struct TokenFatArrowPtr(pub SyntaxStablePtrId); +impl TokenFatArrowPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenMatchArrow { - TokenMatchArrow::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenFatArrow { + TokenFatArrow::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenMatchArrowGreen(pub GreenId); -impl TokenMatchArrowGreen { +pub struct TokenFatArrowGreen(pub GreenId); +impl TokenFatArrowGreen { pub fn text(&self, db: &dyn SyntaxGroup) -> SmolStr { extract_matches!(&db.lookup_intern_green(self.0).details, GreenNodeDetails::Token).clone() } } -impl TypedSyntaxNode for TokenMatchArrow { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenMatchArrow); - type StablePtr = TokenMatchArrowPtr; - type Green = TokenMatchArrowGreen; +impl TypedSyntaxNode for TokenFatArrow { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenFatArrow); + type StablePtr = TokenFatArrowPtr; + type Green = TokenFatArrowGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TokenMatchArrowGreen(db.intern_green(Arc::new(GreenNode { + TokenFatArrowGreen(db.intern_green(Arc::new(GreenNode { kind: SyntaxKind::TokenMissing, details: GreenNodeDetails::Token("".into()), }))) @@ -22314,7 +22326,7 @@ impl TypedSyntaxNode for TokenMatchArrow { match db.lookup_intern_green(node.0.green).details { GreenNodeDetails::Token(_) => Self { node }, GreenNodeDetails::Node { .. } => { - panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenMatchArrow) + panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenFatArrow) } } } @@ -22322,27 +22334,27 @@ impl TypedSyntaxNode for TokenMatchArrow { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TokenMatchArrowPtr(self.node.0.stable_ptr) + TokenFatArrowPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TerminalMatchArrow { +pub struct TerminalFatArrow { node: SyntaxNode, children: Arc>, } -impl Terminal for TerminalMatchArrow { - const KIND: SyntaxKind = SyntaxKind::TerminalMatchArrow; - type TokenType = TokenMatchArrow; +impl Terminal for TerminalFatArrow { + const KIND: SyntaxKind = SyntaxKind::TerminalFatArrow; + type TokenType = TokenFatArrow; fn new_green( db: &dyn SyntaxGroup, leading_trivia: TriviaGreen, - token: <::TokenType as TypedSyntaxNode>::Green, + token: <::TokenType as TypedSyntaxNode>::Green, trailing_trivia: TriviaGreen, ) -> Self::Green { let children: Vec = vec![leading_trivia.0, token.0, trailing_trivia.0]; let width = children.iter().copied().map(|id| db.lookup_intern_green(id).width()).sum(); - TerminalMatchArrowGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalMatchArrow, + TerminalFatArrowGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalFatArrow, details: GreenNodeDetails::Node { children, width }, }))) } @@ -22350,40 +22362,40 @@ impl Terminal for TerminalMatchArrow { self.token(db).text(db) } } -impl TerminalMatchArrow { +impl TerminalFatArrow { pub fn leading_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[0].clone()) } - pub fn token(&self, db: &dyn SyntaxGroup) -> TokenMatchArrow { - TokenMatchArrow::from_syntax_node(db, self.children[1].clone()) + pub fn token(&self, db: &dyn SyntaxGroup) -> TokenFatArrow { + TokenFatArrow::from_syntax_node(db, self.children[1].clone()) } pub fn trailing_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[2].clone()) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalMatchArrowPtr(pub SyntaxStablePtrId); -impl TerminalMatchArrowPtr { +pub struct TerminalFatArrowPtr(pub SyntaxStablePtrId); +impl TerminalFatArrowPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalMatchArrow { - TerminalMatchArrow::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalFatArrow { + TerminalFatArrow::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalMatchArrowGreen(pub GreenId); -impl TypedSyntaxNode for TerminalMatchArrow { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalMatchArrow); - type StablePtr = TerminalMatchArrowPtr; - type Green = TerminalMatchArrowGreen; +pub struct TerminalFatArrowGreen(pub GreenId); +impl TypedSyntaxNode for TerminalFatArrow { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalFatArrow); + type StablePtr = TerminalFatArrowPtr; + type Green = TerminalFatArrowGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TerminalMatchArrowGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalMatchArrow, + TerminalFatArrowGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalFatArrow, details: GreenNodeDetails::Node { children: vec![ Trivia::missing(db).0, - TokenMatchArrow::missing(db).0, + TokenFatArrow::missing(db).0, Trivia::missing(db).0, ], width: TextWidth::default(), @@ -22394,10 +22406,10 @@ impl TypedSyntaxNode for TerminalMatchArrow { let kind = node.kind(db); assert_eq!( kind, - SyntaxKind::TerminalMatchArrow, + SyntaxKind::TerminalFatArrow, "Unexpected SyntaxKind {:?}. Expected {:?}.", kind, - SyntaxKind::TerminalMatchArrow + SyntaxKind::TerminalFatArrow ); let children = db.get_children(node.clone()); Self { node, children } @@ -22406,7 +22418,7 @@ impl TypedSyntaxNode for TerminalMatchArrow { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TerminalMatchArrowPtr(self.node.0.stable_ptr) + TerminalFatArrowPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] @@ -22700,13 +22712,13 @@ impl TypedSyntaxNode for TerminalMinusEq { } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TokenMod { +pub struct TokenPercent { node: SyntaxNode, } -impl Token for TokenMod { +impl Token for TokenPercent { fn new_green(db: &dyn SyntaxGroup, text: SmolStr) -> Self::Green { - TokenModGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TokenMod, + TokenPercentGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TokenPercent, details: GreenNodeDetails::Token(text), }))) } @@ -22719,28 +22731,28 @@ impl Token for TokenMod { } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenModPtr(pub SyntaxStablePtrId); -impl TokenModPtr { +pub struct TokenPercentPtr(pub SyntaxStablePtrId); +impl TokenPercentPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenMod { - TokenMod::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenPercent { + TokenPercent::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenModGreen(pub GreenId); -impl TokenModGreen { +pub struct TokenPercentGreen(pub GreenId); +impl TokenPercentGreen { pub fn text(&self, db: &dyn SyntaxGroup) -> SmolStr { extract_matches!(&db.lookup_intern_green(self.0).details, GreenNodeDetails::Token).clone() } } -impl TypedSyntaxNode for TokenMod { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenMod); - type StablePtr = TokenModPtr; - type Green = TokenModGreen; +impl TypedSyntaxNode for TokenPercent { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenPercent); + type StablePtr = TokenPercentPtr; + type Green = TokenPercentGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TokenModGreen(db.intern_green(Arc::new(GreenNode { + TokenPercentGreen(db.intern_green(Arc::new(GreenNode { kind: SyntaxKind::TokenMissing, details: GreenNodeDetails::Token("".into()), }))) @@ -22749,7 +22761,7 @@ impl TypedSyntaxNode for TokenMod { match db.lookup_intern_green(node.0.green).details { GreenNodeDetails::Token(_) => Self { node }, GreenNodeDetails::Node { .. } => { - panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenMod) + panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenPercent) } } } @@ -22757,27 +22769,27 @@ impl TypedSyntaxNode for TokenMod { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TokenModPtr(self.node.0.stable_ptr) + TokenPercentPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TerminalMod { +pub struct TerminalPercent { node: SyntaxNode, children: Arc>, } -impl Terminal for TerminalMod { - const KIND: SyntaxKind = SyntaxKind::TerminalMod; - type TokenType = TokenMod; +impl Terminal for TerminalPercent { + const KIND: SyntaxKind = SyntaxKind::TerminalPercent; + type TokenType = TokenPercent; fn new_green( db: &dyn SyntaxGroup, leading_trivia: TriviaGreen, - token: <::TokenType as TypedSyntaxNode>::Green, + token: <::TokenType as TypedSyntaxNode>::Green, trailing_trivia: TriviaGreen, ) -> Self::Green { let children: Vec = vec![leading_trivia.0, token.0, trailing_trivia.0]; let width = children.iter().copied().map(|id| db.lookup_intern_green(id).width()).sum(); - TerminalModGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalMod, + TerminalPercentGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalPercent, details: GreenNodeDetails::Node { children, width }, }))) } @@ -22785,40 +22797,40 @@ impl Terminal for TerminalMod { self.token(db).text(db) } } -impl TerminalMod { +impl TerminalPercent { pub fn leading_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[0].clone()) } - pub fn token(&self, db: &dyn SyntaxGroup) -> TokenMod { - TokenMod::from_syntax_node(db, self.children[1].clone()) + pub fn token(&self, db: &dyn SyntaxGroup) -> TokenPercent { + TokenPercent::from_syntax_node(db, self.children[1].clone()) } pub fn trailing_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[2].clone()) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalModPtr(pub SyntaxStablePtrId); -impl TerminalModPtr { +pub struct TerminalPercentPtr(pub SyntaxStablePtrId); +impl TerminalPercentPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalMod { - TerminalMod::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalPercent { + TerminalPercent::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalModGreen(pub GreenId); -impl TypedSyntaxNode for TerminalMod { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalMod); - type StablePtr = TerminalModPtr; - type Green = TerminalModGreen; +pub struct TerminalPercentGreen(pub GreenId); +impl TypedSyntaxNode for TerminalPercent { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalPercent); + type StablePtr = TerminalPercentPtr; + type Green = TerminalPercentGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TerminalModGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalMod, + TerminalPercentGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalPercent, details: GreenNodeDetails::Node { children: vec![ Trivia::missing(db).0, - TokenMod::missing(db).0, + TokenPercent::missing(db).0, Trivia::missing(db).0, ], width: TextWidth::default(), @@ -22829,10 +22841,10 @@ impl TypedSyntaxNode for TerminalMod { let kind = node.kind(db); assert_eq!( kind, - SyntaxKind::TerminalMod, + SyntaxKind::TerminalPercent, "Unexpected SyntaxKind {:?}. Expected {:?}.", kind, - SyntaxKind::TerminalMod + SyntaxKind::TerminalPercent ); let children = db.get_children(node.clone()); Self { node, children } @@ -22841,17 +22853,17 @@ impl TypedSyntaxNode for TerminalMod { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TerminalModPtr(self.node.0.stable_ptr) + TerminalPercentPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TokenModEq { +pub struct TokenPercentEq { node: SyntaxNode, } -impl Token for TokenModEq { +impl Token for TokenPercentEq { fn new_green(db: &dyn SyntaxGroup, text: SmolStr) -> Self::Green { - TokenModEqGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TokenModEq, + TokenPercentEqGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TokenPercentEq, details: GreenNodeDetails::Token(text), }))) } @@ -22864,28 +22876,28 @@ impl Token for TokenModEq { } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenModEqPtr(pub SyntaxStablePtrId); -impl TokenModEqPtr { +pub struct TokenPercentEqPtr(pub SyntaxStablePtrId); +impl TokenPercentEqPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenModEq { - TokenModEq::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenPercentEq { + TokenPercentEq::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenModEqGreen(pub GreenId); -impl TokenModEqGreen { +pub struct TokenPercentEqGreen(pub GreenId); +impl TokenPercentEqGreen { pub fn text(&self, db: &dyn SyntaxGroup) -> SmolStr { extract_matches!(&db.lookup_intern_green(self.0).details, GreenNodeDetails::Token).clone() } } -impl TypedSyntaxNode for TokenModEq { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenModEq); - type StablePtr = TokenModEqPtr; - type Green = TokenModEqGreen; +impl TypedSyntaxNode for TokenPercentEq { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenPercentEq); + type StablePtr = TokenPercentEqPtr; + type Green = TokenPercentEqGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TokenModEqGreen(db.intern_green(Arc::new(GreenNode { + TokenPercentEqGreen(db.intern_green(Arc::new(GreenNode { kind: SyntaxKind::TokenMissing, details: GreenNodeDetails::Token("".into()), }))) @@ -22894,7 +22906,7 @@ impl TypedSyntaxNode for TokenModEq { match db.lookup_intern_green(node.0.green).details { GreenNodeDetails::Token(_) => Self { node }, GreenNodeDetails::Node { .. } => { - panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenModEq) + panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenPercentEq) } } } @@ -22902,27 +22914,27 @@ impl TypedSyntaxNode for TokenModEq { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TokenModEqPtr(self.node.0.stable_ptr) + TokenPercentEqPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TerminalModEq { +pub struct TerminalPercentEq { node: SyntaxNode, children: Arc>, } -impl Terminal for TerminalModEq { - const KIND: SyntaxKind = SyntaxKind::TerminalModEq; - type TokenType = TokenModEq; +impl Terminal for TerminalPercentEq { + const KIND: SyntaxKind = SyntaxKind::TerminalPercentEq; + type TokenType = TokenPercentEq; fn new_green( db: &dyn SyntaxGroup, leading_trivia: TriviaGreen, - token: <::TokenType as TypedSyntaxNode>::Green, + token: <::TokenType as TypedSyntaxNode>::Green, trailing_trivia: TriviaGreen, ) -> Self::Green { let children: Vec = vec![leading_trivia.0, token.0, trailing_trivia.0]; let width = children.iter().copied().map(|id| db.lookup_intern_green(id).width()).sum(); - TerminalModEqGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalModEq, + TerminalPercentEqGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalPercentEq, details: GreenNodeDetails::Node { children, width }, }))) } @@ -22930,40 +22942,40 @@ impl Terminal for TerminalModEq { self.token(db).text(db) } } -impl TerminalModEq { +impl TerminalPercentEq { pub fn leading_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[0].clone()) } - pub fn token(&self, db: &dyn SyntaxGroup) -> TokenModEq { - TokenModEq::from_syntax_node(db, self.children[1].clone()) + pub fn token(&self, db: &dyn SyntaxGroup) -> TokenPercentEq { + TokenPercentEq::from_syntax_node(db, self.children[1].clone()) } pub fn trailing_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[2].clone()) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalModEqPtr(pub SyntaxStablePtrId); -impl TerminalModEqPtr { +pub struct TerminalPercentEqPtr(pub SyntaxStablePtrId); +impl TerminalPercentEqPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalModEq { - TerminalModEq::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalPercentEq { + TerminalPercentEq::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalModEqGreen(pub GreenId); -impl TypedSyntaxNode for TerminalModEq { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalModEq); - type StablePtr = TerminalModEqPtr; - type Green = TerminalModEqGreen; +pub struct TerminalPercentEqGreen(pub GreenId); +impl TypedSyntaxNode for TerminalPercentEq { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalPercentEq); + type StablePtr = TerminalPercentEqPtr; + type Green = TerminalPercentEqGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TerminalModEqGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalModEq, + TerminalPercentEqGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalPercentEq, details: GreenNodeDetails::Node { children: vec![ Trivia::missing(db).0, - TokenModEq::missing(db).0, + TokenPercentEq::missing(db).0, Trivia::missing(db).0, ], width: TextWidth::default(), @@ -22974,10 +22986,10 @@ impl TypedSyntaxNode for TerminalModEq { let kind = node.kind(db); assert_eq!( kind, - SyntaxKind::TerminalModEq, + SyntaxKind::TerminalPercentEq, "Unexpected SyntaxKind {:?}. Expected {:?}.", kind, - SyntaxKind::TerminalModEq + SyntaxKind::TerminalPercentEq ); let children = db.get_children(node.clone()); Self { node, children } @@ -22986,17 +22998,17 @@ impl TypedSyntaxNode for TerminalModEq { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TerminalModEqPtr(self.node.0.stable_ptr) + TerminalPercentEqPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TokenMul { +pub struct TokenStar { node: SyntaxNode, } -impl Token for TokenMul { +impl Token for TokenStar { fn new_green(db: &dyn SyntaxGroup, text: SmolStr) -> Self::Green { - TokenMulGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TokenMul, + TokenStarGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TokenStar, details: GreenNodeDetails::Token(text), }))) } @@ -23009,28 +23021,28 @@ impl Token for TokenMul { } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenMulPtr(pub SyntaxStablePtrId); -impl TokenMulPtr { +pub struct TokenStarPtr(pub SyntaxStablePtrId); +impl TokenStarPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenMul { - TokenMul::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenStar { + TokenStar::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenMulGreen(pub GreenId); -impl TokenMulGreen { +pub struct TokenStarGreen(pub GreenId); +impl TokenStarGreen { pub fn text(&self, db: &dyn SyntaxGroup) -> SmolStr { extract_matches!(&db.lookup_intern_green(self.0).details, GreenNodeDetails::Token).clone() } } -impl TypedSyntaxNode for TokenMul { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenMul); - type StablePtr = TokenMulPtr; - type Green = TokenMulGreen; +impl TypedSyntaxNode for TokenStar { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenStar); + type StablePtr = TokenStarPtr; + type Green = TokenStarGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TokenMulGreen(db.intern_green(Arc::new(GreenNode { + TokenStarGreen(db.intern_green(Arc::new(GreenNode { kind: SyntaxKind::TokenMissing, details: GreenNodeDetails::Token("".into()), }))) @@ -23039,7 +23051,7 @@ impl TypedSyntaxNode for TokenMul { match db.lookup_intern_green(node.0.green).details { GreenNodeDetails::Token(_) => Self { node }, GreenNodeDetails::Node { .. } => { - panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenMul) + panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenStar) } } } @@ -23047,27 +23059,27 @@ impl TypedSyntaxNode for TokenMul { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TokenMulPtr(self.node.0.stable_ptr) + TokenStarPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TerminalMul { +pub struct TerminalStar { node: SyntaxNode, children: Arc>, } -impl Terminal for TerminalMul { - const KIND: SyntaxKind = SyntaxKind::TerminalMul; - type TokenType = TokenMul; +impl Terminal for TerminalStar { + const KIND: SyntaxKind = SyntaxKind::TerminalStar; + type TokenType = TokenStar; fn new_green( db: &dyn SyntaxGroup, leading_trivia: TriviaGreen, - token: <::TokenType as TypedSyntaxNode>::Green, + token: <::TokenType as TypedSyntaxNode>::Green, trailing_trivia: TriviaGreen, ) -> Self::Green { let children: Vec = vec![leading_trivia.0, token.0, trailing_trivia.0]; let width = children.iter().copied().map(|id| db.lookup_intern_green(id).width()).sum(); - TerminalMulGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalMul, + TerminalStarGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalStar, details: GreenNodeDetails::Node { children, width }, }))) } @@ -23075,40 +23087,40 @@ impl Terminal for TerminalMul { self.token(db).text(db) } } -impl TerminalMul { +impl TerminalStar { pub fn leading_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[0].clone()) } - pub fn token(&self, db: &dyn SyntaxGroup) -> TokenMul { - TokenMul::from_syntax_node(db, self.children[1].clone()) + pub fn token(&self, db: &dyn SyntaxGroup) -> TokenStar { + TokenStar::from_syntax_node(db, self.children[1].clone()) } pub fn trailing_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[2].clone()) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalMulPtr(pub SyntaxStablePtrId); -impl TerminalMulPtr { +pub struct TerminalStarPtr(pub SyntaxStablePtrId); +impl TerminalStarPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalMul { - TerminalMul::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalStar { + TerminalStar::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalMulGreen(pub GreenId); -impl TypedSyntaxNode for TerminalMul { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalMul); - type StablePtr = TerminalMulPtr; - type Green = TerminalMulGreen; +pub struct TerminalStarGreen(pub GreenId); +impl TypedSyntaxNode for TerminalStar { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalStar); + type StablePtr = TerminalStarPtr; + type Green = TerminalStarGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TerminalMulGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalMul, + TerminalStarGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalStar, details: GreenNodeDetails::Node { children: vec![ Trivia::missing(db).0, - TokenMul::missing(db).0, + TokenStar::missing(db).0, Trivia::missing(db).0, ], width: TextWidth::default(), @@ -23119,10 +23131,10 @@ impl TypedSyntaxNode for TerminalMul { let kind = node.kind(db); assert_eq!( kind, - SyntaxKind::TerminalMul, + SyntaxKind::TerminalStar, "Unexpected SyntaxKind {:?}. Expected {:?}.", kind, - SyntaxKind::TerminalMul + SyntaxKind::TerminalStar ); let children = db.get_children(node.clone()); Self { node, children } @@ -23131,17 +23143,17 @@ impl TypedSyntaxNode for TerminalMul { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TerminalMulPtr(self.node.0.stable_ptr) + TerminalStarPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TokenMulEq { +pub struct TokenStarEq { node: SyntaxNode, } -impl Token for TokenMulEq { +impl Token for TokenStarEq { fn new_green(db: &dyn SyntaxGroup, text: SmolStr) -> Self::Green { - TokenMulEqGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TokenMulEq, + TokenStarEqGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TokenStarEq, details: GreenNodeDetails::Token(text), }))) } @@ -23154,28 +23166,28 @@ impl Token for TokenMulEq { } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenMulEqPtr(pub SyntaxStablePtrId); -impl TokenMulEqPtr { +pub struct TokenStarEqPtr(pub SyntaxStablePtrId); +impl TokenStarEqPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenMulEq { - TokenMulEq::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenStarEq { + TokenStarEq::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenMulEqGreen(pub GreenId); -impl TokenMulEqGreen { +pub struct TokenStarEqGreen(pub GreenId); +impl TokenStarEqGreen { pub fn text(&self, db: &dyn SyntaxGroup) -> SmolStr { extract_matches!(&db.lookup_intern_green(self.0).details, GreenNodeDetails::Token).clone() } } -impl TypedSyntaxNode for TokenMulEq { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenMulEq); - type StablePtr = TokenMulEqPtr; - type Green = TokenMulEqGreen; +impl TypedSyntaxNode for TokenStarEq { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenStarEq); + type StablePtr = TokenStarEqPtr; + type Green = TokenStarEqGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TokenMulEqGreen(db.intern_green(Arc::new(GreenNode { + TokenStarEqGreen(db.intern_green(Arc::new(GreenNode { kind: SyntaxKind::TokenMissing, details: GreenNodeDetails::Token("".into()), }))) @@ -23184,7 +23196,7 @@ impl TypedSyntaxNode for TokenMulEq { match db.lookup_intern_green(node.0.green).details { GreenNodeDetails::Token(_) => Self { node }, GreenNodeDetails::Node { .. } => { - panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenMulEq) + panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenStarEq) } } } @@ -23192,27 +23204,27 @@ impl TypedSyntaxNode for TokenMulEq { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TokenMulEqPtr(self.node.0.stable_ptr) + TokenStarEqPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TerminalMulEq { +pub struct TerminalStarEq { node: SyntaxNode, children: Arc>, } -impl Terminal for TerminalMulEq { - const KIND: SyntaxKind = SyntaxKind::TerminalMulEq; - type TokenType = TokenMulEq; +impl Terminal for TerminalStarEq { + const KIND: SyntaxKind = SyntaxKind::TerminalStarEq; + type TokenType = TokenStarEq; fn new_green( db: &dyn SyntaxGroup, leading_trivia: TriviaGreen, - token: <::TokenType as TypedSyntaxNode>::Green, + token: <::TokenType as TypedSyntaxNode>::Green, trailing_trivia: TriviaGreen, ) -> Self::Green { let children: Vec = vec![leading_trivia.0, token.0, trailing_trivia.0]; let width = children.iter().copied().map(|id| db.lookup_intern_green(id).width()).sum(); - TerminalMulEqGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalMulEq, + TerminalStarEqGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalStarEq, details: GreenNodeDetails::Node { children, width }, }))) } @@ -23220,40 +23232,40 @@ impl Terminal for TerminalMulEq { self.token(db).text(db) } } -impl TerminalMulEq { +impl TerminalStarEq { pub fn leading_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[0].clone()) } - pub fn token(&self, db: &dyn SyntaxGroup) -> TokenMulEq { - TokenMulEq::from_syntax_node(db, self.children[1].clone()) + pub fn token(&self, db: &dyn SyntaxGroup) -> TokenStarEq { + TokenStarEq::from_syntax_node(db, self.children[1].clone()) } pub fn trailing_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[2].clone()) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalMulEqPtr(pub SyntaxStablePtrId); -impl TerminalMulEqPtr { +pub struct TerminalStarEqPtr(pub SyntaxStablePtrId); +impl TerminalStarEqPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalMulEq { - TerminalMulEq::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalStarEq { + TerminalStarEq::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalMulEqGreen(pub GreenId); -impl TypedSyntaxNode for TerminalMulEq { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalMulEq); - type StablePtr = TerminalMulEqPtr; - type Green = TerminalMulEqGreen; +pub struct TerminalStarEqGreen(pub GreenId); +impl TypedSyntaxNode for TerminalStarEq { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalStarEq); + type StablePtr = TerminalStarEqPtr; + type Green = TerminalStarEqGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TerminalMulEqGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalMulEq, + TerminalStarEqGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalStarEq, details: GreenNodeDetails::Node { children: vec![ Trivia::missing(db).0, - TokenMulEq::missing(db).0, + TokenStarEq::missing(db).0, Trivia::missing(db).0, ], width: TextWidth::default(), @@ -23264,10 +23276,10 @@ impl TypedSyntaxNode for TerminalMulEq { let kind = node.kind(db); assert_eq!( kind, - SyntaxKind::TerminalMulEq, + SyntaxKind::TerminalStarEq, "Unexpected SyntaxKind {:?}. Expected {:?}.", kind, - SyntaxKind::TerminalMulEq + SyntaxKind::TerminalStarEq ); let children = db.get_children(node.clone()); Self { node, children } @@ -23276,7 +23288,7 @@ impl TypedSyntaxNode for TerminalMulEq { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TerminalMulEqPtr(self.node.0.stable_ptr) + TerminalStarEqPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] @@ -23425,13 +23437,13 @@ impl TypedSyntaxNode for TerminalNeq { } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TokenNot { +pub struct TokenBang { node: SyntaxNode, } -impl Token for TokenNot { +impl Token for TokenBang { fn new_green(db: &dyn SyntaxGroup, text: SmolStr) -> Self::Green { - TokenNotGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TokenNot, + TokenBangGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TokenBang, details: GreenNodeDetails::Token(text), }))) } @@ -23444,28 +23456,28 @@ impl Token for TokenNot { } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenNotPtr(pub SyntaxStablePtrId); -impl TokenNotPtr { +pub struct TokenBangPtr(pub SyntaxStablePtrId); +impl TokenBangPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenNot { - TokenNot::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenBang { + TokenBang::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenNotGreen(pub GreenId); -impl TokenNotGreen { +pub struct TokenBangGreen(pub GreenId); +impl TokenBangGreen { pub fn text(&self, db: &dyn SyntaxGroup) -> SmolStr { extract_matches!(&db.lookup_intern_green(self.0).details, GreenNodeDetails::Token).clone() } } -impl TypedSyntaxNode for TokenNot { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenNot); - type StablePtr = TokenNotPtr; - type Green = TokenNotGreen; +impl TypedSyntaxNode for TokenBang { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenBang); + type StablePtr = TokenBangPtr; + type Green = TokenBangGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TokenNotGreen(db.intern_green(Arc::new(GreenNode { + TokenBangGreen(db.intern_green(Arc::new(GreenNode { kind: SyntaxKind::TokenMissing, details: GreenNodeDetails::Token("".into()), }))) @@ -23474,7 +23486,7 @@ impl TypedSyntaxNode for TokenNot { match db.lookup_intern_green(node.0.green).details { GreenNodeDetails::Token(_) => Self { node }, GreenNodeDetails::Node { .. } => { - panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenNot) + panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenBang) } } } @@ -23482,27 +23494,27 @@ impl TypedSyntaxNode for TokenNot { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TokenNotPtr(self.node.0.stable_ptr) + TokenBangPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TerminalNot { +pub struct TerminalBang { node: SyntaxNode, children: Arc>, } -impl Terminal for TerminalNot { - const KIND: SyntaxKind = SyntaxKind::TerminalNot; - type TokenType = TokenNot; +impl Terminal for TerminalBang { + const KIND: SyntaxKind = SyntaxKind::TerminalBang; + type TokenType = TokenBang; fn new_green( db: &dyn SyntaxGroup, leading_trivia: TriviaGreen, - token: <::TokenType as TypedSyntaxNode>::Green, + token: <::TokenType as TypedSyntaxNode>::Green, trailing_trivia: TriviaGreen, ) -> Self::Green { let children: Vec = vec![leading_trivia.0, token.0, trailing_trivia.0]; let width = children.iter().copied().map(|id| db.lookup_intern_green(id).width()).sum(); - TerminalNotGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalNot, + TerminalBangGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalBang, details: GreenNodeDetails::Node { children, width }, }))) } @@ -23510,40 +23522,40 @@ impl Terminal for TerminalNot { self.token(db).text(db) } } -impl TerminalNot { +impl TerminalBang { pub fn leading_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[0].clone()) } - pub fn token(&self, db: &dyn SyntaxGroup) -> TokenNot { - TokenNot::from_syntax_node(db, self.children[1].clone()) + pub fn token(&self, db: &dyn SyntaxGroup) -> TokenBang { + TokenBang::from_syntax_node(db, self.children[1].clone()) } pub fn trailing_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[2].clone()) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalNotPtr(pub SyntaxStablePtrId); -impl TerminalNotPtr { +pub struct TerminalBangPtr(pub SyntaxStablePtrId); +impl TerminalBangPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalNot { - TerminalNot::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalBang { + TerminalBang::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalNotGreen(pub GreenId); -impl TypedSyntaxNode for TerminalNot { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalNot); - type StablePtr = TerminalNotPtr; - type Green = TerminalNotGreen; +pub struct TerminalBangGreen(pub GreenId); +impl TypedSyntaxNode for TerminalBang { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalBang); + type StablePtr = TerminalBangPtr; + type Green = TerminalBangGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TerminalNotGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalNot, + TerminalBangGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalBang, details: GreenNodeDetails::Node { children: vec![ Trivia::missing(db).0, - TokenNot::missing(db).0, + TokenBang::missing(db).0, Trivia::missing(db).0, ], width: TextWidth::default(), @@ -23554,10 +23566,10 @@ impl TypedSyntaxNode for TerminalNot { let kind = node.kind(db); assert_eq!( kind, - SyntaxKind::TerminalNot, + SyntaxKind::TerminalBang, "Unexpected SyntaxKind {:?}. Expected {:?}.", kind, - SyntaxKind::TerminalNot + SyntaxKind::TerminalBang ); let children = db.get_children(node.clone()); Self { node, children } @@ -23566,17 +23578,17 @@ impl TypedSyntaxNode for TerminalNot { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TerminalNotPtr(self.node.0.stable_ptr) + TerminalBangPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TokenBitNot { +pub struct TokenTilde { node: SyntaxNode, } -impl Token for TokenBitNot { +impl Token for TokenTilde { fn new_green(db: &dyn SyntaxGroup, text: SmolStr) -> Self::Green { - TokenBitNotGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TokenBitNot, + TokenTildeGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TokenTilde, details: GreenNodeDetails::Token(text), }))) } @@ -23589,28 +23601,28 @@ impl Token for TokenBitNot { } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenBitNotPtr(pub SyntaxStablePtrId); -impl TokenBitNotPtr { +pub struct TokenTildePtr(pub SyntaxStablePtrId); +impl TokenTildePtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenBitNot { - TokenBitNot::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenTilde { + TokenTilde::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenBitNotGreen(pub GreenId); -impl TokenBitNotGreen { +pub struct TokenTildeGreen(pub GreenId); +impl TokenTildeGreen { pub fn text(&self, db: &dyn SyntaxGroup) -> SmolStr { extract_matches!(&db.lookup_intern_green(self.0).details, GreenNodeDetails::Token).clone() } } -impl TypedSyntaxNode for TokenBitNot { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenBitNot); - type StablePtr = TokenBitNotPtr; - type Green = TokenBitNotGreen; +impl TypedSyntaxNode for TokenTilde { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenTilde); + type StablePtr = TokenTildePtr; + type Green = TokenTildeGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TokenBitNotGreen(db.intern_green(Arc::new(GreenNode { + TokenTildeGreen(db.intern_green(Arc::new(GreenNode { kind: SyntaxKind::TokenMissing, details: GreenNodeDetails::Token("".into()), }))) @@ -23619,7 +23631,7 @@ impl TypedSyntaxNode for TokenBitNot { match db.lookup_intern_green(node.0.green).details { GreenNodeDetails::Token(_) => Self { node }, GreenNodeDetails::Node { .. } => { - panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenBitNot) + panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenTilde) } } } @@ -23627,27 +23639,27 @@ impl TypedSyntaxNode for TokenBitNot { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TokenBitNotPtr(self.node.0.stable_ptr) + TokenTildePtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TerminalBitNot { +pub struct TerminalTilde { node: SyntaxNode, children: Arc>, } -impl Terminal for TerminalBitNot { - const KIND: SyntaxKind = SyntaxKind::TerminalBitNot; - type TokenType = TokenBitNot; +impl Terminal for TerminalTilde { + const KIND: SyntaxKind = SyntaxKind::TerminalTilde; + type TokenType = TokenTilde; fn new_green( db: &dyn SyntaxGroup, leading_trivia: TriviaGreen, - token: <::TokenType as TypedSyntaxNode>::Green, + token: <::TokenType as TypedSyntaxNode>::Green, trailing_trivia: TriviaGreen, ) -> Self::Green { let children: Vec = vec![leading_trivia.0, token.0, trailing_trivia.0]; let width = children.iter().copied().map(|id| db.lookup_intern_green(id).width()).sum(); - TerminalBitNotGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalBitNot, + TerminalTildeGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalTilde, details: GreenNodeDetails::Node { children, width }, }))) } @@ -23655,40 +23667,40 @@ impl Terminal for TerminalBitNot { self.token(db).text(db) } } -impl TerminalBitNot { +impl TerminalTilde { pub fn leading_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[0].clone()) } - pub fn token(&self, db: &dyn SyntaxGroup) -> TokenBitNot { - TokenBitNot::from_syntax_node(db, self.children[1].clone()) + pub fn token(&self, db: &dyn SyntaxGroup) -> TokenTilde { + TokenTilde::from_syntax_node(db, self.children[1].clone()) } pub fn trailing_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[2].clone()) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalBitNotPtr(pub SyntaxStablePtrId); -impl TerminalBitNotPtr { +pub struct TerminalTildePtr(pub SyntaxStablePtrId); +impl TerminalTildePtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalBitNot { - TerminalBitNot::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalTilde { + TerminalTilde::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalBitNotGreen(pub GreenId); -impl TypedSyntaxNode for TerminalBitNot { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalBitNot); - type StablePtr = TerminalBitNotPtr; - type Green = TerminalBitNotGreen; +pub struct TerminalTildeGreen(pub GreenId); +impl TypedSyntaxNode for TerminalTilde { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalTilde); + type StablePtr = TerminalTildePtr; + type Green = TerminalTildeGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TerminalBitNotGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalBitNot, + TerminalTildeGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalTilde, details: GreenNodeDetails::Node { children: vec![ Trivia::missing(db).0, - TokenBitNot::missing(db).0, + TokenTilde::missing(db).0, Trivia::missing(db).0, ], width: TextWidth::default(), @@ -23699,10 +23711,10 @@ impl TypedSyntaxNode for TerminalBitNot { let kind = node.kind(db); assert_eq!( kind, - SyntaxKind::TerminalBitNot, + SyntaxKind::TerminalTilde, "Unexpected SyntaxKind {:?}. Expected {:?}.", kind, - SyntaxKind::TerminalBitNot + SyntaxKind::TerminalTilde ); let children = db.get_children(node.clone()); Self { node, children } @@ -23711,7 +23723,7 @@ impl TypedSyntaxNode for TerminalBitNot { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TerminalBitNotPtr(self.node.0.stable_ptr) + TerminalTildePtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] @@ -25165,13 +25177,13 @@ impl TypedSyntaxNode for TerminalUnderscore { } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TokenXor { +pub struct TokenCaret { node: SyntaxNode, } -impl Token for TokenXor { +impl Token for TokenCaret { fn new_green(db: &dyn SyntaxGroup, text: SmolStr) -> Self::Green { - TokenXorGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TokenXor, + TokenCaretGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TokenCaret, details: GreenNodeDetails::Token(text), }))) } @@ -25184,28 +25196,28 @@ impl Token for TokenXor { } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenXorPtr(pub SyntaxStablePtrId); -impl TokenXorPtr { +pub struct TokenCaretPtr(pub SyntaxStablePtrId); +impl TokenCaretPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenXor { - TokenXor::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TokenCaret { + TokenCaret::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TokenXorGreen(pub GreenId); -impl TokenXorGreen { +pub struct TokenCaretGreen(pub GreenId); +impl TokenCaretGreen { pub fn text(&self, db: &dyn SyntaxGroup) -> SmolStr { extract_matches!(&db.lookup_intern_green(self.0).details, GreenNodeDetails::Token).clone() } } -impl TypedSyntaxNode for TokenXor { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenXor); - type StablePtr = TokenXorPtr; - type Green = TokenXorGreen; +impl TypedSyntaxNode for TokenCaret { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TokenCaret); + type StablePtr = TokenCaretPtr; + type Green = TokenCaretGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TokenXorGreen(db.intern_green(Arc::new(GreenNode { + TokenCaretGreen(db.intern_green(Arc::new(GreenNode { kind: SyntaxKind::TokenMissing, details: GreenNodeDetails::Token("".into()), }))) @@ -25214,7 +25226,7 @@ impl TypedSyntaxNode for TokenXor { match db.lookup_intern_green(node.0.green).details { GreenNodeDetails::Token(_) => Self { node }, GreenNodeDetails::Node { .. } => { - panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenXor) + panic!("Expected a token {:?}, not an internal node", SyntaxKind::TokenCaret) } } } @@ -25222,27 +25234,27 @@ impl TypedSyntaxNode for TokenXor { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TokenXorPtr(self.node.0.stable_ptr) + TokenCaretPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct TerminalXor { +pub struct TerminalCaret { node: SyntaxNode, children: Arc>, } -impl Terminal for TerminalXor { - const KIND: SyntaxKind = SyntaxKind::TerminalXor; - type TokenType = TokenXor; +impl Terminal for TerminalCaret { + const KIND: SyntaxKind = SyntaxKind::TerminalCaret; + type TokenType = TokenCaret; fn new_green( db: &dyn SyntaxGroup, leading_trivia: TriviaGreen, - token: <::TokenType as TypedSyntaxNode>::Green, + token: <::TokenType as TypedSyntaxNode>::Green, trailing_trivia: TriviaGreen, ) -> Self::Green { let children: Vec = vec![leading_trivia.0, token.0, trailing_trivia.0]; let width = children.iter().copied().map(|id| db.lookup_intern_green(id).width()).sum(); - TerminalXorGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalXor, + TerminalCaretGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalCaret, details: GreenNodeDetails::Node { children, width }, }))) } @@ -25250,40 +25262,40 @@ impl Terminal for TerminalXor { self.token(db).text(db) } } -impl TerminalXor { +impl TerminalCaret { pub fn leading_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[0].clone()) } - pub fn token(&self, db: &dyn SyntaxGroup) -> TokenXor { - TokenXor::from_syntax_node(db, self.children[1].clone()) + pub fn token(&self, db: &dyn SyntaxGroup) -> TokenCaret { + TokenCaret::from_syntax_node(db, self.children[1].clone()) } pub fn trailing_trivia(&self, db: &dyn SyntaxGroup) -> Trivia { Trivia::from_syntax_node(db, self.children[2].clone()) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalXorPtr(pub SyntaxStablePtrId); -impl TerminalXorPtr { +pub struct TerminalCaretPtr(pub SyntaxStablePtrId); +impl TerminalCaretPtr { pub fn untyped(&self) -> SyntaxStablePtrId { self.0 } - pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalXor { - TerminalXor::from_syntax_node(db, self.0.lookup(db)) + pub fn lookup(&self, db: &dyn SyntaxGroup) -> TerminalCaret { + TerminalCaret::from_syntax_node(db, self.0.lookup(db)) } } #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct TerminalXorGreen(pub GreenId); -impl TypedSyntaxNode for TerminalXor { - const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalXor); - type StablePtr = TerminalXorPtr; - type Green = TerminalXorGreen; +pub struct TerminalCaretGreen(pub GreenId); +impl TypedSyntaxNode for TerminalCaret { + const OPTIONAL_KIND: Option = Some(SyntaxKind::TerminalCaret); + type StablePtr = TerminalCaretPtr; + type Green = TerminalCaretGreen; fn missing(db: &dyn SyntaxGroup) -> Self::Green { - TerminalXorGreen(db.intern_green(Arc::new(GreenNode { - kind: SyntaxKind::TerminalXor, + TerminalCaretGreen(db.intern_green(Arc::new(GreenNode { + kind: SyntaxKind::TerminalCaret, details: GreenNodeDetails::Node { children: vec![ Trivia::missing(db).0, - TokenXor::missing(db).0, + TokenCaret::missing(db).0, Trivia::missing(db).0, ], width: TextWidth::default(), @@ -25294,10 +25306,10 @@ impl TypedSyntaxNode for TerminalXor { let kind = node.kind(db); assert_eq!( kind, - SyntaxKind::TerminalXor, + SyntaxKind::TerminalCaret, "Unexpected SyntaxKind {:?}. Expected {:?}.", kind, - SyntaxKind::TerminalXor + SyntaxKind::TerminalCaret ); let children = db.get_children(node.clone()); Self { node, children } @@ -25306,7 +25318,7 @@ impl TypedSyntaxNode for TerminalXor { self.node.clone() } fn stable_ptr(&self) -> Self::StablePtr { - TerminalXorPtr(self.node.0.stable_ptr) + TerminalCaretPtr(self.node.0.stable_ptr) } } #[derive(Clone, Debug, Eq, Hash, PartialEq)] diff --git a/crates/cairo-lang-syntax/src/node/key_fields.rs b/crates/cairo-lang-syntax/src/node/key_fields.rs index 993c15f3d1e..d6644559890 100644 --- a/crates/cairo-lang-syntax/src/node/key_fields.rs +++ b/crates/cairo-lang-syntax/src/node/key_fields.rs @@ -499,12 +499,12 @@ pub fn get_key_fields(kind: SyntaxKind, children: &[GreenId]) -> Vec { SyntaxKind::TerminalComma => { vec![] } - SyntaxKind::TokenDiv => vec![], - SyntaxKind::TerminalDiv => { + SyntaxKind::TokenSlash => vec![], + SyntaxKind::TerminalSlash => { vec![] } - SyntaxKind::TokenDivEq => vec![], - SyntaxKind::TerminalDivEq => { + SyntaxKind::TokenSlashEq => vec![], + SyntaxKind::TerminalSlashEq => { vec![] } SyntaxKind::TokenDot => vec![], @@ -559,8 +559,8 @@ pub fn get_key_fields(kind: SyntaxKind, children: &[GreenId]) -> Vec { SyntaxKind::TerminalLT => { vec![] } - SyntaxKind::TokenMatchArrow => vec![], - SyntaxKind::TerminalMatchArrow => { + SyntaxKind::TokenFatArrow => vec![], + SyntaxKind::TerminalFatArrow => { vec![] } SyntaxKind::TokenMinus => vec![], @@ -571,32 +571,32 @@ pub fn get_key_fields(kind: SyntaxKind, children: &[GreenId]) -> Vec { SyntaxKind::TerminalMinusEq => { vec![] } - SyntaxKind::TokenMod => vec![], - SyntaxKind::TerminalMod => { + SyntaxKind::TokenPercent => vec![], + SyntaxKind::TerminalPercent => { vec![] } - SyntaxKind::TokenModEq => vec![], - SyntaxKind::TerminalModEq => { + SyntaxKind::TokenPercentEq => vec![], + SyntaxKind::TerminalPercentEq => { vec![] } - SyntaxKind::TokenMul => vec![], - SyntaxKind::TerminalMul => { + SyntaxKind::TokenStar => vec![], + SyntaxKind::TerminalStar => { vec![] } - SyntaxKind::TokenMulEq => vec![], - SyntaxKind::TerminalMulEq => { + SyntaxKind::TokenStarEq => vec![], + SyntaxKind::TerminalStarEq => { vec![] } SyntaxKind::TokenNeq => vec![], SyntaxKind::TerminalNeq => { vec![] } - SyntaxKind::TokenNot => vec![], - SyntaxKind::TerminalNot => { + SyntaxKind::TokenBang => vec![], + SyntaxKind::TerminalBang => { vec![] } - SyntaxKind::TokenBitNot => vec![], - SyntaxKind::TerminalBitNot => { + SyntaxKind::TokenTilde => vec![], + SyntaxKind::TerminalTilde => { vec![] } SyntaxKind::TokenOr => vec![], @@ -639,8 +639,8 @@ pub fn get_key_fields(kind: SyntaxKind, children: &[GreenId]) -> Vec { SyntaxKind::TerminalUnderscore => { vec![] } - SyntaxKind::TokenXor => vec![], - SyntaxKind::TerminalXor => { + SyntaxKind::TokenCaret => vec![], + SyntaxKind::TerminalCaret => { vec![] } SyntaxKind::SyntaxFile => { diff --git a/crates/cairo-lang-syntax/src/node/kind.rs b/crates/cairo-lang-syntax/src/node/kind.rs index 692a86e4583..6e12fdc4396 100644 --- a/crates/cairo-lang-syntax/src/node/kind.rs +++ b/crates/cairo-lang-syntax/src/node/kind.rs @@ -207,10 +207,10 @@ pub enum SyntaxKind { TerminalColonColon, TokenComma, TerminalComma, - TokenDiv, - TerminalDiv, - TokenDivEq, - TerminalDivEq, + TokenSlash, + TerminalSlash, + TokenSlashEq, + TerminalSlashEq, TokenDot, TerminalDot, TokenDotDot, @@ -237,26 +237,26 @@ pub enum SyntaxKind { TerminalLParen, TokenLT, TerminalLT, - TokenMatchArrow, - TerminalMatchArrow, + TokenFatArrow, + TerminalFatArrow, TokenMinus, TerminalMinus, TokenMinusEq, TerminalMinusEq, - TokenMod, - TerminalMod, - TokenModEq, - TerminalModEq, - TokenMul, - TerminalMul, - TokenMulEq, - TerminalMulEq, + TokenPercent, + TerminalPercent, + TokenPercentEq, + TerminalPercentEq, + TokenStar, + TerminalStar, + TokenStarEq, + TerminalStarEq, TokenNeq, TerminalNeq, - TokenNot, - TerminalNot, - TokenBitNot, - TerminalBitNot, + TokenBang, + TerminalBang, + TokenTilde, + TerminalTilde, TokenOr, TerminalOr, TokenOrOr, @@ -277,8 +277,8 @@ pub enum SyntaxKind { TerminalSemicolon, TokenUnderscore, TerminalUnderscore, - TokenXor, - TerminalXor, + TokenCaret, + TerminalCaret, SyntaxFile, TokenSingleLineComment, TokenWhitespace, @@ -329,8 +329,8 @@ impl SyntaxKind { | SyntaxKind::TokenColon | SyntaxKind::TokenColonColon | SyntaxKind::TokenComma - | SyntaxKind::TokenDiv - | SyntaxKind::TokenDivEq + | SyntaxKind::TokenSlash + | SyntaxKind::TokenSlashEq | SyntaxKind::TokenDot | SyntaxKind::TokenDotDot | SyntaxKind::TokenEndOfFile @@ -344,16 +344,16 @@ impl SyntaxKind { | SyntaxKind::TokenLE | SyntaxKind::TokenLParen | SyntaxKind::TokenLT - | SyntaxKind::TokenMatchArrow + | SyntaxKind::TokenFatArrow | SyntaxKind::TokenMinus | SyntaxKind::TokenMinusEq - | SyntaxKind::TokenMod - | SyntaxKind::TokenModEq - | SyntaxKind::TokenMul - | SyntaxKind::TokenMulEq + | SyntaxKind::TokenPercent + | SyntaxKind::TokenPercentEq + | SyntaxKind::TokenStar + | SyntaxKind::TokenStarEq | SyntaxKind::TokenNeq - | SyntaxKind::TokenNot - | SyntaxKind::TokenBitNot + | SyntaxKind::TokenBang + | SyntaxKind::TokenTilde | SyntaxKind::TokenOr | SyntaxKind::TokenOrOr | SyntaxKind::TokenPlus @@ -364,7 +364,7 @@ impl SyntaxKind { | SyntaxKind::TokenRParen | SyntaxKind::TokenSemicolon | SyntaxKind::TokenUnderscore - | SyntaxKind::TokenXor + | SyntaxKind::TokenCaret | SyntaxKind::TokenSingleLineComment | SyntaxKind::TokenWhitespace | SyntaxKind::TokenNewline @@ -414,8 +414,8 @@ impl SyntaxKind { | SyntaxKind::TerminalColon | SyntaxKind::TerminalColonColon | SyntaxKind::TerminalComma - | SyntaxKind::TerminalDiv - | SyntaxKind::TerminalDivEq + | SyntaxKind::TerminalSlash + | SyntaxKind::TerminalSlashEq | SyntaxKind::TerminalDot | SyntaxKind::TerminalDotDot | SyntaxKind::TerminalEndOfFile @@ -429,16 +429,16 @@ impl SyntaxKind { | SyntaxKind::TerminalLE | SyntaxKind::TerminalLParen | SyntaxKind::TerminalLT - | SyntaxKind::TerminalMatchArrow + | SyntaxKind::TerminalFatArrow | SyntaxKind::TerminalMinus | SyntaxKind::TerminalMinusEq - | SyntaxKind::TerminalMod - | SyntaxKind::TerminalModEq - | SyntaxKind::TerminalMul - | SyntaxKind::TerminalMulEq + | SyntaxKind::TerminalPercent + | SyntaxKind::TerminalPercentEq + | SyntaxKind::TerminalStar + | SyntaxKind::TerminalStarEq | SyntaxKind::TerminalNeq - | SyntaxKind::TerminalNot - | SyntaxKind::TerminalBitNot + | SyntaxKind::TerminalBang + | SyntaxKind::TerminalTilde | SyntaxKind::TerminalOr | SyntaxKind::TerminalOrOr | SyntaxKind::TerminalPlus @@ -449,7 +449,7 @@ impl SyntaxKind { | SyntaxKind::TerminalRParen | SyntaxKind::TerminalSemicolon | SyntaxKind::TerminalUnderscore - | SyntaxKind::TerminalXor + | SyntaxKind::TerminalCaret ) } pub fn is_keyword_token(&self) -> bool {