Skip to content

Commit

Permalink
Print all edge labels in snapshot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mjoerussell committed Jan 3, 2025
1 parent 790f5d5 commit 4b5c352
Show file tree
Hide file tree
Showing 954 changed files with 955 additions and 964 deletions.
1 change: 0 additions & 1 deletion crates/metaslang/cst/generated/public_api.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions crates/metaslang/cst/src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ impl<T: KindTypes> Cursor<T> {
self.node.clone()
}

pub fn has_open_parent(&self) -> bool {
matches!(self.parent, Parent::Connected(_))
}

pub fn label(&self) -> T::EdgeLabel {
match &self.parent {
Parent::Connected(parent) => {
Expand Down
12 changes: 4 additions & 8 deletions crates/solidity/outputs/cargo/tests/src/cst_output/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,10 @@ fn render_key(cursor: &mut Cursor) -> String {
Node::Terminal(terminal) => terminal.kind.to_string(),
};

if cursor.has_open_parent() {
format!(
"({label}꞉ {kind})",
label = cursor.label().as_ref().to_snake_case()
)
} else {
format!("({kind})")
}
format!(
"({label}꞉ {kind})",
label = cursor.label().as_ref().to_snake_case()
)
}

fn render_value(cursor: &mut Cursor, source: &str) -> String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Source: >
Errors: []

Tree:
- (AssemblyStatement): # 'assembly "evmasm" ("memory-safe") {\n\n}\n' (0..39)
- (root꞉ AssemblyStatement): # 'assembly "evmasm" ("memory-safe") {\n\n}\n' (0..39)
- (assembly_keyword꞉ AssemblyKeyword): "assembly" # (0..8)
- (label꞉ StringLiteral): # ' "evmasm"' (8..17)
- (leading_trivia꞉ Whitespace): " " # (8..9)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Errors: # 1 total
───╯
Tree:
- (Block): # "// Make sure we don't panic when encountering an u..." (0..122)
- (root꞉ Block): # "// Make sure we don't panic when encountering an u..." (0..122)
- (leading_trivia꞉ SingleLineComment): "// Make sure we don't panic when encountering an u..." # (0..93)
- (leading_trivia꞉ EndOfLine): "\n" # (93..94)
- (leading_trivia꞉ EndOfLine): "\n" # (94..95)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Errors: # 1 total
───╯
Tree:
- (Block): # "// Make sure we don't panic when encountering an u..." (0..122)
- (root꞉ Block): # "// Make sure we don't panic when encountering an u..." (0..122)
- (leading_trivia꞉ SingleLineComment): "// Make sure we don't panic when encountering an u..." # (0..93)
- (leading_trivia꞉ EndOfLine): "\n" # (93..94)
- (leading_trivia꞉ EndOfLine): "\n" # (94..95)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Errors: # 1 total
───╯
Tree:
- (Block): # "{ unchecked { x = 1; } }" (0..24)
- (root꞉ Block): # "{ unchecked { x = 1; } }" (0..24)
- (open_brace꞉ OpenBrace): "{" # (0..1)
- (statements꞉ Statements): # " unchecked " (1..12)
- (item꞉ Statement) ► (variant꞉ VariableDeclarationStatement): # " unchecked " (1..12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Errors: # 1 total
───╯
Tree:
- (Block): # "{ unchecked { x = 1; } }" (0..24)
- (root꞉ Block): # "{ unchecked { x = 1; } }" (0..24)
- (open_brace꞉ OpenBrace): "{" # (0..1)
- (statements꞉ Statements): [] # (1..1)
- (leading_trivia꞉ Whitespace): " " # (1..2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Errors: # 1 total
───╯
Tree:
- (Block): # "{ unchecked { x = 1; } }" (0..24)
- (root꞉ Block): # "{ unchecked { x = 1; } }" (0..24)
- (open_brace꞉ OpenBrace): "{" # (0..1)
- (statements꞉ Statements): [] # (1..1)
- (leading_trivia꞉ Whitespace): " " # (1..2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Errors: # 1 total
───╯
Tree:
- (Block): # "{ unchecked { x = 1; } }" (0..24)
- (root꞉ Block): # "{ unchecked { x = 1; } }" (0..24)
- (open_brace꞉ OpenBrace): "{" # (0..1)
- (statements꞉ Statements): [] # (1..1)
- (leading_trivia꞉ Whitespace): " " # (1..2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Errors: # 1 total
───╯
Tree:
- (Block): # "{ unchecked { x = 1; } }" (0..24)
- (root꞉ Block): # "{ unchecked { x = 1; } }" (0..24)
- (open_brace꞉ OpenBrace): "{" # (0..1)
- (statements꞉ Statements): [] # (1..1)
- (leading_trivia꞉ Whitespace): " " # (1..2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (Block): # "{ unchecked { x = 1; } }" (0..24)
- (root꞉ Block): # "{ unchecked { x = 1; } }" (0..24)
- (open_brace꞉ OpenBrace): "{" # (0..1)
- (statements꞉ Statements): # " unchecked { x = 1; }" (1..22)
- (item꞉ Statement) ► (variant꞉ UncheckedBlock): # " unchecked { x = 1; }" (1..22)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Errors: # 1 total
───╯
Tree:
- (BreakStatement): # "break invalid ;\n" (0..16)
- (root꞉ BreakStatement): # "break invalid ;\n" (0..16)
- (break_keyword꞉ BreakKeyword): "break" # (0..5)
- (leading_trivia꞉ Whitespace): " " # (5..6)
- (root꞉ UNRECOGNIZED): "invalid " # (6..14)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (BreakStatement): # "break ;\n" (0..8)
- (root꞉ BreakStatement): # "break ;\n" (0..8)
- (break_keyword꞉ BreakKeyword): "break" # (0..5)
- (leading_trivia꞉ Whitespace): " " # (5..6)
- (semicolon꞉ Semicolon): ";" # (6..7)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (ConditionalExpression): # "foo ? true : false" (0..18)
- (root꞉ ConditionalExpression): # "foo ? true : false" (0..18)
- (operand꞉ Expression) ► (variant꞉ Identifier): "foo" # (0..3)
- (leading_trivia꞉ Whitespace): " " # (3..4)
- (question_mark꞉ QuestionMark): "?" # (4..5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (ConditionalExpression): # "(foo == bar) ? true : false" (0..27)
- (root꞉ ConditionalExpression): # "(foo == bar) ? true : false" (0..27)
- (operand꞉ Expression) ► (variant꞉ TupleExpression): # "(foo == bar)" (0..12)
- (open_paren꞉ OpenParen): "(" # (0..1)
- (items꞉ TupleValues): # "foo == bar" (1..11)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (ConditionalExpression): # "foo ? (a + b) : (c + d)" (0..23)
- (root꞉ ConditionalExpression): # "foo ? (a + b) : (c + d)" (0..23)
- (operand꞉ Expression) ► (variant꞉ Identifier): "foo" # (0..3)
- (leading_trivia꞉ Whitespace): " " # (3..4)
- (question_mark꞉ QuestionMark): "?" # (4..5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (ConditionalExpression): # "foo ? a == b ? a + b * c : a + b * c + d : !bar ? ..." (0..63)
- (root꞉ ConditionalExpression): # "foo ? a == b ? a + b * c : a + b * c + d : !bar ? ..." (0..63)
- (operand꞉ Expression) ► (variant꞉ Identifier): "foo" # (0..3)
- (leading_trivia꞉ Whitespace): " " # (3..4)
- (question_mark꞉ QuestionMark): "?" # (4..5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Errors: # 1 total
───╯
Tree:
- (UNRECOGNIZED): "int constant foo = 0;" # (0..21)
- (root꞉ UNRECOGNIZED): "int constant foo = 0;" # (0..21)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (ConstantDefinition): # "int constant foo = 0;" (0..21)
- (root꞉ ConstantDefinition): # "int constant foo = 0;" (0..21)
- (type_name꞉ TypeName) ► (variant꞉ ElementaryType) ► (variant꞉ IntKeyword): "int" # (0..3)
- (leading_trivia꞉ Whitespace): " " # (3..4)
- (constant_keyword꞉ ConstantKeyword): "constant" # (4..12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Errors: # 1 total
───╯
Tree:
- (UNRECOGNIZED): "constructor () override {}\n" # (0..27)
- (root꞉ UNRECOGNIZED): "constructor () override {}\n" # (0..27)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (ConstructorDefinition): # "constructor () override {}\n" (0..27)
- (root꞉ ConstructorDefinition): # "constructor () override {}\n" (0..27)
- (constructor_keyword꞉ ConstructorKeyword): "constructor" # (0..11)
- (parameters꞉ ParametersDeclaration): # " ()" (11..14)
- (leading_trivia꞉ Whitespace): " " # (11..12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Errors: # 1 total
───╯
Tree:
- (ConstructorDefinition): # "constructor () override {}\n" (0..27)
- (root꞉ ConstructorDefinition): # "constructor () override {}\n" (0..27)
- (constructor_keyword꞉ ConstructorKeyword): "constructor" # (0..11)
- (parameters꞉ ParametersDeclaration): # " ()" (11..14)
- (leading_trivia꞉ Whitespace): " " # (11..12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (ConstructorDefinition): # "constructor () override {}\n" (0..27)
- (root꞉ ConstructorDefinition): # "constructor () override {}\n" (0..27)
- (constructor_keyword꞉ ConstructorKeyword): "constructor" # (0..11)
- (parameters꞉ ParametersDeclaration): # " ()" (11..14)
- (leading_trivia꞉ Whitespace): " " # (11..12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Errors: # 1 total
───╯
Tree:
- (ConstructorDefinition): # "constructor () override {}\n" (0..27)
- (root꞉ ConstructorDefinition): # "constructor () override {}\n" (0..27)
- (constructor_keyword꞉ ConstructorKeyword): "constructor" # (0..11)
- (parameters꞉ ParametersDeclaration): # " ()" (11..14)
- (leading_trivia꞉ Whitespace): " " # (11..12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Errors: # 1 total
───╯
Tree:
- (UNRECOGNIZED): "constructor () {}" # (0..17)
- (root꞉ UNRECOGNIZED): "constructor () {}" # (0..17)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (ConstructorDefinition): # "constructor () {}" (0..17)
- (root꞉ ConstructorDefinition): # "constructor () {}" (0..17)
- (constructor_keyword꞉ ConstructorKeyword): "constructor" # (0..11)
- (parameters꞉ ParametersDeclaration): # " ()" (11..14)
- (leading_trivia꞉ Whitespace): " " # (11..12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Errors: # 1 total
───╯
Tree:
- (UNRECOGNIZED): "constructor () virtual {}\n" # (0..26)
- (root꞉ UNRECOGNIZED): "constructor () virtual {}\n" # (0..26)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (ConstructorDefinition): # "constructor () virtual {}\n" (0..26)
- (root꞉ ConstructorDefinition): # "constructor () virtual {}\n" (0..26)
- (constructor_keyword꞉ ConstructorKeyword): "constructor" # (0..11)
- (parameters꞉ ParametersDeclaration): # " ()" (11..14)
- (leading_trivia꞉ Whitespace): " " # (11..12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (ConstructorDefinition): # "constructor () virtual {}\n" (0..26)
- (root꞉ ConstructorDefinition): # "constructor () virtual {}\n" (0..26)
- (constructor_keyword꞉ ConstructorKeyword): "constructor" # (0..11)
- (parameters꞉ ParametersDeclaration): # " ()" (11..14)
- (leading_trivia꞉ Whitespace): " " # (11..12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Errors: # 1 total
───╯
Tree:
- (ConstructorDefinition): # "constructor () virtual {}\n" (0..26)
- (root꞉ ConstructorDefinition): # "constructor () virtual {}\n" (0..26)
- (constructor_keyword꞉ ConstructorKeyword): "constructor" # (0..11)
- (parameters꞉ ParametersDeclaration): # " ()" (11..14)
- (leading_trivia꞉ Whitespace): " " # (11..12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Errors: # 1 total
───╯
Tree:
- (UNRECOGNIZED): "abstract contract Sample {}\n" # (0..28)
- (root꞉ UNRECOGNIZED): "abstract contract Sample {}\n" # (0..28)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (ContractDefinition): # "abstract contract Sample {}\n" (0..28)
- (root꞉ ContractDefinition): # "abstract contract Sample {}\n" (0..28)
- (abstract_keyword꞉ AbstractKeyword): "abstract" # (0..8)
- (leading_trivia꞉ Whitespace): " " # (8..9)
- (contract_keyword꞉ ContractKeyword): "contract" # (9..17)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Errors: # 1 total
───╯
Tree:
- (ContractDefinition): # "// Constructors introduced in 0.4.22 but `construc..." (0..191)
- (root꞉ ContractDefinition): # "// Constructors introduced in 0.4.22 but `construc..." (0..191)
- (leading_trivia꞉ SingleLineComment): "// Constructors introduced in 0.4.22 but `construc..." # (0..91)
- (leading_trivia꞉ EndOfLine): "\n" # (91..92)
- (leading_trivia꞉ EndOfLine): "\n" # (92..93)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Source: >
Errors: []

Tree:
- (ContractDefinition): # "// Constructors introduced in 0.4.22 but `construc..." (0..191)
- (root꞉ ContractDefinition): # "// Constructors introduced in 0.4.22 but `construc..." (0..191)
- (leading_trivia꞉ SingleLineComment): "// Constructors introduced in 0.4.22 but `construc..." # (0..91)
- (leading_trivia꞉ EndOfLine): "\n" # (91..92)
- (leading_trivia꞉ EndOfLine): "\n" # (92..93)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Errors: # 1 total
───╯
Tree:
- (ContractDefinition): # "// Constructors introduced in 0.4.22 but `construc..." (0..191)
- (root꞉ ContractDefinition): # "// Constructors introduced in 0.4.22 but `construc..." (0..191)
- (leading_trivia꞉ SingleLineComment): "// Constructors introduced in 0.4.22 but `construc..." # (0..91)
- (leading_trivia꞉ EndOfLine): "\n" # (91..92)
- (leading_trivia꞉ EndOfLine): "\n" # (92..93)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Errors: # 1 total
───╯
Tree:
- (ContractDefinition): # "// Emitting events introduced syntactically in 0.4..." (0..243)
- (root꞉ ContractDefinition): # "// Emitting events introduced syntactically in 0.4..." (0..243)
- (leading_trivia꞉ SingleLineComment): "// Emitting events introduced syntactically in 0.4..." # (0..101)
- (leading_trivia꞉ EndOfLine): "\n" # (101..102)
- (leading_trivia꞉ EndOfLine): "\n" # (102..103)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Source: >
Errors: []

Tree:
- (ContractDefinition): # "// Emitting events introduced syntactically in 0.4..." (0..243)
- (root꞉ ContractDefinition): # "// Emitting events introduced syntactically in 0.4..." (0..243)
- (leading_trivia꞉ SingleLineComment): "// Emitting events introduced syntactically in 0.4..." # (0..101)
- (leading_trivia꞉ EndOfLine): "\n" # (101..102)
- (leading_trivia꞉ EndOfLine): "\n" # (102..103)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Errors: # 1 total
───╯
Tree:
- (ContractDefinition): # "// Emitting events introduced syntactically in 0.4..." (0..243)
- (root꞉ ContractDefinition): # "// Emitting events introduced syntactically in 0.4..." (0..243)
- (leading_trivia꞉ SingleLineComment): "// Emitting events introduced syntactically in 0.4..." # (0..101)
- (leading_trivia꞉ EndOfLine): "\n" # (101..102)
- (leading_trivia꞉ EndOfLine): "\n" # (102..103)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Source: >
Errors: []

Tree:
- (ContractDefinition): # "contract Sample {}\n" (0..19)
- (root꞉ ContractDefinition): # "contract Sample {}\n" (0..19)
- (contract_keyword꞉ ContractKeyword): "contract" # (0..8)
- (leading_trivia꞉ Whitespace): " " # (8..9)
- (name꞉ Identifier): "Sample" # (9..15)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Errors: # 1 total
───╯
Tree:
- (ContractDefinition): # "// SPDX-License-Identifier: MIT\ncontract ABC {\n f..." (0..352)
- (root꞉ ContractDefinition): # "// SPDX-License-Identifier: MIT\ncontract ABC {\n f..." (0..352)
- (leading_trivia꞉ SingleLineComment): "// SPDX-License-Identifier: MIT" # (0..31)
- (leading_trivia꞉ EndOfLine): "\n" # (31..32)
- (contract_keyword꞉ ContractKeyword): "contract" # (32..40)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Errors: # 1 total
───╯
Tree:
- (ContractDefinition): # "// SPDX-License-Identifier: MIT\ncontract ABC {\n f..." (0..352)
- (root꞉ ContractDefinition): # "// SPDX-License-Identifier: MIT\ncontract ABC {\n f..." (0..352)
- (leading_trivia꞉ SingleLineComment): "// SPDX-License-Identifier: MIT" # (0..31)
- (leading_trivia꞉ EndOfLine): "\n" # (31..32)
- (contract_keyword꞉ ContractKeyword): "contract" # (32..40)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Source: >
Errors: []

Tree:
- (ContractDefinition): # "// SPDX-License-Identifier: MIT\ncontract ABC {\n f..." (0..352)
- (root꞉ ContractDefinition): # "// SPDX-License-Identifier: MIT\ncontract ABC {\n f..." (0..352)
- (leading_trivia꞉ SingleLineComment): "// SPDX-License-Identifier: MIT" # (0..31)
- (leading_trivia꞉ EndOfLine): "\n" # (31..32)
- (contract_keyword꞉ ContractKeyword): "contract" # (32..40)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Source: >
Errors: []

Tree:
- (ContractDefinition): # "/*\n * Lorem ipsum dolor sit amet, consectetur adip..." (0..2001)
- (root꞉ ContractDefinition): # "/*\n * Lorem ipsum dolor sit amet, consectetur adip..." (0..2001)
- (leading_trivia꞉ MultiLineComment): "/*\n * Lorem ipsum dolor sit amet, consectetur adip..." # (0..1985)
- (leading_trivia꞉ EndOfLine): "\n" # (1985..1986)
- (contract_keyword꞉ ContractKeyword): "contract" # (1986..1994)
Expand Down
Loading

0 comments on commit 4b5c352

Please sign in to comment.