From 5db05e86f09f075862f8a2873f31ceb4919d4dba Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Thu, 21 Nov 2024 15:23:21 -0300 Subject: [PATCH 01/22] First attempt: re-parse leading trivia and advance index accordingly --- .../parser/parser_support/parser_function.rs | 18 ++++++++++++++---- .../parser/parser_support/parser_function.rs | 18 ++++++++++++++---- .../generated/0.4.11-failure.yml | 10 ++++------ .../generated/0.4.25-failure.yml | 9 ++++----- .../generated/0.4.25-failure.yml | 9 ++++----- .../try_catch/generated/0.4.11-failure.yml | 4 ++-- .../with_var/generated/0.5.0-failure.yml | 9 ++++----- .../generated/0.6.0-failure.yml | 9 ++++----- .../parser/parser_support/parser_function.rs | 18 ++++++++++++++---- 9 files changed, 64 insertions(+), 40 deletions(-) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs index 2cb239078e..964268c940 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs @@ -57,16 +57,26 @@ where ParserResult::PrattOperatorMatch(..) => unreachable!("PrattOperatorMatch is internal"), ParserResult::NoMatch(no_match) => { - let kind = if input.is_empty() { - TerminalKind::MISSING + let (kind, start) = if input.is_empty() { + (TerminalKind::MISSING, TextIndex::ZERO) } else { - TerminalKind::UNRECOGNIZED + let mut stream = ParserContext::new(input); + if let ParserResult::Match(trivia) = Lexer::leading_trivia(parser, &mut stream) + { + let mut ti = TextIndex::ZERO; + trivia.nodes.iter().for_each(|node| { + node.unparse().chars().for_each(|c| ti.advance(c, None)); + }); + (TerminalKind::UNRECOGNIZED, ti) + } else { + (TerminalKind::UNRECOGNIZED, TextIndex::ZERO) + } }; ParseOutput { parse_tree: Node::terminal(kind, input.to_string()), errors: vec![ParseError::new( - TextIndex::ZERO..input.into(), + start..input.into(), no_match.expected_terminals, )], } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index 57f5d3ed4b..f271e6dfe2 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -59,16 +59,26 @@ where ParserResult::PrattOperatorMatch(..) => unreachable!("PrattOperatorMatch is internal"), ParserResult::NoMatch(no_match) => { - let kind = if input.is_empty() { - TerminalKind::MISSING + let (kind, start) = if input.is_empty() { + (TerminalKind::MISSING, TextIndex::ZERO) } else { - TerminalKind::UNRECOGNIZED + let mut stream = ParserContext::new(input); + if let ParserResult::Match(trivia) = Lexer::leading_trivia(parser, &mut stream) + { + let mut ti = TextIndex::ZERO; + trivia.nodes.iter().for_each(|node| { + node.unparse().chars().for_each(|c| ti.advance(c, None)); + }); + (TerminalKind::UNRECOGNIZED, ti) + } else { + (TerminalKind::UNRECOGNIZED, TextIndex::ZERO) + } }; ParseOutput { parse_tree: Node::terminal(kind, input.to_string()), errors: vec![ParseError::new( - TextIndex::ZERO..input.into(), + start..input.into(), no_match.expected_terminals, )], } diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unicode_in_doc_comments/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unicode_in_doc_comments/generated/0.4.11-failure.yml index 53b662c853..b92ae184b3 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unicode_in_doc_comments/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unicode_in_doc_comments/generated/0.4.11-failure.yml @@ -9,13 +9,11 @@ Source: > Errors: # 1 total - > Error: Expected ContractKeyword. - ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/unicode_in_doc_comments/input.sol:1:1] + ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/unicode_in_doc_comments/input.sol:4:1] │ - 1 │ ╭─▶ // ╒════════════════════════════════════════════════════════════════╕ - ┆ ┆ - 4 │ ├─▶ unexpected - │ │ - │ ╰──────────────── Error occurred here. + 4 │ unexpected + │ ─────┬───── + │ ╰─────── Error occurred here. ───╯ Tree: diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_ascii/generated/0.4.25-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_ascii/generated/0.4.25-failure.yml index 9d82a9cbc4..fa426b798c 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_ascii/generated/0.4.25-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_ascii/generated/0.4.25-failure.yml @@ -7,12 +7,11 @@ Source: > Errors: # 1 total - > Error: Expected DoubleQuotedStringLiteral or SingleQuotedStringLiteral. - ╭─[crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_ascii/input.sol:1:1] + ╭─[crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_ascii/input.sol:2:1] │ - 1 │ ╭─▶ // Disallowed post 0.4.25 - 2 │ ├─▶ "\a" - │ │ - │ ╰────────── Error occurred here. + 2 │ "\a" + │ ──┬── + │ ╰──── Error occurred here. ───╯ Tree: diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_unicode/generated/0.4.25-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_unicode/generated/0.4.25-failure.yml index 687e39fa6e..48bab2bab6 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_unicode/generated/0.4.25-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_unicode/generated/0.4.25-failure.yml @@ -7,12 +7,11 @@ Source: > Errors: # 1 total - > Error: Expected DoubleQuotedStringLiteral or SingleQuotedStringLiteral. - ╭─[crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_unicode/input.sol:1:1] + ╭─[crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_unicode/input.sol:2:1] │ - 1 │ ╭─▶ // Disallowed post 0.4.25 - 2 │ ├─▶ "\✅" - │ │ - │ ╰─────────── Error occurred here. + 2 │ "\✅" + │ ──┬─── + │ ╰───── Error occurred here. ───╯ Tree: diff --git a/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/generated/0.4.11-failure.yml index 112b08de0b..893a1bbd44 100644 --- a/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/generated/0.4.11-failure.yml @@ -12,9 +12,9 @@ Source: > Errors: # 1 total - > Error: Expected end of file. - ╭─[crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/input.sol:1:1] + ╭─[crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/input.sol:4:1] │ - 1 │ ╭─▶ // Make sure that error recovery won't lead to misparsing + 4 │ ╭─▶ try foo() { ┆ ┆ 7 │ ├─▶ } │ │ diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_var/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_var/generated/0.5.0-failure.yml index 35c47c54f3..124aed234c 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_var/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_var/generated/0.5.0-failure.yml @@ -7,12 +7,11 @@ Source: > Errors: # 1 total - > Error: Expected OpenParen. - ╭─[crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_var/input.sol:1:1] + ╭─[crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_var/input.sol:2:1] │ - 1 │ ╭─▶ // "var" should be disabled in "0.5.0": - 2 │ ├─▶ var (foo, bar) = rhs; - │ │ - │ ╰─────────────────────────── Error occurred here. + 2 │ var (foo, bar) = rhs; + │ ───────────┬────────── + │ ╰──────────── Error occurred here. ───╯ Tree: diff --git a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/generated/0.6.0-failure.yml index c588db9952..df7c141a1b 100644 --- a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/generated/0.6.0-failure.yml @@ -7,12 +7,11 @@ Source: > Errors: # 1 total - > Error: Expected end of file. - ╭─[crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/input.sol:1:1] + ╭─[crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/input.sol:2:1] │ - 1 │ ╭─▶ // Split into `view` and `pure` in 0.4.16 - 2 │ ├─▶ function () constant {} - │ │ - │ ╰───────────────────────────── Error occurred here. + 2 │ function () constant {} + │ ────────────┬─────────── + │ ╰───────────── Error occurred here. ───╯ Tree: diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index 57f5d3ed4b..f271e6dfe2 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -59,16 +59,26 @@ where ParserResult::PrattOperatorMatch(..) => unreachable!("PrattOperatorMatch is internal"), ParserResult::NoMatch(no_match) => { - let kind = if input.is_empty() { - TerminalKind::MISSING + let (kind, start) = if input.is_empty() { + (TerminalKind::MISSING, TextIndex::ZERO) } else { - TerminalKind::UNRECOGNIZED + let mut stream = ParserContext::new(input); + if let ParserResult::Match(trivia) = Lexer::leading_trivia(parser, &mut stream) + { + let mut ti = TextIndex::ZERO; + trivia.nodes.iter().for_each(|node| { + node.unparse().chars().for_each(|c| ti.advance(c, None)); + }); + (TerminalKind::UNRECOGNIZED, ti) + } else { + (TerminalKind::UNRECOGNIZED, TextIndex::ZERO) + } }; ParseOutput { parse_tree: Node::terminal(kind, input.to_string()), errors: vec![ParseError::new( - TextIndex::ZERO..input.into(), + start..input.into(), no_match.expected_terminals, )], } From 86540f43295133de507d5b8a75008e2adc180b84 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Mon, 25 Nov 2024 15:07:10 -0300 Subject: [PATCH 02/22] Adding nodes in NoMatch --- .../crate/src/runtime/parser/lexer/mod.rs | 4 +- .../parser/parser_support/choice_helper.rs | 2 +- .../parser/parser_support/parser_result.rs | 16 ++-- .../runtime/parser/parser_support/recovery.rs | 4 +- .../parser_support/repetition_helper.rs | 11 ++- .../parser/parser_support/separated_helper.rs | 2 +- .../codegen/precedence_parser_definition.rs | 4 +- .../src/generated/parser/generated/parser.rs | 84 +++++++++---------- .../crate/src/generated/parser/lexer/mod.rs | 4 +- .../parser/parser_support/choice_helper.rs | 2 +- .../parser/parser_support/parser_result.rs | 16 ++-- .../parser/parser_support/recovery.rs | 4 +- .../parser_support/repetition_helper.rs | 11 ++- .../parser/parser_support/separated_helper.rs | 2 +- .../src/generated/parser/generated/parser.rs | 12 +-- .../crate/src/generated/parser/lexer/mod.rs | 4 +- .../parser/parser_support/choice_helper.rs | 2 +- .../parser/parser_support/parser_result.rs | 16 ++-- .../parser/parser_support/recovery.rs | 4 +- .../parser_support/repetition_helper.rs | 11 ++- .../parser/parser_support/separated_helper.rs | 2 +- 21 files changed, 128 insertions(+), 89 deletions(-) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs index 71d28c520b..1a1882e2e0 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs @@ -94,7 +94,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(start); - return ParserResult::no_match(vec![kind]); + return ParserResult::no_match(vec![], vec![kind]); } let end = input.position(); @@ -129,7 +129,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(restore); - return ParserResult::no_match(vec![kind]); + return ParserResult::no_match(children, vec![kind]); } let end = input.position(); children.push(Edge::anonymous(Node::terminal( diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs index a52654b63c..3253a7988d 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs @@ -21,7 +21,7 @@ pub struct ChoiceHelper { impl ChoiceHelper { pub fn new(input: &mut ParserContext<'_>) -> Self { Self { - result: ParserResult::no_match(vec![]), + result: ParserResult::default(), start_position: input.mark(), recovered_errors: vec![], last_progress: input.position(), diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs index e6afd564cb..e86d8c3550 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs @@ -16,6 +16,7 @@ pub enum ParserResult { impl Default for ParserResult { fn default() -> Self { Self::NoMatch(NoMatch { + nodes: vec![], expected_terminals: vec![], }) } @@ -36,11 +37,11 @@ impl ParserResult { /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![])`. pub fn disabled() -> Self { - Self::no_match(vec![]) + Self::no_match(vec![], vec![]) } - pub fn no_match(expected_terminals: Vec) -> Self { - ParserResult::NoMatch(NoMatch::new(expected_terminals)) + pub fn no_match(nodes: Vec, expected_terminals: Vec) -> Self { + ParserResult::NoMatch(NoMatch::new(nodes, expected_terminals)) } #[must_use] @@ -230,13 +231,18 @@ impl IncompleteMatch { #[derive(PartialEq, Eq, Clone, Debug)] pub struct NoMatch { + /// The terminals that were parsed; trivia + pub nodes: Vec, /// Terminals that would have allowed for more progress. Collected for the purposes of error reporting. pub expected_terminals: Vec, } impl NoMatch { - pub fn new(expected_terminals: Vec) -> Self { - Self { expected_terminals } + pub fn new(nodes: Vec, expected_terminals: Vec) -> Self { + Self { + nodes, + expected_terminals, + } } } diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs index cec55a393c..8cd4fd372c 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs @@ -105,7 +105,9 @@ impl ParserResult { ParseResultKind::Incomplete => { ParserResult::incomplete_match(nodes, expected_terminals) } - ParseResultKind::NoMatch => ParserResult::no_match(expected_terminals), + ParseResultKind::NoMatch => { + ParserResult::no_match(leading_trivia, expected_terminals) + } } } } diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs index e4bcf1433d..b4f2c14abb 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs @@ -26,8 +26,11 @@ impl RepetitionHelper { // Couldn't get a full match but we allow 0 items - return an empty match // so the parse is considered valid but note the expected terminals - ParserResult::NoMatch(NoMatch { expected_terminals }) if MIN_COUNT == 0 => { - return ParserResult::r#match(vec![], expected_terminals); + ParserResult::NoMatch(NoMatch { + nodes, + expected_terminals, + }) if MIN_COUNT == 0 => { + return ParserResult::r#match(nodes, expected_terminals); } // Don't try repeating if we don't have a full match and we require at least one incomplete_or_no_match => return incomplete_or_no_match, @@ -60,7 +63,9 @@ impl RepetitionHelper { ParserResult::IncompleteMatch(IncompleteMatch { expected_terminals, .. }) - | ParserResult::NoMatch(NoMatch { expected_terminals }), + | ParserResult::NoMatch(NoMatch { + expected_terminals, .. + }), ) => { input.rewind(save); running.expected_terminals = expected_terminals; diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs index e1455a8155..44615a7d4f 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs @@ -89,7 +89,7 @@ impl SeparatedHelper { } ParserResult::NoMatch(no_match) => { return if accum.is_empty() { - ParserResult::no_match(no_match.expected_terminals) + ParserResult::no_match(no_match.nodes, no_match.expected_terminals) } else { ParserResult::incomplete_match(accum, no_match.expected_terminals) }; diff --git a/crates/codegen/runtime/generator/src/parser/codegen/precedence_parser_definition.rs b/crates/codegen/runtime/generator/src/parser/codegen/precedence_parser_definition.rs index 30c11f90a3..b917749aaa 100644 --- a/crates/codegen/runtime/generator/src/parser/codegen/precedence_parser_definition.rs +++ b/crates/codegen/runtime/generator/src/parser/codegen/precedence_parser_definition.rs @@ -49,9 +49,9 @@ impl PrecedenceParserDefinitionCodegen for PrecedenceParserDefinitionRef { [inner @ cst::Edge { node: cst::Node::Nonterminal(node), .. }] if node.kind == NonterminalKind::#op_nonterminal_name => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } }; diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/generated/parser.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/generated/parser.rs index 4daf7c6f0c..91c358a3b4 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/generated/parser.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/generated/parser.rs @@ -254,9 +254,9 @@ impl Parser { }] if node.kind == NonterminalKind::AdditiveExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -301,9 +301,9 @@ impl Parser { }] if node.kind == NonterminalKind::AndExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -371,9 +371,9 @@ impl Parser { }] if node.kind == NonterminalKind::ArrayTypeName => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -476,9 +476,9 @@ impl Parser { }] if node.kind == NonterminalKind::AssignmentExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -499,9 +499,9 @@ impl Parser { }] if node.kind == NonterminalKind::BitwiseAndExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -522,9 +522,9 @@ impl Parser { }] if node.kind == NonterminalKind::BitwiseOrExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -545,9 +545,9 @@ impl Parser { }] if node.kind == NonterminalKind::BitwiseXorExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -646,9 +646,9 @@ impl Parser { }] if node.kind == NonterminalKind::CallOptionsExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -727,9 +727,9 @@ impl Parser { }] if node.kind == NonterminalKind::ComparisonExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -750,9 +750,9 @@ impl Parser { }] if node.kind == NonterminalKind::ConditionalExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -1320,9 +1320,9 @@ impl Parser { }] if node.kind == NonterminalKind::EqualityExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -1625,9 +1625,9 @@ impl Parser { }] if node.kind == NonterminalKind::ExponentiationExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -2639,9 +2639,9 @@ impl Parser { }] if node.kind == NonterminalKind::FunctionCallExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -3082,9 +3082,9 @@ impl Parser { }] if node.kind == NonterminalKind::IndexAccessExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -3375,9 +3375,9 @@ impl Parser { }] if node.kind == NonterminalKind::MemberAccessExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -3467,9 +3467,9 @@ impl Parser { }] if node.kind == NonterminalKind::MultiplicativeExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -3705,9 +3705,9 @@ impl Parser { }] if node.kind == NonterminalKind::OrExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -3932,9 +3932,9 @@ impl Parser { }] if node.kind == NonterminalKind::PostfixExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -4004,9 +4004,9 @@ impl Parser { }] if node.kind == NonterminalKind::PrefixExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -4192,9 +4192,9 @@ impl Parser { }] if node.kind == NonterminalKind::ShiftExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -6468,9 +6468,9 @@ impl Parser { }] if node.kind == NonterminalKind::YulFunctionCallExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs index 02bbe2b817..4212f7b4f4 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs @@ -96,7 +96,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(start); - return ParserResult::no_match(vec![kind]); + return ParserResult::no_match(vec![], vec![kind]); } let end = input.position(); @@ -131,7 +131,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(restore); - return ParserResult::no_match(vec![kind]); + return ParserResult::no_match(children, vec![kind]); } let end = input.position(); children.push(Edge::anonymous(Node::terminal( diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs index 925582d5f7..84e9295266 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs @@ -23,7 +23,7 @@ pub struct ChoiceHelper { impl ChoiceHelper { pub fn new(input: &mut ParserContext<'_>) -> Self { Self { - result: ParserResult::no_match(vec![]), + result: ParserResult::default(), start_position: input.mark(), recovered_errors: vec![], last_progress: input.position(), diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs index ed86a774bf..260dc6fc61 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs @@ -18,6 +18,7 @@ pub enum ParserResult { impl Default for ParserResult { fn default() -> Self { Self::NoMatch(NoMatch { + nodes: vec![], expected_terminals: vec![], }) } @@ -38,11 +39,11 @@ impl ParserResult { /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![])`. pub fn disabled() -> Self { - Self::no_match(vec![]) + Self::no_match(vec![], vec![]) } - pub fn no_match(expected_terminals: Vec) -> Self { - ParserResult::NoMatch(NoMatch::new(expected_terminals)) + pub fn no_match(nodes: Vec, expected_terminals: Vec) -> Self { + ParserResult::NoMatch(NoMatch::new(nodes, expected_terminals)) } #[must_use] @@ -232,13 +233,18 @@ impl IncompleteMatch { #[derive(PartialEq, Eq, Clone, Debug)] pub struct NoMatch { + /// The terminals that were parsed; trivia + pub nodes: Vec, /// Terminals that would have allowed for more progress. Collected for the purposes of error reporting. pub expected_terminals: Vec, } impl NoMatch { - pub fn new(expected_terminals: Vec) -> Self { - Self { expected_terminals } + pub fn new(nodes: Vec, expected_terminals: Vec) -> Self { + Self { + nodes, + expected_terminals, + } } } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs index f54ae45934..848eb12e81 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs @@ -107,7 +107,9 @@ impl ParserResult { ParseResultKind::Incomplete => { ParserResult::incomplete_match(nodes, expected_terminals) } - ParseResultKind::NoMatch => ParserResult::no_match(expected_terminals), + ParseResultKind::NoMatch => { + ParserResult::no_match(leading_trivia, expected_terminals) + } } } } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs index a808e73796..95026d38ae 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs @@ -28,8 +28,11 @@ impl RepetitionHelper { // Couldn't get a full match but we allow 0 items - return an empty match // so the parse is considered valid but note the expected terminals - ParserResult::NoMatch(NoMatch { expected_terminals }) if MIN_COUNT == 0 => { - return ParserResult::r#match(vec![], expected_terminals); + ParserResult::NoMatch(NoMatch { + nodes, + expected_terminals, + }) if MIN_COUNT == 0 => { + return ParserResult::r#match(nodes, expected_terminals); } // Don't try repeating if we don't have a full match and we require at least one incomplete_or_no_match => return incomplete_or_no_match, @@ -62,7 +65,9 @@ impl RepetitionHelper { ParserResult::IncompleteMatch(IncompleteMatch { expected_terminals, .. }) - | ParserResult::NoMatch(NoMatch { expected_terminals }), + | ParserResult::NoMatch(NoMatch { + expected_terminals, .. + }), ) => { input.rewind(save); running.expected_terminals = expected_terminals; diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs index bcc5dc64f0..527944afba 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs @@ -91,7 +91,7 @@ impl SeparatedHelper { } ParserResult::NoMatch(no_match) => { return if accum.is_empty() { - ParserResult::no_match(no_match.expected_terminals) + ParserResult::no_match(no_match.nodes, no_match.expected_terminals) } else { ParserResult::incomplete_match(accum, no_match.expected_terminals) }; diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/generated/parser.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/generated/parser.rs index 9526734434..ef1e4ba83a 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/generated/parser.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/generated/parser.rs @@ -87,9 +87,9 @@ impl Parser { }] if node.kind == NonterminalKind::AdditionExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -237,9 +237,9 @@ impl Parser { }] if node.kind == NonterminalKind::MemberAccessExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } @@ -260,9 +260,9 @@ impl Parser { }] if node.kind == NonterminalKind::NegationExpression => { ParserResult::r#match(vec![inner.clone()], r#match.expected_terminals.clone()) } - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), }, - _ => ParserResult::no_match(vec![]), + _ => ParserResult::default(), } } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs index 02bbe2b817..4212f7b4f4 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs @@ -96,7 +96,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(start); - return ParserResult::no_match(vec![kind]); + return ParserResult::no_match(vec![], vec![kind]); } let end = input.position(); @@ -131,7 +131,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(restore); - return ParserResult::no_match(vec![kind]); + return ParserResult::no_match(children, vec![kind]); } let end = input.position(); children.push(Edge::anonymous(Node::terminal( diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs index 925582d5f7..84e9295266 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs @@ -23,7 +23,7 @@ pub struct ChoiceHelper { impl ChoiceHelper { pub fn new(input: &mut ParserContext<'_>) -> Self { Self { - result: ParserResult::no_match(vec![]), + result: ParserResult::default(), start_position: input.mark(), recovered_errors: vec![], last_progress: input.position(), diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs index ed86a774bf..260dc6fc61 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs @@ -18,6 +18,7 @@ pub enum ParserResult { impl Default for ParserResult { fn default() -> Self { Self::NoMatch(NoMatch { + nodes: vec![], expected_terminals: vec![], }) } @@ -38,11 +39,11 @@ impl ParserResult { /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![])`. pub fn disabled() -> Self { - Self::no_match(vec![]) + Self::no_match(vec![], vec![]) } - pub fn no_match(expected_terminals: Vec) -> Self { - ParserResult::NoMatch(NoMatch::new(expected_terminals)) + pub fn no_match(nodes: Vec, expected_terminals: Vec) -> Self { + ParserResult::NoMatch(NoMatch::new(nodes, expected_terminals)) } #[must_use] @@ -232,13 +233,18 @@ impl IncompleteMatch { #[derive(PartialEq, Eq, Clone, Debug)] pub struct NoMatch { + /// The terminals that were parsed; trivia + pub nodes: Vec, /// Terminals that would have allowed for more progress. Collected for the purposes of error reporting. pub expected_terminals: Vec, } impl NoMatch { - pub fn new(expected_terminals: Vec) -> Self { - Self { expected_terminals } + pub fn new(nodes: Vec, expected_terminals: Vec) -> Self { + Self { + nodes, + expected_terminals, + } } } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs index f54ae45934..848eb12e81 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs @@ -107,7 +107,9 @@ impl ParserResult { ParseResultKind::Incomplete => { ParserResult::incomplete_match(nodes, expected_terminals) } - ParseResultKind::NoMatch => ParserResult::no_match(expected_terminals), + ParseResultKind::NoMatch => { + ParserResult::no_match(leading_trivia, expected_terminals) + } } } } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs index a808e73796..95026d38ae 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs @@ -28,8 +28,11 @@ impl RepetitionHelper { // Couldn't get a full match but we allow 0 items - return an empty match // so the parse is considered valid but note the expected terminals - ParserResult::NoMatch(NoMatch { expected_terminals }) if MIN_COUNT == 0 => { - return ParserResult::r#match(vec![], expected_terminals); + ParserResult::NoMatch(NoMatch { + nodes, + expected_terminals, + }) if MIN_COUNT == 0 => { + return ParserResult::r#match(nodes, expected_terminals); } // Don't try repeating if we don't have a full match and we require at least one incomplete_or_no_match => return incomplete_or_no_match, @@ -62,7 +65,9 @@ impl RepetitionHelper { ParserResult::IncompleteMatch(IncompleteMatch { expected_terminals, .. }) - | ParserResult::NoMatch(NoMatch { expected_terminals }), + | ParserResult::NoMatch(NoMatch { + expected_terminals, .. + }), ) => { input.rewind(save); running.expected_terminals = expected_terminals; diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs index bcc5dc64f0..527944afba 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs @@ -91,7 +91,7 @@ impl SeparatedHelper { } ParserResult::NoMatch(no_match) => { return if accum.is_empty() { - ParserResult::no_match(no_match.expected_terminals) + ParserResult::no_match(no_match.nodes, no_match.expected_terminals) } else { ParserResult::incomplete_match(accum, no_match.expected_terminals) }; From a74ea7d3fc2117aee2d5fe4465889b3d9cc4b7ad Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Wed, 27 Nov 2024 13:35:09 -0300 Subject: [PATCH 03/22] NoMatch with tracking information about trivia and originator non-terminal --- .../crate/src/runtime/parser/lexer/mod.rs | 4 +-- .../parser/parser_support/choice_helper.rs | 6 +++- .../parser/parser_support/optional_helper.rs | 2 +- .../parser/parser_support/parser_function.rs | 31 +++++++++++-------- .../parser/parser_support/parser_result.rs | 26 ++++++++++++---- .../runtime/parser/parser_support/recovery.rs | 8 +++-- .../parser_support/repetition_helper.rs | 1 + .../parser/parser_support/separated_helper.rs | 2 +- crates/metaslang/cst/src/text_index.rs | 8 +++++ .../crate/src/generated/parser/lexer/mod.rs | 4 +-- .../parser/parser_support/choice_helper.rs | 6 +++- .../parser/parser_support/optional_helper.rs | 2 +- .../parser/parser_support/parser_function.rs | 31 +++++++++++-------- .../parser/parser_support/parser_result.rs | 26 ++++++++++++---- .../parser/parser_support/recovery.rs | 8 +++-- .../parser_support/repetition_helper.rs | 1 + .../parser/parser_support/separated_helper.rs | 2 +- 17 files changed, 116 insertions(+), 52 deletions(-) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs index 1a1882e2e0..5925617b28 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs @@ -94,7 +94,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(start); - return ParserResult::no_match(vec![], vec![kind]); + return ParserResult::no_match(vec![], None, vec![kind]); } let end = input.position(); @@ -129,7 +129,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(restore); - return ParserResult::no_match(children, vec![kind]); + return ParserResult::no_match(children, None, vec![kind]); } let end = input.position(); children.push(Edge::anonymous(Node::terminal( diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs index 3253a7988d..353e090cf8 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs @@ -52,6 +52,10 @@ impl ChoiceHelper { // Still no match, extend the possible expected terminals. (ParserResult::NoMatch(running), ParserResult::NoMatch(next)) => { + if running.nodes.is_empty() && !next.nodes.is_empty() { + // transfer nodes + running.nodes.extend(next.nodes.clone()); + } running .expected_terminals .extend(next.expected_terminals.clone()); @@ -127,7 +131,7 @@ pub fn total_not_skipped_span(result: &ParserResult) -> usize { ParserResult::Match(match_) => &match_.nodes, ParserResult::IncompleteMatch(incomplete_match) => &incomplete_match.nodes, ParserResult::SkippedUntil(skipped) => &skipped.nodes, - ParserResult::NoMatch(_) => &[][..], + ParserResult::NoMatch(no_match) => &no_match.nodes, ParserResult::PrattOperatorMatch(_) => unreachable!( "PrattOperatorMatch is always considered a better pick, so it should never be considered here" ), diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/optional_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/optional_helper.rs index 9ef5430056..a052cc4f66 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/optional_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/optional_helper.rs @@ -8,7 +8,7 @@ impl OptionalHelper { // If there's absolutely no match, we treat it as a match (for the purposes of the Result algebra) // but we bubble up the information which terminals would have allowed more progress. ParserResult::NoMatch(no_match) => { - ParserResult::r#match(vec![], no_match.expected_terminals) + ParserResult::r#match(no_match.nodes, no_match.expected_terminals) } // ... otherwise we return the result as-is ParserResult::Match(_) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs index 964268c940..189b9c7734 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs @@ -56,25 +56,30 @@ where match result { ParserResult::PrattOperatorMatch(..) => unreachable!("PrattOperatorMatch is internal"), - ParserResult::NoMatch(no_match) => { + ParserResult::NoMatch(mut no_match) => { let (kind, start) = if input.is_empty() { (TerminalKind::MISSING, TextIndex::ZERO) } else { - let mut stream = ParserContext::new(input); - if let ParserResult::Match(trivia) = Lexer::leading_trivia(parser, &mut stream) - { - let mut ti = TextIndex::ZERO; - trivia.nodes.iter().for_each(|node| { - node.unparse().chars().for_each(|c| ti.advance(c, None)); - }); - (TerminalKind::UNRECOGNIZED, ti) - } else { - (TerminalKind::UNRECOGNIZED, TextIndex::ZERO) - } + let mut ti = TextIndex::ZERO; + no_match.nodes.iter().for_each(|edge| { + if let Node::Terminal(terminal) = &edge.node { + if terminal.kind.is_valid() { + ti.advance_str(terminal.text.as_str()); + } + } + }); + (TerminalKind::UNRECOGNIZED, ti) }; + let node = Node::terminal(kind, input[start.utf8..].to_string()); + let tree = if no_match.kind.is_none() || start.utf8 == 0 { + node + } else { + no_match.nodes.push(Edge::anonymous(node)); + Node::nonterminal(no_match.kind.unwrap(), no_match.nodes) + }; ParseOutput { - parse_tree: Node::terminal(kind, input.to_string()), + parse_tree: tree, errors: vec![ParseError::new( start..input.into(), no_match.expected_terminals, diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs index e86d8c3550..57db35864e 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs @@ -17,6 +17,7 @@ impl Default for ParserResult { fn default() -> Self { Self::NoMatch(NoMatch { nodes: vec![], + kind: None, expected_terminals: vec![], }) } @@ -35,13 +36,17 @@ impl ParserResult { ParserResult::IncompleteMatch(IncompleteMatch::new(nodes, expected_terminals)) } - /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![])`. + /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![], None, vec![])`. pub fn disabled() -> Self { - Self::no_match(vec![], vec![]) + Self::no_match(vec![], None, vec![]) } - pub fn no_match(nodes: Vec, expected_terminals: Vec) -> Self { - ParserResult::NoMatch(NoMatch::new(nodes, expected_terminals)) + pub fn no_match( + nodes: Vec, + kind: Option, + expected_terminals: Vec, + ) -> Self { + ParserResult::NoMatch(NoMatch::new(nodes, kind, expected_terminals)) } #[must_use] @@ -62,7 +67,9 @@ impl ParserResult { nodes: vec![Edge::anonymous(Node::nonterminal(new_kind, skipped.nodes))], ..skipped }), - ParserResult::NoMatch(_) => self, + ParserResult::NoMatch(no_match) => { + ParserResult::no_match(no_match.nodes, Some(new_kind), no_match.expected_terminals) + } ParserResult::PrattOperatorMatch(_) => { unreachable!("PrattOperatorMatch cannot be converted to a nonterminal") } @@ -233,14 +240,21 @@ impl IncompleteMatch { pub struct NoMatch { /// The terminals that were parsed; trivia pub nodes: Vec, + /// The nonterminal kind this match is coming from + pub kind: Option, /// Terminals that would have allowed for more progress. Collected for the purposes of error reporting. pub expected_terminals: Vec, } impl NoMatch { - pub fn new(nodes: Vec, expected_terminals: Vec) -> Self { + pub fn new( + nodes: Vec, + kind: Option, + expected_terminals: Vec, + ) -> Self { Self { nodes, + kind, expected_terminals, } } diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs index 8cd4fd372c..1a610349d0 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs @@ -70,7 +70,11 @@ impl ParserResult { ) } ParserResult::NoMatch(result) if acceptance_threshold.0 == 0 => { - (vec![], result.expected_terminals, ParseResultKind::NoMatch) + ( + vec![], /* trivia will be read below */ + result.expected_terminals, + ParseResultKind::NoMatch, + ) } // No need to recover, so just return as-is. _ => return self, @@ -106,7 +110,7 @@ impl ParserResult { ParserResult::incomplete_match(nodes, expected_terminals) } ParseResultKind::NoMatch => { - ParserResult::no_match(leading_trivia, expected_terminals) + ParserResult::no_match(leading_trivia, None, expected_terminals) } } } diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs index b4f2c14abb..7a13af5bd1 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs @@ -28,6 +28,7 @@ impl RepetitionHelper { // so the parse is considered valid but note the expected terminals ParserResult::NoMatch(NoMatch { nodes, + kind: _, expected_terminals, }) if MIN_COUNT == 0 => { return ParserResult::r#match(nodes, expected_terminals); diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs index 44615a7d4f..8efcac8f74 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs @@ -89,7 +89,7 @@ impl SeparatedHelper { } ParserResult::NoMatch(no_match) => { return if accum.is_empty() { - ParserResult::no_match(no_match.nodes, no_match.expected_terminals) + ParserResult::no_match(no_match.nodes, None, no_match.expected_terminals) } else { ParserResult::incomplete_match(accum, no_match.expected_terminals) }; diff --git a/crates/metaslang/cst/src/text_index.rs b/crates/metaslang/cst/src/text_index.rs index c107c4f191..c0144c4a3f 100644 --- a/crates/metaslang/cst/src/text_index.rs +++ b/crates/metaslang/cst/src/text_index.rs @@ -40,6 +40,14 @@ impl TextIndex { } } } + + pub fn advance_str(&mut self, text: &str) { + text.chars().for_each(|c| { + if c != '\r' { + self.advance(c, None); + } + }); + } } impl PartialOrd for TextIndex { diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs index 4212f7b4f4..480c652881 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs @@ -96,7 +96,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(start); - return ParserResult::no_match(vec![], vec![kind]); + return ParserResult::no_match(vec![], None, vec![kind]); } let end = input.position(); @@ -131,7 +131,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(restore); - return ParserResult::no_match(children, vec![kind]); + return ParserResult::no_match(children, None, vec![kind]); } let end = input.position(); children.push(Edge::anonymous(Node::terminal( diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs index 84e9295266..f7c44e0137 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs @@ -54,6 +54,10 @@ impl ChoiceHelper { // Still no match, extend the possible expected terminals. (ParserResult::NoMatch(running), ParserResult::NoMatch(next)) => { + if running.nodes.is_empty() && !next.nodes.is_empty() { + // transfer nodes + running.nodes.extend(next.nodes.clone()); + } running .expected_terminals .extend(next.expected_terminals.clone()); @@ -129,7 +133,7 @@ pub fn total_not_skipped_span(result: &ParserResult) -> usize { ParserResult::Match(match_) => &match_.nodes, ParserResult::IncompleteMatch(incomplete_match) => &incomplete_match.nodes, ParserResult::SkippedUntil(skipped) => &skipped.nodes, - ParserResult::NoMatch(_) => &[][..], + ParserResult::NoMatch(no_match) => &no_match.nodes, ParserResult::PrattOperatorMatch(_) => unreachable!( "PrattOperatorMatch is always considered a better pick, so it should never be considered here" ), diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs index 989e259cda..7bcdead08e 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs @@ -10,7 +10,7 @@ impl OptionalHelper { // If there's absolutely no match, we treat it as a match (for the purposes of the Result algebra) // but we bubble up the information which terminals would have allowed more progress. ParserResult::NoMatch(no_match) => { - ParserResult::r#match(vec![], no_match.expected_terminals) + ParserResult::r#match(no_match.nodes, no_match.expected_terminals) } // ... otherwise we return the result as-is ParserResult::Match(_) diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index f271e6dfe2..d1bd24d10e 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -58,25 +58,30 @@ where match result { ParserResult::PrattOperatorMatch(..) => unreachable!("PrattOperatorMatch is internal"), - ParserResult::NoMatch(no_match) => { + ParserResult::NoMatch(mut no_match) => { let (kind, start) = if input.is_empty() { (TerminalKind::MISSING, TextIndex::ZERO) } else { - let mut stream = ParserContext::new(input); - if let ParserResult::Match(trivia) = Lexer::leading_trivia(parser, &mut stream) - { - let mut ti = TextIndex::ZERO; - trivia.nodes.iter().for_each(|node| { - node.unparse().chars().for_each(|c| ti.advance(c, None)); - }); - (TerminalKind::UNRECOGNIZED, ti) - } else { - (TerminalKind::UNRECOGNIZED, TextIndex::ZERO) - } + let mut ti = TextIndex::ZERO; + no_match.nodes.iter().for_each(|edge| { + if let Node::Terminal(terminal) = &edge.node { + if terminal.kind.is_valid() { + ti.advance_str(terminal.text.as_str()); + } + } + }); + (TerminalKind::UNRECOGNIZED, ti) }; + let node = Node::terminal(kind, input[start.utf8..].to_string()); + let tree = if no_match.kind.is_none() || start.utf8 == 0 { + node + } else { + no_match.nodes.push(Edge::anonymous(node)); + Node::nonterminal(no_match.kind.unwrap(), no_match.nodes) + }; ParseOutput { - parse_tree: Node::terminal(kind, input.to_string()), + parse_tree: tree, errors: vec![ParseError::new( start..input.into(), no_match.expected_terminals, diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs index 260dc6fc61..016f002ca4 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs @@ -19,6 +19,7 @@ impl Default for ParserResult { fn default() -> Self { Self::NoMatch(NoMatch { nodes: vec![], + kind: None, expected_terminals: vec![], }) } @@ -37,13 +38,17 @@ impl ParserResult { ParserResult::IncompleteMatch(IncompleteMatch::new(nodes, expected_terminals)) } - /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![])`. + /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![], None, vec![])`. pub fn disabled() -> Self { - Self::no_match(vec![], vec![]) + Self::no_match(vec![], None, vec![]) } - pub fn no_match(nodes: Vec, expected_terminals: Vec) -> Self { - ParserResult::NoMatch(NoMatch::new(nodes, expected_terminals)) + pub fn no_match( + nodes: Vec, + kind: Option, + expected_terminals: Vec, + ) -> Self { + ParserResult::NoMatch(NoMatch::new(nodes, kind, expected_terminals)) } #[must_use] @@ -64,7 +69,9 @@ impl ParserResult { nodes: vec![Edge::anonymous(Node::nonterminal(new_kind, skipped.nodes))], ..skipped }), - ParserResult::NoMatch(_) => self, + ParserResult::NoMatch(no_match) => { + ParserResult::no_match(no_match.nodes, Some(new_kind), no_match.expected_terminals) + } ParserResult::PrattOperatorMatch(_) => { unreachable!("PrattOperatorMatch cannot be converted to a nonterminal") } @@ -235,14 +242,21 @@ impl IncompleteMatch { pub struct NoMatch { /// The terminals that were parsed; trivia pub nodes: Vec, + /// The nonterminal kind this match is coming from + pub kind: Option, /// Terminals that would have allowed for more progress. Collected for the purposes of error reporting. pub expected_terminals: Vec, } impl NoMatch { - pub fn new(nodes: Vec, expected_terminals: Vec) -> Self { + pub fn new( + nodes: Vec, + kind: Option, + expected_terminals: Vec, + ) -> Self { Self { nodes, + kind, expected_terminals, } } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs index 848eb12e81..843c908e16 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs @@ -72,7 +72,11 @@ impl ParserResult { ) } ParserResult::NoMatch(result) if acceptance_threshold.0 == 0 => { - (vec![], result.expected_terminals, ParseResultKind::NoMatch) + ( + vec![], /* trivia will be read below */ + result.expected_terminals, + ParseResultKind::NoMatch, + ) } // No need to recover, so just return as-is. _ => return self, @@ -108,7 +112,7 @@ impl ParserResult { ParserResult::incomplete_match(nodes, expected_terminals) } ParseResultKind::NoMatch => { - ParserResult::no_match(leading_trivia, expected_terminals) + ParserResult::no_match(leading_trivia, None, expected_terminals) } } } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs index 95026d38ae..abfd3cf3c0 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs @@ -30,6 +30,7 @@ impl RepetitionHelper { // so the parse is considered valid but note the expected terminals ParserResult::NoMatch(NoMatch { nodes, + kind: _, expected_terminals, }) if MIN_COUNT == 0 => { return ParserResult::r#match(nodes, expected_terminals); diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs index 527944afba..e2d68a177e 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs @@ -91,7 +91,7 @@ impl SeparatedHelper { } ParserResult::NoMatch(no_match) => { return if accum.is_empty() { - ParserResult::no_match(no_match.nodes, no_match.expected_terminals) + ParserResult::no_match(no_match.nodes, None, no_match.expected_terminals) } else { ParserResult::incomplete_match(accum, no_match.expected_terminals) }; From cf6b9646aadb2ccee1e28a2bf7c9608b95c399f6 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Wed, 27 Nov 2024 13:36:47 -0300 Subject: [PATCH 04/22] Missing files --- .../crate/src/generated/parser/lexer/mod.rs | 4 +-- .../parser/parser_support/choice_helper.rs | 6 +++- .../parser/parser_support/optional_helper.rs | 2 +- .../parser/parser_support/parser_function.rs | 31 +++++++++++-------- .../parser/parser_support/parser_result.rs | 26 ++++++++++++---- .../parser/parser_support/recovery.rs | 8 +++-- .../parser_support/repetition_helper.rs | 1 + .../parser/parser_support/separated_helper.rs | 2 +- 8 files changed, 54 insertions(+), 26 deletions(-) diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs index 4212f7b4f4..480c652881 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs @@ -96,7 +96,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(start); - return ParserResult::no_match(vec![], vec![kind]); + return ParserResult::no_match(vec![], None, vec![kind]); } let end = input.position(); @@ -131,7 +131,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(restore); - return ParserResult::no_match(children, vec![kind]); + return ParserResult::no_match(children, None, vec![kind]); } let end = input.position(); children.push(Edge::anonymous(Node::terminal( diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs index 84e9295266..f7c44e0137 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs @@ -54,6 +54,10 @@ impl ChoiceHelper { // Still no match, extend the possible expected terminals. (ParserResult::NoMatch(running), ParserResult::NoMatch(next)) => { + if running.nodes.is_empty() && !next.nodes.is_empty() { + // transfer nodes + running.nodes.extend(next.nodes.clone()); + } running .expected_terminals .extend(next.expected_terminals.clone()); @@ -129,7 +133,7 @@ pub fn total_not_skipped_span(result: &ParserResult) -> usize { ParserResult::Match(match_) => &match_.nodes, ParserResult::IncompleteMatch(incomplete_match) => &incomplete_match.nodes, ParserResult::SkippedUntil(skipped) => &skipped.nodes, - ParserResult::NoMatch(_) => &[][..], + ParserResult::NoMatch(no_match) => &no_match.nodes, ParserResult::PrattOperatorMatch(_) => unreachable!( "PrattOperatorMatch is always considered a better pick, so it should never be considered here" ), diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs index 989e259cda..7bcdead08e 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs @@ -10,7 +10,7 @@ impl OptionalHelper { // If there's absolutely no match, we treat it as a match (for the purposes of the Result algebra) // but we bubble up the information which terminals would have allowed more progress. ParserResult::NoMatch(no_match) => { - ParserResult::r#match(vec![], no_match.expected_terminals) + ParserResult::r#match(no_match.nodes, no_match.expected_terminals) } // ... otherwise we return the result as-is ParserResult::Match(_) diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index f271e6dfe2..d1bd24d10e 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -58,25 +58,30 @@ where match result { ParserResult::PrattOperatorMatch(..) => unreachable!("PrattOperatorMatch is internal"), - ParserResult::NoMatch(no_match) => { + ParserResult::NoMatch(mut no_match) => { let (kind, start) = if input.is_empty() { (TerminalKind::MISSING, TextIndex::ZERO) } else { - let mut stream = ParserContext::new(input); - if let ParserResult::Match(trivia) = Lexer::leading_trivia(parser, &mut stream) - { - let mut ti = TextIndex::ZERO; - trivia.nodes.iter().for_each(|node| { - node.unparse().chars().for_each(|c| ti.advance(c, None)); - }); - (TerminalKind::UNRECOGNIZED, ti) - } else { - (TerminalKind::UNRECOGNIZED, TextIndex::ZERO) - } + let mut ti = TextIndex::ZERO; + no_match.nodes.iter().for_each(|edge| { + if let Node::Terminal(terminal) = &edge.node { + if terminal.kind.is_valid() { + ti.advance_str(terminal.text.as_str()); + } + } + }); + (TerminalKind::UNRECOGNIZED, ti) }; + let node = Node::terminal(kind, input[start.utf8..].to_string()); + let tree = if no_match.kind.is_none() || start.utf8 == 0 { + node + } else { + no_match.nodes.push(Edge::anonymous(node)); + Node::nonterminal(no_match.kind.unwrap(), no_match.nodes) + }; ParseOutput { - parse_tree: Node::terminal(kind, input.to_string()), + parse_tree: tree, errors: vec![ParseError::new( start..input.into(), no_match.expected_terminals, diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs index 260dc6fc61..016f002ca4 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs @@ -19,6 +19,7 @@ impl Default for ParserResult { fn default() -> Self { Self::NoMatch(NoMatch { nodes: vec![], + kind: None, expected_terminals: vec![], }) } @@ -37,13 +38,17 @@ impl ParserResult { ParserResult::IncompleteMatch(IncompleteMatch::new(nodes, expected_terminals)) } - /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![])`. + /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![], None, vec![])`. pub fn disabled() -> Self { - Self::no_match(vec![], vec![]) + Self::no_match(vec![], None, vec![]) } - pub fn no_match(nodes: Vec, expected_terminals: Vec) -> Self { - ParserResult::NoMatch(NoMatch::new(nodes, expected_terminals)) + pub fn no_match( + nodes: Vec, + kind: Option, + expected_terminals: Vec, + ) -> Self { + ParserResult::NoMatch(NoMatch::new(nodes, kind, expected_terminals)) } #[must_use] @@ -64,7 +69,9 @@ impl ParserResult { nodes: vec![Edge::anonymous(Node::nonterminal(new_kind, skipped.nodes))], ..skipped }), - ParserResult::NoMatch(_) => self, + ParserResult::NoMatch(no_match) => { + ParserResult::no_match(no_match.nodes, Some(new_kind), no_match.expected_terminals) + } ParserResult::PrattOperatorMatch(_) => { unreachable!("PrattOperatorMatch cannot be converted to a nonterminal") } @@ -235,14 +242,21 @@ impl IncompleteMatch { pub struct NoMatch { /// The terminals that were parsed; trivia pub nodes: Vec, + /// The nonterminal kind this match is coming from + pub kind: Option, /// Terminals that would have allowed for more progress. Collected for the purposes of error reporting. pub expected_terminals: Vec, } impl NoMatch { - pub fn new(nodes: Vec, expected_terminals: Vec) -> Self { + pub fn new( + nodes: Vec, + kind: Option, + expected_terminals: Vec, + ) -> Self { Self { nodes, + kind, expected_terminals, } } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs index 848eb12e81..843c908e16 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs @@ -72,7 +72,11 @@ impl ParserResult { ) } ParserResult::NoMatch(result) if acceptance_threshold.0 == 0 => { - (vec![], result.expected_terminals, ParseResultKind::NoMatch) + ( + vec![], /* trivia will be read below */ + result.expected_terminals, + ParseResultKind::NoMatch, + ) } // No need to recover, so just return as-is. _ => return self, @@ -108,7 +112,7 @@ impl ParserResult { ParserResult::incomplete_match(nodes, expected_terminals) } ParseResultKind::NoMatch => { - ParserResult::no_match(leading_trivia, expected_terminals) + ParserResult::no_match(leading_trivia, None, expected_terminals) } } } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs index 95026d38ae..abfd3cf3c0 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs @@ -30,6 +30,7 @@ impl RepetitionHelper { // so the parse is considered valid but note the expected terminals ParserResult::NoMatch(NoMatch { nodes, + kind: _, expected_terminals, }) if MIN_COUNT == 0 => { return ParserResult::r#match(nodes, expected_terminals); diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs index 527944afba..e2d68a177e 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs @@ -91,7 +91,7 @@ impl SeparatedHelper { } ParserResult::NoMatch(no_match) => { return if accum.is_empty() { - ParserResult::no_match(no_match.nodes, no_match.expected_terminals) + ParserResult::no_match(no_match.nodes, None, no_match.expected_terminals) } else { ParserResult::incomplete_match(accum, no_match.expected_terminals) }; From 3fbefa4d223b5e96ca18d3cd5b3317564b2ae42e Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Thu, 28 Nov 2024 09:25:04 -0300 Subject: [PATCH 05/22] Revert to not carry the trivia in the NoMatch result --- .../crate/src/runtime/parser/lexer/mod.rs | 4 +- .../parser/parser_support/choice_helper.rs | 6 +-- .../parser/parser_support/optional_helper.rs | 2 +- .../parser/parser_support/parser_function.rs | 40 +++++++++++-------- .../parser/parser_support/parser_result.rs | 22 +++------- .../runtime/parser/parser_support/recovery.rs | 4 +- .../parser_support/repetition_helper.rs | 3 +- .../parser/parser_support/separated_helper.rs | 2 +- crates/metaslang/cst/generated/public_api.txt | 1 + crates/metaslang/cst/src/text_index.rs | 16 +++----- .../crate/src/generated/parser/lexer/mod.rs | 4 +- .../parser/parser_support/choice_helper.rs | 6 +-- .../parser/parser_support/optional_helper.rs | 2 +- .../parser/parser_support/parser_function.rs | 40 +++++++++++-------- .../parser/parser_support/parser_result.rs | 22 +++------- .../parser/parser_support/recovery.rs | 4 +- .../parser_support/repetition_helper.rs | 3 +- .../parser/parser_support/separated_helper.rs | 2 +- .../generated/0.4.11-failure.yml | 9 ++++- .../generated/0.4.25-failure.yml | 5 ++- .../generated/0.4.25-failure.yml | 5 ++- .../try_catch/generated/0.4.11-failure.yml | 8 +++- .../with_var/generated/0.5.0-failure.yml | 5 ++- .../generated/0.6.0-failure.yml | 5 ++- .../crate/src/generated/parser/lexer/mod.rs | 4 +- .../parser/parser_support/choice_helper.rs | 6 +-- .../parser/parser_support/optional_helper.rs | 2 +- .../parser/parser_support/parser_function.rs | 40 +++++++++++-------- .../parser/parser_support/parser_result.rs | 22 +++------- .../parser/parser_support/recovery.rs | 4 +- .../parser_support/repetition_helper.rs | 3 +- .../parser/parser_support/separated_helper.rs | 2 +- 32 files changed, 146 insertions(+), 157 deletions(-) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs index 5925617b28..156ce5583d 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs @@ -94,7 +94,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(start); - return ParserResult::no_match(vec![], None, vec![kind]); + return ParserResult::no_match(None, vec![kind]); } let end = input.position(); @@ -129,7 +129,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(restore); - return ParserResult::no_match(children, None, vec![kind]); + return ParserResult::no_match(None, vec![kind]); } let end = input.position(); children.push(Edge::anonymous(Node::terminal( diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs index 353e090cf8..b96c0c8557 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs @@ -52,10 +52,6 @@ impl ChoiceHelper { // Still no match, extend the possible expected terminals. (ParserResult::NoMatch(running), ParserResult::NoMatch(next)) => { - if running.nodes.is_empty() && !next.nodes.is_empty() { - // transfer nodes - running.nodes.extend(next.nodes.clone()); - } running .expected_terminals .extend(next.expected_terminals.clone()); @@ -131,7 +127,7 @@ pub fn total_not_skipped_span(result: &ParserResult) -> usize { ParserResult::Match(match_) => &match_.nodes, ParserResult::IncompleteMatch(incomplete_match) => &incomplete_match.nodes, ParserResult::SkippedUntil(skipped) => &skipped.nodes, - ParserResult::NoMatch(no_match) => &no_match.nodes, + ParserResult::NoMatch(_) => &vec![], ParserResult::PrattOperatorMatch(_) => unreachable!( "PrattOperatorMatch is always considered a better pick, so it should never be considered here" ), diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/optional_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/optional_helper.rs index a052cc4f66..9ef5430056 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/optional_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/optional_helper.rs @@ -8,7 +8,7 @@ impl OptionalHelper { // If there's absolutely no match, we treat it as a match (for the purposes of the Result algebra) // but we bubble up the information which terminals would have allowed more progress. ParserResult::NoMatch(no_match) => { - ParserResult::r#match(no_match.nodes, no_match.expected_terminals) + ParserResult::r#match(vec![], no_match.expected_terminals) } // ... otherwise we return the result as-is ParserResult::Match(_) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs index 189b9c7734..531f5a0c6e 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs @@ -56,32 +56,40 @@ where match result { ParserResult::PrattOperatorMatch(..) => unreachable!("PrattOperatorMatch is internal"), - ParserResult::NoMatch(mut no_match) => { - let (kind, start) = if input.is_empty() { - (TerminalKind::MISSING, TextIndex::ZERO) + ParserResult::NoMatch(no_match) => { + let mut trivia_nodes = if let ParserResult::Match(matched) = + Lexer::leading_trivia(parser, &mut stream) + { + matched.nodes } else { - let mut ti = TextIndex::ZERO; - no_match.nodes.iter().for_each(|edge| { - if let Node::Terminal(terminal) = &edge.node { - if terminal.kind.is_valid() { - ti.advance_str(terminal.text.as_str()); - } - } - }); - (TerminalKind::UNRECOGNIZED, ti) + vec![] }; - let node = Node::terminal(kind, input[start.utf8..].to_string()); + let mut start = TextIndex::ZERO; + for edge in &trivia_nodes { + if let Node::Terminal(terminal) = &edge.node { + if terminal.kind.is_valid() { + start.advance_str(terminal.text.as_str()); + } + } + } + let input = &input[start.utf8..]; + let kind = if input.is_empty() { + TerminalKind::MISSING + } else { + TerminalKind::UNRECOGNIZED + }; + let node = Node::terminal(kind, input.to_string()); let tree = if no_match.kind.is_none() || start.utf8 == 0 { node } else { - no_match.nodes.push(Edge::anonymous(node)); - Node::nonterminal(no_match.kind.unwrap(), no_match.nodes) + trivia_nodes.push(Edge::anonymous(node)); + Node::nonterminal(no_match.kind.unwrap(), trivia_nodes) }; ParseOutput { parse_tree: tree, errors: vec![ParseError::new( - start..input.into(), + start..start + input.into(), no_match.expected_terminals, )], } diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs index 57db35864e..eaf550849e 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs @@ -16,7 +16,6 @@ pub enum ParserResult { impl Default for ParserResult { fn default() -> Self { Self::NoMatch(NoMatch { - nodes: vec![], kind: None, expected_terminals: vec![], }) @@ -38,15 +37,11 @@ impl ParserResult { /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![], None, vec![])`. pub fn disabled() -> Self { - Self::no_match(vec![], None, vec![]) + Self::no_match(None, vec![]) } - pub fn no_match( - nodes: Vec, - kind: Option, - expected_terminals: Vec, - ) -> Self { - ParserResult::NoMatch(NoMatch::new(nodes, kind, expected_terminals)) + pub fn no_match(kind: Option, expected_terminals: Vec) -> Self { + ParserResult::NoMatch(NoMatch::new(kind, expected_terminals)) } #[must_use] @@ -68,7 +63,7 @@ impl ParserResult { ..skipped }), ParserResult::NoMatch(no_match) => { - ParserResult::no_match(no_match.nodes, Some(new_kind), no_match.expected_terminals) + ParserResult::no_match(Some(new_kind), no_match.expected_terminals) } ParserResult::PrattOperatorMatch(_) => { unreachable!("PrattOperatorMatch cannot be converted to a nonterminal") @@ -238,8 +233,6 @@ impl IncompleteMatch { #[derive(PartialEq, Eq, Clone, Debug)] pub struct NoMatch { - /// The terminals that were parsed; trivia - pub nodes: Vec, /// The nonterminal kind this match is coming from pub kind: Option, /// Terminals that would have allowed for more progress. Collected for the purposes of error reporting. @@ -247,13 +240,8 @@ pub struct NoMatch { } impl NoMatch { - pub fn new( - nodes: Vec, - kind: Option, - expected_terminals: Vec, - ) -> Self { + pub fn new(kind: Option, expected_terminals: Vec) -> Self { Self { - nodes, kind, expected_terminals, } diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs index 1a610349d0..ce57ca3b68 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs @@ -109,9 +109,7 @@ impl ParserResult { ParseResultKind::Incomplete => { ParserResult::incomplete_match(nodes, expected_terminals) } - ParseResultKind::NoMatch => { - ParserResult::no_match(leading_trivia, None, expected_terminals) - } + ParseResultKind::NoMatch => ParserResult::no_match(None, expected_terminals), } } } diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs index 7a13af5bd1..3d612e4fe3 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs @@ -27,11 +27,10 @@ impl RepetitionHelper { // Couldn't get a full match but we allow 0 items - return an empty match // so the parse is considered valid but note the expected terminals ParserResult::NoMatch(NoMatch { - nodes, kind: _, expected_terminals, }) if MIN_COUNT == 0 => { - return ParserResult::r#match(nodes, expected_terminals); + return ParserResult::r#match(vec![], expected_terminals); } // Don't try repeating if we don't have a full match and we require at least one incomplete_or_no_match => return incomplete_or_no_match, diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs index 8efcac8f74..280d89c8cf 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs @@ -89,7 +89,7 @@ impl SeparatedHelper { } ParserResult::NoMatch(no_match) => { return if accum.is_empty() { - ParserResult::no_match(no_match.nodes, None, no_match.expected_terminals) + ParserResult::no_match(None, no_match.expected_terminals) } else { ParserResult::incomplete_match(accum, no_match.expected_terminals) }; diff --git a/crates/metaslang/cst/generated/public_api.txt b/crates/metaslang/cst/generated/public_api.txt index 3f00927431..9a2eb5a033 100644 --- a/crates/metaslang/cst/generated/public_api.txt +++ b/crates/metaslang/cst/generated/public_api.txt @@ -247,6 +247,7 @@ pub metaslang_cst::text_index::TextIndex::utf8: usize impl metaslang_cst::text_index::TextIndex pub const metaslang_cst::text_index::TextIndex::ZERO: metaslang_cst::text_index::TextIndex pub fn metaslang_cst::text_index::TextIndex::advance(&mut self, c: char, next: core::option::Option<&char>) +pub fn metaslang_cst::text_index::TextIndex::advance_str(&mut self, text: &str) impl core::clone::Clone for metaslang_cst::text_index::TextIndex pub fn metaslang_cst::text_index::TextIndex::clone(&self) -> metaslang_cst::text_index::TextIndex impl core::cmp::Eq for metaslang_cst::text_index::TextIndex diff --git a/crates/metaslang/cst/src/text_index.rs b/crates/metaslang/cst/src/text_index.rs index c0144c4a3f..18ed1b4dd8 100644 --- a/crates/metaslang/cst/src/text_index.rs +++ b/crates/metaslang/cst/src/text_index.rs @@ -42,11 +42,11 @@ impl TextIndex { } pub fn advance_str(&mut self, text: &str) { - text.chars().for_each(|c| { - if c != '\r' { - self.advance(c, None); - } - }); + let mut iter = text.chars().peekable(); + while let Some(c) = iter.next() { + let n = iter.peek(); + self.advance(c, n); + } } } @@ -71,11 +71,7 @@ impl Display for TextIndex { impl> From for TextIndex { fn from(s: T) -> Self { let mut result = Self::ZERO; - let mut iter = s.as_ref().chars().peekable(); - while let Some(c) = iter.next() { - let n = iter.peek(); - result.advance(c, n); - } + result.advance_str(s.as_ref()); result } } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs index 480c652881..c648756daf 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs @@ -96,7 +96,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(start); - return ParserResult::no_match(vec![], None, vec![kind]); + return ParserResult::no_match(None, vec![kind]); } let end = input.position(); @@ -131,7 +131,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(restore); - return ParserResult::no_match(children, None, vec![kind]); + return ParserResult::no_match(None, vec![kind]); } let end = input.position(); children.push(Edge::anonymous(Node::terminal( diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs index f7c44e0137..9042b7756c 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs @@ -54,10 +54,6 @@ impl ChoiceHelper { // Still no match, extend the possible expected terminals. (ParserResult::NoMatch(running), ParserResult::NoMatch(next)) => { - if running.nodes.is_empty() && !next.nodes.is_empty() { - // transfer nodes - running.nodes.extend(next.nodes.clone()); - } running .expected_terminals .extend(next.expected_terminals.clone()); @@ -133,7 +129,7 @@ pub fn total_not_skipped_span(result: &ParserResult) -> usize { ParserResult::Match(match_) => &match_.nodes, ParserResult::IncompleteMatch(incomplete_match) => &incomplete_match.nodes, ParserResult::SkippedUntil(skipped) => &skipped.nodes, - ParserResult::NoMatch(no_match) => &no_match.nodes, + ParserResult::NoMatch(_) => &vec![], ParserResult::PrattOperatorMatch(_) => unreachable!( "PrattOperatorMatch is always considered a better pick, so it should never be considered here" ), diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs index 7bcdead08e..989e259cda 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs @@ -10,7 +10,7 @@ impl OptionalHelper { // If there's absolutely no match, we treat it as a match (for the purposes of the Result algebra) // but we bubble up the information which terminals would have allowed more progress. ParserResult::NoMatch(no_match) => { - ParserResult::r#match(no_match.nodes, no_match.expected_terminals) + ParserResult::r#match(vec![], no_match.expected_terminals) } // ... otherwise we return the result as-is ParserResult::Match(_) diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index d1bd24d10e..7a3afb9156 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -58,32 +58,40 @@ where match result { ParserResult::PrattOperatorMatch(..) => unreachable!("PrattOperatorMatch is internal"), - ParserResult::NoMatch(mut no_match) => { - let (kind, start) = if input.is_empty() { - (TerminalKind::MISSING, TextIndex::ZERO) + ParserResult::NoMatch(no_match) => { + let mut trivia_nodes = if let ParserResult::Match(matched) = + Lexer::leading_trivia(parser, &mut stream) + { + matched.nodes } else { - let mut ti = TextIndex::ZERO; - no_match.nodes.iter().for_each(|edge| { - if let Node::Terminal(terminal) = &edge.node { - if terminal.kind.is_valid() { - ti.advance_str(terminal.text.as_str()); - } - } - }); - (TerminalKind::UNRECOGNIZED, ti) + vec![] }; - let node = Node::terminal(kind, input[start.utf8..].to_string()); + let mut start = TextIndex::ZERO; + for edge in &trivia_nodes { + if let Node::Terminal(terminal) = &edge.node { + if terminal.kind.is_valid() { + start.advance_str(terminal.text.as_str()); + } + } + } + let input = &input[start.utf8..]; + let kind = if input.is_empty() { + TerminalKind::MISSING + } else { + TerminalKind::UNRECOGNIZED + }; + let node = Node::terminal(kind, input.to_string()); let tree = if no_match.kind.is_none() || start.utf8 == 0 { node } else { - no_match.nodes.push(Edge::anonymous(node)); - Node::nonterminal(no_match.kind.unwrap(), no_match.nodes) + trivia_nodes.push(Edge::anonymous(node)); + Node::nonterminal(no_match.kind.unwrap(), trivia_nodes) }; ParseOutput { parse_tree: tree, errors: vec![ParseError::new( - start..input.into(), + start..start + input.into(), no_match.expected_terminals, )], } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs index 016f002ca4..64f7f41fe1 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs @@ -18,7 +18,6 @@ pub enum ParserResult { impl Default for ParserResult { fn default() -> Self { Self::NoMatch(NoMatch { - nodes: vec![], kind: None, expected_terminals: vec![], }) @@ -40,15 +39,11 @@ impl ParserResult { /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![], None, vec![])`. pub fn disabled() -> Self { - Self::no_match(vec![], None, vec![]) + Self::no_match(None, vec![]) } - pub fn no_match( - nodes: Vec, - kind: Option, - expected_terminals: Vec, - ) -> Self { - ParserResult::NoMatch(NoMatch::new(nodes, kind, expected_terminals)) + pub fn no_match(kind: Option, expected_terminals: Vec) -> Self { + ParserResult::NoMatch(NoMatch::new(kind, expected_terminals)) } #[must_use] @@ -70,7 +65,7 @@ impl ParserResult { ..skipped }), ParserResult::NoMatch(no_match) => { - ParserResult::no_match(no_match.nodes, Some(new_kind), no_match.expected_terminals) + ParserResult::no_match(Some(new_kind), no_match.expected_terminals) } ParserResult::PrattOperatorMatch(_) => { unreachable!("PrattOperatorMatch cannot be converted to a nonterminal") @@ -240,8 +235,6 @@ impl IncompleteMatch { #[derive(PartialEq, Eq, Clone, Debug)] pub struct NoMatch { - /// The terminals that were parsed; trivia - pub nodes: Vec, /// The nonterminal kind this match is coming from pub kind: Option, /// Terminals that would have allowed for more progress. Collected for the purposes of error reporting. @@ -249,13 +242,8 @@ pub struct NoMatch { } impl NoMatch { - pub fn new( - nodes: Vec, - kind: Option, - expected_terminals: Vec, - ) -> Self { + pub fn new(kind: Option, expected_terminals: Vec) -> Self { Self { - nodes, kind, expected_terminals, } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs index 843c908e16..1833209d75 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs @@ -111,9 +111,7 @@ impl ParserResult { ParseResultKind::Incomplete => { ParserResult::incomplete_match(nodes, expected_terminals) } - ParseResultKind::NoMatch => { - ParserResult::no_match(leading_trivia, None, expected_terminals) - } + ParseResultKind::NoMatch => ParserResult::no_match(None, expected_terminals), } } } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs index abfd3cf3c0..a4fb3a2be5 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs @@ -29,11 +29,10 @@ impl RepetitionHelper { // Couldn't get a full match but we allow 0 items - return an empty match // so the parse is considered valid but note the expected terminals ParserResult::NoMatch(NoMatch { - nodes, kind: _, expected_terminals, }) if MIN_COUNT == 0 => { - return ParserResult::r#match(nodes, expected_terminals); + return ParserResult::r#match(vec![], expected_terminals); } // Don't try repeating if we don't have a full match and we require at least one incomplete_or_no_match => return incomplete_or_no_match, diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs index e2d68a177e..eca96115d0 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs @@ -91,7 +91,7 @@ impl SeparatedHelper { } ParserResult::NoMatch(no_match) => { return if accum.is_empty() { - ParserResult::no_match(no_match.nodes, None, no_match.expected_terminals) + ParserResult::no_match(None, no_match.expected_terminals) } else { ParserResult::incomplete_match(accum, no_match.expected_terminals) }; diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unicode_in_doc_comments/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unicode_in_doc_comments/generated/0.4.11-failure.yml index b92ae184b3..02e2ecb360 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unicode_in_doc_comments/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unicode_in_doc_comments/generated/0.4.11-failure.yml @@ -17,4 +17,11 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "// ╒══════════════════════════════════════════════..." # (0..489) + - (ContractDefinition): # "// ╒══════════════════════════════════════════════..." (0..489) + - (leading_trivia꞉ SingleLineComment): "// ╒══════════════════════════════════════════════..." # (0..201) + - (leading_trivia꞉ EndOfLine): "\n" # (201..202) + - (leading_trivia꞉ SingleLineComment): "// │ More Info: https://github.com/NomicFoundation..." # (202..275) + - (leading_trivia꞉ EndOfLine): "\n" # (275..276) + - (leading_trivia꞉ SingleLineComment): "// ╘══════════════════════════════════════════════..." # (276..477) + - (leading_trivia꞉ EndOfLine): "\n" # (477..478) + - (UNRECOGNIZED): "unexpected\n" # (478..489) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_ascii/generated/0.4.25-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_ascii/generated/0.4.25-failure.yml index fa426b798c..6d35cb954c 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_ascii/generated/0.4.25-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_ascii/generated/0.4.25-failure.yml @@ -15,4 +15,7 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): '// Disallowed post 0.4.25\n"\a"\n' # (0..31) + - (StringLiteral): # '// Disallowed post 0.4.25\n"\a"\n' (0..31) + - (leading_trivia꞉ SingleLineComment): "// Disallowed post 0.4.25" # (0..25) + - (leading_trivia꞉ EndOfLine): "\n" # (25..26) + - (UNRECOGNIZED): '"\a"\n' # (26..31) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_unicode/generated/0.4.25-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_unicode/generated/0.4.25-failure.yml index 48bab2bab6..e98c1d5e98 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_unicode/generated/0.4.25-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_arbitrary_unicode/generated/0.4.25-failure.yml @@ -15,4 +15,7 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): '// Disallowed post 0.4.25\n"\✅"\n' # (0..33) + - (StringLiteral): # '// Disallowed post 0.4.25\n"\✅"\n' (0..33) + - (leading_trivia꞉ SingleLineComment): "// Disallowed post 0.4.25" # (0..25) + - (leading_trivia꞉ EndOfLine): "\n" # (25..26) + - (UNRECOGNIZED): '"\✅"\n' # (26..33) diff --git a/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/generated/0.4.11-failure.yml index 893a1bbd44..4f4bbd6c52 100644 --- a/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/generated/0.4.11-failure.yml @@ -22,4 +22,10 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "// Make sure that error recovery won't lead to mis..." # (0..171) + - (TryStatement): # "// Make sure that error recovery won't lead to mis..." (0..171) + - (leading_trivia꞉ SingleLineComment): "// Make sure that error recovery won't lead to mis..." # (0..57) + - (leading_trivia꞉ EndOfLine): "\n" # (57..58) + - (leading_trivia꞉ SingleLineComment): "// ambiguous function call options with the block ..." # (58..136) + - (leading_trivia꞉ EndOfLine): "\n" # (136..137) + - (leading_trivia꞉ EndOfLine): "\n" # (137..138) + - (UNRECOGNIZED): "try foo() {\n bar();\n} catch {\n}\n" # (138..171) diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_var/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_var/generated/0.5.0-failure.yml index 124aed234c..12cc49290f 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_var/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_var/generated/0.5.0-failure.yml @@ -15,4 +15,7 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): '// "var" should be disabled in "0.5.0":\nvar (foo, ...' # (0..62) + - (TupleDeconstructionStatement): # '// "var" should be disabled in "0.5.0":\nvar (foo, ...' (0..62) + - (leading_trivia꞉ SingleLineComment): '// "var" should be disabled in "0.5.0":' # (0..39) + - (leading_trivia꞉ EndOfLine): "\n" # (39..40) + - (UNRECOGNIZED): "var (foo, bar) = rhs;\n" # (40..62) diff --git a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/generated/0.6.0-failure.yml index df7c141a1b..7f629684df 100644 --- a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/generated/0.6.0-failure.yml @@ -15,4 +15,7 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "// Split into `view` and `pure` in 0.4.16\nfunction..." # (0..66) + - (UnnamedFunctionDefinition): # "// Split into `view` and `pure` in 0.4.16\nfunction..." (0..66) + - (leading_trivia꞉ SingleLineComment): "// Split into `view` and `pure` in 0.4.16" # (0..41) + - (leading_trivia꞉ EndOfLine): "\n" # (41..42) + - (UNRECOGNIZED): "function () constant {}\n" # (42..66) diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs index 480c652881..c648756daf 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs @@ -96,7 +96,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(start); - return ParserResult::no_match(vec![], None, vec![kind]); + return ParserResult::no_match(None, vec![kind]); } let end = input.position(); @@ -131,7 +131,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(restore); - return ParserResult::no_match(children, None, vec![kind]); + return ParserResult::no_match(None, vec![kind]); } let end = input.position(); children.push(Edge::anonymous(Node::terminal( diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs index f7c44e0137..9042b7756c 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs @@ -54,10 +54,6 @@ impl ChoiceHelper { // Still no match, extend the possible expected terminals. (ParserResult::NoMatch(running), ParserResult::NoMatch(next)) => { - if running.nodes.is_empty() && !next.nodes.is_empty() { - // transfer nodes - running.nodes.extend(next.nodes.clone()); - } running .expected_terminals .extend(next.expected_terminals.clone()); @@ -133,7 +129,7 @@ pub fn total_not_skipped_span(result: &ParserResult) -> usize { ParserResult::Match(match_) => &match_.nodes, ParserResult::IncompleteMatch(incomplete_match) => &incomplete_match.nodes, ParserResult::SkippedUntil(skipped) => &skipped.nodes, - ParserResult::NoMatch(no_match) => &no_match.nodes, + ParserResult::NoMatch(_) => &vec![], ParserResult::PrattOperatorMatch(_) => unreachable!( "PrattOperatorMatch is always considered a better pick, so it should never be considered here" ), diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs index 7bcdead08e..989e259cda 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/optional_helper.rs @@ -10,7 +10,7 @@ impl OptionalHelper { // If there's absolutely no match, we treat it as a match (for the purposes of the Result algebra) // but we bubble up the information which terminals would have allowed more progress. ParserResult::NoMatch(no_match) => { - ParserResult::r#match(no_match.nodes, no_match.expected_terminals) + ParserResult::r#match(vec![], no_match.expected_terminals) } // ... otherwise we return the result as-is ParserResult::Match(_) diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index d1bd24d10e..7a3afb9156 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -58,32 +58,40 @@ where match result { ParserResult::PrattOperatorMatch(..) => unreachable!("PrattOperatorMatch is internal"), - ParserResult::NoMatch(mut no_match) => { - let (kind, start) = if input.is_empty() { - (TerminalKind::MISSING, TextIndex::ZERO) + ParserResult::NoMatch(no_match) => { + let mut trivia_nodes = if let ParserResult::Match(matched) = + Lexer::leading_trivia(parser, &mut stream) + { + matched.nodes } else { - let mut ti = TextIndex::ZERO; - no_match.nodes.iter().for_each(|edge| { - if let Node::Terminal(terminal) = &edge.node { - if terminal.kind.is_valid() { - ti.advance_str(terminal.text.as_str()); - } - } - }); - (TerminalKind::UNRECOGNIZED, ti) + vec![] }; - let node = Node::terminal(kind, input[start.utf8..].to_string()); + let mut start = TextIndex::ZERO; + for edge in &trivia_nodes { + if let Node::Terminal(terminal) = &edge.node { + if terminal.kind.is_valid() { + start.advance_str(terminal.text.as_str()); + } + } + } + let input = &input[start.utf8..]; + let kind = if input.is_empty() { + TerminalKind::MISSING + } else { + TerminalKind::UNRECOGNIZED + }; + let node = Node::terminal(kind, input.to_string()); let tree = if no_match.kind.is_none() || start.utf8 == 0 { node } else { - no_match.nodes.push(Edge::anonymous(node)); - Node::nonterminal(no_match.kind.unwrap(), no_match.nodes) + trivia_nodes.push(Edge::anonymous(node)); + Node::nonterminal(no_match.kind.unwrap(), trivia_nodes) }; ParseOutput { parse_tree: tree, errors: vec![ParseError::new( - start..input.into(), + start..start + input.into(), no_match.expected_terminals, )], } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs index 016f002ca4..64f7f41fe1 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs @@ -18,7 +18,6 @@ pub enum ParserResult { impl Default for ParserResult { fn default() -> Self { Self::NoMatch(NoMatch { - nodes: vec![], kind: None, expected_terminals: vec![], }) @@ -40,15 +39,11 @@ impl ParserResult { /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![], None, vec![])`. pub fn disabled() -> Self { - Self::no_match(vec![], None, vec![]) + Self::no_match(None, vec![]) } - pub fn no_match( - nodes: Vec, - kind: Option, - expected_terminals: Vec, - ) -> Self { - ParserResult::NoMatch(NoMatch::new(nodes, kind, expected_terminals)) + pub fn no_match(kind: Option, expected_terminals: Vec) -> Self { + ParserResult::NoMatch(NoMatch::new(kind, expected_terminals)) } #[must_use] @@ -70,7 +65,7 @@ impl ParserResult { ..skipped }), ParserResult::NoMatch(no_match) => { - ParserResult::no_match(no_match.nodes, Some(new_kind), no_match.expected_terminals) + ParserResult::no_match(Some(new_kind), no_match.expected_terminals) } ParserResult::PrattOperatorMatch(_) => { unreachable!("PrattOperatorMatch cannot be converted to a nonterminal") @@ -240,8 +235,6 @@ impl IncompleteMatch { #[derive(PartialEq, Eq, Clone, Debug)] pub struct NoMatch { - /// The terminals that were parsed; trivia - pub nodes: Vec, /// The nonterminal kind this match is coming from pub kind: Option, /// Terminals that would have allowed for more progress. Collected for the purposes of error reporting. @@ -249,13 +242,8 @@ pub struct NoMatch { } impl NoMatch { - pub fn new( - nodes: Vec, - kind: Option, - expected_terminals: Vec, - ) -> Self { + pub fn new(kind: Option, expected_terminals: Vec) -> Self { Self { - nodes, kind, expected_terminals, } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs index 843c908e16..1833209d75 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs @@ -111,9 +111,7 @@ impl ParserResult { ParseResultKind::Incomplete => { ParserResult::incomplete_match(nodes, expected_terminals) } - ParseResultKind::NoMatch => { - ParserResult::no_match(leading_trivia, None, expected_terminals) - } + ParseResultKind::NoMatch => ParserResult::no_match(None, expected_terminals), } } } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs index abfd3cf3c0..a4fb3a2be5 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs @@ -29,11 +29,10 @@ impl RepetitionHelper { // Couldn't get a full match but we allow 0 items - return an empty match // so the parse is considered valid but note the expected terminals ParserResult::NoMatch(NoMatch { - nodes, kind: _, expected_terminals, }) if MIN_COUNT == 0 => { - return ParserResult::r#match(nodes, expected_terminals); + return ParserResult::r#match(vec![], expected_terminals); } // Don't try repeating if we don't have a full match and we require at least one incomplete_or_no_match => return incomplete_or_no_match, diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs index e2d68a177e..eca96115d0 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs @@ -91,7 +91,7 @@ impl SeparatedHelper { } ParserResult::NoMatch(no_match) => { return if accum.is_empty() { - ParserResult::no_match(no_match.nodes, None, no_match.expected_terminals) + ParserResult::no_match(None, no_match.expected_terminals) } else { ParserResult::incomplete_match(accum, no_match.expected_terminals) }; From 24aff8c1841c4a6f157b117a926f8f5159a7c944 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Thu, 28 Nov 2024 09:30:02 -0300 Subject: [PATCH 06/22] Revert little change with no semantic difference --- .../crate/src/runtime/parser/parser_support/choice_helper.rs | 2 +- .../crate/src/generated/parser/parser_support/choice_helper.rs | 2 +- .../crate/src/generated/parser/parser_support/choice_helper.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs index b96c0c8557..3253a7988d 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/choice_helper.rs @@ -127,7 +127,7 @@ pub fn total_not_skipped_span(result: &ParserResult) -> usize { ParserResult::Match(match_) => &match_.nodes, ParserResult::IncompleteMatch(incomplete_match) => &incomplete_match.nodes, ParserResult::SkippedUntil(skipped) => &skipped.nodes, - ParserResult::NoMatch(_) => &vec![], + ParserResult::NoMatch(_) => &[][..], ParserResult::PrattOperatorMatch(_) => unreachable!( "PrattOperatorMatch is always considered a better pick, so it should never be considered here" ), diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs index 9042b7756c..84e9295266 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs @@ -129,7 +129,7 @@ pub fn total_not_skipped_span(result: &ParserResult) -> usize { ParserResult::Match(match_) => &match_.nodes, ParserResult::IncompleteMatch(incomplete_match) => &incomplete_match.nodes, ParserResult::SkippedUntil(skipped) => &skipped.nodes, - ParserResult::NoMatch(_) => &vec![], + ParserResult::NoMatch(_) => &[][..], ParserResult::PrattOperatorMatch(_) => unreachable!( "PrattOperatorMatch is always considered a better pick, so it should never be considered here" ), diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs index 9042b7756c..84e9295266 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/choice_helper.rs @@ -129,7 +129,7 @@ pub fn total_not_skipped_span(result: &ParserResult) -> usize { ParserResult::Match(match_) => &match_.nodes, ParserResult::IncompleteMatch(incomplete_match) => &incomplete_match.nodes, ParserResult::SkippedUntil(skipped) => &skipped.nodes, - ParserResult::NoMatch(_) => &vec![], + ParserResult::NoMatch(_) => &[][..], ParserResult::PrattOperatorMatch(_) => unreachable!( "PrattOperatorMatch is always considered a better pick, so it should never be considered here" ), From ecd50620e0ee7b0fbba7f285563979bafef14e59 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Thu, 28 Nov 2024 09:31:25 -0300 Subject: [PATCH 07/22] Fixing comment --- .../crate/src/runtime/parser/parser_support/parser_result.rs | 2 +- .../crate/src/generated/parser/parser_support/parser_result.rs | 2 +- .../crate/src/generated/parser/parser_support/parser_result.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs index eaf550849e..1f9b6e8e14 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs @@ -35,7 +35,7 @@ impl ParserResult { ParserResult::IncompleteMatch(IncompleteMatch::new(nodes, expected_terminals)) } - /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![], None, vec![])`. + /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(None, vec![])`. pub fn disabled() -> Self { Self::no_match(None, vec![]) } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs index 64f7f41fe1..1ec7594426 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs @@ -37,7 +37,7 @@ impl ParserResult { ParserResult::IncompleteMatch(IncompleteMatch::new(nodes, expected_terminals)) } - /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![], None, vec![])`. + /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(None, vec![])`. pub fn disabled() -> Self { Self::no_match(None, vec![]) } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs index 64f7f41fe1..1ec7594426 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs @@ -37,7 +37,7 @@ impl ParserResult { ParserResult::IncompleteMatch(IncompleteMatch::new(nodes, expected_terminals)) } - /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![], None, vec![])`. + /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(None, vec![])`. pub fn disabled() -> Self { Self::no_match(None, vec![]) } From 41136096be4744aa8ded421819d236cb320a1df2 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Thu, 28 Nov 2024 09:41:15 -0300 Subject: [PATCH 08/22] revert of unnecessary change --- .../crate/src/runtime/parser/parser_support/recovery.rs | 6 +----- .../crate/src/generated/parser/parser_support/recovery.rs | 6 +----- .../crate/src/generated/parser/parser_support/recovery.rs | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs index ce57ca3b68..9885e723b3 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs @@ -70,11 +70,7 @@ impl ParserResult { ) } ParserResult::NoMatch(result) if acceptance_threshold.0 == 0 => { - ( - vec![], /* trivia will be read below */ - result.expected_terminals, - ParseResultKind::NoMatch, - ) + (vec![], result.expected_terminals, ParseResultKind::NoMatch) } // No need to recover, so just return as-is. _ => return self, diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs index 1833209d75..c49819e30f 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs @@ -72,11 +72,7 @@ impl ParserResult { ) } ParserResult::NoMatch(result) if acceptance_threshold.0 == 0 => { - ( - vec![], /* trivia will be read below */ - result.expected_terminals, - ParseResultKind::NoMatch, - ) + (vec![], result.expected_terminals, ParseResultKind::NoMatch) } // No need to recover, so just return as-is. _ => return self, diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs index 1833209d75..c49819e30f 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs @@ -72,11 +72,7 @@ impl ParserResult { ) } ParserResult::NoMatch(result) if acceptance_threshold.0 == 0 => { - ( - vec![], /* trivia will be read below */ - result.expected_terminals, - ParseResultKind::NoMatch, - ) + (vec![], result.expected_terminals, ParseResultKind::NoMatch) } // No need to recover, so just return as-is. _ => return self, From 7495413cb894ee8cfd68dd858466823b9150787a Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Tue, 10 Dec 2024 10:55:39 -0300 Subject: [PATCH 09/22] Adding comment --- .../src/runtime/parser/parser_support/parser_function.rs | 5 +++++ .../src/generated/parser/parser_support/parser_function.rs | 5 +++++ .../src/generated/parser/parser_support/parser_function.rs | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs index 531f5a0c6e..b921590b2f 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs @@ -57,6 +57,11 @@ where ParserResult::PrattOperatorMatch(..) => unreachable!("PrattOperatorMatch is internal"), ParserResult::NoMatch(no_match) => { + // Parse leading trivia (see #1172 for details). One could argue that trivia should be parsed + // just once, and returned in the `NoMatch` structure. However, in rules like (This | That), + // trivia is already parsed twice, one for each branch. And there's a good reason: each branch might + // accept different trivia, so it's not clear what the combination of the two rules should return in a + // NoMatch. Therefore, we just parse it again. Note that trivia is anyway cached by the parser (#1119). let mut trivia_nodes = if let ParserResult::Match(matched) = Lexer::leading_trivia(parser, &mut stream) { diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index 7a3afb9156..ec3766b706 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -59,6 +59,11 @@ where ParserResult::PrattOperatorMatch(..) => unreachable!("PrattOperatorMatch is internal"), ParserResult::NoMatch(no_match) => { + // Parse leading trivia (see #1172 for details). One could argue that trivia should be parsed + // just once, and returned in the `NoMatch` structure. However, in rules like (This | That), + // trivia is already parsed twice, one for each branch. And there's a good reason: each branch might + // accept different trivia, so it's not clear what the combination of the two rules should return in a + // NoMatch. Therefore, we just parse it again. Note that trivia is anyway cached by the parser (#1119). let mut trivia_nodes = if let ParserResult::Match(matched) = Lexer::leading_trivia(parser, &mut stream) { diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index 7a3afb9156..ec3766b706 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -59,6 +59,11 @@ where ParserResult::PrattOperatorMatch(..) => unreachable!("PrattOperatorMatch is internal"), ParserResult::NoMatch(no_match) => { + // Parse leading trivia (see #1172 for details). One could argue that trivia should be parsed + // just once, and returned in the `NoMatch` structure. However, in rules like (This | That), + // trivia is already parsed twice, one for each branch. And there's a good reason: each branch might + // accept different trivia, so it's not clear what the combination of the two rules should return in a + // NoMatch. Therefore, we just parse it again. Note that trivia is anyway cached by the parser (#1119). let mut trivia_nodes = if let ParserResult::Match(matched) = Lexer::leading_trivia(parser, &mut stream) { From 4dc2d0bf4d94135c908debb040d8ac1988eadc4a Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Tue, 10 Dec 2024 10:58:04 -0300 Subject: [PATCH 10/22] Adding changeset --- .changeset/smart-cooks-suffer.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/smart-cooks-suffer.md diff --git a/.changeset/smart-cooks-suffer.md b/.changeset/smart-cooks-suffer.md new file mode 100644 index 0000000000..c1f5530082 --- /dev/null +++ b/.changeset/smart-cooks-suffer.md @@ -0,0 +1,5 @@ +--- +"@nomicfoundation/slang": minor +--- + +Improved error recovery, where leading trivia are always parsed and included before an errornous terminal. From 72d485800d7b00495ac7266b40dc4d14a91105ad Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Wed, 11 Dec 2024 10:29:08 -0300 Subject: [PATCH 11/22] fixup --- .changeset/smart-cooks-suffer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/smart-cooks-suffer.md b/.changeset/smart-cooks-suffer.md index c1f5530082..2c46a5040c 100644 --- a/.changeset/smart-cooks-suffer.md +++ b/.changeset/smart-cooks-suffer.md @@ -2,4 +2,4 @@ "@nomicfoundation/slang": minor --- -Improved error recovery, where leading trivia are always parsed and included before an errornous terminal. +Improved error recovery, where leading trivia are always parsed and included before an erroneous terminal. From 26d5e003e3bc3ff07d34d1362d481ea8cfc0d83a Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Wed, 11 Dec 2024 15:41:49 -0300 Subject: [PATCH 12/22] Changing parse_result to return a NonTerminalNode instead of a Node --- .../crate/src/runtime/parser/parse_output.rs | 12 ++++++----- .../parser/parser_support/parser_function.rs | 18 ++++++----------- .../runtime/interface/generated/parser.wit | 4 ++-- .../src/runtime/interface/parser.wit.jinja2 | 4 ++-- .../wasm/src/runtime/wrappers/parser/mod.rs | 4 ++-- crates/metaslang/cst/generated/public_api.txt | 2 ++ crates/metaslang/cst/src/nodes.rs | 20 ++++++++++++------- .../cargo/crate/generated/public_api.txt | 2 +- .../src/generated/parser/parse_output.rs | 12 ++++++----- .../parser/parser_support/parser_function.rs | 18 ++++++----------- .../outputs/cargo/tests/src/bindings.rs | 7 ++++--- .../src/doc_examples/using_the_parser.rs | 3 +-- .../generated/interface/generated/parser.wit | 4 ++-- .../wasm/src/generated/wrappers/parser/mod.rs | 4 ++-- .../solidity/testing/sanctuary/src/tests.rs | 6 +++--- .../src/generated/parser/parse_output.rs | 12 ++++++----- .../parser/parser_support/parser_function.rs | 18 ++++++----------- .../generated/interface/generated/parser.wit | 4 ++-- .../wasm/src/generated/wrappers/parser/mod.rs | 4 ++-- 19 files changed, 77 insertions(+), 81 deletions(-) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parse_output.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parse_output.rs index 77b6b157f5..912645f278 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parse_output.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parse_output.rs @@ -1,15 +1,17 @@ -use crate::cst::{Cursor, Node, TextIndex}; +use std::rc::Rc; + +use crate::cst::{Cursor, NonterminalNode, TextIndex}; use crate::parser::ParseError; #[derive(Debug, PartialEq)] pub struct ParseOutput { - pub(crate) parse_tree: Node, + pub(crate) parse_tree: Rc, pub(crate) errors: Vec, } impl ParseOutput { - pub fn tree(&self) -> Node { - self.parse_tree.clone() + pub fn tree(&self) -> Rc { + Rc::clone(&self.parse_tree) } pub fn errors(&self) -> &Vec { @@ -22,6 +24,6 @@ impl ParseOutput { /// Creates a cursor that starts at the root of the parse tree. pub fn create_tree_cursor(&self) -> Cursor { - self.parse_tree.clone().cursor_with_offset(TextIndex::ZERO) + Rc::clone(&self.parse_tree).cursor_with_offset(TextIndex::ZERO) } } diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs index f2ab664108..7536d3b348 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs @@ -1,6 +1,6 @@ use std::rc::Rc; -use crate::cst::{Edge, Node, TerminalKind, TerminalKindExtensions, TextIndex}; +use crate::cst::{Edge, Node, NonterminalNode, TerminalKind, TerminalKindExtensions, TextIndex}; use crate::parser::lexer::Lexer; use crate::parser::parser_support::context::ParserContext; use crate::parser::parser_support::parser_result::{ @@ -85,14 +85,9 @@ where TerminalKind::UNRECOGNIZED }; let node = Node::terminal(kind, input.to_string()); - let tree = if no_match.kind.is_none() || start.utf8 == 0 { - node - } else { - trivia_nodes.push(Edge::anonymous(node)); - Node::nonterminal(no_match.kind.unwrap(), trivia_nodes) - }; + trivia_nodes.push(Edge::anonymous(node)); ParseOutput { - parse_tree: tree, + parse_tree: Rc::new(NonterminalNode::new(no_match.kind.unwrap(), trivia_nodes)), errors: vec![ParseError::new( start..start + input.into(), no_match.expected_terminals, @@ -156,18 +151,17 @@ where )); ParseOutput { - parse_tree: Node::nonterminal(topmost_node.kind, new_children), + parse_tree: Rc::new(NonterminalNode::new(topmost_node.kind, new_children)), errors, } } else { - let parse_tree = Node::Nonterminal(topmost_node); + let parse_tree = topmost_node; let errors = stream.into_errors(); // Sanity check: Make sure that succesful parse is equivalent to not having any invalid nodes debug_assert_eq!( errors.is_empty(), - parse_tree - .clone() + Rc::clone(&parse_tree) .cursor_with_offset(TextIndex::ZERO) .remaining_nodes() .all(|edge| edge diff --git a/crates/codegen/runtime/cargo/wasm/src/runtime/interface/generated/parser.wit b/crates/codegen/runtime/cargo/wasm/src/runtime/interface/generated/parser.wit index bbe8faa7c8..42b61577d4 100644 --- a/crates/codegen/runtime/cargo/wasm/src/runtime/interface/generated/parser.wit +++ b/crates/codegen/runtime/cargo/wasm/src/runtime/interface/generated/parser.wit @@ -1,7 +1,7 @@ // This file is generated automatically by infrastructure scripts. Please don't edit by hand. interface parser { - use cst.{cursor, node, nonterminal-kind, text-range}; + use cst.{cursor, nonterminal-node, nonterminal-kind, text-range}; /// A parser instance that can parse source code into syntax trees. /// Each parser is configured for a specific language version and grammar. @@ -38,7 +38,7 @@ interface parser { resource parse-output { /// Returns the root node of the parsed syntax tree. /// Even if there are parsing errors, a partial tree will still be available. - tree: func() -> node; + tree: func() -> nonterminal-node; /// Returns a list of all parsing errors encountered. /// An empty list indicates successful parsing with no errors. diff --git a/crates/codegen/runtime/cargo/wasm/src/runtime/interface/parser.wit.jinja2 b/crates/codegen/runtime/cargo/wasm/src/runtime/interface/parser.wit.jinja2 index dd9ddccb28..484c013563 100644 --- a/crates/codegen/runtime/cargo/wasm/src/runtime/interface/parser.wit.jinja2 +++ b/crates/codegen/runtime/cargo/wasm/src/runtime/interface/parser.wit.jinja2 @@ -1,5 +1,5 @@ interface parser { - use cst.{cursor, node, nonterminal-kind, text-range}; + use cst.{cursor, nonterminal-node, nonterminal-kind, text-range}; /// A parser instance that can parse source code into syntax trees. /// Each parser is configured for a specific language version and grammar. @@ -36,7 +36,7 @@ interface parser { resource parse-output { /// Returns the root node of the parsed syntax tree. /// Even if there are parsing errors, a partial tree will still be available. - tree: func() -> node; + tree: func() -> nonterminal-node; /// Returns a list of all parsing errors encountered. /// An empty list indicates successful parsing with no errors. diff --git a/crates/codegen/runtime/cargo/wasm/src/runtime/wrappers/parser/mod.rs b/crates/codegen/runtime/cargo/wasm/src/runtime/wrappers/parser/mod.rs index 4add8de247..053ad7324b 100644 --- a/crates/codegen/runtime/cargo/wasm/src/runtime/wrappers/parser/mod.rs +++ b/crates/codegen/runtime/cargo/wasm/src/runtime/wrappers/parser/mod.rs @@ -2,7 +2,7 @@ use crate::wasm_crate::utils::{define_wrapper, FromFFI, IntoFFI}; mod ffi { pub use crate::wasm_crate::bindings::exports::nomic_foundation::slang::cst::{ - Cursor, Node, TextRange, + Cursor, NonterminalNode, TextRange, }; pub use crate::wasm_crate::bindings::exports::nomic_foundation::slang::parser::{ Guest, GuestParseError, GuestParseOutput, GuestParser, NonterminalKind, ParseError, @@ -77,7 +77,7 @@ define_wrapper! { ParseError { //================================================ define_wrapper! { ParseOutput { - fn tree(&self) -> ffi::Node { + fn tree(&self) -> ffi::NonterminalNode { self._borrow_ffi().tree()._into_ffi() } diff --git a/crates/metaslang/cst/generated/public_api.txt b/crates/metaslang/cst/generated/public_api.txt index 83370fcc7c..d1f0012ef2 100644 --- a/crates/metaslang/cst/generated/public_api.txt +++ b/crates/metaslang/cst/generated/public_api.txt @@ -153,6 +153,8 @@ pub fn metaslang_cst::nodes::NonterminalNode::cursor_with_offset(self: alloc: pub fn metaslang_cst::nodes::NonterminalNode::descendants(self: alloc::rc::Rc) -> metaslang_cst::cursor::CursorIterator pub fn metaslang_cst::nodes::NonterminalNode::id(self: &alloc::rc::Rc) -> usize pub fn metaslang_cst::nodes::NonterminalNode::unparse(&self) -> alloc::string::String +impl metaslang_cst::nodes::NonterminalNode +pub fn metaslang_cst::nodes::NonterminalNode::new(kind: ::NonterminalKind, children: alloc::vec::Vec>) -> Self impl core::clone::Clone for metaslang_cst::nodes::NonterminalNode where ::NonterminalKind: core::clone::Clone pub fn metaslang_cst::nodes::NonterminalNode::clone(&self) -> metaslang_cst::nodes::NonterminalNode impl core::cmp::Eq for metaslang_cst::nodes::NonterminalNode where ::NonterminalKind: core::cmp::Eq diff --git a/crates/metaslang/cst/src/nodes.rs b/crates/metaslang/cst/src/nodes.rs index 8795b70a9e..ae8dc83f01 100644 --- a/crates/metaslang/cst/src/nodes.rs +++ b/crates/metaslang/cst/src/nodes.rs @@ -64,6 +64,18 @@ pub struct Edge { pub node: Node, } +impl NonterminalNode { + pub fn new(kind: T::NonterminalKind, children: Vec>) -> Self { + let text_len = children.iter().map(|edge| edge.text_len()).sum(); + + NonterminalNode { + kind, + text_len, + children, + } + } +} + impl Edge { /// Creates an anonymous node (without a label). pub fn anonymous(node: Node) -> Self { @@ -81,13 +93,7 @@ impl std::ops::Deref for Edge { impl Node { pub fn nonterminal(kind: T::NonterminalKind, children: Vec>) -> Self { - let text_len = children.iter().map(|edge| edge.text_len()).sum(); - - Self::Nonterminal(Rc::new(NonterminalNode { - kind, - text_len, - children, - })) + Self::Nonterminal(Rc::new(NonterminalNode::new(kind, children))) } pub fn terminal(kind: T::TerminalKind, text: String) -> Self { diff --git a/crates/solidity/outputs/cargo/crate/generated/public_api.txt b/crates/solidity/outputs/cargo/crate/generated/public_api.txt index 5fa1c4d0eb..297e576fbf 100644 --- a/crates/solidity/outputs/cargo/crate/generated/public_api.txt +++ b/crates/solidity/outputs/cargo/crate/generated/public_api.txt @@ -914,7 +914,7 @@ impl slang_solidity::parser::ParseOutput pub fn slang_solidity::parser::ParseOutput::create_tree_cursor(&self) -> slang_solidity::cst::Cursor pub fn slang_solidity::parser::ParseOutput::errors(&self) -> &alloc::vec::Vec pub fn slang_solidity::parser::ParseOutput::is_valid(&self) -> bool -pub fn slang_solidity::parser::ParseOutput::tree(&self) -> slang_solidity::cst::Node +pub fn slang_solidity::parser::ParseOutput::tree(&self) -> alloc::rc::Rc impl core::cmp::PartialEq for slang_solidity::parser::ParseOutput pub fn slang_solidity::parser::ParseOutput::eq(&self, other: &slang_solidity::parser::ParseOutput) -> bool impl core::fmt::Debug for slang_solidity::parser::ParseOutput diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parse_output.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parse_output.rs index 9ec833b5a7..91662bae43 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parse_output.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parse_output.rs @@ -1,17 +1,19 @@ // This file is generated automatically by infrastructure scripts. Please don't edit by hand. -use crate::cst::{Cursor, Node, TextIndex}; +use std::rc::Rc; + +use crate::cst::{Cursor, NonterminalNode, TextIndex}; use crate::parser::ParseError; #[derive(Debug, PartialEq)] pub struct ParseOutput { - pub(crate) parse_tree: Node, + pub(crate) parse_tree: Rc, pub(crate) errors: Vec, } impl ParseOutput { - pub fn tree(&self) -> Node { - self.parse_tree.clone() + pub fn tree(&self) -> Rc { + Rc::clone(&self.parse_tree) } pub fn errors(&self) -> &Vec { @@ -24,6 +26,6 @@ impl ParseOutput { /// Creates a cursor that starts at the root of the parse tree. pub fn create_tree_cursor(&self) -> Cursor { - self.parse_tree.clone().cursor_with_offset(TextIndex::ZERO) + Rc::clone(&self.parse_tree).cursor_with_offset(TextIndex::ZERO) } } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index c9fc3e44e5..07af27499c 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -2,7 +2,7 @@ use std::rc::Rc; -use crate::cst::{Edge, Node, TerminalKind, TerminalKindExtensions, TextIndex}; +use crate::cst::{Edge, Node, NonterminalNode, TerminalKind, TerminalKindExtensions, TextIndex}; use crate::parser::lexer::Lexer; use crate::parser::parser_support::context::ParserContext; use crate::parser::parser_support::parser_result::{ @@ -87,14 +87,9 @@ where TerminalKind::UNRECOGNIZED }; let node = Node::terminal(kind, input.to_string()); - let tree = if no_match.kind.is_none() || start.utf8 == 0 { - node - } else { - trivia_nodes.push(Edge::anonymous(node)); - Node::nonterminal(no_match.kind.unwrap(), trivia_nodes) - }; + trivia_nodes.push(Edge::anonymous(node)); ParseOutput { - parse_tree: tree, + parse_tree: Rc::new(NonterminalNode::new(no_match.kind.unwrap(), trivia_nodes)), errors: vec![ParseError::new( start..start + input.into(), no_match.expected_terminals, @@ -158,18 +153,17 @@ where )); ParseOutput { - parse_tree: Node::nonterminal(topmost_node.kind, new_children), + parse_tree: Rc::new(NonterminalNode::new(topmost_node.kind, new_children)), errors, } } else { - let parse_tree = Node::Nonterminal(topmost_node); + let parse_tree = topmost_node; let errors = stream.into_errors(); // Sanity check: Make sure that succesful parse is equivalent to not having any invalid nodes debug_assert_eq!( errors.is_empty(), - parse_tree - .clone() + Rc::clone(&parse_tree) .cursor_with_offset(TextIndex::ZERO) .remaining_nodes() .all(|edge| edge diff --git a/crates/solidity/outputs/cargo/tests/src/bindings.rs b/crates/solidity/outputs/cargo/tests/src/bindings.rs index c346ab6afb..b8eb8b52f1 100644 --- a/crates/solidity/outputs/cargo/tests/src/bindings.rs +++ b/crates/solidity/outputs/cargo/tests/src/bindings.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use anyhow::Result; use semver::Version; use slang_solidity::bindings::{self, Bindings}; -use slang_solidity::cst::TextIndex; +use slang_solidity::cst::{Node, TextIndex}; use slang_solidity::parser::Parser; use slang_solidity::transform_built_ins_node; @@ -20,8 +20,9 @@ pub fn create_bindings(version: &Version) -> Result { "built-ins parse without errors" ); - let built_ins_cursor = transform_built_ins_node(&built_ins_parse_output.tree()) - .cursor_with_offset(TextIndex::ZERO); + let built_ins_cursor = + transform_built_ins_node(&Node::Nonterminal(built_ins_parse_output.tree())) + .cursor_with_offset(TextIndex::ZERO); bindings.add_system_file("built_ins.sol", built_ins_cursor); Ok(bindings) diff --git a/crates/solidity/outputs/cargo/tests/src/doc_examples/using_the_parser.rs b/crates/solidity/outputs/cargo/tests/src/doc_examples/using_the_parser.rs index 69fb289bcb..f8ccc8d74a 100644 --- a/crates/solidity/outputs/cargo/tests/src/doc_examples/using_the_parser.rs +++ b/crates/solidity/outputs/cargo/tests/src/doc_examples/using_the_parser.rs @@ -38,9 +38,8 @@ fn using_the_parser() -> Result<()> { // --8<-- [end:assert-is-valid] // --8<-- [start:inspect-tree] - let parse_tree = parse_output.tree(); + let contract = parse_output.tree(); - let contract = parse_tree.as_nonterminal().unwrap(); assert_eq!(contract.kind, NonterminalKind::ContractDefinition); assert_eq!(contract.children.len(), 7); diff --git a/crates/solidity/outputs/cargo/wasm/src/generated/interface/generated/parser.wit b/crates/solidity/outputs/cargo/wasm/src/generated/interface/generated/parser.wit index bbe8faa7c8..42b61577d4 100644 --- a/crates/solidity/outputs/cargo/wasm/src/generated/interface/generated/parser.wit +++ b/crates/solidity/outputs/cargo/wasm/src/generated/interface/generated/parser.wit @@ -1,7 +1,7 @@ // This file is generated automatically by infrastructure scripts. Please don't edit by hand. interface parser { - use cst.{cursor, node, nonterminal-kind, text-range}; + use cst.{cursor, nonterminal-node, nonterminal-kind, text-range}; /// A parser instance that can parse source code into syntax trees. /// Each parser is configured for a specific language version and grammar. @@ -38,7 +38,7 @@ interface parser { resource parse-output { /// Returns the root node of the parsed syntax tree. /// Even if there are parsing errors, a partial tree will still be available. - tree: func() -> node; + tree: func() -> nonterminal-node; /// Returns a list of all parsing errors encountered. /// An empty list indicates successful parsing with no errors. diff --git a/crates/solidity/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs b/crates/solidity/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs index 311c2b9d8a..8100d7dc13 100644 --- a/crates/solidity/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs +++ b/crates/solidity/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs @@ -4,7 +4,7 @@ use crate::wasm_crate::utils::{define_wrapper, FromFFI, IntoFFI}; mod ffi { pub use crate::wasm_crate::bindings::exports::nomic_foundation::slang::cst::{ - Cursor, Node, TextRange, + Cursor, NonterminalNode, TextRange, }; pub use crate::wasm_crate::bindings::exports::nomic_foundation::slang::parser::{ Guest, GuestParseError, GuestParseOutput, GuestParser, NonterminalKind, ParseError, @@ -79,7 +79,7 @@ define_wrapper! { ParseError { //================================================ define_wrapper! { ParseOutput { - fn tree(&self) -> ffi::Node { + fn tree(&self) -> ffi::NonterminalNode { self._borrow_ffi().tree()._into_ffi() } diff --git a/crates/solidity/testing/sanctuary/src/tests.rs b/crates/solidity/testing/sanctuary/src/tests.rs index 6571da0b11..0b0f4cb001 100644 --- a/crates/solidity/testing/sanctuary/src/tests.rs +++ b/crates/solidity/testing/sanctuary/src/tests.rs @@ -8,7 +8,7 @@ use itertools::Itertools; use metaslang_bindings::PathResolver; use semver::Version; use slang_solidity::bindings::Bindings; -use slang_solidity::cst::{Cursor, NonterminalKind, TextIndex, TextRange}; +use slang_solidity::cst::{Cursor, Node, NonterminalKind, TextIndex, TextRange}; use slang_solidity::diagnostic::{Diagnostic, Severity}; use slang_solidity::parser::{ParseOutput, Parser}; use slang_solidity::{bindings, transform_built_ins_node}; @@ -218,8 +218,8 @@ fn create_bindings(version: &Version, source_id: &str, output: &ParseOutput) -> bindings::get_built_ins(version), ) .tree(); - let built_ins_cursor = - transform_built_ins_node(&built_ins_tree).cursor_with_offset(TextIndex::ZERO); + let built_ins_cursor = transform_built_ins_node(&Node::Nonterminal(built_ins_tree)) + .cursor_with_offset(TextIndex::ZERO); bindings.add_system_file("built_ins.sol", built_ins_cursor); bindings.add_user_file(source_id, output.create_tree_cursor()); diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parse_output.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parse_output.rs index 9ec833b5a7..91662bae43 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parse_output.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parse_output.rs @@ -1,17 +1,19 @@ // This file is generated automatically by infrastructure scripts. Please don't edit by hand. -use crate::cst::{Cursor, Node, TextIndex}; +use std::rc::Rc; + +use crate::cst::{Cursor, NonterminalNode, TextIndex}; use crate::parser::ParseError; #[derive(Debug, PartialEq)] pub struct ParseOutput { - pub(crate) parse_tree: Node, + pub(crate) parse_tree: Rc, pub(crate) errors: Vec, } impl ParseOutput { - pub fn tree(&self) -> Node { - self.parse_tree.clone() + pub fn tree(&self) -> Rc { + Rc::clone(&self.parse_tree) } pub fn errors(&self) -> &Vec { @@ -24,6 +26,6 @@ impl ParseOutput { /// Creates a cursor that starts at the root of the parse tree. pub fn create_tree_cursor(&self) -> Cursor { - self.parse_tree.clone().cursor_with_offset(TextIndex::ZERO) + Rc::clone(&self.parse_tree).cursor_with_offset(TextIndex::ZERO) } } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index c9fc3e44e5..07af27499c 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -2,7 +2,7 @@ use std::rc::Rc; -use crate::cst::{Edge, Node, TerminalKind, TerminalKindExtensions, TextIndex}; +use crate::cst::{Edge, Node, NonterminalNode, TerminalKind, TerminalKindExtensions, TextIndex}; use crate::parser::lexer::Lexer; use crate::parser::parser_support::context::ParserContext; use crate::parser::parser_support::parser_result::{ @@ -87,14 +87,9 @@ where TerminalKind::UNRECOGNIZED }; let node = Node::terminal(kind, input.to_string()); - let tree = if no_match.kind.is_none() || start.utf8 == 0 { - node - } else { - trivia_nodes.push(Edge::anonymous(node)); - Node::nonterminal(no_match.kind.unwrap(), trivia_nodes) - }; + trivia_nodes.push(Edge::anonymous(node)); ParseOutput { - parse_tree: tree, + parse_tree: Rc::new(NonterminalNode::new(no_match.kind.unwrap(), trivia_nodes)), errors: vec![ParseError::new( start..start + input.into(), no_match.expected_terminals, @@ -158,18 +153,17 @@ where )); ParseOutput { - parse_tree: Node::nonterminal(topmost_node.kind, new_children), + parse_tree: Rc::new(NonterminalNode::new(topmost_node.kind, new_children)), errors, } } else { - let parse_tree = Node::Nonterminal(topmost_node); + let parse_tree = topmost_node; let errors = stream.into_errors(); // Sanity check: Make sure that succesful parse is equivalent to not having any invalid nodes debug_assert_eq!( errors.is_empty(), - parse_tree - .clone() + Rc::clone(&parse_tree) .cursor_with_offset(TextIndex::ZERO) .remaining_nodes() .all(|edge| edge diff --git a/crates/testlang/outputs/cargo/wasm/src/generated/interface/generated/parser.wit b/crates/testlang/outputs/cargo/wasm/src/generated/interface/generated/parser.wit index bbe8faa7c8..42b61577d4 100644 --- a/crates/testlang/outputs/cargo/wasm/src/generated/interface/generated/parser.wit +++ b/crates/testlang/outputs/cargo/wasm/src/generated/interface/generated/parser.wit @@ -1,7 +1,7 @@ // This file is generated automatically by infrastructure scripts. Please don't edit by hand. interface parser { - use cst.{cursor, node, nonterminal-kind, text-range}; + use cst.{cursor, nonterminal-node, nonterminal-kind, text-range}; /// A parser instance that can parse source code into syntax trees. /// Each parser is configured for a specific language version and grammar. @@ -38,7 +38,7 @@ interface parser { resource parse-output { /// Returns the root node of the parsed syntax tree. /// Even if there are parsing errors, a partial tree will still be available. - tree: func() -> node; + tree: func() -> nonterminal-node; /// Returns a list of all parsing errors encountered. /// An empty list indicates successful parsing with no errors. diff --git a/crates/testlang/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs b/crates/testlang/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs index 311c2b9d8a..8100d7dc13 100644 --- a/crates/testlang/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs +++ b/crates/testlang/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs @@ -4,7 +4,7 @@ use crate::wasm_crate::utils::{define_wrapper, FromFFI, IntoFFI}; mod ffi { pub use crate::wasm_crate::bindings::exports::nomic_foundation::slang::cst::{ - Cursor, Node, TextRange, + Cursor, NonterminalNode, TextRange, }; pub use crate::wasm_crate::bindings::exports::nomic_foundation::slang::parser::{ Guest, GuestParseError, GuestParseOutput, GuestParser, NonterminalKind, ParseError, @@ -79,7 +79,7 @@ define_wrapper! { ParseError { //================================================ define_wrapper! { ParseOutput { - fn tree(&self) -> ffi::Node { + fn tree(&self) -> ffi::NonterminalNode { self._borrow_ffi().tree()._into_ffi() } From 160e02ec50e4da6aa66c229fc9d5e77ae05a722f Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Wed, 11 Dec 2024 15:45:27 -0300 Subject: [PATCH 13/22] Generated examples --- .../ConstantDefinition/int/generated/0.4.11-failure.yml | 2 +- .../override_attribute/generated/0.4.11-failure.yml | 2 +- .../ConstructorDefinition/simple/generated/0.4.11-failure.yml | 2 +- .../virtual_attribute/generated/0.4.11-failure.yml | 2 +- .../abstract_contract/generated/0.4.11-failure.yml | 2 +- .../zero_length_input/generated/0.4.11-failure.yml | 2 +- .../decimal_trailing_ident_start/generated/0.4.11-failure.yml | 2 +- .../integer_ident_after_period/generated/0.4.11-failure.yml | 2 +- .../generated/0.4.11-failure.yml | 2 +- .../ErrorDefinition/top_level/generated/0.4.11-failure.yml | 2 +- .../Expression/keyword_alias/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_alias/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_alias/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_alias/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_alias/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_apply/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_apply/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_apply/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_apply/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_apply/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_auto/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_auto/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_auto/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_auto/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_auto/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_calldata/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_calldata/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_calldata/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_calldata/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_calldata/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_constructor/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_constructor/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_constructor/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_constructor/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_constructor/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_copyof/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_copyof/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_copyof/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_copyof/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_copyof/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_define/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_define/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_define/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_define/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_define/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_emit/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_emit/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_emit/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_emit/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_emit/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_fallback/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_fallback/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_fallback/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_finney/generated/0.4.11-failure.yml | 2 +- .../Expression/keyword_finney/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_finney/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_immutable/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_immutable/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_immutable/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_immutable/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_immutable/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_implements/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_implements/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_implements/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_implements/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_implements/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_macro/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_macro/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_macro/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_macro/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_macro/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_mutable/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_mutable/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_mutable/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_mutable/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_mutable/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_override/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_override/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_override/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_override/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_override/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_partial/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_partial/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_partial/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_partial/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_partial/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_promise/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_promise/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_promise/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_promise/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_promise/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_receive/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_receive/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_receive/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_reference/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_reference/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_reference/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_reference/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_reference/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_sealed/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_sealed/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_sealed/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_sealed/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_sealed/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_sizeof/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_sizeof/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_sizeof/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_sizeof/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_sizeof/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_supports/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_supports/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_supports/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_supports/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_supports/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_szabo/generated/0.4.11-failure.yml | 2 +- .../Expression/keyword_szabo/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_szabo/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_typedef/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_typedef/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_typedef/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_typedef/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_typedef/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_unchecked/generated/0.5.0-failure.yml | 2 +- .../Expression/keyword_unchecked/generated/0.5.3-failure.yml | 2 +- .../Expression/keyword_unchecked/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_unchecked/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_unchecked/generated/0.8.0-failure.yml | 2 +- .../Expression/keyword_virtual/generated/0.6.0-failure.yml | 2 +- .../Expression/keyword_virtual/generated/0.7.0-failure.yml | 2 +- .../Expression/keyword_virtual/generated/0.8.0-failure.yml | 2 +- .../member_access_integer/generated/0.4.11-failure.yml | 2 +- .../Expression/prefix_plus/generated/0.5.0-failure.yml | 2 +- .../Expression/prefix_plus/generated/0.5.3-failure.yml | 2 +- .../Expression/prefix_plus/generated/0.6.0-failure.yml | 2 +- .../Expression/prefix_plus/generated/0.7.0-failure.yml | 2 +- .../Expression/prefix_plus/generated/0.8.0-failure.yml | 2 +- .../cst_output/Expression/returns/generated/0.4.11-failure.yml | 2 +- .../cst_output/Expression/returns/generated/0.5.3-failure.yml | 2 +- .../cst_output/Expression/returns/generated/0.6.0-failure.yml | 2 +- .../cst_output/Expression/returns/generated/0.7.0-failure.yml | 2 +- .../cst_output/Expression/returns/generated/0.8.0-failure.yml | 2 +- .../simple/generated/0.4.11-failure.yml | 2 +- .../payable_conversion/generated/0.4.11-failure.yml | 2 +- .../payable_conversion/generated/0.5.3-failure.yml | 2 +- .../hex_consecutive_underscores/generated/0.4.11-failure.yml | 2 +- .../hex_invalid_alpha_digit/generated/0.4.11-failure.yml | 2 +- .../hex_leading_underscore/generated/0.4.11-failure.yml | 2 +- .../hex_no_digits/generated/0.4.11-failure.yml | 2 +- .../hex_trailing_ident_start/generated/0.4.11-failure.yml | 2 +- .../hex_trailing_underscore/generated/0.4.11-failure.yml | 2 +- .../hex_uppercase_prefix/generated/0.5.0-failure.yml | 2 +- .../all_separated_pairs/generated/0.4.11-failure.yml | 3 ++- .../generated/0.4.11-failure.yml | 3 ++- .../generated/0.5.14-failure.yml | 3 ++- .../invalid_leading_separator/generated/0.4.11-failure.yml | 3 ++- .../invalid_leading_separator/generated/0.5.14-failure.yml | 3 ++- .../generated/0.4.11-failure.yml | 3 ++- .../generated/0.5.14-failure.yml | 3 ++- .../invalid_trailing_separator/generated/0.4.11-failure.yml | 3 ++- .../invalid_trailing_separator/generated/0.5.14-failure.yml | 3 ++- .../HexStringLiterals/multiple/generated/0.4.11-failure.yml | 3 ++- .../no_separators/generated/0.4.11-failure.yml | 3 ++- .../HexStringLiterals/single/generated/0.4.11-failure.yml | 3 ++- .../single_trailing_ident/generated/0.4.11-failure.yml | 3 ++- .../some_separated_pairs/generated/0.4.11-failure.yml | 3 ++- .../simple/generated/0.4.11-failure.yml | 2 +- .../double_quote_unicode/generated/0.7.0-failure.yml | 2 +- .../escape_hex_invalid/generated/0.4.11-failure.yml | 2 +- .../escape_unicode_invalid/generated/0.4.11-failure.yml | 2 +- .../single_quote_unicode/generated/0.7.0-failure.yml | 2 +- .../tabs_double_quote/generated/0.7.0-failure.yml | 2 +- .../tabs_single_quote/generated/0.7.0-failure.yml | 2 +- .../StringLiterals/both_quotes/generated/0.4.11-failure.yml | 3 ++- .../StringLiterals/double_quote/generated/0.4.11-failure.yml | 3 ++- .../double_quote_unicode/generated/0.4.11-failure.yml | 3 ++- .../double_quote_unicode/generated/0.7.0-failure.yml | 3 ++- .../StringLiterals/single_quote/generated/0.4.11-failure.yml | 3 ++- .../single_quote_unicode/generated/0.4.11-failure.yml | 3 ++- .../single_quote_unicode/generated/0.7.0-failure.yml | 3 ++- .../single_trailing_ident/generated/0.4.11-failure.yml | 3 ++- .../ThrowStatement/throw/generated/0.5.0-failure.yml | 2 +- .../try_catch_empty_body/generated/0.4.11-failure.yml | 2 +- .../try_expr_call_options/generated/0.4.11-failure.yml | 2 +- .../cst_output/TypeName/byte/generated/0.8.0-failure.yml | 2 +- .../multiple/generated/0.4.11-failure.yml | 3 ++- .../UnicodeStringLiterals/single/generated/0.4.11-failure.yml | 3 ++- .../single_trailing_ident/generated/0.4.11-failure.yml | 3 ++- .../internal_attribute/generated/0.6.0-failure.yml | 2 +- .../private_attribute/generated/0.6.0-failure.yml | 2 +- .../public_attribute/generated/0.6.0-failure.yml | 2 +- .../bool/generated/0.4.11-failure.yml | 2 +- .../identifier_path/generated/0.4.11-failure.yml | 2 +- .../identifier_path_as_operator/generated/0.4.11-failure.yml | 2 +- .../single_id/generated/0.4.11-failure.yml | 2 +- .../single_id_as_operator/generated/0.4.11-failure.yml | 2 +- .../var/generated/0.5.0-failure.yml | 2 +- .../var/generated/0.8.0-failure.yml | 2 +- .../decimal_trailing_ident_start/generated/0.4.11-failure.yml | 2 +- .../decimal_trailing_ident_start/generated/0.4.12-failure.yml | 2 +- .../decimal_trailing_ident_start/generated/0.5.0-failure.yml | 2 +- .../decimal_trailing_ident_start/generated/0.8.18-failure.yml | 2 +- .../decimal_trailing_ident_start/generated/0.8.24-failure.yml | 2 +- .../decimal_trailing_ident_start/generated/0.8.7-failure.yml | 2 +- .../hex_trailing_ident_start/generated/0.4.11-failure.yml | 2 +- .../hex_trailing_ident_start/generated/0.4.12-failure.yml | 2 +- .../hex_trailing_ident_start/generated/0.5.0-failure.yml | 2 +- .../hex_trailing_ident_start/generated/0.8.18-failure.yml | 2 +- .../hex_trailing_ident_start/generated/0.8.24-failure.yml | 2 +- .../hex_trailing_ident_start/generated/0.8.7-failure.yml | 2 +- .../built_in_difficulty/generated/0.8.18-failure.yml | 2 +- .../built_in_difficulty/generated/0.8.24-failure.yml | 2 +- .../built_in_jump/generated/0.5.0-failure.yml | 2 +- .../built_in_jump/generated/0.8.18-failure.yml | 2 +- .../built_in_jump/generated/0.8.24-failure.yml | 2 +- .../built_in_jump/generated/0.8.7-failure.yml | 2 +- .../built_in_jumpi/generated/0.5.0-failure.yml | 2 +- .../built_in_jumpi/generated/0.8.18-failure.yml | 2 +- .../built_in_jumpi/generated/0.8.24-failure.yml | 2 +- .../built_in_jumpi/generated/0.8.7-failure.yml | 2 +- .../YulLabel/single_label/generated/0.5.0-failure.yml | 2 +- .../YulLeaveStatement/leave/generated/0.4.11-failure.yml | 2 +- .../equal_colon_separated/generated/0.5.0-failure.yml | 2 +- .../single_variable/generated/0.5.0-failure.yml | 2 +- .../identifier_add/generated/0.4.11-failure.yml | 2 +- .../identifier_addmod/generated/0.4.11-failure.yml | 2 +- .../identifier_and/generated/0.4.11-failure.yml | 2 +- .../identifier_balance/generated/0.4.11-failure.yml | 2 +- .../identifier_basefee/generated/0.8.7-failure.yml | 2 +- .../identifier_blockhash/generated/0.4.11-failure.yml | 2 +- .../identifier_byte/generated/0.4.11-failure.yml | 2 +- .../identifier_call/generated/0.4.11-failure.yml | 2 +- .../identifier_callcode/generated/0.4.11-failure.yml | 2 +- .../identifier_calldatacopy/generated/0.4.11-failure.yml | 2 +- .../identifier_calldataload/generated/0.4.11-failure.yml | 2 +- .../identifier_calldatasize/generated/0.4.11-failure.yml | 2 +- .../identifier_caller/generated/0.4.11-failure.yml | 2 +- .../identifier_callvalue/generated/0.4.11-failure.yml | 2 +- .../identifier_chainid/generated/0.5.12-failure.yml | 2 +- .../identifier_coinbase/generated/0.4.11-failure.yml | 2 +- .../identifier_create/generated/0.4.11-failure.yml | 2 +- .../identifier_create2/generated/0.4.12-failure.yml | 2 +- .../identifier_delegatecall/generated/0.4.11-failure.yml | 2 +- .../identifier_difficulty/generated/0.4.11-failure.yml | 2 +- .../identifier_div/generated/0.4.11-failure.yml | 2 +- .../identifier_eq/generated/0.4.11-failure.yml | 2 +- .../identifier_exp/generated/0.4.11-failure.yml | 2 +- .../identifier_extcodecopy/generated/0.4.11-failure.yml | 2 +- .../identifier_extcodehash/generated/0.5.0-failure.yml | 2 +- .../identifier_extcodesize/generated/0.4.11-failure.yml | 2 +- .../identifier_gas/generated/0.4.11-failure.yml | 2 +- .../identifier_gaslimit/generated/0.4.11-failure.yml | 2 +- .../identifier_gasprice/generated/0.4.11-failure.yml | 2 +- .../identifier_gt/generated/0.4.11-failure.yml | 2 +- .../identifier_invalid/generated/0.4.11-failure.yml | 2 +- .../identifier_iszero/generated/0.4.11-failure.yml | 2 +- .../identifier_jump/generated/0.4.11-failure.yml | 2 +- .../identifier_jumpi/generated/0.4.11-failure.yml | 2 +- .../identifier_keccak256/generated/0.4.12-failure.yml | 2 +- .../identifier_log0/generated/0.4.11-failure.yml | 2 +- .../identifier_log1/generated/0.4.11-failure.yml | 2 +- .../identifier_log2/generated/0.4.11-failure.yml | 2 +- .../identifier_log3/generated/0.4.11-failure.yml | 2 +- .../identifier_log4/generated/0.4.11-failure.yml | 2 +- .../identifier_lt/generated/0.4.11-failure.yml | 2 +- .../identifier_mload/generated/0.4.11-failure.yml | 2 +- .../identifier_mod/generated/0.4.11-failure.yml | 2 +- .../identifier_msize/generated/0.4.11-failure.yml | 2 +- .../identifier_mstore/generated/0.4.11-failure.yml | 2 +- .../identifier_mstore8/generated/0.4.11-failure.yml | 2 +- .../identifier_mul/generated/0.4.11-failure.yml | 2 +- .../identifier_mulmod/generated/0.4.11-failure.yml | 2 +- .../identifier_not/generated/0.4.11-failure.yml | 2 +- .../identifier_number/generated/0.4.11-failure.yml | 2 +- .../identifier_or/generated/0.4.11-failure.yml | 2 +- .../identifier_origin/generated/0.4.11-failure.yml | 2 +- .../identifier_pop/generated/0.4.11-failure.yml | 2 +- .../identifier_prevrandao/generated/0.8.18-failure.yml | 2 +- .../identifier_return/generated/0.4.11-failure.yml | 2 +- .../identifier_returndatacopy/generated/0.4.12-failure.yml | 2 +- .../identifier_returndatasize/generated/0.4.12-failure.yml | 2 +- .../identifier_revert/generated/0.4.11-failure.yml | 2 +- .../identifier_sar/generated/0.4.21-failure.yml | 2 +- .../identifier_sdiv/generated/0.4.11-failure.yml | 2 +- .../identifier_selfbalance/generated/0.5.12-failure.yml | 2 +- .../identifier_selfdestruct/generated/0.4.11-failure.yml | 2 +- .../identifier_sgt/generated/0.4.11-failure.yml | 2 +- .../identifier_sha3/generated/0.4.11-failure.yml | 2 +- .../identifier_shl/generated/0.4.21-failure.yml | 2 +- .../identifier_shr/generated/0.4.21-failure.yml | 2 +- .../identifier_signextend/generated/0.4.11-failure.yml | 2 +- .../identifier_sload/generated/0.4.11-failure.yml | 2 +- .../identifier_slt/generated/0.4.11-failure.yml | 2 +- .../identifier_smod/generated/0.4.11-failure.yml | 2 +- .../identifier_sstore/generated/0.4.11-failure.yml | 2 +- .../identifier_staticcall/generated/0.4.12-failure.yml | 2 +- .../identifier_stop/generated/0.4.11-failure.yml | 2 +- .../identifier_sub/generated/0.4.11-failure.yml | 2 +- .../identifier_suicide/generated/0.4.11-failure.yml | 2 +- .../identifier_timestamp/generated/0.4.11-failure.yml | 2 +- .../identifier_xor/generated/0.4.11-failure.yml | 2 +- 300 files changed, 325 insertions(+), 300 deletions(-) diff --git a/crates/solidity/testing/snapshots/cst_output/ConstantDefinition/int/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ConstantDefinition/int/generated/0.4.11-failure.yml index 08d01dbba8..0ef4b23f31 100644 --- a/crates/solidity/testing/snapshots/cst_output/ConstantDefinition/int/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ConstantDefinition/int/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "int constant foo = 0;" # (0..21) + - (ConstantDefinition) ► (UNRECOGNIZED): "int constant foo = 0;" # (0..21) diff --git a/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/override_attribute/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/override_attribute/generated/0.4.11-failure.yml index 17ac299239..920a36974d 100644 --- a/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/override_attribute/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/override_attribute/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "constructor () override {}\n" # (0..27) + - (ConstructorDefinition) ► (UNRECOGNIZED): "constructor () override {}\n" # (0..27) diff --git a/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.11-failure.yml index f0c515d544..ff85d1f11c 100644 --- a/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "constructor () {}" # (0..17) + - (ConstructorDefinition) ► (UNRECOGNIZED): "constructor () {}" # (0..17) diff --git a/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/virtual_attribute/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/virtual_attribute/generated/0.4.11-failure.yml index 5ef7b34da2..0c709a62f4 100644 --- a/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/virtual_attribute/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/virtual_attribute/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "constructor () virtual {}\n" # (0..26) + - (ConstructorDefinition) ► (UNRECOGNIZED): "constructor () virtual {}\n" # (0..26) diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/abstract_contract/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/abstract_contract/generated/0.4.11-failure.yml index c31c4f4506..d335672bcf 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/abstract_contract/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/abstract_contract/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "abstract contract Sample {}\n" # (0..28) + - (ContractDefinition) ► (UNRECOGNIZED): "abstract contract Sample {}\n" # (0..28) diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/zero_length_input/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/zero_length_input/generated/0.4.11-failure.yml index d655f10704..4e0355ae08 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/zero_length_input/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/zero_length_input/generated/0.4.11-failure.yml @@ -8,4 +8,4 @@ Errors: # 1 total ─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/zero_length_input/input.sol:0:0] Tree: - - (MISSING): "" # (0..0) + - (ContractDefinition) ► (MISSING): "" # (0..0) diff --git a/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/decimal_trailing_ident_start/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/decimal_trailing_ident_start/generated/0.4.11-failure.yml index 8a8f8d029a..df904c8e07 100644 --- a/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/decimal_trailing_ident_start/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/decimal_trailing_ident_start/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "1a\n" # (0..3) + - (DecimalNumberExpression) ► (UNRECOGNIZED): "1a\n" # (0..3) diff --git a/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/integer_ident_after_period/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/integer_ident_after_period/generated/0.4.11-failure.yml index 378fcbfae9..e88cf73c82 100644 --- a/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/integer_ident_after_period/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/integer_ident_after_period/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "1.a\n" # (0..4) + - (DecimalNumberExpression) ► (UNRECOGNIZED): "1.a\n" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/leading_period_ident_after_decimal/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/leading_period_ident_after_decimal/generated/0.4.11-failure.yml index 7ca52f6fa4..a64cffb7a0 100644 --- a/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/leading_period_ident_after_decimal/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/leading_period_ident_after_decimal/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): ".1a\n" # (0..4) + - (DecimalNumberExpression) ► (UNRECOGNIZED): ".1a\n" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/ErrorDefinition/top_level/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ErrorDefinition/top_level/generated/0.4.11-failure.yml index ac74fc3c66..72f059a1c2 100644 --- a/crates/solidity/testing/snapshots/cst_output/ErrorDefinition/top_level/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ErrorDefinition/top_level/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "error MyError();" # (0..16) + - (ErrorDefinition) ► (UNRECOGNIZED): "error MyError();" # (0..16) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.5.0-failure.yml index 7e281af7f2..6f250e1032 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "alias" # (0..5) + - (Expression) ► (UNRECOGNIZED): "alias" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.5.3-failure.yml index dab59ee476..471c159d1e 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "alias" # (0..5) + - (Expression) ► (UNRECOGNIZED): "alias" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.6.0-failure.yml index 04136ebfa7..2cbb8a87aa 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "alias" # (0..5) + - (Expression) ► (UNRECOGNIZED): "alias" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.7.0-failure.yml index d89da6a71c..cf0c981bf6 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "alias" # (0..5) + - (Expression) ► (UNRECOGNIZED): "alias" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.8.0-failure.yml index 02d00f3918..0761326f86 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "alias" # (0..5) + - (Expression) ► (UNRECOGNIZED): "alias" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.5.0-failure.yml index a2006698a4..3a4b72b769 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "apply" # (0..5) + - (Expression) ► (UNRECOGNIZED): "apply" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.5.3-failure.yml index d38d98f889..bc00539a18 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "apply" # (0..5) + - (Expression) ► (UNRECOGNIZED): "apply" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.6.0-failure.yml index fc1e93bd9c..ef9eb32b7a 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "apply" # (0..5) + - (Expression) ► (UNRECOGNIZED): "apply" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.7.0-failure.yml index a338fdae65..185aedf372 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "apply" # (0..5) + - (Expression) ► (UNRECOGNIZED): "apply" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.8.0-failure.yml index 064889e70a..6cce11acbc 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "apply" # (0..5) + - (Expression) ► (UNRECOGNIZED): "apply" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.5.0-failure.yml index 52d07b59ac..4ac97bba25 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "auto" # (0..4) + - (Expression) ► (UNRECOGNIZED): "auto" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.5.3-failure.yml index aaeb539c00..973da5e0ba 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "auto" # (0..4) + - (Expression) ► (UNRECOGNIZED): "auto" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.6.0-failure.yml index 3c1527dccc..ca025d26c7 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "auto" # (0..4) + - (Expression) ► (UNRECOGNIZED): "auto" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.7.0-failure.yml index 5230aad22f..6230d67e5e 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "auto" # (0..4) + - (Expression) ► (UNRECOGNIZED): "auto" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.8.0-failure.yml index 951ab59874..e663ebd592 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "auto" # (0..4) + - (Expression) ► (UNRECOGNIZED): "auto" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.5.0-failure.yml index 4b8fa0915d..f483a3d08c 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "calldata" # (0..8) + - (Expression) ► (UNRECOGNIZED): "calldata" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.5.3-failure.yml index 53584bf448..e4d3bf47f3 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "calldata" # (0..8) + - (Expression) ► (UNRECOGNIZED): "calldata" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.6.0-failure.yml index 6d22762c8c..65a8e017ef 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "calldata" # (0..8) + - (Expression) ► (UNRECOGNIZED): "calldata" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.7.0-failure.yml index 2352d49615..1cbe3c8e5d 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "calldata" # (0..8) + - (Expression) ► (UNRECOGNIZED): "calldata" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.8.0-failure.yml index 2d75e15329..0d672b0092 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "calldata" # (0..8) + - (Expression) ► (UNRECOGNIZED): "calldata" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.5.0-failure.yml index 534bcdb9d6..a1b1220af8 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "constructor" # (0..11) + - (Expression) ► (UNRECOGNIZED): "constructor" # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.5.3-failure.yml index d664f04f80..3514e6a88f 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "constructor" # (0..11) + - (Expression) ► (UNRECOGNIZED): "constructor" # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.6.0-failure.yml index b55bbe15ee..db47e870b4 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "constructor" # (0..11) + - (Expression) ► (UNRECOGNIZED): "constructor" # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.7.0-failure.yml index 0107c47f47..14579484e4 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "constructor" # (0..11) + - (Expression) ► (UNRECOGNIZED): "constructor" # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.8.0-failure.yml index 0995cfa4b5..be7f5e7d52 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "constructor" # (0..11) + - (Expression) ► (UNRECOGNIZED): "constructor" # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.5.0-failure.yml index 8785a4bcfe..7b8172525d 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "copyof" # (0..6) + - (Expression) ► (UNRECOGNIZED): "copyof" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.5.3-failure.yml index 7b9a2de25c..eb3c6320ac 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "copyof" # (0..6) + - (Expression) ► (UNRECOGNIZED): "copyof" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.6.0-failure.yml index d23b163478..9419f4b210 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "copyof" # (0..6) + - (Expression) ► (UNRECOGNIZED): "copyof" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.7.0-failure.yml index 1650c062e8..88793f11a3 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "copyof" # (0..6) + - (Expression) ► (UNRECOGNIZED): "copyof" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.8.0-failure.yml index 85245544de..a771fd7f26 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "copyof" # (0..6) + - (Expression) ► (UNRECOGNIZED): "copyof" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.5.0-failure.yml index cec10979f3..1c43cce82c 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "define" # (0..6) + - (Expression) ► (UNRECOGNIZED): "define" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.5.3-failure.yml index ffb5d5f2a6..14a8cc1d8b 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "define" # (0..6) + - (Expression) ► (UNRECOGNIZED): "define" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.6.0-failure.yml index 743a630a0d..fc61cddd20 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "define" # (0..6) + - (Expression) ► (UNRECOGNIZED): "define" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.7.0-failure.yml index 534d1237bf..ca3ad54e9a 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "define" # (0..6) + - (Expression) ► (UNRECOGNIZED): "define" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.8.0-failure.yml index 8663eab971..ebb0897ca1 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "define" # (0..6) + - (Expression) ► (UNRECOGNIZED): "define" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.5.0-failure.yml index a660a49f8a..d6b5574f26 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "emit" # (0..4) + - (Expression) ► (UNRECOGNIZED): "emit" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.5.3-failure.yml index e0b580be24..4dd2171acc 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "emit" # (0..4) + - (Expression) ► (UNRECOGNIZED): "emit" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.6.0-failure.yml index 817a88feca..fc95da1b7a 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "emit" # (0..4) + - (Expression) ► (UNRECOGNIZED): "emit" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.7.0-failure.yml index b44c079ac9..28496f1b0a 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "emit" # (0..4) + - (Expression) ► (UNRECOGNIZED): "emit" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.8.0-failure.yml index 4c347514bf..19fb5b0508 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "emit" # (0..4) + - (Expression) ► (UNRECOGNIZED): "emit" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/generated/0.6.0-failure.yml index 392e7301f4..b349d8912f 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "fallback" # (0..8) + - (Expression) ► (UNRECOGNIZED): "fallback" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/generated/0.7.0-failure.yml index 5e840eeec4..c5b7fb22be 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "fallback" # (0..8) + - (Expression) ► (UNRECOGNIZED): "fallback" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/generated/0.8.0-failure.yml index 5004467fbe..580a42e2e4 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "fallback" # (0..8) + - (Expression) ► (UNRECOGNIZED): "fallback" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/generated/0.4.11-failure.yml index 64469405d7..ff698b9026 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "finney" # (0..6) + - (Expression) ► (UNRECOGNIZED): "finney" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/generated/0.5.3-failure.yml index 5d7afa5e68..6f1c56ebb9 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "finney" # (0..6) + - (Expression) ► (UNRECOGNIZED): "finney" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/generated/0.6.0-failure.yml index f6a41378f2..7eacd36988 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "finney" # (0..6) + - (Expression) ► (UNRECOGNIZED): "finney" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.5.0-failure.yml index b6f8096c1f..b94e175823 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "immutable" # (0..9) + - (Expression) ► (UNRECOGNIZED): "immutable" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.5.3-failure.yml index 71cc39329b..7d14eb7529 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "immutable" # (0..9) + - (Expression) ► (UNRECOGNIZED): "immutable" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.6.0-failure.yml index 00f728a275..6a9d1f4c77 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "immutable" # (0..9) + - (Expression) ► (UNRECOGNIZED): "immutable" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.7.0-failure.yml index 3c2ba9c6df..8fb563d232 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "immutable" # (0..9) + - (Expression) ► (UNRECOGNIZED): "immutable" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.8.0-failure.yml index ddc317eb52..2a2c9ebb47 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "immutable" # (0..9) + - (Expression) ► (UNRECOGNIZED): "immutable" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.5.0-failure.yml index 0469cec327..3ef592b8ae 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "implements" # (0..10) + - (Expression) ► (UNRECOGNIZED): "implements" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.5.3-failure.yml index 56b90d7df3..94664a0f7a 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "implements" # (0..10) + - (Expression) ► (UNRECOGNIZED): "implements" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.6.0-failure.yml index 0c8dd48c06..ad2be9a8ca 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "implements" # (0..10) + - (Expression) ► (UNRECOGNIZED): "implements" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.7.0-failure.yml index dc1c067821..78c8b02f7a 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "implements" # (0..10) + - (Expression) ► (UNRECOGNIZED): "implements" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.8.0-failure.yml index 608dbfe7a3..69c6f4a447 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "implements" # (0..10) + - (Expression) ► (UNRECOGNIZED): "implements" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.5.0-failure.yml index 6178b7f46a..72e7ce2dad 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "macro" # (0..5) + - (Expression) ► (UNRECOGNIZED): "macro" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.5.3-failure.yml index 45afa3cccb..9cb94a9892 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "macro" # (0..5) + - (Expression) ► (UNRECOGNIZED): "macro" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.6.0-failure.yml index 1885208b90..ae6842d694 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "macro" # (0..5) + - (Expression) ► (UNRECOGNIZED): "macro" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.7.0-failure.yml index 3c9a1b9bba..598242910c 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "macro" # (0..5) + - (Expression) ► (UNRECOGNIZED): "macro" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.8.0-failure.yml index c50859bbc1..f1053e0c9e 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "macro" # (0..5) + - (Expression) ► (UNRECOGNIZED): "macro" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.5.0-failure.yml index 0b603412a9..ca1a211e45 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "mutable" # (0..7) + - (Expression) ► (UNRECOGNIZED): "mutable" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.5.3-failure.yml index 17b6690d69..507e44417d 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "mutable" # (0..7) + - (Expression) ► (UNRECOGNIZED): "mutable" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.6.0-failure.yml index 396d11d303..4a2b3e2712 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "mutable" # (0..7) + - (Expression) ► (UNRECOGNIZED): "mutable" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.7.0-failure.yml index b81f2a2c34..98ecf8a90e 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "mutable" # (0..7) + - (Expression) ► (UNRECOGNIZED): "mutable" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.8.0-failure.yml index ecd3c01698..1bdc3db886 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "mutable" # (0..7) + - (Expression) ► (UNRECOGNIZED): "mutable" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.5.0-failure.yml index 4844ea6d79..473a7d8ef1 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "override" # (0..8) + - (Expression) ► (UNRECOGNIZED): "override" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.5.3-failure.yml index 21ab745629..60346accc9 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "override" # (0..8) + - (Expression) ► (UNRECOGNIZED): "override" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.6.0-failure.yml index 452cdddcc7..84be592470 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "override" # (0..8) + - (Expression) ► (UNRECOGNIZED): "override" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.7.0-failure.yml index e44bacf54c..52bb8b0c33 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "override" # (0..8) + - (Expression) ► (UNRECOGNIZED): "override" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.8.0-failure.yml index 9300cdcc65..64139a5510 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "override" # (0..8) + - (Expression) ► (UNRECOGNIZED): "override" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.5.0-failure.yml index 0e82260fc8..ecb5478dfa 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "partial" # (0..7) + - (Expression) ► (UNRECOGNIZED): "partial" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.5.3-failure.yml index 5b40de3457..43a45d151d 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "partial" # (0..7) + - (Expression) ► (UNRECOGNIZED): "partial" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.6.0-failure.yml index 5c1c2fb0df..9d080dd4be 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "partial" # (0..7) + - (Expression) ► (UNRECOGNIZED): "partial" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.7.0-failure.yml index 53c096afa0..03b9f175a4 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "partial" # (0..7) + - (Expression) ► (UNRECOGNIZED): "partial" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.8.0-failure.yml index cc761460ee..19f24f7f4e 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "partial" # (0..7) + - (Expression) ► (UNRECOGNIZED): "partial" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.5.0-failure.yml index e8c73a5823..1af571ba49 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "promise" # (0..7) + - (Expression) ► (UNRECOGNIZED): "promise" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.5.3-failure.yml index fb380b615a..13b41d1cb3 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "promise" # (0..7) + - (Expression) ► (UNRECOGNIZED): "promise" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.6.0-failure.yml index 29f368e6d2..e5949cffb6 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "promise" # (0..7) + - (Expression) ► (UNRECOGNIZED): "promise" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.7.0-failure.yml index 5b46318d91..daee147b85 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "promise" # (0..7) + - (Expression) ► (UNRECOGNIZED): "promise" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.8.0-failure.yml index 26671ca2ad..f87911474a 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "promise" # (0..7) + - (Expression) ► (UNRECOGNIZED): "promise" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/generated/0.6.0-failure.yml index 8765fdab9c..1af5420f20 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "receive" # (0..7) + - (Expression) ► (UNRECOGNIZED): "receive" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/generated/0.7.0-failure.yml index aa7014b9c6..272ad2b0a3 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "receive" # (0..7) + - (Expression) ► (UNRECOGNIZED): "receive" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/generated/0.8.0-failure.yml index 45bb102349..2dd566c576 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "receive" # (0..7) + - (Expression) ► (UNRECOGNIZED): "receive" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.5.0-failure.yml index c8f08ac497..6b2f9f903c 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "reference" # (0..9) + - (Expression) ► (UNRECOGNIZED): "reference" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.5.3-failure.yml index 95c2ae4c93..3c6a664f9e 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "reference" # (0..9) + - (Expression) ► (UNRECOGNIZED): "reference" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.6.0-failure.yml index d39f63f356..823aa255b9 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "reference" # (0..9) + - (Expression) ► (UNRECOGNIZED): "reference" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.7.0-failure.yml index 84c0c8ae2a..97b4357175 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "reference" # (0..9) + - (Expression) ► (UNRECOGNIZED): "reference" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.8.0-failure.yml index 06830f4110..6a89b78fad 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "reference" # (0..9) + - (Expression) ► (UNRECOGNIZED): "reference" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.5.0-failure.yml index 88e4a7fdb2..0f7e6d64da 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sealed" # (0..6) + - (Expression) ► (UNRECOGNIZED): "sealed" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.5.3-failure.yml index f4ce822c7b..d45fc581f2 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sealed" # (0..6) + - (Expression) ► (UNRECOGNIZED): "sealed" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.6.0-failure.yml index b73a063a0c..02a6dd52dd 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sealed" # (0..6) + - (Expression) ► (UNRECOGNIZED): "sealed" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.7.0-failure.yml index 68d198960e..16715d0e6f 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sealed" # (0..6) + - (Expression) ► (UNRECOGNIZED): "sealed" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.8.0-failure.yml index 4c18fda310..31fdec16bd 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sealed" # (0..6) + - (Expression) ► (UNRECOGNIZED): "sealed" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.5.0-failure.yml index f512e1f4b1..ee5e47af18 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sizeof" # (0..6) + - (Expression) ► (UNRECOGNIZED): "sizeof" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.5.3-failure.yml index e0d946775c..a72f0256e5 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sizeof" # (0..6) + - (Expression) ► (UNRECOGNIZED): "sizeof" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.6.0-failure.yml index f58fa3e39d..fc1fc4baca 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sizeof" # (0..6) + - (Expression) ► (UNRECOGNIZED): "sizeof" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.7.0-failure.yml index b79bac5031..cd5f23f735 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sizeof" # (0..6) + - (Expression) ► (UNRECOGNIZED): "sizeof" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.8.0-failure.yml index 5ced421909..b972aa039a 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sizeof" # (0..6) + - (Expression) ► (UNRECOGNIZED): "sizeof" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.5.0-failure.yml index b60ee9a43b..63fa67b0d6 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "supports" # (0..8) + - (Expression) ► (UNRECOGNIZED): "supports" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.5.3-failure.yml index 08013c9387..8ccde5042c 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "supports" # (0..8) + - (Expression) ► (UNRECOGNIZED): "supports" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.6.0-failure.yml index 1fa673bb3e..464f222504 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "supports" # (0..8) + - (Expression) ► (UNRECOGNIZED): "supports" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.7.0-failure.yml index 772a9678c0..6b55a03787 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "supports" # (0..8) + - (Expression) ► (UNRECOGNIZED): "supports" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.8.0-failure.yml index 7a1687fd98..45967c4b9c 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "supports" # (0..8) + - (Expression) ► (UNRECOGNIZED): "supports" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/generated/0.4.11-failure.yml index 9f09b21cb0..dd01cf1b1f 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "szabo" # (0..5) + - (Expression) ► (UNRECOGNIZED): "szabo" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/generated/0.5.3-failure.yml index 3114410d3c..18d1298817 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "szabo" # (0..5) + - (Expression) ► (UNRECOGNIZED): "szabo" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/generated/0.6.0-failure.yml index 7a6c47eff4..cc2deda6ff 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "szabo" # (0..5) + - (Expression) ► (UNRECOGNIZED): "szabo" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.5.0-failure.yml index 0851ac3983..abe824f779 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "typedef" # (0..7) + - (Expression) ► (UNRECOGNIZED): "typedef" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.5.3-failure.yml index 2f81b55c8a..0dc9cf4209 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "typedef" # (0..7) + - (Expression) ► (UNRECOGNIZED): "typedef" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.6.0-failure.yml index 3520f8f86c..92a5a77e12 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "typedef" # (0..7) + - (Expression) ► (UNRECOGNIZED): "typedef" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.7.0-failure.yml index 893231de89..cdf86020dd 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "typedef" # (0..7) + - (Expression) ► (UNRECOGNIZED): "typedef" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.8.0-failure.yml index 2422903f62..5e2589b0c6 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "typedef" # (0..7) + - (Expression) ► (UNRECOGNIZED): "typedef" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.5.0-failure.yml index 5312018ab6..ef8af2866d 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "unchecked" # (0..9) + - (Expression) ► (UNRECOGNIZED): "unchecked" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.5.3-failure.yml index 88f4ab147d..6c41c727fd 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "unchecked" # (0..9) + - (Expression) ► (UNRECOGNIZED): "unchecked" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.6.0-failure.yml index ab4f09eab4..545dae5596 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "unchecked" # (0..9) + - (Expression) ► (UNRECOGNIZED): "unchecked" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.7.0-failure.yml index c02d3490c7..c3e11b1f11 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "unchecked" # (0..9) + - (Expression) ► (UNRECOGNIZED): "unchecked" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.8.0-failure.yml index 0e792c0cac..2d3dcf6bdf 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "unchecked" # (0..9) + - (Expression) ► (UNRECOGNIZED): "unchecked" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/generated/0.6.0-failure.yml index 06e1ca5def..4adbecb37a 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "virtual" # (0..7) + - (Expression) ► (UNRECOGNIZED): "virtual" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/generated/0.7.0-failure.yml index e44abb633f..7b87eaa98a 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "virtual" # (0..7) + - (Expression) ► (UNRECOGNIZED): "virtual" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/generated/0.8.0-failure.yml index 3f28103e3f..4991c6bbed 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "virtual" # (0..7) + - (Expression) ► (UNRECOGNIZED): "virtual" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_integer/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_integer/generated/0.4.11-failure.yml index 5749570223..7b8ad02c28 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_integer/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_integer/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "5.fromUint()\n" # (0..13) + - (Expression) ► (UNRECOGNIZED): "5.fromUint()\n" # (0..13) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.0-failure.yml index 0fddf5d22e..6840a419c8 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "+foo" # (0..4) + - (Expression) ► (UNRECOGNIZED): "+foo" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.3-failure.yml index 23440c0691..855afc9057 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "+foo" # (0..4) + - (Expression) ► (UNRECOGNIZED): "+foo" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.6.0-failure.yml index cabfa301aa..df7e0da920 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "+foo" # (0..4) + - (Expression) ► (UNRECOGNIZED): "+foo" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.7.0-failure.yml index b92f9e7606..3a6cf21044 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "+foo" # (0..4) + - (Expression) ► (UNRECOGNIZED): "+foo" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.8.0-failure.yml index 18510fc3d6..89fb6dc2bf 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "+foo" # (0..4) + - (Expression) ► (UNRECOGNIZED): "+foo" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.4.11-failure.yml index 1595a796b2..dfc1cbdcf9 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "returns" # (0..7) + - (Expression) ► (UNRECOGNIZED): "returns" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.5.3-failure.yml index 6986246228..2cdfe4fd6e 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "returns" # (0..7) + - (Expression) ► (UNRECOGNIZED): "returns" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.6.0-failure.yml index e60560d991..0a0b647cf4 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "returns" # (0..7) + - (Expression) ► (UNRECOGNIZED): "returns" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.7.0-failure.yml index a01979c523..72118daa0b 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "returns" # (0..7) + - (Expression) ► (UNRECOGNIZED): "returns" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.8.0-failure.yml index 57911c31fd..864a9f63fa 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/returns/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "returns" # (0..7) + - (Expression) ► (UNRECOGNIZED): "returns" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.4.11-failure.yml index 5a85cce79e..e04263b758 100644 --- a/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "fallback () {}" # (0..14) + - (FallbackFunctionDefinition) ► (UNRECOGNIZED): "fallback () {}" # (0..14) diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.4.11-failure.yml index 82157923b9..d0ca5ab517 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "payable(msg.sender)\n" # (0..20) + - (Expression) ► (UNRECOGNIZED): "payable(msg.sender)\n" # (0..20) diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.5.3-failure.yml index 73e74359e0..76d0bc5be0 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "payable(msg.sender)\n" # (0..20) + - (Expression) ► (UNRECOGNIZED): "payable(msg.sender)\n" # (0..20) diff --git a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_consecutive_underscores/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_consecutive_underscores/generated/0.4.11-failure.yml index 9918fdb455..a57cc88a3e 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_consecutive_underscores/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_consecutive_underscores/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "0x1__2" # (0..6) + - (HexNumberExpression) ► (UNRECOGNIZED): "0x1__2" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_invalid_alpha_digit/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_invalid_alpha_digit/generated/0.4.11-failure.yml index f2ba2421b1..3a7f3fa7ba 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_invalid_alpha_digit/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_invalid_alpha_digit/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "0xabzz\n" # (0..7) + - (HexNumberExpression) ► (UNRECOGNIZED): "0xabzz\n" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_leading_underscore/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_leading_underscore/generated/0.4.11-failure.yml index 9745aa8716..5ee7a3c96a 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_leading_underscore/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_leading_underscore/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "0x_1" # (0..4) + - (HexNumberExpression) ► (UNRECOGNIZED): "0x_1" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_no_digits/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_no_digits/generated/0.4.11-failure.yml index 21aeff5b9e..9708b88250 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_no_digits/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_no_digits/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "0x" # (0..2) + - (HexNumberExpression) ► (UNRECOGNIZED): "0x" # (0..2) diff --git a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_trailing_ident_start/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_trailing_ident_start/generated/0.4.11-failure.yml index 814406e5a3..57e8908f64 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_trailing_ident_start/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_trailing_ident_start/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "0x1$\n" # (0..5) + - (HexNumberExpression) ► (UNRECOGNIZED): "0x1$\n" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_trailing_underscore/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_trailing_underscore/generated/0.4.11-failure.yml index e20fa684b3..01186b1fc5 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_trailing_underscore/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_trailing_underscore/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "0x1_" # (0..4) + - (HexNumberExpression) ► (UNRECOGNIZED): "0x1_" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_uppercase_prefix/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_uppercase_prefix/generated/0.5.0-failure.yml index 876b398766..625a63bedf 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_uppercase_prefix/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_uppercase_prefix/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "0X123456789" # (0..11) + - (HexNumberExpression) ► (UNRECOGNIZED): "0X123456789" # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/generated/0.4.11-failure.yml index e0246fa758..474ac8df85 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"12_34_56_78_90_ab_cd_ef"' # (0..28) + - (HexStringLiterals): # 'hex"12_34_56_78_90_ab_cd_ef"' (0..28) + - (UNRECOGNIZED): 'hex"12_34_56_78_90_ab_cd_ef"' # (0..28) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.4.11-failure.yml index f7a6110c5d..ce1871a80d 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"12__34"' # (0..11) + - (HexStringLiterals): # 'hex"12__34"' (0..11) + - (UNRECOGNIZED): 'hex"12__34"' # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.5.14-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.5.14-failure.yml index c0314a2227..3addea05b7 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.5.14-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.5.14-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"12__34"' # (0..11) + - (HexStringLiterals): # 'hex"12__34"' (0..11) + - (UNRECOGNIZED): 'hex"12__34"' # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.4.11-failure.yml index c812b18cd1..70b4e64746 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"_1234"' # (0..10) + - (HexStringLiterals): # 'hex"_1234"' (0..10) + - (UNRECOGNIZED): 'hex"_1234"' # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.5.14-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.5.14-failure.yml index 3e67df94b8..a6ddd80a0a 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.5.14-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.5.14-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"_1234"' # (0..10) + - (HexStringLiterals): # 'hex"_1234"' (0..10) + - (UNRECOGNIZED): 'hex"_1234"' # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.4.11-failure.yml index 4933241160..5896a6751e 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"1_2"' # (0..8) + - (HexStringLiterals): # 'hex"1_2"' (0..8) + - (UNRECOGNIZED): 'hex"1_2"' # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.5.14-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.5.14-failure.yml index ccaa9fb96c..5527e65890 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.5.14-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.5.14-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"1_2"' # (0..8) + - (HexStringLiterals): # 'hex"1_2"' (0..8) + - (UNRECOGNIZED): 'hex"1_2"' # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.4.11-failure.yml index 405422e3e8..1fb3dfb928 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"1234_"' # (0..10) + - (HexStringLiterals): # 'hex"1234_"' (0..10) + - (UNRECOGNIZED): 'hex"1234_"' # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.5.14-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.5.14-failure.yml index bf935d5a9d..85ba3f5010 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.5.14-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.5.14-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"1234_"' # (0..10) + - (HexStringLiterals): # 'hex"1234_"' (0..10) + - (UNRECOGNIZED): 'hex"1234_"' # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/generated/0.4.11-failure.yml index bcaeaaba1a..6c7d89139c 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"ab" hex''cd''' # (0..15) + - (HexStringLiterals): # 'hex"ab" hex''cd''' (0..15) + - (UNRECOGNIZED): 'hex"ab" hex''cd''' # (0..15) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/generated/0.4.11-failure.yml index a41950a33d..0a91e924e8 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"1234567890abcdef"' # (0..21) + - (HexStringLiterals): # 'hex"1234567890abcdef"' (0..21) + - (UNRECOGNIZED): 'hex"1234567890abcdef"' # (0..21) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/generated/0.4.11-failure.yml index d4a4b8af33..0260055a93 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"abcdef"' # (0..11) + - (HexStringLiterals): # 'hex"abcdef"' (0..11) + - (UNRECOGNIZED): 'hex"abcdef"' # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml index 77691893be..3a4e13b3a5 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"12"b\n' # (0..9) + - (HexStringLiterals): # 'hex"12"b\n' (0..9) + - (UNRECOGNIZED): 'hex"12"b\n' # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/generated/0.4.11-failure.yml index 6cf3327293..091e8e0f79 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'hex"1234_5678_90ab_cdef"' # (0..24) + - (HexStringLiterals): # 'hex"1234_5678_90ab_cdef"' (0..24) + - (UNRECOGNIZED): 'hex"1234_5678_90ab_cdef"' # (0..24) diff --git a/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.4.11-failure.yml index 11cc8c50d4..68d597a533 100644 --- a/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "receive () {}" # (0..13) + - (ReceiveFunctionDefinition) ► (UNRECOGNIZED): "receive () {}" # (0..13) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiteral/double_quote_unicode/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiteral/double_quote_unicode/generated/0.7.0-failure.yml index 1e58ee9522..05e806a168 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiteral/double_quote_unicode/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiteral/double_quote_unicode/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): '"दिल"\n' # (0..12) + - (StringLiteral) ► (UNRECOGNIZED): '"दिल"\n' # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_hex_invalid/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_hex_invalid/generated/0.4.11-failure.yml index d92a232864..890fd53bf3 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_hex_invalid/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_hex_invalid/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): '"\x1"\n' # (0..6) + - (StringLiteral) ► (UNRECOGNIZED): '"\x1"\n' # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_unicode_invalid/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_unicode_invalid/generated/0.4.11-failure.yml index 34fc7d5605..b4e18e2a4b 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_unicode_invalid/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiteral/escape_unicode_invalid/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): '"\u123"\n' # (0..8) + - (StringLiteral) ► (UNRECOGNIZED): '"\u123"\n' # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiteral/single_quote_unicode/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiteral/single_quote_unicode/generated/0.7.0-failure.yml index 784eb543df..55caeb08f2 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiteral/single_quote_unicode/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiteral/single_quote_unicode/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "'दिल'\n" # (0..12) + - (StringLiteral) ► (UNRECOGNIZED): "'दिल'\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiteral/tabs_double_quote/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiteral/tabs_double_quote/generated/0.7.0-failure.yml index c2c5bbd4a3..2d4641a7b2 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiteral/tabs_double_quote/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiteral/tabs_double_quote/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): '"tab:\t"\n' # (0..8) + - (StringLiteral) ► (UNRECOGNIZED): '"tab:\t"\n' # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiteral/tabs_single_quote/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiteral/tabs_single_quote/generated/0.7.0-failure.yml index b97418a06d..779dc1ab79 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiteral/tabs_single_quote/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiteral/tabs_single_quote/generated/0.7.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "'tab:\t'\n" # (0..8) + - (StringLiteral) ► (UNRECOGNIZED): "'tab:\t'\n" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiterals/both_quotes/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiterals/both_quotes/generated/0.4.11-failure.yml index 92e0fef125..5444318ac7 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiterals/both_quotes/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiterals/both_quotes/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): '"foo" ''bar''' # (0..11) + - (StringLiterals): # '"foo" ''bar''' (0..11) + - (UNRECOGNIZED): '"foo" ''bar''' # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiterals/double_quote/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiterals/double_quote/generated/0.4.11-failure.yml index 6335d89eb2..eec18bd33c 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiterals/double_quote/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiterals/double_quote/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): '"foo"' # (0..5) + - (StringLiterals): # '"foo"' (0..5) + - (UNRECOGNIZED): '"foo"' # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiterals/double_quote_unicode/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiterals/double_quote_unicode/generated/0.4.11-failure.yml index 546abf6328..244510fc54 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiterals/double_quote_unicode/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiterals/double_quote_unicode/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): '"Fireworks 🎆"\n' # (0..17) + - (StringLiterals): # '"Fireworks 🎆"\n' (0..17) + - (UNRECOGNIZED): '"Fireworks 🎆"\n' # (0..17) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiterals/double_quote_unicode/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiterals/double_quote_unicode/generated/0.7.0-failure.yml index c2ef65f7a2..3f29d066d3 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiterals/double_quote_unicode/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiterals/double_quote_unicode/generated/0.7.0-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): '"Fireworks 🎆"\n' # (0..17) + - (StringLiterals): # '"Fireworks 🎆"\n' (0..17) + - (UNRECOGNIZED): '"Fireworks 🎆"\n' # (0..17) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_quote/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_quote/generated/0.4.11-failure.yml index bb18ee8d26..8ee401c506 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_quote/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_quote/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "'foo'\n" # (0..6) + - (StringLiterals): # "'foo'\n" (0..6) + - (UNRECOGNIZED): "'foo'\n" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_quote_unicode/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_quote_unicode/generated/0.4.11-failure.yml index 3156caaa70..2b4367b5bd 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_quote_unicode/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_quote_unicode/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "'Fireworks 🎆'\n" # (0..17) + - (StringLiterals): # "'Fireworks 🎆'\n" (0..17) + - (UNRECOGNIZED): "'Fireworks 🎆'\n" # (0..17) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_quote_unicode/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_quote_unicode/generated/0.7.0-failure.yml index b4ed4e9990..630ae87719 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_quote_unicode/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_quote_unicode/generated/0.7.0-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "'Fireworks 🎆'\n" # (0..17) + - (StringLiterals): # "'Fireworks 🎆'\n" (0..17) + - (UNRECOGNIZED): "'Fireworks 🎆'\n" # (0..17) diff --git a/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_trailing_ident/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_trailing_ident/generated/0.4.11-failure.yml index d9f05bf8ab..09fa18040b 100644 --- a/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_trailing_ident/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StringLiterals/single_trailing_ident/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): '"foo"bar\n' # (0..9) + - (StringLiterals): # '"foo"bar\n' (0..9) + - (UNRECOGNIZED): '"foo"bar\n' # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/ThrowStatement/throw/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ThrowStatement/throw/generated/0.5.0-failure.yml index 9293eb9ca4..1b20f9ae34 100644 --- a/crates/solidity/testing/snapshots/cst_output/ThrowStatement/throw/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ThrowStatement/throw/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "throw;" # (0..6) + - (ThrowStatement) ► (UNRECOGNIZED): "throw;" # (0..6) diff --git a/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch_empty_body/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch_empty_body/generated/0.4.11-failure.yml index 781f78ad52..dbb20dbabb 100644 --- a/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch_empty_body/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch_empty_body/generated/0.4.11-failure.yml @@ -18,4 +18,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "try foo() {\n} catch {\n}\n" # (0..24) + - (TryStatement) ► (UNRECOGNIZED): "try foo() {\n} catch {\n}\n" # (0..24) diff --git a/crates/solidity/testing/snapshots/cst_output/TryStatement/try_expr_call_options/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/TryStatement/try_expr_call_options/generated/0.4.11-failure.yml index fe0d8c03cd..8b662f1ce1 100644 --- a/crates/solidity/testing/snapshots/cst_output/TryStatement/try_expr_call_options/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/TryStatement/try_expr_call_options/generated/0.4.11-failure.yml @@ -19,4 +19,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "try foo() { x: 1 } {\n bar();\n} catch {\n}\n" # (0..42) + - (TryStatement) ► (UNRECOGNIZED): "try foo() { x: 1 } {\n bar();\n} catch {\n}\n" # (0..42) diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/byte/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/byte/generated/0.8.0-failure.yml index 808e3c38cf..0474331cdf 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/byte/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/byte/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "byte" # (0..4) + - (TypeName) ► (UNRECOGNIZED): "byte" # (0..4) diff --git a/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiterals/multiple/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiterals/multiple/generated/0.4.11-failure.yml index ddf7d1dcc7..61cf190490 100644 --- a/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiterals/multiple/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiterals/multiple/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'unicode"happy 😃" unicode''sad 😔''' # (0..37) + - (UnicodeStringLiterals): # 'unicode"happy 😃" unicode''sad 😔''' (0..37) + - (UNRECOGNIZED): 'unicode"happy 😃" unicode''sad 😔''' # (0..37) diff --git a/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiterals/single/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiterals/single/generated/0.4.11-failure.yml index a0361ef521..3183c54afe 100644 --- a/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiterals/single/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiterals/single/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'unicode"emoji 😃"' # (0..19) + - (UnicodeStringLiterals): # 'unicode"emoji 😃"' (0..19) + - (UNRECOGNIZED): 'unicode"emoji 😃"' # (0..19) diff --git a/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml index f58ddc4997..e059696a68 100644 --- a/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnicodeStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml @@ -14,4 +14,5 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): 'unicode"emoji 😃"happy\n' # (0..25) + - (UnicodeStringLiterals): # 'unicode"emoji 😃"happy\n' (0..25) + - (UNRECOGNIZED): 'unicode"emoji 😃"happy\n' # (0..25) diff --git a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/internal_attribute/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/internal_attribute/generated/0.6.0-failure.yml index 73970e9bb2..dde314d12c 100644 --- a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/internal_attribute/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/internal_attribute/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "function () internal {}\n" # (0..24) + - (UnnamedFunctionDefinition) ► (UNRECOGNIZED): "function () internal {}\n" # (0..24) diff --git a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/private_attribute/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/private_attribute/generated/0.6.0-failure.yml index 2957a53bf7..feca7c72b7 100644 --- a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/private_attribute/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/private_attribute/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "function () private {}\n" # (0..23) + - (UnnamedFunctionDefinition) ► (UNRECOGNIZED): "function () private {}\n" # (0..23) diff --git a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/public_attribute/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/public_attribute/generated/0.6.0-failure.yml index 17db83672a..1aed3aae7f 100644 --- a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/public_attribute/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/public_attribute/generated/0.6.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "function () public {}\n" # (0..22) + - (UnnamedFunctionDefinition) ► (UNRECOGNIZED): "function () public {}\n" # (0..22) diff --git a/crates/solidity/testing/snapshots/cst_output/UserDefinedValueTypeDefinition/bool/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UserDefinedValueTypeDefinition/bool/generated/0.4.11-failure.yml index 363d879a14..f4184c93f0 100644 --- a/crates/solidity/testing/snapshots/cst_output/UserDefinedValueTypeDefinition/bool/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UserDefinedValueTypeDefinition/bool/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "type Foo is bool;" # (0..17) + - (UserDefinedValueTypeDefinition) ► (UNRECOGNIZED): "type Foo is bool;" # (0..17) diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/identifier_path/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/identifier_path/generated/0.4.11-failure.yml index 4138f963be..cee50cbabd 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/identifier_path/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/identifier_path/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "foo.bar" # (0..7) + - (UsingDeconstructionSymbol) ► (UNRECOGNIZED): "foo.bar" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/identifier_path_as_operator/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/identifier_path_as_operator/generated/0.4.11-failure.yml index f34dd87635..fcc9589e2f 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/identifier_path_as_operator/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/identifier_path_as_operator/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "foo.bar as /" # (0..12) + - (UsingDeconstructionSymbol) ► (UNRECOGNIZED): "foo.bar as /" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/single_id/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/single_id/generated/0.4.11-failure.yml index 297afe649f..82c7771977 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/single_id/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/single_id/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "foo" # (0..3) + - (UsingDeconstructionSymbol) ► (UNRECOGNIZED): "foo" # (0..3) diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/single_id_as_operator/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/single_id_as_operator/generated/0.4.11-failure.yml index 197d6e40d7..1e1597c1bd 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/single_id_as_operator/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/single_id_as_operator/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "foo as /" # (0..8) + - (UsingDeconstructionSymbol) ► (UNRECOGNIZED): "foo as /" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.5.0-failure.yml index 0df83c14e1..4d5b2395b2 100644 --- a/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "var z = 0;" # (0..10) + - (VariableDeclarationStatement) ► (UNRECOGNIZED): "var z = 0;" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.8.0-failure.yml index d06a33c8e9..99c12572d6 100644 --- a/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.8.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "var z = 0;" # (0..10) + - (VariableDeclarationStatement) ► (UNRECOGNIZED): "var z = 0;" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.4.11-failure.yml index 2c6030d513..401e8b684b 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "1a\n" # (0..3) + - (YulExpression) ► (UNRECOGNIZED): "1a\n" # (0..3) diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.4.12-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.4.12-failure.yml index b670fca596..5e5b01ade5 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.4.12-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.4.12-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "1a\n" # (0..3) + - (YulExpression) ► (UNRECOGNIZED): "1a\n" # (0..3) diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.5.0-failure.yml index d1e9f68596..c0d47dcc92 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "1a\n" # (0..3) + - (YulExpression) ► (UNRECOGNIZED): "1a\n" # (0..3) diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.8.18-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.8.18-failure.yml index 45c5e2c84a..89d0bb5ac4 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.8.18-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.8.18-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "1a\n" # (0..3) + - (YulExpression) ► (UNRECOGNIZED): "1a\n" # (0..3) diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.8.24-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.8.24-failure.yml index f1ba0b535b..83bf8a6513 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.8.24-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.8.24-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "1a\n" # (0..3) + - (YulExpression) ► (UNRECOGNIZED): "1a\n" # (0..3) diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.8.7-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.8.7-failure.yml index 4a20fefc34..71f2088cee 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.8.7-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/generated/0.8.7-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "1a\n" # (0..3) + - (YulExpression) ► (UNRECOGNIZED): "1a\n" # (0..3) diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.4.11-failure.yml index 7b09521d67..2756730801 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "0x1$\n" # (0..5) + - (YulExpression) ► (UNRECOGNIZED): "0x1$\n" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.4.12-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.4.12-failure.yml index 4886b5dbb8..0b38d51dd9 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.4.12-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.4.12-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "0x1$\n" # (0..5) + - (YulExpression) ► (UNRECOGNIZED): "0x1$\n" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.5.0-failure.yml index 0d1ef39635..c978498d80 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "0x1$\n" # (0..5) + - (YulExpression) ► (UNRECOGNIZED): "0x1$\n" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.8.18-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.8.18-failure.yml index a6a4431fc5..4fe5773cbc 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.8.18-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.8.18-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "0x1$\n" # (0..5) + - (YulExpression) ► (UNRECOGNIZED): "0x1$\n" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.8.24-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.8.24-failure.yml index 87e1c2f406..a174044bab 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.8.24-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.8.24-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "0x1$\n" # (0..5) + - (YulExpression) ► (UNRECOGNIZED): "0x1$\n" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.8.7-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.8.7-failure.yml index 66cc443373..964a731a90 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.8.7-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/generated/0.8.7-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "0x1$\n" # (0..5) + - (YulExpression) ► (UNRECOGNIZED): "0x1$\n" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.18-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.18-failure.yml index 3773ff95d7..7fc8615ff0 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.18-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.18-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "difficulty()\n" # (0..13) + - (YulExpression) ► (UNRECOGNIZED): "difficulty()\n" # (0..13) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.24-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.24-failure.yml index 35ef43d207..aea5563d27 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.24-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.24-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "difficulty()\n" # (0..13) + - (YulExpression) ► (UNRECOGNIZED): "difficulty()\n" # (0..13) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.5.0-failure.yml index a308883cd2..2f0d3004b0 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "jump()\n" # (0..7) + - (YulExpression) ► (UNRECOGNIZED): "jump()\n" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.18-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.18-failure.yml index da308c7866..86cdad0565 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.18-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.18-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "jump()\n" # (0..7) + - (YulExpression) ► (UNRECOGNIZED): "jump()\n" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.24-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.24-failure.yml index 7174edda97..143e865bee 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.24-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.24-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "jump()\n" # (0..7) + - (YulExpression) ► (UNRECOGNIZED): "jump()\n" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.7-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.7-failure.yml index f96a9d1499..93ed08378b 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.7-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.7-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "jump()\n" # (0..7) + - (YulExpression) ► (UNRECOGNIZED): "jump()\n" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.5.0-failure.yml index a2993d10b4..433831df0a 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "jumpi()\n" # (0..8) + - (YulExpression) ► (UNRECOGNIZED): "jumpi()\n" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.18-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.18-failure.yml index 2fcb53ba57..caa036df1b 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.18-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.18-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "jumpi()\n" # (0..8) + - (YulExpression) ► (UNRECOGNIZED): "jumpi()\n" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.24-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.24-failure.yml index 81ac40f2a8..627d656f96 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.24-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.24-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "jumpi()\n" # (0..8) + - (YulExpression) ► (UNRECOGNIZED): "jumpi()\n" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.7-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.7-failure.yml index 3c5be2d138..94c5517f07 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.7-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.7-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "jumpi()\n" # (0..8) + - (YulExpression) ► (UNRECOGNIZED): "jumpi()\n" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulLabel/single_label/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulLabel/single_label/generated/0.5.0-failure.yml index d1c4f1e611..d7f8d04eb8 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulLabel/single_label/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulLabel/single_label/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "foo:\n" # (0..5) + - (YulLabel) ► (UNRECOGNIZED): "foo:\n" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/YulLeaveStatement/leave/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulLeaveStatement/leave/generated/0.4.11-failure.yml index f10cef3c19..426d59fa16 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulLeaveStatement/leave/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulLeaveStatement/leave/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "leave" # (0..5) + - (YulLeaveStatement) ► (UNRECOGNIZED): "leave" # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/generated/0.5.0-failure.yml index 13d3aa868a..c9d42e06ca 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "= : success\n" # (0..12) + - (YulStackAssignmentStatement) ► (UNRECOGNIZED): "= : success\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/generated/0.5.0-failure.yml index 0de1a8336f..70b81c499d 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "=: success\n" # (0..11) + - (YulStackAssignmentStatement) ► (UNRECOGNIZED): "=: success\n" # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_add/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_add/generated/0.4.11-failure.yml index a8387e452d..95d5282f53 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_add/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_add/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "add := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "add := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_addmod/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_addmod/generated/0.4.11-failure.yml index 12c546816f..6732b3fb59 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_addmod/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_addmod/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "addmod := 0\n" # (0..12) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "addmod := 0\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_and/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_and/generated/0.4.11-failure.yml index 25323582a7..7f2b91c4d4 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_and/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_and/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "and := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "and := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_balance/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_balance/generated/0.4.11-failure.yml index f7476e9c29..d55cb40335 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_balance/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_balance/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "balance := 0\n" # (0..13) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "balance := 0\n" # (0..13) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_basefee/generated/0.8.7-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_basefee/generated/0.8.7-failure.yml index 2c93a9be38..13e4aac997 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_basefee/generated/0.8.7-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_basefee/generated/0.8.7-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "basefee := 0\n" # (0..13) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "basefee := 0\n" # (0..13) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_blockhash/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_blockhash/generated/0.4.11-failure.yml index febb39e2e7..876113b8d8 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_blockhash/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_blockhash/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "blockhash := 0\n" # (0..15) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "blockhash := 0\n" # (0..15) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_byte/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_byte/generated/0.4.11-failure.yml index 45aeb94081..a18e013979 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_byte/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_byte/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "byte := 0\n" # (0..10) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "byte := 0\n" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_call/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_call/generated/0.4.11-failure.yml index dc9ceee8ea..74159dcc76 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_call/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_call/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "call := 0\n" # (0..10) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "call := 0\n" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_callcode/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_callcode/generated/0.4.11-failure.yml index eed682254e..438199383b 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_callcode/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_callcode/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "callcode := 0\n" # (0..14) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "callcode := 0\n" # (0..14) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_calldatacopy/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_calldatacopy/generated/0.4.11-failure.yml index 8fa2369117..0e7800ca0e 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_calldatacopy/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_calldatacopy/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "calldatacopy := 0\n" # (0..18) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "calldatacopy := 0\n" # (0..18) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_calldataload/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_calldataload/generated/0.4.11-failure.yml index 8a6701a47b..dd269e3605 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_calldataload/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_calldataload/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "calldataload := 0\n" # (0..18) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "calldataload := 0\n" # (0..18) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_calldatasize/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_calldatasize/generated/0.4.11-failure.yml index f8db4d07d0..1fbad5e588 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_calldatasize/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_calldatasize/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "calldatasize := 0\n" # (0..18) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "calldatasize := 0\n" # (0..18) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_caller/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_caller/generated/0.4.11-failure.yml index c95d66bbe7..b4fb95120c 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_caller/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_caller/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "caller := 0\n" # (0..12) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "caller := 0\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_callvalue/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_callvalue/generated/0.4.11-failure.yml index 649ebf6bfe..0e07af7405 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_callvalue/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_callvalue/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "callvalue := 0\n" # (0..15) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "callvalue := 0\n" # (0..15) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_chainid/generated/0.5.12-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_chainid/generated/0.5.12-failure.yml index e54a3e44ef..723343ad93 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_chainid/generated/0.5.12-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_chainid/generated/0.5.12-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "chainid := 0\n" # (0..13) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "chainid := 0\n" # (0..13) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_coinbase/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_coinbase/generated/0.4.11-failure.yml index fa21344a09..e4358a273a 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_coinbase/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_coinbase/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "coinbase := 0\n" # (0..14) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "coinbase := 0\n" # (0..14) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_create/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_create/generated/0.4.11-failure.yml index 0a5f22fbf0..24c93e211e 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_create/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_create/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "create := 0\n" # (0..12) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "create := 0\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_create2/generated/0.4.12-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_create2/generated/0.4.12-failure.yml index 783ebd372f..e459d1909c 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_create2/generated/0.4.12-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_create2/generated/0.4.12-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "create2 := 0\n" # (0..13) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "create2 := 0\n" # (0..13) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_delegatecall/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_delegatecall/generated/0.4.11-failure.yml index b86b42a063..55abb74577 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_delegatecall/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_delegatecall/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "delegatecall := 0\n" # (0..18) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "delegatecall := 0\n" # (0..18) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_difficulty/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_difficulty/generated/0.4.11-failure.yml index 6c0d66353b..50f1774952 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_difficulty/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_difficulty/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "difficulty := 0\n" # (0..16) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "difficulty := 0\n" # (0..16) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_div/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_div/generated/0.4.11-failure.yml index f05377b7fd..b314311634 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_div/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_div/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "div := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "div := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_eq/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_eq/generated/0.4.11-failure.yml index 2133975c85..632f6997a1 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_eq/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_eq/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "eq := 0\n" # (0..8) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "eq := 0\n" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_exp/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_exp/generated/0.4.11-failure.yml index 89f041cdf3..c316524abb 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_exp/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_exp/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "exp := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "exp := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_extcodecopy/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_extcodecopy/generated/0.4.11-failure.yml index 05428cf809..acef15af8d 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_extcodecopy/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_extcodecopy/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "extcodecopy := 0\n" # (0..17) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "extcodecopy := 0\n" # (0..17) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_extcodehash/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_extcodehash/generated/0.5.0-failure.yml index 721c2e3eb3..26b9611b9d 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_extcodehash/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_extcodehash/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "extcodehash := 0\n" # (0..17) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "extcodehash := 0\n" # (0..17) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_extcodesize/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_extcodesize/generated/0.4.11-failure.yml index dea27db7d3..eb67197c22 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_extcodesize/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_extcodesize/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "extcodesize := 0\n" # (0..17) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "extcodesize := 0\n" # (0..17) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gas/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gas/generated/0.4.11-failure.yml index d559f2fcf5..d305b36fc4 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gas/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gas/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "gas := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "gas := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gaslimit/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gaslimit/generated/0.4.11-failure.yml index 2219b5775c..782019ba3b 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gaslimit/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gaslimit/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "gaslimit := 0\n" # (0..14) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "gaslimit := 0\n" # (0..14) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gasprice/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gasprice/generated/0.4.11-failure.yml index bd859ad583..02203203a6 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gasprice/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gasprice/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "gasprice := 0\n" # (0..14) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "gasprice := 0\n" # (0..14) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gt/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gt/generated/0.4.11-failure.yml index d3bfe80352..a513d169e2 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gt/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_gt/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "gt := 0\n" # (0..8) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "gt := 0\n" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_invalid/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_invalid/generated/0.4.11-failure.yml index 1142222c49..9218cb6b55 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_invalid/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_invalid/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "invalid := 0\n" # (0..13) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "invalid := 0\n" # (0..13) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_iszero/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_iszero/generated/0.4.11-failure.yml index c2266cc237..9789db3e10 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_iszero/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_iszero/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "iszero := 0\n" # (0..12) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "iszero := 0\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_jump/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_jump/generated/0.4.11-failure.yml index 09ac706353..93b62fe296 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_jump/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_jump/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "jump := 0\n" # (0..10) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "jump := 0\n" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_jumpi/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_jumpi/generated/0.4.11-failure.yml index cbf4a3ef3e..5bac33a400 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_jumpi/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_jumpi/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "jumpi := 0\n" # (0..11) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "jumpi := 0\n" # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_keccak256/generated/0.4.12-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_keccak256/generated/0.4.12-failure.yml index 230455fd1d..015e66490d 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_keccak256/generated/0.4.12-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_keccak256/generated/0.4.12-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "keccak256 := 0\n" # (0..15) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "keccak256 := 0\n" # (0..15) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log0/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log0/generated/0.4.11-failure.yml index 34761345f4..9b261c7757 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log0/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log0/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "log0 := 0\n" # (0..10) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "log0 := 0\n" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log1/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log1/generated/0.4.11-failure.yml index 85c3cca2e6..bd105258a9 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log1/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log1/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "log1 := 0\n" # (0..10) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "log1 := 0\n" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log2/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log2/generated/0.4.11-failure.yml index 1f5f8ff675..49fdb016c4 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log2/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log2/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "log2 := 0\n" # (0..10) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "log2 := 0\n" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log3/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log3/generated/0.4.11-failure.yml index f5dbde997a..fec5f1efc4 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log3/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log3/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "log3 := 0\n" # (0..10) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "log3 := 0\n" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log4/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log4/generated/0.4.11-failure.yml index 18f6242134..585aebc2c3 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log4/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_log4/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "log4 := 0\n" # (0..10) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "log4 := 0\n" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_lt/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_lt/generated/0.4.11-failure.yml index 381e9d03f0..4c52ade47b 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_lt/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_lt/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "lt := 0\n" # (0..8) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "lt := 0\n" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mload/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mload/generated/0.4.11-failure.yml index ff77461245..a9480243c6 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mload/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mload/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "mload := 0\n" # (0..11) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "mload := 0\n" # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mod/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mod/generated/0.4.11-failure.yml index 942f74e3c4..cb423eb5ca 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mod/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mod/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "mod := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "mod := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_msize/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_msize/generated/0.4.11-failure.yml index 12b79a8b3a..eedeeafe53 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_msize/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_msize/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "msize := 0\n" # (0..11) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "msize := 0\n" # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mstore/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mstore/generated/0.4.11-failure.yml index 1431a594a8..36433a3e29 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mstore/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mstore/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "mstore := 0\n" # (0..12) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "mstore := 0\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mstore8/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mstore8/generated/0.4.11-failure.yml index 96d7ea8821..12cf7b1f53 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mstore8/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mstore8/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "mstore8 := 0\n" # (0..13) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "mstore8 := 0\n" # (0..13) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mul/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mul/generated/0.4.11-failure.yml index 924ffad34c..95b1f548df 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mul/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mul/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "mul := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "mul := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mulmod/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mulmod/generated/0.4.11-failure.yml index da6c1fa36b..a8805022d9 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mulmod/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_mulmod/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "mulmod := 0\n" # (0..12) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "mulmod := 0\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_not/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_not/generated/0.4.11-failure.yml index 7c9f939dad..7f1d03d151 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_not/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_not/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "not := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "not := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_number/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_number/generated/0.4.11-failure.yml index 5702376f4b..a0cf93bf11 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_number/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_number/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "number := 0\n" # (0..12) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "number := 0\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_or/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_or/generated/0.4.11-failure.yml index 54890d0c14..43a31c4fb8 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_or/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_or/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "or := 0\n" # (0..8) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "or := 0\n" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_origin/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_origin/generated/0.4.11-failure.yml index 98489d5b3c..015df65c24 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_origin/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_origin/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "origin := 0\n" # (0..12) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "origin := 0\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_pop/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_pop/generated/0.4.11-failure.yml index bc37f4d85d..428317127a 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_pop/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_pop/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "pop := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "pop := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_prevrandao/generated/0.8.18-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_prevrandao/generated/0.8.18-failure.yml index aca16dca94..7f0296aa24 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_prevrandao/generated/0.8.18-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_prevrandao/generated/0.8.18-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "prevrandao := 0\n" # (0..16) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "prevrandao := 0\n" # (0..16) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_return/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_return/generated/0.4.11-failure.yml index 702a812ad7..ab7aa055a8 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_return/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_return/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "return := 0\n" # (0..12) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "return := 0\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_returndatacopy/generated/0.4.12-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_returndatacopy/generated/0.4.12-failure.yml index 483abd7fd6..f1df804459 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_returndatacopy/generated/0.4.12-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_returndatacopy/generated/0.4.12-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "returndatacopy := 0\n" # (0..20) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "returndatacopy := 0\n" # (0..20) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_returndatasize/generated/0.4.12-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_returndatasize/generated/0.4.12-failure.yml index acdab8240f..ab74a0b24d 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_returndatasize/generated/0.4.12-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_returndatasize/generated/0.4.12-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "returndatasize := 0\n" # (0..20) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "returndatasize := 0\n" # (0..20) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_revert/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_revert/generated/0.4.11-failure.yml index 28493ec4c0..4543ac0d91 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_revert/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_revert/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "revert := 0\n" # (0..12) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "revert := 0\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sar/generated/0.4.21-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sar/generated/0.4.21-failure.yml index e68584151b..e06e9c3cf2 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sar/generated/0.4.21-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sar/generated/0.4.21-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sar := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "sar := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sdiv/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sdiv/generated/0.4.11-failure.yml index e4cef253f0..5b38c77315 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sdiv/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sdiv/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sdiv := 0\n" # (0..10) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "sdiv := 0\n" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_selfbalance/generated/0.5.12-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_selfbalance/generated/0.5.12-failure.yml index c562425df5..a10a9de3b3 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_selfbalance/generated/0.5.12-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_selfbalance/generated/0.5.12-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "selfbalance := 0\n" # (0..17) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "selfbalance := 0\n" # (0..17) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_selfdestruct/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_selfdestruct/generated/0.4.11-failure.yml index 3f670bb1d2..ea6a5df1c2 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_selfdestruct/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_selfdestruct/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "selfdestruct := 0\n" # (0..18) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "selfdestruct := 0\n" # (0..18) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sgt/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sgt/generated/0.4.11-failure.yml index 8c4abf38b1..e5df81559a 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sgt/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sgt/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sgt := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "sgt := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sha3/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sha3/generated/0.4.11-failure.yml index 2a2257cd1d..11d0c52cb2 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sha3/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sha3/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sha3 := 0\n" # (0..10) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "sha3 := 0\n" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_shl/generated/0.4.21-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_shl/generated/0.4.21-failure.yml index a01633c3d1..4631a051bf 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_shl/generated/0.4.21-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_shl/generated/0.4.21-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "shl := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "shl := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_shr/generated/0.4.21-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_shr/generated/0.4.21-failure.yml index 1124ddbb21..5489f01bfb 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_shr/generated/0.4.21-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_shr/generated/0.4.21-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "shr := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "shr := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_signextend/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_signextend/generated/0.4.11-failure.yml index 609570255c..7bc0429856 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_signextend/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_signextend/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "signextend := 0\n" # (0..16) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "signextend := 0\n" # (0..16) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sload/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sload/generated/0.4.11-failure.yml index 5210ad3453..b40c8cd928 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sload/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sload/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sload := 0\n" # (0..11) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "sload := 0\n" # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_slt/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_slt/generated/0.4.11-failure.yml index 072c3786e3..99f4593062 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_slt/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_slt/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "slt := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "slt := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_smod/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_smod/generated/0.4.11-failure.yml index 8e01f79870..0a4440af9f 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_smod/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_smod/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "smod := 0\n" # (0..10) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "smod := 0\n" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sstore/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sstore/generated/0.4.11-failure.yml index dfa5ab660f..a156f46c5b 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sstore/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sstore/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sstore := 0\n" # (0..12) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "sstore := 0\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_staticcall/generated/0.4.12-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_staticcall/generated/0.4.12-failure.yml index fdd6c3890d..396b7c6967 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_staticcall/generated/0.4.12-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_staticcall/generated/0.4.12-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "staticcall := 0\n" # (0..16) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "staticcall := 0\n" # (0..16) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_stop/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_stop/generated/0.4.11-failure.yml index 13cb1c1acc..6f55a25287 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_stop/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_stop/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "stop := 0\n" # (0..10) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "stop := 0\n" # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sub/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sub/generated/0.4.11-failure.yml index 172b6cbbcb..6095a1354c 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sub/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_sub/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "sub := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "sub := 0\n" # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_suicide/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_suicide/generated/0.4.11-failure.yml index 6a4c96e78d..39ec260e33 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_suicide/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_suicide/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "suicide := 0\n" # (0..13) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "suicide := 0\n" # (0..13) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_timestamp/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_timestamp/generated/0.4.11-failure.yml index bac842d46d..668952feca 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_timestamp/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_timestamp/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "timestamp := 0\n" # (0..15) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "timestamp := 0\n" # (0..15) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_xor/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_xor/generated/0.4.11-failure.yml index c3d04a8db0..d86ca55001 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_xor/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/identifier_xor/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (UNRECOGNIZED): "xor := 0\n" # (0..9) + - (YulVariableAssignmentStatement) ► (UNRECOGNIZED): "xor := 0\n" # (0..9) From 95137a0a327e1ba5e7011a70b725c75485268c6c Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Thu, 12 Dec 2024 08:53:24 -0300 Subject: [PATCH 14/22] Missing files --- .../generated/interfaces/nomic-foundation-slang-parser.d.ts | 6 +++--- .../generated/interfaces/nomic-foundation-slang-parser.d.ts | 6 +++--- .../generated/interfaces/nomic-foundation-slang-parser.d.ts | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/codegen/runtime/npm/package/wasm/generated/interfaces/nomic-foundation-slang-parser.d.ts b/crates/codegen/runtime/npm/package/wasm/generated/interfaces/nomic-foundation-slang-parser.d.ts index 9d24311b88..8435457d8e 100644 --- a/crates/codegen/runtime/npm/package/wasm/generated/interfaces/nomic-foundation-slang-parser.d.ts +++ b/crates/codegen/runtime/npm/package/wasm/generated/interfaces/nomic-foundation-slang-parser.d.ts @@ -7,8 +7,8 @@ export namespace NomicFoundationSlangParser { } import type { Cursor } from "./nomic-foundation-slang-cst.js"; export { Cursor }; -import type { Node } from "./nomic-foundation-slang-cst.js"; -export { Node }; +import type { NonterminalNode } from "./nomic-foundation-slang-cst.js"; +export { NonterminalNode }; import type { NonterminalKind } from "./nomic-foundation-slang-cst.js"; export { NonterminalKind }; import type { TextRange } from "./nomic-foundation-slang-cst.js"; @@ -30,7 +30,7 @@ export class ParseOutput { * Returns the root node of the parsed syntax tree. * Even if there are parsing errors, a partial tree will still be available. */ - get tree(): Node; + get tree(): NonterminalNode; /** * Returns a list of all parsing errors encountered. * An empty list indicates successful parsing with no errors. diff --git a/crates/solidity/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-parser.d.ts b/crates/solidity/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-parser.d.ts index 9d24311b88..8435457d8e 100644 --- a/crates/solidity/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-parser.d.ts +++ b/crates/solidity/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-parser.d.ts @@ -7,8 +7,8 @@ export namespace NomicFoundationSlangParser { } import type { Cursor } from "./nomic-foundation-slang-cst.js"; export { Cursor }; -import type { Node } from "./nomic-foundation-slang-cst.js"; -export { Node }; +import type { NonterminalNode } from "./nomic-foundation-slang-cst.js"; +export { NonterminalNode }; import type { NonterminalKind } from "./nomic-foundation-slang-cst.js"; export { NonterminalKind }; import type { TextRange } from "./nomic-foundation-slang-cst.js"; @@ -30,7 +30,7 @@ export class ParseOutput { * Returns the root node of the parsed syntax tree. * Even if there are parsing errors, a partial tree will still be available. */ - get tree(): Node; + get tree(): NonterminalNode; /** * Returns a list of all parsing errors encountered. * An empty list indicates successful parsing with no errors. diff --git a/crates/testlang/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-parser.d.ts b/crates/testlang/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-parser.d.ts index 9d24311b88..8435457d8e 100644 --- a/crates/testlang/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-parser.d.ts +++ b/crates/testlang/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-parser.d.ts @@ -7,8 +7,8 @@ export namespace NomicFoundationSlangParser { } import type { Cursor } from "./nomic-foundation-slang-cst.js"; export { Cursor }; -import type { Node } from "./nomic-foundation-slang-cst.js"; -export { Node }; +import type { NonterminalNode } from "./nomic-foundation-slang-cst.js"; +export { NonterminalNode }; import type { NonterminalKind } from "./nomic-foundation-slang-cst.js"; export { NonterminalKind }; import type { TextRange } from "./nomic-foundation-slang-cst.js"; @@ -30,7 +30,7 @@ export class ParseOutput { * Returns the root node of the parsed syntax tree. * Even if there are parsing errors, a partial tree will still be available. */ - get tree(): Node; + get tree(): NonterminalNode; /** * Returns a list of all parsing errors encountered. * An empty list indicates successful parsing with no errors. From 05d405aac98c782c5abd9c174695182a8f1dc9a8 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Thu, 19 Dec 2024 14:36:53 -0300 Subject: [PATCH 15/22] Moving clone to clients --- .../cargo/crate/src/runtime/parser/parse_output.rs | 4 ++-- .../cargo/wasm/src/runtime/wrappers/parser/mod.rs | 4 +++- .../crate/src/generated/parser/parse_output.rs | 4 ++-- .../solidity/outputs/cargo/tests/src/bindings.rs | 3 ++- .../tests/src/doc_examples/using_the_cursor.rs | 7 +++---- crates/solidity/outputs/cargo/tests/src/trivia.rs | 5 +++-- .../wasm/src/generated/wrappers/parser/mod.rs | 4 +++- crates/solidity/testing/sanctuary/src/tests.rs | 14 +++++++------- .../crate/src/generated/parser/parse_output.rs | 4 ++-- .../wasm/src/generated/wrappers/parser/mod.rs | 4 +++- 10 files changed, 30 insertions(+), 23 deletions(-) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parse_output.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parse_output.rs index 912645f278..76a7961e75 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parse_output.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parse_output.rs @@ -10,8 +10,8 @@ pub struct ParseOutput { } impl ParseOutput { - pub fn tree(&self) -> Rc { - Rc::clone(&self.parse_tree) + pub fn tree(&self) -> &Rc { + &self.parse_tree } pub fn errors(&self) -> &Vec { diff --git a/crates/codegen/runtime/cargo/wasm/src/runtime/wrappers/parser/mod.rs b/crates/codegen/runtime/cargo/wasm/src/runtime/wrappers/parser/mod.rs index 053ad7324b..d02394a852 100644 --- a/crates/codegen/runtime/cargo/wasm/src/runtime/wrappers/parser/mod.rs +++ b/crates/codegen/runtime/cargo/wasm/src/runtime/wrappers/parser/mod.rs @@ -1,3 +1,5 @@ +use std::rc::Rc; + use crate::wasm_crate::utils::{define_wrapper, FromFFI, IntoFFI}; mod ffi { @@ -78,7 +80,7 @@ define_wrapper! { ParseError { define_wrapper! { ParseOutput { fn tree(&self) -> ffi::NonterminalNode { - self._borrow_ffi().tree()._into_ffi() + Rc::clone(self._borrow_ffi().tree())._into_ffi() } fn errors(&self) -> Vec { diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parse_output.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parse_output.rs index 91662bae43..f6f06245e6 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parse_output.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parse_output.rs @@ -12,8 +12,8 @@ pub struct ParseOutput { } impl ParseOutput { - pub fn tree(&self) -> Rc { - Rc::clone(&self.parse_tree) + pub fn tree(&self) -> &Rc { + &self.parse_tree } pub fn errors(&self) -> &Vec { diff --git a/crates/solidity/outputs/cargo/tests/src/bindings.rs b/crates/solidity/outputs/cargo/tests/src/bindings.rs index b8eb8b52f1..2ddca80a49 100644 --- a/crates/solidity/outputs/cargo/tests/src/bindings.rs +++ b/crates/solidity/outputs/cargo/tests/src/bindings.rs @@ -1,3 +1,4 @@ +use std::rc::Rc; use std::sync::Arc; use anyhow::Result; @@ -21,7 +22,7 @@ pub fn create_bindings(version: &Version) -> Result { ); let built_ins_cursor = - transform_built_ins_node(&Node::Nonterminal(built_ins_parse_output.tree())) + transform_built_ins_node(&Node::Nonterminal(Rc::clone(built_ins_parse_output.tree()))) .cursor_with_offset(TextIndex::ZERO); bindings.add_system_file("built_ins.sol", built_ins_cursor); diff --git a/crates/solidity/outputs/cargo/tests/src/doc_examples/using_the_cursor.rs b/crates/solidity/outputs/cargo/tests/src/doc_examples/using_the_cursor.rs index 26d8a6c656..8979470be1 100644 --- a/crates/solidity/outputs/cargo/tests/src/doc_examples/using_the_cursor.rs +++ b/crates/solidity/outputs/cargo/tests/src/doc_examples/using_the_cursor.rs @@ -1,4 +1,5 @@ use std::path::Path; +use std::rc::Rc; use anyhow::Result; use infra_utils::paths::PathExtensions; @@ -89,8 +90,7 @@ fn using_the_cursor() -> Result<()> { { // --8<-- [start:using-iterator-api] - let identifiers: Vec<_> = parse_output - .tree() + let identifiers: Vec<_> = Rc::clone(parse_output.tree()) .descendants() .filter(|edge| edge.is_terminal_with_kind(TerminalKind::Identifier)) .map(|identifier| identifier.unparse()) @@ -103,8 +103,7 @@ fn using_the_cursor() -> Result<()> { { // --8<-- [start:using-cursors-with-labels] - let identifiers: Vec<_> = parse_output - .tree() + let identifiers: Vec<_> = Rc::clone(parse_output.tree()) .descendants() .filter(|edge| edge.label == Some(EdgeLabel::Name)) .filter(|edge| edge.is_terminal_with_kind(TerminalKind::Identifier)) diff --git a/crates/solidity/outputs/cargo/tests/src/trivia.rs b/crates/solidity/outputs/cargo/tests/src/trivia.rs index 1eadc077cc..8eb2ebc6f7 100644 --- a/crates/solidity/outputs/cargo/tests/src/trivia.rs +++ b/crates/solidity/outputs/cargo/tests/src/trivia.rs @@ -1,3 +1,5 @@ +use std::rc::Rc; + use anyhow::Result; use semver::Version; use slang_solidity::cst::{NonterminalKind, TerminalKind}; @@ -27,8 +29,7 @@ fn compare_end_of_lines(input: &str, expected: &[&str]) -> Result<()> { let output = parser.parse(NonterminalKind::SourceUnit, input); assert!(output.is_valid()); - let actual = output - .tree() + let actual = Rc::clone(output.tree()) .descendants() .filter(|edge| edge.is_terminal_with_kind(TerminalKind::EndOfLine)) .map(|eol| eol.unparse()) diff --git a/crates/solidity/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs b/crates/solidity/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs index 8100d7dc13..d2e73f91de 100644 --- a/crates/solidity/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs +++ b/crates/solidity/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs @@ -1,5 +1,7 @@ // This file is generated automatically by infrastructure scripts. Please don't edit by hand. +use std::rc::Rc; + use crate::wasm_crate::utils::{define_wrapper, FromFFI, IntoFFI}; mod ffi { @@ -80,7 +82,7 @@ define_wrapper! { ParseError { define_wrapper! { ParseOutput { fn tree(&self) -> ffi::NonterminalNode { - self._borrow_ffi().tree()._into_ffi() + Rc::clone(self._borrow_ffi().tree())._into_ffi() } fn errors(&self) -> Vec { diff --git a/crates/solidity/testing/sanctuary/src/tests.rs b/crates/solidity/testing/sanctuary/src/tests.rs index 0b0f4cb001..315e645b57 100644 --- a/crates/solidity/testing/sanctuary/src/tests.rs +++ b/crates/solidity/testing/sanctuary/src/tests.rs @@ -1,5 +1,6 @@ use std::cmp::min; use std::path::Path; +use std::rc::Rc; use std::sync::Arc; use anyhow::Result; @@ -212,13 +213,12 @@ fn create_bindings(version: &Version, source_id: &str, output: &ParseOutput) -> }), ); let parser = Parser::create(version.clone())?; - let built_ins_tree = parser - .parse( - NonterminalKind::SourceUnit, - bindings::get_built_ins(version), - ) - .tree(); - let built_ins_cursor = transform_built_ins_node(&Node::Nonterminal(built_ins_tree)) + let built_ins_parser = parser.parse( + NonterminalKind::SourceUnit, + bindings::get_built_ins(version), + ); + let built_ins_tree = built_ins_parser.tree(); + let built_ins_cursor = transform_built_ins_node(&Node::Nonterminal(Rc::clone(built_ins_tree))) .cursor_with_offset(TextIndex::ZERO); bindings.add_system_file("built_ins.sol", built_ins_cursor); diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parse_output.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parse_output.rs index 91662bae43..f6f06245e6 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parse_output.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parse_output.rs @@ -12,8 +12,8 @@ pub struct ParseOutput { } impl ParseOutput { - pub fn tree(&self) -> Rc { - Rc::clone(&self.parse_tree) + pub fn tree(&self) -> &Rc { + &self.parse_tree } pub fn errors(&self) -> &Vec { diff --git a/crates/testlang/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs b/crates/testlang/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs index 8100d7dc13..d2e73f91de 100644 --- a/crates/testlang/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs +++ b/crates/testlang/outputs/cargo/wasm/src/generated/wrappers/parser/mod.rs @@ -1,5 +1,7 @@ // This file is generated automatically by infrastructure scripts. Please don't edit by hand. +use std::rc::Rc; + use crate::wasm_crate::utils::{define_wrapper, FromFFI, IntoFFI}; mod ffi { @@ -80,7 +82,7 @@ define_wrapper! { ParseError { define_wrapper! { ParseOutput { fn tree(&self) -> ffi::NonterminalNode { - self._borrow_ffi().tree()._into_ffi() + Rc::clone(self._borrow_ffi().tree())._into_ffi() } fn errors(&self) -> Vec { From 9ee09963b36547b9096aa825d739795617f894d0 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Wed, 8 Jan 2025 14:52:42 -0300 Subject: [PATCH 16/22] Pulling the kind away of nomatch to the parse() function --- .../crate/src/runtime/parser/lexer/mod.rs | 4 +- .../crate/src/runtime/parser/parser.rs.jinja2 | 2 +- .../parser/parser_support/parser_function.rs | 12 +- .../parser/parser_support/parser_result.rs | 22 +- .../runtime/parser/parser_support/recovery.rs | 2 +- .../parser_support/repetition_helper.rs | 9 +- .../parser/parser_support/separated_helper.rs | 2 +- .../src/generated/parser/generated/parser.rs | 512 ++++++++++-------- .../crate/src/generated/parser/lexer/mod.rs | 4 +- .../parser/parser_support/parser_function.rs | 12 +- .../parser/parser_support/parser_result.rs | 22 +- .../parser/parser_support/recovery.rs | 2 +- .../parser_support/repetition_helper.rs | 9 +- .../parser/parser_support/separated_helper.rs | 2 +- .../src/generated/parser/generated/parser.rs | 34 +- .../crate/src/generated/parser/lexer/mod.rs | 4 +- .../parser/parser_support/parser_function.rs | 12 +- .../parser/parser_support/parser_result.rs | 22 +- .../parser/parser_support/recovery.rs | 2 +- .../parser_support/repetition_helper.rs | 9 +- .../parser/parser_support/separated_helper.rs | 2 +- 21 files changed, 370 insertions(+), 331 deletions(-) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs index 156ce5583d..71d28c520b 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/lexer/mod.rs @@ -94,7 +94,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(start); - return ParserResult::no_match(None, vec![kind]); + return ParserResult::no_match(vec![kind]); } let end = input.position(); @@ -129,7 +129,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(restore); - return ParserResult::no_match(None, vec![kind]); + return ParserResult::no_match(vec![kind]); } let end = input.position(); children.push(Edge::anonymous(Node::terminal( diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser.rs.jinja2 b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser.rs.jinja2 index a2c8b8cc2f..e6b5215d4a 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser.rs.jinja2 +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser.rs.jinja2 @@ -115,7 +115,7 @@ impl Parser { {%- else -%} match kind { {%- for parser_name, _ in model.parser.parser_functions -%} - NonterminalKind::{{ parser_name }} => Self::{{ parser_name | snake_case }}.parse(self, input), + NonterminalKind::{{ parser_name }} => Self::{{ parser_name | snake_case }}.parse(self, input, kind), {%- endfor -%} } {%- endif -%} diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs index 7536d3b348..65354536be 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs @@ -1,6 +1,8 @@ use std::rc::Rc; -use crate::cst::{Edge, Node, NonterminalNode, TerminalKind, TerminalKindExtensions, TextIndex}; +use crate::cst::{ + Edge, Node, NonterminalKind, NonterminalNode, TerminalKind, TerminalKindExtensions, TextIndex, +}; use crate::parser::lexer::Lexer; use crate::parser::parser_support::context::ParserContext; use crate::parser::parser_support::parser_result::{ @@ -12,7 +14,7 @@ pub trait ParserFunction

where Self: Fn(&P, &mut ParserContext<'_>) -> ParserResult, { - fn parse(&self, parser: &P, input: &str) -> ParseOutput; + fn parse(&self, parser: &P, input: &str, expected: NonterminalKind) -> ParseOutput; } impl ParserFunction

for F @@ -21,7 +23,7 @@ where F: Fn(&P, &mut ParserContext<'_>) -> ParserResult, { #[allow(clippy::too_many_lines)] - fn parse(&self, parser: &P, input: &str) -> ParseOutput { + fn parse(&self, parser: &P, input: &str, expected: NonterminalKind) -> ParseOutput { let mut stream = ParserContext::new(input); let mut result = self(parser, &mut stream); @@ -46,7 +48,7 @@ where let mut new_children = nonterminal.children.clone(); new_children.extend(eof_trivia); - topmost.node = Node::nonterminal(nonterminal.kind, new_children); + topmost.node = Node::nonterminal(expected, new_children); } } @@ -87,7 +89,7 @@ where let node = Node::terminal(kind, input.to_string()); trivia_nodes.push(Edge::anonymous(node)); ParseOutput { - parse_tree: Rc::new(NonterminalNode::new(no_match.kind.unwrap(), trivia_nodes)), + parse_tree: Rc::new(NonterminalNode::new(expected, trivia_nodes)), errors: vec![ParseError::new( start..start + input.into(), no_match.expected_terminals, diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs index 2e091daf1e..f24a1abd25 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_result.rs @@ -16,7 +16,6 @@ pub enum ParserResult { impl Default for ParserResult { fn default() -> Self { Self::NoMatch(NoMatch { - kind: None, expected_terminals: vec![], }) } @@ -35,13 +34,13 @@ impl ParserResult { ParserResult::IncompleteMatch(IncompleteMatch::new(nodes, expected_terminals)) } - /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(None, vec![])`. + /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![])`. pub fn disabled() -> Self { - Self::no_match(None, vec![]) + Self::no_match(vec![]) } - pub fn no_match(kind: Option, expected_terminals: Vec) -> Self { - ParserResult::NoMatch(NoMatch::new(kind, expected_terminals)) + pub fn no_match(expected_terminals: Vec) -> Self { + ParserResult::NoMatch(NoMatch::new(expected_terminals)) } #[must_use] @@ -62,9 +61,7 @@ impl ParserResult { nodes: vec![Edge::anonymous(Node::nonterminal(new_kind, skipped.nodes))], ..skipped }), - ParserResult::NoMatch(no_match) => { - ParserResult::no_match(Some(new_kind), no_match.expected_terminals) - } + ParserResult::NoMatch(no_match) => ParserResult::no_match(no_match.expected_terminals), ParserResult::PrattOperatorMatch(_) => { unreachable!("PrattOperatorMatch cannot be converted to a nonterminal") } @@ -243,18 +240,13 @@ impl IncompleteMatch { #[derive(PartialEq, Eq, Clone, Debug)] pub struct NoMatch { - /// The nonterminal kind this match is coming from - pub kind: Option, /// Terminals that would have allowed for more progress. Collected for the purposes of error reporting. pub expected_terminals: Vec, } impl NoMatch { - pub fn new(kind: Option, expected_terminals: Vec) -> Self { - Self { - kind, - expected_terminals, - } + pub fn new(expected_terminals: Vec) -> Self { + Self { expected_terminals } } } diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs index 9885e723b3..cec55a393c 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/recovery.rs @@ -105,7 +105,7 @@ impl ParserResult { ParseResultKind::Incomplete => { ParserResult::incomplete_match(nodes, expected_terminals) } - ParseResultKind::NoMatch => ParserResult::no_match(None, expected_terminals), + ParseResultKind::NoMatch => ParserResult::no_match(expected_terminals), } } } diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs index 3d612e4fe3..e4bcf1433d 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/repetition_helper.rs @@ -26,10 +26,7 @@ impl RepetitionHelper { // Couldn't get a full match but we allow 0 items - return an empty match // so the parse is considered valid but note the expected terminals - ParserResult::NoMatch(NoMatch { - kind: _, - expected_terminals, - }) if MIN_COUNT == 0 => { + ParserResult::NoMatch(NoMatch { expected_terminals }) if MIN_COUNT == 0 => { return ParserResult::r#match(vec![], expected_terminals); } // Don't try repeating if we don't have a full match and we require at least one @@ -63,9 +60,7 @@ impl RepetitionHelper { ParserResult::IncompleteMatch(IncompleteMatch { expected_terminals, .. }) - | ParserResult::NoMatch(NoMatch { - expected_terminals, .. - }), + | ParserResult::NoMatch(NoMatch { expected_terminals }), ) => { input.rewind(save); running.expected_terminals = expected_terminals; diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs index 280d89c8cf..e1455a8155 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/separated_helper.rs @@ -89,7 +89,7 @@ impl SeparatedHelper { } ParserResult::NoMatch(no_match) => { return if accum.is_empty() { - ParserResult::no_match(None, no_match.expected_terminals) + ParserResult::no_match(no_match.expected_terminals) } else { ParserResult::incomplete_match(accum, no_match.expected_terminals) }; diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/generated/parser.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/generated/parser.rs index de10be92a5..cc1ef42937 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/generated/parser.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/generated/parser.rs @@ -9143,349 +9143,413 @@ impl Parser { pub fn parse(&self, kind: NonterminalKind, input: &str) -> ParseOutput { match kind { - NonterminalKind::AbicoderPragma => Self::abicoder_pragma.parse(self, input), - NonterminalKind::AdditiveExpression => Self::additive_expression.parse(self, input), - NonterminalKind::AddressType => Self::address_type.parse(self, input), - NonterminalKind::AndExpression => Self::and_expression.parse(self, input), - NonterminalKind::ArgumentsDeclaration => Self::arguments_declaration.parse(self, input), - NonterminalKind::ArrayExpression => Self::array_expression.parse(self, input), - NonterminalKind::ArrayTypeName => Self::array_type_name.parse(self, input), - NonterminalKind::ArrayValues => Self::array_values.parse(self, input), - NonterminalKind::AssemblyFlags => Self::assembly_flags.parse(self, input), + NonterminalKind::AbicoderPragma => Self::abicoder_pragma.parse(self, input, kind), + NonterminalKind::AdditiveExpression => { + Self::additive_expression.parse(self, input, kind) + } + NonterminalKind::AddressType => Self::address_type.parse(self, input, kind), + NonterminalKind::AndExpression => Self::and_expression.parse(self, input, kind), + NonterminalKind::ArgumentsDeclaration => { + Self::arguments_declaration.parse(self, input, kind) + } + NonterminalKind::ArrayExpression => Self::array_expression.parse(self, input, kind), + NonterminalKind::ArrayTypeName => Self::array_type_name.parse(self, input, kind), + NonterminalKind::ArrayValues => Self::array_values.parse(self, input, kind), + NonterminalKind::AssemblyFlags => Self::assembly_flags.parse(self, input, kind), NonterminalKind::AssemblyFlagsDeclaration => { - Self::assembly_flags_declaration.parse(self, input) + Self::assembly_flags_declaration.parse(self, input, kind) + } + NonterminalKind::AssemblyStatement => Self::assembly_statement.parse(self, input, kind), + NonterminalKind::AssignmentExpression => { + Self::assignment_expression.parse(self, input, kind) } - NonterminalKind::AssemblyStatement => Self::assembly_statement.parse(self, input), - NonterminalKind::AssignmentExpression => Self::assignment_expression.parse(self, input), NonterminalKind::BitwiseAndExpression => { - Self::bitwise_and_expression.parse(self, input) + Self::bitwise_and_expression.parse(self, input, kind) + } + NonterminalKind::BitwiseOrExpression => { + Self::bitwise_or_expression.parse(self, input, kind) } - NonterminalKind::BitwiseOrExpression => Self::bitwise_or_expression.parse(self, input), NonterminalKind::BitwiseXorExpression => { - Self::bitwise_xor_expression.parse(self, input) + Self::bitwise_xor_expression.parse(self, input, kind) } - NonterminalKind::Block => Self::block.parse(self, input), - NonterminalKind::BreakStatement => Self::break_statement.parse(self, input), - NonterminalKind::CallOptions => Self::call_options.parse(self, input), + NonterminalKind::Block => Self::block.parse(self, input, kind), + NonterminalKind::BreakStatement => Self::break_statement.parse(self, input, kind), + NonterminalKind::CallOptions => Self::call_options.parse(self, input, kind), NonterminalKind::CallOptionsExpression => { - Self::call_options_expression.parse(self, input) + Self::call_options_expression.parse(self, input, kind) + } + NonterminalKind::CatchClause => Self::catch_clause.parse(self, input, kind), + NonterminalKind::CatchClauseError => Self::catch_clause_error.parse(self, input, kind), + NonterminalKind::CatchClauses => Self::catch_clauses.parse(self, input, kind), + NonterminalKind::ComparisonExpression => { + Self::comparison_expression.parse(self, input, kind) } - NonterminalKind::CatchClause => Self::catch_clause.parse(self, input), - NonterminalKind::CatchClauseError => Self::catch_clause_error.parse(self, input), - NonterminalKind::CatchClauses => Self::catch_clauses.parse(self, input), - NonterminalKind::ComparisonExpression => Self::comparison_expression.parse(self, input), NonterminalKind::ConditionalExpression => { - Self::conditional_expression.parse(self, input) + Self::conditional_expression.parse(self, input, kind) + } + NonterminalKind::ConstantDefinition => { + Self::constant_definition.parse(self, input, kind) + } + NonterminalKind::ConstructorAttribute => { + Self::constructor_attribute.parse(self, input, kind) } - NonterminalKind::ConstantDefinition => Self::constant_definition.parse(self, input), - NonterminalKind::ConstructorAttribute => Self::constructor_attribute.parse(self, input), NonterminalKind::ConstructorAttributes => { - Self::constructor_attributes.parse(self, input) + Self::constructor_attributes.parse(self, input, kind) } NonterminalKind::ConstructorDefinition => { - Self::constructor_definition.parse(self, input) + Self::constructor_definition.parse(self, input, kind) + } + NonterminalKind::ContinueStatement => Self::continue_statement.parse(self, input, kind), + NonterminalKind::ContractDefinition => { + Self::contract_definition.parse(self, input, kind) } - NonterminalKind::ContinueStatement => Self::continue_statement.parse(self, input), - NonterminalKind::ContractDefinition => Self::contract_definition.parse(self, input), - NonterminalKind::ContractMember => Self::contract_member.parse(self, input), - NonterminalKind::ContractMembers => Self::contract_members.parse(self, input), + NonterminalKind::ContractMember => Self::contract_member.parse(self, input, kind), + NonterminalKind::ContractMembers => Self::contract_members.parse(self, input, kind), NonterminalKind::DecimalNumberExpression => { - Self::decimal_number_expression.parse(self, input) - } - NonterminalKind::DoWhileStatement => Self::do_while_statement.parse(self, input), - NonterminalKind::ElementaryType => Self::elementary_type.parse(self, input), - NonterminalKind::ElseBranch => Self::else_branch.parse(self, input), - NonterminalKind::EmitStatement => Self::emit_statement.parse(self, input), - NonterminalKind::EnumDefinition => Self::enum_definition.parse(self, input), - NonterminalKind::EnumMembers => Self::enum_members.parse(self, input), - NonterminalKind::EqualityExpression => Self::equality_expression.parse(self, input), - NonterminalKind::ErrorDefinition => Self::error_definition.parse(self, input), - NonterminalKind::ErrorParameter => Self::error_parameter.parse(self, input), - NonterminalKind::ErrorParameters => Self::error_parameters.parse(self, input), + Self::decimal_number_expression.parse(self, input, kind) + } + NonterminalKind::DoWhileStatement => Self::do_while_statement.parse(self, input, kind), + NonterminalKind::ElementaryType => Self::elementary_type.parse(self, input, kind), + NonterminalKind::ElseBranch => Self::else_branch.parse(self, input, kind), + NonterminalKind::EmitStatement => Self::emit_statement.parse(self, input, kind), + NonterminalKind::EnumDefinition => Self::enum_definition.parse(self, input, kind), + NonterminalKind::EnumMembers => Self::enum_members.parse(self, input, kind), + NonterminalKind::EqualityExpression => { + Self::equality_expression.parse(self, input, kind) + } + NonterminalKind::ErrorDefinition => Self::error_definition.parse(self, input, kind), + NonterminalKind::ErrorParameter => Self::error_parameter.parse(self, input, kind), + NonterminalKind::ErrorParameters => Self::error_parameters.parse(self, input, kind), NonterminalKind::ErrorParametersDeclaration => { - Self::error_parameters_declaration.parse(self, input) + Self::error_parameters_declaration.parse(self, input, kind) } - NonterminalKind::EventDefinition => Self::event_definition.parse(self, input), - NonterminalKind::EventParameter => Self::event_parameter.parse(self, input), - NonterminalKind::EventParameters => Self::event_parameters.parse(self, input), + NonterminalKind::EventDefinition => Self::event_definition.parse(self, input, kind), + NonterminalKind::EventParameter => Self::event_parameter.parse(self, input, kind), + NonterminalKind::EventParameters => Self::event_parameters.parse(self, input, kind), NonterminalKind::EventParametersDeclaration => { - Self::event_parameters_declaration.parse(self, input) + Self::event_parameters_declaration.parse(self, input, kind) + } + NonterminalKind::ExperimentalFeature => { + Self::experimental_feature.parse(self, input, kind) + } + NonterminalKind::ExperimentalPragma => { + Self::experimental_pragma.parse(self, input, kind) } - NonterminalKind::ExperimentalFeature => Self::experimental_feature.parse(self, input), - NonterminalKind::ExperimentalPragma => Self::experimental_pragma.parse(self, input), NonterminalKind::ExponentiationExpression => { - Self::exponentiation_expression.parse(self, input) + Self::exponentiation_expression.parse(self, input, kind) + } + NonterminalKind::Expression => Self::expression.parse(self, input, kind), + NonterminalKind::ExpressionStatement => { + Self::expression_statement.parse(self, input, kind) } - NonterminalKind::Expression => Self::expression.parse(self, input), - NonterminalKind::ExpressionStatement => Self::expression_statement.parse(self, input), NonterminalKind::FallbackFunctionAttribute => { - Self::fallback_function_attribute.parse(self, input) + Self::fallback_function_attribute.parse(self, input, kind) } NonterminalKind::FallbackFunctionAttributes => { - Self::fallback_function_attributes.parse(self, input) + Self::fallback_function_attributes.parse(self, input, kind) } NonterminalKind::FallbackFunctionDefinition => { - Self::fallback_function_definition.parse(self, input) + Self::fallback_function_definition.parse(self, input, kind) } - NonterminalKind::ForStatement => Self::for_statement.parse(self, input), + NonterminalKind::ForStatement => Self::for_statement.parse(self, input, kind), NonterminalKind::ForStatementCondition => { - Self::for_statement_condition.parse(self, input) + Self::for_statement_condition.parse(self, input, kind) } NonterminalKind::ForStatementInitialization => { - Self::for_statement_initialization.parse(self, input) + Self::for_statement_initialization.parse(self, input, kind) + } + NonterminalKind::FunctionAttribute => Self::function_attribute.parse(self, input, kind), + NonterminalKind::FunctionAttributes => { + Self::function_attributes.parse(self, input, kind) } - NonterminalKind::FunctionAttribute => Self::function_attribute.parse(self, input), - NonterminalKind::FunctionAttributes => Self::function_attributes.parse(self, input), - NonterminalKind::FunctionBody => Self::function_body.parse(self, input), + NonterminalKind::FunctionBody => Self::function_body.parse(self, input, kind), NonterminalKind::FunctionCallExpression => { - Self::function_call_expression.parse(self, input) + Self::function_call_expression.parse(self, input, kind) } - NonterminalKind::FunctionDefinition => Self::function_definition.parse(self, input), - NonterminalKind::FunctionName => Self::function_name.parse(self, input), - NonterminalKind::FunctionType => Self::function_type.parse(self, input), + NonterminalKind::FunctionDefinition => { + Self::function_definition.parse(self, input, kind) + } + NonterminalKind::FunctionName => Self::function_name.parse(self, input, kind), + NonterminalKind::FunctionType => Self::function_type.parse(self, input, kind), NonterminalKind::FunctionTypeAttribute => { - Self::function_type_attribute.parse(self, input) + Self::function_type_attribute.parse(self, input, kind) } NonterminalKind::FunctionTypeAttributes => { - Self::function_type_attributes.parse(self, input) - } - NonterminalKind::HexNumberExpression => Self::hex_number_expression.parse(self, input), - NonterminalKind::HexStringLiteral => Self::hex_string_literal.parse(self, input), - NonterminalKind::HexStringLiterals => Self::hex_string_literals.parse(self, input), - NonterminalKind::IdentifierPath => Self::identifier_path.parse(self, input), - NonterminalKind::IfStatement => Self::if_statement.parse(self, input), - NonterminalKind::ImportAlias => Self::import_alias.parse(self, input), - NonterminalKind::ImportClause => Self::import_clause.parse(self, input), - NonterminalKind::ImportDeconstruction => Self::import_deconstruction.parse(self, input), + Self::function_type_attributes.parse(self, input, kind) + } + NonterminalKind::HexNumberExpression => { + Self::hex_number_expression.parse(self, input, kind) + } + NonterminalKind::HexStringLiteral => Self::hex_string_literal.parse(self, input, kind), + NonterminalKind::HexStringLiterals => { + Self::hex_string_literals.parse(self, input, kind) + } + NonterminalKind::IdentifierPath => Self::identifier_path.parse(self, input, kind), + NonterminalKind::IfStatement => Self::if_statement.parse(self, input, kind), + NonterminalKind::ImportAlias => Self::import_alias.parse(self, input, kind), + NonterminalKind::ImportClause => Self::import_clause.parse(self, input, kind), + NonterminalKind::ImportDeconstruction => { + Self::import_deconstruction.parse(self, input, kind) + } NonterminalKind::ImportDeconstructionSymbol => { - Self::import_deconstruction_symbol.parse(self, input) + Self::import_deconstruction_symbol.parse(self, input, kind) } NonterminalKind::ImportDeconstructionSymbols => { - Self::import_deconstruction_symbols.parse(self, input) + Self::import_deconstruction_symbols.parse(self, input, kind) } - NonterminalKind::ImportDirective => Self::import_directive.parse(self, input), - NonterminalKind::IndexAccessEnd => Self::index_access_end.parse(self, input), + NonterminalKind::ImportDirective => Self::import_directive.parse(self, input, kind), + NonterminalKind::IndexAccessEnd => Self::index_access_end.parse(self, input, kind), NonterminalKind::IndexAccessExpression => { - Self::index_access_expression.parse(self, input) - } - NonterminalKind::InheritanceSpecifier => Self::inheritance_specifier.parse(self, input), - NonterminalKind::InheritanceType => Self::inheritance_type.parse(self, input), - NonterminalKind::InheritanceTypes => Self::inheritance_types.parse(self, input), - NonterminalKind::InterfaceDefinition => Self::interface_definition.parse(self, input), - NonterminalKind::InterfaceMembers => Self::interface_members.parse(self, input), - NonterminalKind::LibraryDefinition => Self::library_definition.parse(self, input), - NonterminalKind::LibraryMembers => Self::library_members.parse(self, input), - NonterminalKind::MappingKey => Self::mapping_key.parse(self, input), - NonterminalKind::MappingKeyType => Self::mapping_key_type.parse(self, input), - NonterminalKind::MappingType => Self::mapping_type.parse(self, input), - NonterminalKind::MappingValue => Self::mapping_value.parse(self, input), + Self::index_access_expression.parse(self, input, kind) + } + NonterminalKind::InheritanceSpecifier => { + Self::inheritance_specifier.parse(self, input, kind) + } + NonterminalKind::InheritanceType => Self::inheritance_type.parse(self, input, kind), + NonterminalKind::InheritanceTypes => Self::inheritance_types.parse(self, input, kind), + NonterminalKind::InterfaceDefinition => { + Self::interface_definition.parse(self, input, kind) + } + NonterminalKind::InterfaceMembers => Self::interface_members.parse(self, input, kind), + NonterminalKind::LibraryDefinition => Self::library_definition.parse(self, input, kind), + NonterminalKind::LibraryMembers => Self::library_members.parse(self, input, kind), + NonterminalKind::MappingKey => Self::mapping_key.parse(self, input, kind), + NonterminalKind::MappingKeyType => Self::mapping_key_type.parse(self, input, kind), + NonterminalKind::MappingType => Self::mapping_type.parse(self, input, kind), + NonterminalKind::MappingValue => Self::mapping_value.parse(self, input, kind), NonterminalKind::MemberAccessExpression => { - Self::member_access_expression.parse(self, input) + Self::member_access_expression.parse(self, input, kind) + } + NonterminalKind::ModifierAttribute => Self::modifier_attribute.parse(self, input, kind), + NonterminalKind::ModifierAttributes => { + Self::modifier_attributes.parse(self, input, kind) + } + NonterminalKind::ModifierDefinition => { + Self::modifier_definition.parse(self, input, kind) + } + NonterminalKind::ModifierInvocation => { + Self::modifier_invocation.parse(self, input, kind) } - NonterminalKind::ModifierAttribute => Self::modifier_attribute.parse(self, input), - NonterminalKind::ModifierAttributes => Self::modifier_attributes.parse(self, input), - NonterminalKind::ModifierDefinition => Self::modifier_definition.parse(self, input), - NonterminalKind::ModifierInvocation => Self::modifier_invocation.parse(self, input), NonterminalKind::MultiplicativeExpression => { - Self::multiplicative_expression.parse(self, input) + Self::multiplicative_expression.parse(self, input, kind) + } + NonterminalKind::NamedArgument => Self::named_argument.parse(self, input, kind), + NonterminalKind::NamedArgumentGroup => { + Self::named_argument_group.parse(self, input, kind) } - NonterminalKind::NamedArgument => Self::named_argument.parse(self, input), - NonterminalKind::NamedArgumentGroup => Self::named_argument_group.parse(self, input), - NonterminalKind::NamedArguments => Self::named_arguments.parse(self, input), + NonterminalKind::NamedArguments => Self::named_arguments.parse(self, input, kind), NonterminalKind::NamedArgumentsDeclaration => { - Self::named_arguments_declaration.parse(self, input) + Self::named_arguments_declaration.parse(self, input, kind) } - NonterminalKind::NamedImport => Self::named_import.parse(self, input), - NonterminalKind::NewExpression => Self::new_expression.parse(self, input), - NonterminalKind::NumberUnit => Self::number_unit.parse(self, input), - NonterminalKind::OrExpression => Self::or_expression.parse(self, input), - NonterminalKind::OverridePaths => Self::override_paths.parse(self, input), + NonterminalKind::NamedImport => Self::named_import.parse(self, input, kind), + NonterminalKind::NewExpression => Self::new_expression.parse(self, input, kind), + NonterminalKind::NumberUnit => Self::number_unit.parse(self, input, kind), + NonterminalKind::OrExpression => Self::or_expression.parse(self, input, kind), + NonterminalKind::OverridePaths => Self::override_paths.parse(self, input, kind), NonterminalKind::OverridePathsDeclaration => { - Self::override_paths_declaration.parse(self, input) + Self::override_paths_declaration.parse(self, input, kind) } - NonterminalKind::OverrideSpecifier => Self::override_specifier.parse(self, input), - NonterminalKind::Parameter => Self::parameter.parse(self, input), - NonterminalKind::Parameters => Self::parameters.parse(self, input), + NonterminalKind::OverrideSpecifier => Self::override_specifier.parse(self, input, kind), + NonterminalKind::Parameter => Self::parameter.parse(self, input, kind), + NonterminalKind::Parameters => Self::parameters.parse(self, input, kind), NonterminalKind::ParametersDeclaration => { - Self::parameters_declaration.parse(self, input) + Self::parameters_declaration.parse(self, input, kind) + } + NonterminalKind::PathImport => Self::path_import.parse(self, input, kind), + NonterminalKind::PositionalArguments => { + Self::positional_arguments.parse(self, input, kind) } - NonterminalKind::PathImport => Self::path_import.parse(self, input), - NonterminalKind::PositionalArguments => Self::positional_arguments.parse(self, input), NonterminalKind::PositionalArgumentsDeclaration => { - Self::positional_arguments_declaration.parse(self, input) + Self::positional_arguments_declaration.parse(self, input, kind) } - NonterminalKind::PostfixExpression => Self::postfix_expression.parse(self, input), - NonterminalKind::Pragma => Self::pragma.parse(self, input), - NonterminalKind::PragmaDirective => Self::pragma_directive.parse(self, input), - NonterminalKind::PrefixExpression => Self::prefix_expression.parse(self, input), + NonterminalKind::PostfixExpression => Self::postfix_expression.parse(self, input, kind), + NonterminalKind::Pragma => Self::pragma.parse(self, input, kind), + NonterminalKind::PragmaDirective => Self::pragma_directive.parse(self, input, kind), + NonterminalKind::PrefixExpression => Self::prefix_expression.parse(self, input, kind), NonterminalKind::ReceiveFunctionAttribute => { - Self::receive_function_attribute.parse(self, input) + Self::receive_function_attribute.parse(self, input, kind) } NonterminalKind::ReceiveFunctionAttributes => { - Self::receive_function_attributes.parse(self, input) + Self::receive_function_attributes.parse(self, input, kind) } NonterminalKind::ReceiveFunctionDefinition => { - Self::receive_function_definition.parse(self, input) + Self::receive_function_definition.parse(self, input, kind) + } + NonterminalKind::ReturnStatement => Self::return_statement.parse(self, input, kind), + NonterminalKind::ReturnsDeclaration => { + Self::returns_declaration.parse(self, input, kind) } - NonterminalKind::ReturnStatement => Self::return_statement.parse(self, input), - NonterminalKind::ReturnsDeclaration => Self::returns_declaration.parse(self, input), - NonterminalKind::RevertStatement => Self::revert_statement.parse(self, input), - NonterminalKind::ShiftExpression => Self::shift_expression.parse(self, input), + NonterminalKind::RevertStatement => Self::revert_statement.parse(self, input, kind), + NonterminalKind::ShiftExpression => Self::shift_expression.parse(self, input, kind), NonterminalKind::SimpleVersionLiteral => { - Self::simple_version_literal.parse(self, input) + Self::simple_version_literal.parse(self, input, kind) + } + NonterminalKind::SourceUnit => Self::source_unit.parse(self, input, kind), + NonterminalKind::SourceUnitMember => Self::source_unit_member.parse(self, input, kind), + NonterminalKind::SourceUnitMembers => { + Self::source_unit_members.parse(self, input, kind) } - NonterminalKind::SourceUnit => Self::source_unit.parse(self, input), - NonterminalKind::SourceUnitMember => Self::source_unit_member.parse(self, input), - NonterminalKind::SourceUnitMembers => Self::source_unit_members.parse(self, input), NonterminalKind::StateVariableAttribute => { - Self::state_variable_attribute.parse(self, input) + Self::state_variable_attribute.parse(self, input, kind) } NonterminalKind::StateVariableAttributes => { - Self::state_variable_attributes.parse(self, input) + Self::state_variable_attributes.parse(self, input, kind) } NonterminalKind::StateVariableDefinition => { - Self::state_variable_definition.parse(self, input) + Self::state_variable_definition.parse(self, input, kind) } NonterminalKind::StateVariableDefinitionValue => { - Self::state_variable_definition_value.parse(self, input) - } - NonterminalKind::Statement => Self::statement.parse(self, input), - NonterminalKind::Statements => Self::statements.parse(self, input), - NonterminalKind::StorageLocation => Self::storage_location.parse(self, input), - NonterminalKind::StringExpression => Self::string_expression.parse(self, input), - NonterminalKind::StringLiteral => Self::string_literal.parse(self, input), - NonterminalKind::StringLiterals => Self::string_literals.parse(self, input), - NonterminalKind::StructDefinition => Self::struct_definition.parse(self, input), - NonterminalKind::StructMember => Self::struct_member.parse(self, input), - NonterminalKind::StructMembers => Self::struct_members.parse(self, input), - NonterminalKind::ThrowStatement => Self::throw_statement.parse(self, input), - NonterminalKind::TryStatement => Self::try_statement.parse(self, input), + Self::state_variable_definition_value.parse(self, input, kind) + } + NonterminalKind::Statement => Self::statement.parse(self, input, kind), + NonterminalKind::Statements => Self::statements.parse(self, input, kind), + NonterminalKind::StorageLocation => Self::storage_location.parse(self, input, kind), + NonterminalKind::StringExpression => Self::string_expression.parse(self, input, kind), + NonterminalKind::StringLiteral => Self::string_literal.parse(self, input, kind), + NonterminalKind::StringLiterals => Self::string_literals.parse(self, input, kind), + NonterminalKind::StructDefinition => Self::struct_definition.parse(self, input, kind), + NonterminalKind::StructMember => Self::struct_member.parse(self, input, kind), + NonterminalKind::StructMembers => Self::struct_members.parse(self, input, kind), + NonterminalKind::ThrowStatement => Self::throw_statement.parse(self, input, kind), + NonterminalKind::TryStatement => Self::try_statement.parse(self, input, kind), NonterminalKind::TupleDeconstructionElement => { - Self::tuple_deconstruction_element.parse(self, input) + Self::tuple_deconstruction_element.parse(self, input, kind) } NonterminalKind::TupleDeconstructionElements => { - Self::tuple_deconstruction_elements.parse(self, input) + Self::tuple_deconstruction_elements.parse(self, input, kind) } NonterminalKind::TupleDeconstructionStatement => { - Self::tuple_deconstruction_statement.parse(self, input) - } - NonterminalKind::TupleExpression => Self::tuple_expression.parse(self, input), - NonterminalKind::TupleMember => Self::tuple_member.parse(self, input), - NonterminalKind::TupleValue => Self::tuple_value.parse(self, input), - NonterminalKind::TupleValues => Self::tuple_values.parse(self, input), - NonterminalKind::TypeExpression => Self::type_expression.parse(self, input), - NonterminalKind::TypeName => Self::type_name.parse(self, input), - NonterminalKind::TypedTupleMember => Self::typed_tuple_member.parse(self, input), - NonterminalKind::UncheckedBlock => Self::unchecked_block.parse(self, input), + Self::tuple_deconstruction_statement.parse(self, input, kind) + } + NonterminalKind::TupleExpression => Self::tuple_expression.parse(self, input, kind), + NonterminalKind::TupleMember => Self::tuple_member.parse(self, input, kind), + NonterminalKind::TupleValue => Self::tuple_value.parse(self, input, kind), + NonterminalKind::TupleValues => Self::tuple_values.parse(self, input, kind), + NonterminalKind::TypeExpression => Self::type_expression.parse(self, input, kind), + NonterminalKind::TypeName => Self::type_name.parse(self, input, kind), + NonterminalKind::TypedTupleMember => Self::typed_tuple_member.parse(self, input, kind), + NonterminalKind::UncheckedBlock => Self::unchecked_block.parse(self, input, kind), NonterminalKind::UnicodeStringLiteral => { - Self::unicode_string_literal.parse(self, input) + Self::unicode_string_literal.parse(self, input, kind) } NonterminalKind::UnicodeStringLiterals => { - Self::unicode_string_literals.parse(self, input) + Self::unicode_string_literals.parse(self, input, kind) } NonterminalKind::UnnamedFunctionAttribute => { - Self::unnamed_function_attribute.parse(self, input) + Self::unnamed_function_attribute.parse(self, input, kind) } NonterminalKind::UnnamedFunctionAttributes => { - Self::unnamed_function_attributes.parse(self, input) + Self::unnamed_function_attributes.parse(self, input, kind) } NonterminalKind::UnnamedFunctionDefinition => { - Self::unnamed_function_definition.parse(self, input) + Self::unnamed_function_definition.parse(self, input, kind) + } + NonterminalKind::UntypedTupleMember => { + Self::untyped_tuple_member.parse(self, input, kind) } - NonterminalKind::UntypedTupleMember => Self::untyped_tuple_member.parse(self, input), NonterminalKind::UserDefinedValueTypeDefinition => { - Self::user_defined_value_type_definition.parse(self, input) + Self::user_defined_value_type_definition.parse(self, input, kind) + } + NonterminalKind::UsingAlias => Self::using_alias.parse(self, input, kind), + NonterminalKind::UsingClause => Self::using_clause.parse(self, input, kind), + NonterminalKind::UsingDeconstruction => { + Self::using_deconstruction.parse(self, input, kind) } - NonterminalKind::UsingAlias => Self::using_alias.parse(self, input), - NonterminalKind::UsingClause => Self::using_clause.parse(self, input), - NonterminalKind::UsingDeconstruction => Self::using_deconstruction.parse(self, input), NonterminalKind::UsingDeconstructionSymbol => { - Self::using_deconstruction_symbol.parse(self, input) + Self::using_deconstruction_symbol.parse(self, input, kind) } NonterminalKind::UsingDeconstructionSymbols => { - Self::using_deconstruction_symbols.parse(self, input) + Self::using_deconstruction_symbols.parse(self, input, kind) } - NonterminalKind::UsingDirective => Self::using_directive.parse(self, input), - NonterminalKind::UsingOperator => Self::using_operator.parse(self, input), - NonterminalKind::UsingTarget => Self::using_target.parse(self, input), + NonterminalKind::UsingDirective => Self::using_directive.parse(self, input, kind), + NonterminalKind::UsingOperator => Self::using_operator.parse(self, input, kind), + NonterminalKind::UsingTarget => Self::using_target.parse(self, input, kind), NonterminalKind::VariableDeclarationStatement => { - Self::variable_declaration_statement.parse(self, input) + Self::variable_declaration_statement.parse(self, input, kind) } NonterminalKind::VariableDeclarationType => { - Self::variable_declaration_type.parse(self, input) + Self::variable_declaration_type.parse(self, input, kind) } NonterminalKind::VariableDeclarationValue => { - Self::variable_declaration_value.parse(self, input) + Self::variable_declaration_value.parse(self, input, kind) } - NonterminalKind::VersionExpression => Self::version_expression.parse(self, input), + NonterminalKind::VersionExpression => Self::version_expression.parse(self, input, kind), NonterminalKind::VersionExpressionSet => { - Self::version_expression_set.parse(self, input) + Self::version_expression_set.parse(self, input, kind) } NonterminalKind::VersionExpressionSets => { - Self::version_expression_sets.parse(self, input) - } - NonterminalKind::VersionLiteral => Self::version_literal.parse(self, input), - NonterminalKind::VersionOperator => Self::version_operator.parse(self, input), - NonterminalKind::VersionPragma => Self::version_pragma.parse(self, input), - NonterminalKind::VersionRange => Self::version_range.parse(self, input), - NonterminalKind::VersionTerm => Self::version_term.parse(self, input), - NonterminalKind::WhileStatement => Self::while_statement.parse(self, input), - NonterminalKind::YulArguments => Self::yul_arguments.parse(self, input), + Self::version_expression_sets.parse(self, input, kind) + } + NonterminalKind::VersionLiteral => Self::version_literal.parse(self, input, kind), + NonterminalKind::VersionOperator => Self::version_operator.parse(self, input, kind), + NonterminalKind::VersionPragma => Self::version_pragma.parse(self, input, kind), + NonterminalKind::VersionRange => Self::version_range.parse(self, input, kind), + NonterminalKind::VersionTerm => Self::version_term.parse(self, input, kind), + NonterminalKind::WhileStatement => Self::while_statement.parse(self, input, kind), + NonterminalKind::YulArguments => Self::yul_arguments.parse(self, input, kind), NonterminalKind::YulAssignmentOperator => { - Self::yul_assignment_operator.parse(self, input) + Self::yul_assignment_operator.parse(self, input, kind) + } + NonterminalKind::YulBlock => Self::yul_block.parse(self, input, kind), + NonterminalKind::YulBreakStatement => { + Self::yul_break_statement.parse(self, input, kind) + } + NonterminalKind::YulBuiltInFunction => { + Self::yul_built_in_function.parse(self, input, kind) } - NonterminalKind::YulBlock => Self::yul_block.parse(self, input), - NonterminalKind::YulBreakStatement => Self::yul_break_statement.parse(self, input), - NonterminalKind::YulBuiltInFunction => Self::yul_built_in_function.parse(self, input), - NonterminalKind::YulColonAndEqual => Self::yul_colon_and_equal.parse(self, input), + NonterminalKind::YulColonAndEqual => Self::yul_colon_and_equal.parse(self, input, kind), NonterminalKind::YulContinueStatement => { - Self::yul_continue_statement.parse(self, input) + Self::yul_continue_statement.parse(self, input, kind) } - NonterminalKind::YulDefaultCase => Self::yul_default_case.parse(self, input), - NonterminalKind::YulEqualAndColon => Self::yul_equal_and_colon.parse(self, input), - NonterminalKind::YulExpression => Self::yul_expression.parse(self, input), - NonterminalKind::YulForStatement => Self::yul_for_statement.parse(self, input), + NonterminalKind::YulDefaultCase => Self::yul_default_case.parse(self, input, kind), + NonterminalKind::YulEqualAndColon => Self::yul_equal_and_colon.parse(self, input, kind), + NonterminalKind::YulExpression => Self::yul_expression.parse(self, input, kind), + NonterminalKind::YulForStatement => Self::yul_for_statement.parse(self, input, kind), NonterminalKind::YulFunctionCallExpression => { - Self::yul_function_call_expression.parse(self, input) + Self::yul_function_call_expression.parse(self, input, kind) } NonterminalKind::YulFunctionDefinition => { - Self::yul_function_definition.parse(self, input) + Self::yul_function_definition.parse(self, input, kind) } - NonterminalKind::YulIfStatement => Self::yul_if_statement.parse(self, input), - NonterminalKind::YulLabel => Self::yul_label.parse(self, input), - NonterminalKind::YulLeaveStatement => Self::yul_leave_statement.parse(self, input), - NonterminalKind::YulLiteral => Self::yul_literal.parse(self, input), - NonterminalKind::YulParameters => Self::yul_parameters.parse(self, input), + NonterminalKind::YulIfStatement => Self::yul_if_statement.parse(self, input, kind), + NonterminalKind::YulLabel => Self::yul_label.parse(self, input, kind), + NonterminalKind::YulLeaveStatement => { + Self::yul_leave_statement.parse(self, input, kind) + } + NonterminalKind::YulLiteral => Self::yul_literal.parse(self, input, kind), + NonterminalKind::YulParameters => Self::yul_parameters.parse(self, input, kind), NonterminalKind::YulParametersDeclaration => { - Self::yul_parameters_declaration.parse(self, input) + Self::yul_parameters_declaration.parse(self, input, kind) } - NonterminalKind::YulPath => Self::yul_path.parse(self, input), - NonterminalKind::YulPaths => Self::yul_paths.parse(self, input), + NonterminalKind::YulPath => Self::yul_path.parse(self, input, kind), + NonterminalKind::YulPaths => Self::yul_paths.parse(self, input, kind), NonterminalKind::YulReturnsDeclaration => { - Self::yul_returns_declaration.parse(self, input) + Self::yul_returns_declaration.parse(self, input, kind) } NonterminalKind::YulStackAssignmentOperator => { - Self::yul_stack_assignment_operator.parse(self, input) + Self::yul_stack_assignment_operator.parse(self, input, kind) } NonterminalKind::YulStackAssignmentStatement => { - Self::yul_stack_assignment_statement.parse(self, input) - } - NonterminalKind::YulStatement => Self::yul_statement.parse(self, input), - NonterminalKind::YulStatements => Self::yul_statements.parse(self, input), - NonterminalKind::YulSwitchCase => Self::yul_switch_case.parse(self, input), - NonterminalKind::YulSwitchCases => Self::yul_switch_cases.parse(self, input), - NonterminalKind::YulSwitchStatement => Self::yul_switch_statement.parse(self, input), - NonterminalKind::YulValueCase => Self::yul_value_case.parse(self, input), + Self::yul_stack_assignment_statement.parse(self, input, kind) + } + NonterminalKind::YulStatement => Self::yul_statement.parse(self, input, kind), + NonterminalKind::YulStatements => Self::yul_statements.parse(self, input, kind), + NonterminalKind::YulSwitchCase => Self::yul_switch_case.parse(self, input, kind), + NonterminalKind::YulSwitchCases => Self::yul_switch_cases.parse(self, input, kind), + NonterminalKind::YulSwitchStatement => { + Self::yul_switch_statement.parse(self, input, kind) + } + NonterminalKind::YulValueCase => Self::yul_value_case.parse(self, input, kind), NonterminalKind::YulVariableAssignmentStatement => { - Self::yul_variable_assignment_statement.parse(self, input) + Self::yul_variable_assignment_statement.parse(self, input, kind) } NonterminalKind::YulVariableDeclarationStatement => { - Self::yul_variable_declaration_statement.parse(self, input) + Self::yul_variable_declaration_statement.parse(self, input, kind) } NonterminalKind::YulVariableDeclarationValue => { - Self::yul_variable_declaration_value.parse(self, input) + Self::yul_variable_declaration_value.parse(self, input, kind) } - NonterminalKind::YulVariableNames => Self::yul_variable_names.parse(self, input), + NonterminalKind::YulVariableNames => Self::yul_variable_names.parse(self, input, kind), } } } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs index c648756daf..02bbe2b817 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/lexer/mod.rs @@ -96,7 +96,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(start); - return ParserResult::no_match(None, vec![kind]); + return ParserResult::no_match(vec![kind]); } let end = input.position(); @@ -131,7 +131,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(restore); - return ParserResult::no_match(None, vec![kind]); + return ParserResult::no_match(vec![kind]); } let end = input.position(); children.push(Edge::anonymous(Node::terminal( diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index 07af27499c..e0a2b4be62 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -2,7 +2,9 @@ use std::rc::Rc; -use crate::cst::{Edge, Node, NonterminalNode, TerminalKind, TerminalKindExtensions, TextIndex}; +use crate::cst::{ + Edge, Node, NonterminalKind, NonterminalNode, TerminalKind, TerminalKindExtensions, TextIndex, +}; use crate::parser::lexer::Lexer; use crate::parser::parser_support::context::ParserContext; use crate::parser::parser_support::parser_result::{ @@ -14,7 +16,7 @@ pub trait ParserFunction

where Self: Fn(&P, &mut ParserContext<'_>) -> ParserResult, { - fn parse(&self, parser: &P, input: &str) -> ParseOutput; + fn parse(&self, parser: &P, input: &str, expected: NonterminalKind) -> ParseOutput; } impl ParserFunction

for F @@ -23,7 +25,7 @@ where F: Fn(&P, &mut ParserContext<'_>) -> ParserResult, { #[allow(clippy::too_many_lines)] - fn parse(&self, parser: &P, input: &str) -> ParseOutput { + fn parse(&self, parser: &P, input: &str, expected: NonterminalKind) -> ParseOutput { let mut stream = ParserContext::new(input); let mut result = self(parser, &mut stream); @@ -48,7 +50,7 @@ where let mut new_children = nonterminal.children.clone(); new_children.extend(eof_trivia); - topmost.node = Node::nonterminal(nonterminal.kind, new_children); + topmost.node = Node::nonterminal(expected, new_children); } } @@ -89,7 +91,7 @@ where let node = Node::terminal(kind, input.to_string()); trivia_nodes.push(Edge::anonymous(node)); ParseOutput { - parse_tree: Rc::new(NonterminalNode::new(no_match.kind.unwrap(), trivia_nodes)), + parse_tree: Rc::new(NonterminalNode::new(expected, trivia_nodes)), errors: vec![ParseError::new( start..start + input.into(), no_match.expected_terminals, diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs index cfd9a8df7e..00666ec339 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs @@ -18,7 +18,6 @@ pub enum ParserResult { impl Default for ParserResult { fn default() -> Self { Self::NoMatch(NoMatch { - kind: None, expected_terminals: vec![], }) } @@ -37,13 +36,13 @@ impl ParserResult { ParserResult::IncompleteMatch(IncompleteMatch::new(nodes, expected_terminals)) } - /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(None, vec![])`. + /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![])`. pub fn disabled() -> Self { - Self::no_match(None, vec![]) + Self::no_match(vec![]) } - pub fn no_match(kind: Option, expected_terminals: Vec) -> Self { - ParserResult::NoMatch(NoMatch::new(kind, expected_terminals)) + pub fn no_match(expected_terminals: Vec) -> Self { + ParserResult::NoMatch(NoMatch::new(expected_terminals)) } #[must_use] @@ -64,9 +63,7 @@ impl ParserResult { nodes: vec![Edge::anonymous(Node::nonterminal(new_kind, skipped.nodes))], ..skipped }), - ParserResult::NoMatch(no_match) => { - ParserResult::no_match(Some(new_kind), no_match.expected_terminals) - } + ParserResult::NoMatch(no_match) => ParserResult::no_match(no_match.expected_terminals), ParserResult::PrattOperatorMatch(_) => { unreachable!("PrattOperatorMatch cannot be converted to a nonterminal") } @@ -245,18 +242,13 @@ impl IncompleteMatch { #[derive(PartialEq, Eq, Clone, Debug)] pub struct NoMatch { - /// The nonterminal kind this match is coming from - pub kind: Option, /// Terminals that would have allowed for more progress. Collected for the purposes of error reporting. pub expected_terminals: Vec, } impl NoMatch { - pub fn new(kind: Option, expected_terminals: Vec) -> Self { - Self { - kind, - expected_terminals, - } + pub fn new(expected_terminals: Vec) -> Self { + Self { expected_terminals } } } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs index c49819e30f..f54ae45934 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs @@ -107,7 +107,7 @@ impl ParserResult { ParseResultKind::Incomplete => { ParserResult::incomplete_match(nodes, expected_terminals) } - ParseResultKind::NoMatch => ParserResult::no_match(None, expected_terminals), + ParseResultKind::NoMatch => ParserResult::no_match(expected_terminals), } } } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs index a4fb3a2be5..a808e73796 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs @@ -28,10 +28,7 @@ impl RepetitionHelper { // Couldn't get a full match but we allow 0 items - return an empty match // so the parse is considered valid but note the expected terminals - ParserResult::NoMatch(NoMatch { - kind: _, - expected_terminals, - }) if MIN_COUNT == 0 => { + ParserResult::NoMatch(NoMatch { expected_terminals }) if MIN_COUNT == 0 => { return ParserResult::r#match(vec![], expected_terminals); } // Don't try repeating if we don't have a full match and we require at least one @@ -65,9 +62,7 @@ impl RepetitionHelper { ParserResult::IncompleteMatch(IncompleteMatch { expected_terminals, .. }) - | ParserResult::NoMatch(NoMatch { - expected_terminals, .. - }), + | ParserResult::NoMatch(NoMatch { expected_terminals }), ) => { input.rewind(save); running.expected_terminals = expected_terminals; diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs index eca96115d0..bcc5dc64f0 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs @@ -91,7 +91,7 @@ impl SeparatedHelper { } ParserResult::NoMatch(no_match) => { return if accum.is_empty() { - ParserResult::no_match(None, no_match.expected_terminals) + ParserResult::no_match(no_match.expected_terminals) } else { ParserResult::incomplete_match(accum, no_match.expected_terminals) }; diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/generated/parser.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/generated/parser.rs index ef1e4ba83a..a3f6c34bc2 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/generated/parser.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/generated/parser.rs @@ -650,21 +650,29 @@ impl Parser { pub fn parse(&self, kind: NonterminalKind, input: &str) -> ParseOutput { match kind { - NonterminalKind::AdditionExpression => Self::addition_expression.parse(self, input), - NonterminalKind::Expression => Self::expression.parse(self, input), - NonterminalKind::Literal => Self::literal.parse(self, input), + NonterminalKind::AdditionExpression => { + Self::addition_expression.parse(self, input, kind) + } + NonterminalKind::Expression => Self::expression.parse(self, input, kind), + NonterminalKind::Literal => Self::literal.parse(self, input, kind), NonterminalKind::MemberAccessExpression => { - Self::member_access_expression.parse(self, input) + Self::member_access_expression.parse(self, input, kind) + } + NonterminalKind::NegationExpression => { + Self::negation_expression.parse(self, input, kind) + } + NonterminalKind::SeparatedIdentifiers => { + Self::separated_identifiers.parse(self, input, kind) + } + NonterminalKind::SourceUnit => Self::source_unit.parse(self, input, kind), + NonterminalKind::SourceUnitMember => Self::source_unit_member.parse(self, input, kind), + NonterminalKind::SourceUnitMembers => { + Self::source_unit_members.parse(self, input, kind) } - NonterminalKind::NegationExpression => Self::negation_expression.parse(self, input), - NonterminalKind::SeparatedIdentifiers => Self::separated_identifiers.parse(self, input), - NonterminalKind::SourceUnit => Self::source_unit.parse(self, input), - NonterminalKind::SourceUnitMember => Self::source_unit_member.parse(self, input), - NonterminalKind::SourceUnitMembers => Self::source_unit_members.parse(self, input), - NonterminalKind::Tree => Self::tree.parse(self, input), - NonterminalKind::TreeNode => Self::tree_node.parse(self, input), - NonterminalKind::TreeNodeChild => Self::tree_node_child.parse(self, input), - NonterminalKind::TreeNodeChildren => Self::tree_node_children.parse(self, input), + NonterminalKind::Tree => Self::tree.parse(self, input, kind), + NonterminalKind::TreeNode => Self::tree_node.parse(self, input, kind), + NonterminalKind::TreeNodeChild => Self::tree_node_child.parse(self, input, kind), + NonterminalKind::TreeNodeChildren => Self::tree_node_children.parse(self, input, kind), } } } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs index c648756daf..02bbe2b817 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/lexer/mod.rs @@ -96,7 +96,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(start); - return ParserResult::no_match(None, vec![kind]); + return ParserResult::no_match(vec![kind]); } let end = input.position(); @@ -131,7 +131,7 @@ pub(crate) trait Lexer { .is_some_and(|t| t.accepted_as(kind)) { input.set_position(restore); - return ParserResult::no_match(None, vec![kind]); + return ParserResult::no_match(vec![kind]); } let end = input.position(); children.push(Edge::anonymous(Node::terminal( diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index 07af27499c..e0a2b4be62 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -2,7 +2,9 @@ use std::rc::Rc; -use crate::cst::{Edge, Node, NonterminalNode, TerminalKind, TerminalKindExtensions, TextIndex}; +use crate::cst::{ + Edge, Node, NonterminalKind, NonterminalNode, TerminalKind, TerminalKindExtensions, TextIndex, +}; use crate::parser::lexer::Lexer; use crate::parser::parser_support::context::ParserContext; use crate::parser::parser_support::parser_result::{ @@ -14,7 +16,7 @@ pub trait ParserFunction

where Self: Fn(&P, &mut ParserContext<'_>) -> ParserResult, { - fn parse(&self, parser: &P, input: &str) -> ParseOutput; + fn parse(&self, parser: &P, input: &str, expected: NonterminalKind) -> ParseOutput; } impl ParserFunction

for F @@ -23,7 +25,7 @@ where F: Fn(&P, &mut ParserContext<'_>) -> ParserResult, { #[allow(clippy::too_many_lines)] - fn parse(&self, parser: &P, input: &str) -> ParseOutput { + fn parse(&self, parser: &P, input: &str, expected: NonterminalKind) -> ParseOutput { let mut stream = ParserContext::new(input); let mut result = self(parser, &mut stream); @@ -48,7 +50,7 @@ where let mut new_children = nonterminal.children.clone(); new_children.extend(eof_trivia); - topmost.node = Node::nonterminal(nonterminal.kind, new_children); + topmost.node = Node::nonterminal(expected, new_children); } } @@ -89,7 +91,7 @@ where let node = Node::terminal(kind, input.to_string()); trivia_nodes.push(Edge::anonymous(node)); ParseOutput { - parse_tree: Rc::new(NonterminalNode::new(no_match.kind.unwrap(), trivia_nodes)), + parse_tree: Rc::new(NonterminalNode::new(expected, trivia_nodes)), errors: vec![ParseError::new( start..start + input.into(), no_match.expected_terminals, diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs index cfd9a8df7e..00666ec339 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_result.rs @@ -18,7 +18,6 @@ pub enum ParserResult { impl Default for ParserResult { fn default() -> Self { Self::NoMatch(NoMatch { - kind: None, expected_terminals: vec![], }) } @@ -37,13 +36,13 @@ impl ParserResult { ParserResult::IncompleteMatch(IncompleteMatch::new(nodes, expected_terminals)) } - /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(None, vec![])`. + /// Whenever a parser didn't run because it's disabled due to versioning. Shorthand for `no_match(vec![])`. pub fn disabled() -> Self { - Self::no_match(None, vec![]) + Self::no_match(vec![]) } - pub fn no_match(kind: Option, expected_terminals: Vec) -> Self { - ParserResult::NoMatch(NoMatch::new(kind, expected_terminals)) + pub fn no_match(expected_terminals: Vec) -> Self { + ParserResult::NoMatch(NoMatch::new(expected_terminals)) } #[must_use] @@ -64,9 +63,7 @@ impl ParserResult { nodes: vec![Edge::anonymous(Node::nonterminal(new_kind, skipped.nodes))], ..skipped }), - ParserResult::NoMatch(no_match) => { - ParserResult::no_match(Some(new_kind), no_match.expected_terminals) - } + ParserResult::NoMatch(no_match) => ParserResult::no_match(no_match.expected_terminals), ParserResult::PrattOperatorMatch(_) => { unreachable!("PrattOperatorMatch cannot be converted to a nonterminal") } @@ -245,18 +242,13 @@ impl IncompleteMatch { #[derive(PartialEq, Eq, Clone, Debug)] pub struct NoMatch { - /// The nonterminal kind this match is coming from - pub kind: Option, /// Terminals that would have allowed for more progress. Collected for the purposes of error reporting. pub expected_terminals: Vec, } impl NoMatch { - pub fn new(kind: Option, expected_terminals: Vec) -> Self { - Self { - kind, - expected_terminals, - } + pub fn new(expected_terminals: Vec) -> Self { + Self { expected_terminals } } } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs index c49819e30f..f54ae45934 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/recovery.rs @@ -107,7 +107,7 @@ impl ParserResult { ParseResultKind::Incomplete => { ParserResult::incomplete_match(nodes, expected_terminals) } - ParseResultKind::NoMatch => ParserResult::no_match(None, expected_terminals), + ParseResultKind::NoMatch => ParserResult::no_match(expected_terminals), } } } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs index a4fb3a2be5..a808e73796 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/repetition_helper.rs @@ -28,10 +28,7 @@ impl RepetitionHelper { // Couldn't get a full match but we allow 0 items - return an empty match // so the parse is considered valid but note the expected terminals - ParserResult::NoMatch(NoMatch { - kind: _, - expected_terminals, - }) if MIN_COUNT == 0 => { + ParserResult::NoMatch(NoMatch { expected_terminals }) if MIN_COUNT == 0 => { return ParserResult::r#match(vec![], expected_terminals); } // Don't try repeating if we don't have a full match and we require at least one @@ -65,9 +62,7 @@ impl RepetitionHelper { ParserResult::IncompleteMatch(IncompleteMatch { expected_terminals, .. }) - | ParserResult::NoMatch(NoMatch { - expected_terminals, .. - }), + | ParserResult::NoMatch(NoMatch { expected_terminals }), ) => { input.rewind(save); running.expected_terminals = expected_terminals; diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs index eca96115d0..bcc5dc64f0 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/separated_helper.rs @@ -91,7 +91,7 @@ impl SeparatedHelper { } ParserResult::NoMatch(no_match) => { return if accum.is_empty() { - ParserResult::no_match(None, no_match.expected_terminals) + ParserResult::no_match(no_match.expected_terminals) } else { ParserResult::incomplete_match(accum, no_match.expected_terminals) }; From 299d966263ada4b432f2fa9d6bd055341930d67d Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Wed, 8 Jan 2025 15:19:28 -0300 Subject: [PATCH 17/22] Changes in generated files --- crates/solidity/outputs/cargo/crate/generated/public_api.txt | 2 +- .../payable_conversion/generated/0.4.11-failure.yml | 2 +- .../payable_conversion/generated/0.5.3-failure.yml | 2 +- .../built_in_difficulty/generated/0.8.18-failure.yml | 2 +- .../built_in_difficulty/generated/0.8.24-failure.yml | 2 +- .../built_in_jump/generated/0.5.0-failure.yml | 2 +- .../built_in_jump/generated/0.8.18-failure.yml | 2 +- .../built_in_jump/generated/0.8.24-failure.yml | 2 +- .../built_in_jump/generated/0.8.7-failure.yml | 2 +- .../built_in_jumpi/generated/0.5.0-failure.yml | 2 +- .../built_in_jumpi/generated/0.8.18-failure.yml | 2 +- .../built_in_jumpi/generated/0.8.24-failure.yml | 2 +- .../built_in_jumpi/generated/0.8.7-failure.yml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/solidity/outputs/cargo/crate/generated/public_api.txt b/crates/solidity/outputs/cargo/crate/generated/public_api.txt index 297e576fbf..0b273298c0 100644 --- a/crates/solidity/outputs/cargo/crate/generated/public_api.txt +++ b/crates/solidity/outputs/cargo/crate/generated/public_api.txt @@ -914,7 +914,7 @@ impl slang_solidity::parser::ParseOutput pub fn slang_solidity::parser::ParseOutput::create_tree_cursor(&self) -> slang_solidity::cst::Cursor pub fn slang_solidity::parser::ParseOutput::errors(&self) -> &alloc::vec::Vec pub fn slang_solidity::parser::ParseOutput::is_valid(&self) -> bool -pub fn slang_solidity::parser::ParseOutput::tree(&self) -> alloc::rc::Rc +pub fn slang_solidity::parser::ParseOutput::tree(&self) -> &alloc::rc::Rc impl core::cmp::PartialEq for slang_solidity::parser::ParseOutput pub fn slang_solidity::parser::ParseOutput::eq(&self, other: &slang_solidity::parser::ParseOutput) -> bool impl core::fmt::Debug for slang_solidity::parser::ParseOutput diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.4.11-failure.yml index d0ca5ab517..d002e3e3f5 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.4.11-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (Expression) ► (UNRECOGNIZED): "payable(msg.sender)\n" # (0..20) + - (FunctionCallExpression) ► (UNRECOGNIZED): "payable(msg.sender)\n" # (0..20) diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.5.3-failure.yml index 76d0bc5be0..302285ec54 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionCallExpression/payable_conversion/generated/0.5.3-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (Expression) ► (UNRECOGNIZED): "payable(msg.sender)\n" # (0..20) + - (FunctionCallExpression) ► (UNRECOGNIZED): "payable(msg.sender)\n" # (0..20) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.18-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.18-failure.yml index 7fc8615ff0..cb10b57211 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.18-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.18-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (YulExpression) ► (UNRECOGNIZED): "difficulty()\n" # (0..13) + - (YulFunctionCallExpression) ► (UNRECOGNIZED): "difficulty()\n" # (0..13) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.24-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.24-failure.yml index aea5563d27..60f2666108 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.24-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_difficulty/generated/0.8.24-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (YulExpression) ► (UNRECOGNIZED): "difficulty()\n" # (0..13) + - (YulFunctionCallExpression) ► (UNRECOGNIZED): "difficulty()\n" # (0..13) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.5.0-failure.yml index 2f0d3004b0..4dc9e664ee 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (YulExpression) ► (UNRECOGNIZED): "jump()\n" # (0..7) + - (YulFunctionCallExpression) ► (UNRECOGNIZED): "jump()\n" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.18-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.18-failure.yml index 86cdad0565..abb9ca5bb8 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.18-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.18-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (YulExpression) ► (UNRECOGNIZED): "jump()\n" # (0..7) + - (YulFunctionCallExpression) ► (UNRECOGNIZED): "jump()\n" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.24-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.24-failure.yml index 143e865bee..110c7ce107 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.24-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.24-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (YulExpression) ► (UNRECOGNIZED): "jump()\n" # (0..7) + - (YulFunctionCallExpression) ► (UNRECOGNIZED): "jump()\n" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.7-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.7-failure.yml index 93ed08378b..87aff14584 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.7-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jump/generated/0.8.7-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (YulExpression) ► (UNRECOGNIZED): "jump()\n" # (0..7) + - (YulFunctionCallExpression) ► (UNRECOGNIZED): "jump()\n" # (0..7) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.5.0-failure.yml index 433831df0a..173e3a6c74 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.5.0-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (YulExpression) ► (UNRECOGNIZED): "jumpi()\n" # (0..8) + - (YulFunctionCallExpression) ► (UNRECOGNIZED): "jumpi()\n" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.18-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.18-failure.yml index caa036df1b..512583209f 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.18-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.18-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (YulExpression) ► (UNRECOGNIZED): "jumpi()\n" # (0..8) + - (YulFunctionCallExpression) ► (UNRECOGNIZED): "jumpi()\n" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.24-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.24-failure.yml index 627d656f96..c828b4eee8 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.24-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.24-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (YulExpression) ► (UNRECOGNIZED): "jumpi()\n" # (0..8) + - (YulFunctionCallExpression) ► (UNRECOGNIZED): "jumpi()\n" # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.7-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.7-failure.yml index 94c5517f07..0cb4b2a599 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.7-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulFunctionCallExpression/built_in_jumpi/generated/0.8.7-failure.yml @@ -14,4 +14,4 @@ Errors: # 1 total ───╯ Tree: - - (YulExpression) ► (UNRECOGNIZED): "jumpi()\n" # (0..8) + - (YulFunctionCallExpression) ► (UNRECOGNIZED): "jumpi()\n" # (0..8) From 3f174c888110a97e9677c58c25700c601a7123ef Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Wed, 8 Jan 2025 15:27:48 -0300 Subject: [PATCH 18/22] Fixing name --- crates/solidity/testing/sanctuary/src/tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/solidity/testing/sanctuary/src/tests.rs b/crates/solidity/testing/sanctuary/src/tests.rs index 315e645b57..5a6c421f39 100644 --- a/crates/solidity/testing/sanctuary/src/tests.rs +++ b/crates/solidity/testing/sanctuary/src/tests.rs @@ -213,11 +213,11 @@ fn create_bindings(version: &Version, source_id: &str, output: &ParseOutput) -> }), ); let parser = Parser::create(version.clone())?; - let built_ins_parser = parser.parse( + let built_ins_output = parser.parse( NonterminalKind::SourceUnit, bindings::get_built_ins(version), ); - let built_ins_tree = built_ins_parser.tree(); + let built_ins_tree = built_ins_output.tree(); let built_ins_cursor = transform_built_ins_node(&Node::Nonterminal(Rc::clone(built_ins_tree))) .cursor_with_offset(TextIndex::ZERO); From 1fb766e374ec2f3bfb4f3dff686c38880c2a0d3c Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Fri, 10 Jan 2025 16:08:52 -0300 Subject: [PATCH 19/22] Applying suggestions from code review --- .../parser/parser_support/parser_function.rs | 14 +++++++------- .../parser/parser_support/parser_function.rs | 14 +++++++------- .../parser/parser_support/parser_function.rs | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs index f0e2448df5..b0611c7cdc 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/parser/parser_support/parser_function.rs @@ -14,7 +14,7 @@ pub trait ParserFunction

where Self: Fn(&P, &mut ParserContext<'_>) -> ParserResult, { - fn parse(&self, parser: &P, input: &str, expected: NonterminalKind) -> ParseOutput; + fn parse(&self, parser: &P, input: &str, topmost_kind: NonterminalKind) -> ParseOutput; } impl ParserFunction

for F @@ -23,7 +23,7 @@ where F: Fn(&P, &mut ParserContext<'_>) -> ParserResult, { #[allow(clippy::too_many_lines)] - fn parse(&self, parser: &P, input: &str, expected: NonterminalKind) -> ParseOutput { + fn parse(&self, parser: &P, input: &str, topmost_kind: NonterminalKind) -> ParseOutput { let mut stream = ParserContext::new(input); let mut result = self(parser, &mut stream); @@ -48,7 +48,7 @@ where let mut new_children = nonterminal.children.clone(); new_children.extend(eof_trivia); - topmost.node = Node::nonterminal(expected, new_children); + topmost.node = Node::nonterminal(topmost_kind, new_children); } } @@ -64,7 +64,7 @@ where // trivia is already parsed twice, one for each branch. And there's a good reason: each branch might // accept different trivia, so it's not clear what the combination of the two rules should return in a // NoMatch. Therefore, we just parse it again. Note that trivia is anyway cached by the parser (#1119). - let mut trivia_nodes = if let ParserResult::Match(matched) = + let mut children = if let ParserResult::Match(matched) = Lexer::leading_trivia(parser, &mut stream) { matched.nodes @@ -73,7 +73,7 @@ where }; let mut start = TextIndex::ZERO; - for edge in &trivia_nodes { + for edge in &children { if let Node::Terminal(terminal) = &edge.node { if terminal.kind.is_valid() { start.advance_str(terminal.text.as_str()); @@ -87,9 +87,9 @@ where TerminalKind::UNRECOGNIZED }; let node = Node::terminal(kind, input.to_string()); - trivia_nodes.push(Edge::anonymous(node)); + children.push(Edge::anonymous(node)); ParseOutput { - tree: Rc::new(NonterminalNode::new(expected, trivia_nodes)), + tree: Rc::new(NonterminalNode::new(topmost_kind, children)), errors: vec![ParseError::new( start..start + input.into(), no_match.expected_terminals, diff --git a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index 60c1a1360c..29d42e609d 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -16,7 +16,7 @@ pub trait ParserFunction

where Self: Fn(&P, &mut ParserContext<'_>) -> ParserResult, { - fn parse(&self, parser: &P, input: &str, expected: NonterminalKind) -> ParseOutput; + fn parse(&self, parser: &P, input: &str, topmost_kind: NonterminalKind) -> ParseOutput; } impl ParserFunction

for F @@ -25,7 +25,7 @@ where F: Fn(&P, &mut ParserContext<'_>) -> ParserResult, { #[allow(clippy::too_many_lines)] - fn parse(&self, parser: &P, input: &str, expected: NonterminalKind) -> ParseOutput { + fn parse(&self, parser: &P, input: &str, topmost_kind: NonterminalKind) -> ParseOutput { let mut stream = ParserContext::new(input); let mut result = self(parser, &mut stream); @@ -50,7 +50,7 @@ where let mut new_children = nonterminal.children.clone(); new_children.extend(eof_trivia); - topmost.node = Node::nonterminal(expected, new_children); + topmost.node = Node::nonterminal(topmost_kind, new_children); } } @@ -66,7 +66,7 @@ where // trivia is already parsed twice, one for each branch. And there's a good reason: each branch might // accept different trivia, so it's not clear what the combination of the two rules should return in a // NoMatch. Therefore, we just parse it again. Note that trivia is anyway cached by the parser (#1119). - let mut trivia_nodes = if let ParserResult::Match(matched) = + let mut children = if let ParserResult::Match(matched) = Lexer::leading_trivia(parser, &mut stream) { matched.nodes @@ -75,7 +75,7 @@ where }; let mut start = TextIndex::ZERO; - for edge in &trivia_nodes { + for edge in &children { if let Node::Terminal(terminal) = &edge.node { if terminal.kind.is_valid() { start.advance_str(terminal.text.as_str()); @@ -89,9 +89,9 @@ where TerminalKind::UNRECOGNIZED }; let node = Node::terminal(kind, input.to_string()); - trivia_nodes.push(Edge::anonymous(node)); + children.push(Edge::anonymous(node)); ParseOutput { - tree: Rc::new(NonterminalNode::new(expected, trivia_nodes)), + tree: Rc::new(NonterminalNode::new(topmost_kind, children)), errors: vec![ParseError::new( start..start + input.into(), no_match.expected_terminals, diff --git a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs index 60c1a1360c..29d42e609d 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/parser/parser_support/parser_function.rs @@ -16,7 +16,7 @@ pub trait ParserFunction

where Self: Fn(&P, &mut ParserContext<'_>) -> ParserResult, { - fn parse(&self, parser: &P, input: &str, expected: NonterminalKind) -> ParseOutput; + fn parse(&self, parser: &P, input: &str, topmost_kind: NonterminalKind) -> ParseOutput; } impl ParserFunction

for F @@ -25,7 +25,7 @@ where F: Fn(&P, &mut ParserContext<'_>) -> ParserResult, { #[allow(clippy::too_many_lines)] - fn parse(&self, parser: &P, input: &str, expected: NonterminalKind) -> ParseOutput { + fn parse(&self, parser: &P, input: &str, topmost_kind: NonterminalKind) -> ParseOutput { let mut stream = ParserContext::new(input); let mut result = self(parser, &mut stream); @@ -50,7 +50,7 @@ where let mut new_children = nonterminal.children.clone(); new_children.extend(eof_trivia); - topmost.node = Node::nonterminal(expected, new_children); + topmost.node = Node::nonterminal(topmost_kind, new_children); } } @@ -66,7 +66,7 @@ where // trivia is already parsed twice, one for each branch. And there's a good reason: each branch might // accept different trivia, so it's not clear what the combination of the two rules should return in a // NoMatch. Therefore, we just parse it again. Note that trivia is anyway cached by the parser (#1119). - let mut trivia_nodes = if let ParserResult::Match(matched) = + let mut children = if let ParserResult::Match(matched) = Lexer::leading_trivia(parser, &mut stream) { matched.nodes @@ -75,7 +75,7 @@ where }; let mut start = TextIndex::ZERO; - for edge in &trivia_nodes { + for edge in &children { if let Node::Terminal(terminal) = &edge.node { if terminal.kind.is_valid() { start.advance_str(terminal.text.as_str()); @@ -89,9 +89,9 @@ where TerminalKind::UNRECOGNIZED }; let node = Node::terminal(kind, input.to_string()); - trivia_nodes.push(Edge::anonymous(node)); + children.push(Edge::anonymous(node)); ParseOutput { - tree: Rc::new(NonterminalNode::new(expected, trivia_nodes)), + tree: Rc::new(NonterminalNode::new(topmost_kind, children)), errors: vec![ParseError::new( start..start + input.into(), no_match.expected_terminals, From 850b5f90bed24bbd1a97c22dfa2912d1186d27d7 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Fri, 10 Jan 2025 16:32:13 -0300 Subject: [PATCH 20/22] Changing the type of File.tree --- .../cargo/crate/src/runtime/compilation/file.rs | 11 ++++++----- .../crate/src/runtime/compilation/internal_builder.rs | 6 +----- .../wasm/src/runtime/interface/compilation.wit.jinja2 | 4 ++-- .../src/runtime/interface/generated/compilation.wit | 4 ++-- .../wasm/src/runtime/wrappers/compilation/mod.rs | 6 ++++-- .../cargo/crate/src/generated/compilation/file.rs | 11 ++++++----- .../src/generated/compilation/internal_builder.rs | 6 +----- .../src/generated/interface/generated/compilation.wit | 4 ++-- .../wasm/src/generated/wrappers/compilation/mod.rs | 6 ++++-- .../cargo/crate/src/generated/compilation/file.rs | 11 ++++++----- .../src/generated/compilation/internal_builder.rs | 6 +----- .../src/generated/interface/generated/compilation.wit | 4 ++-- .../wasm/src/generated/wrappers/compilation/mod.rs | 6 ++++-- 13 files changed, 41 insertions(+), 44 deletions(-) diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/compilation/file.rs b/crates/codegen/runtime/cargo/crate/src/runtime/compilation/file.rs index 07693c8335..a5a7df7862 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/compilation/file.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/compilation/file.rs @@ -1,19 +1,20 @@ use std::collections::BTreeMap; +use std::rc::Rc; use metaslang_cst::text_index::TextIndex; -use crate::cst::{Cursor, Node}; +use crate::cst::{Cursor, NonterminalNode}; #[derive(Clone)] pub struct File { id: String, - tree: Node, + tree: Rc, resolved_imports: BTreeMap, } impl File { - pub(super) fn new(id: String, tree: Node) -> Self { + pub(super) fn new(id: String, tree: Rc) -> Self { Self { id, tree, @@ -26,12 +27,12 @@ impl File { &self.id } - pub fn tree(&self) -> &Node { + pub fn tree(&self) -> &Rc { &self.tree } pub fn create_tree_cursor(&self) -> Cursor { - self.tree.clone().cursor_with_offset(TextIndex::ZERO) + Rc::clone(&self.tree).cursor_with_offset(TextIndex::ZERO) } pub(super) fn resolve_import(&mut self, import_path: &Cursor, destination_file_id: String) { diff --git a/crates/codegen/runtime/cargo/crate/src/runtime/compilation/internal_builder.rs b/crates/codegen/runtime/cargo/crate/src/runtime/compilation/internal_builder.rs index bdda575510..14ccb1ff35 100644 --- a/crates/codegen/runtime/cargo/crate/src/runtime/compilation/internal_builder.rs +++ b/crates/codegen/runtime/cargo/crate/src/runtime/compilation/internal_builder.rs @@ -1,7 +1,6 @@ use std::collections::BTreeMap; use std::rc::Rc; -use metaslang_cst::nodes::Node; use semver::Version; use crate::compilation::{CompilationUnit, File}; @@ -44,10 +43,7 @@ impl InternalCompilationBuilder { let import_paths = self.imports.extract(parse_output.create_tree_cursor()); - let file = File::new( - id.clone(), - Node::Nonterminal(Rc::clone(parse_output.tree())), - ); + let file = File::new(id.clone(), Rc::clone(parse_output.tree())); self.files.insert(id, file); AddFileResponse { import_paths } diff --git a/crates/codegen/runtime/cargo/wasm/src/runtime/interface/compilation.wit.jinja2 b/crates/codegen/runtime/cargo/wasm/src/runtime/interface/compilation.wit.jinja2 index 1436368ad1..34bd8f1d45 100644 --- a/crates/codegen/runtime/cargo/wasm/src/runtime/interface/compilation.wit.jinja2 +++ b/crates/codegen/runtime/cargo/wasm/src/runtime/interface/compilation.wit.jinja2 @@ -1,6 +1,6 @@ interface compilation { use bindings.{binding-graph}; - use cst.{node, cursor}; + use cst.{nonterminal-node, cursor}; /// A builder for creating compilation units. /// Allows incrementally building a transitive list of all files and their imports. @@ -58,7 +58,7 @@ interface compilation { id: func() -> string; /// Returns the syntax tree of this file. - tree: func() -> node; + tree: func() -> nonterminal-node; /// Creates a cursor for traversing the syntax tree of this file. create-tree-cursor: func() -> cursor; diff --git a/crates/codegen/runtime/cargo/wasm/src/runtime/interface/generated/compilation.wit b/crates/codegen/runtime/cargo/wasm/src/runtime/interface/generated/compilation.wit index c9db286d76..93fd36c7df 100644 --- a/crates/codegen/runtime/cargo/wasm/src/runtime/interface/generated/compilation.wit +++ b/crates/codegen/runtime/cargo/wasm/src/runtime/interface/generated/compilation.wit @@ -2,7 +2,7 @@ interface compilation { use bindings.{binding-graph}; - use cst.{node, cursor}; + use cst.{nonterminal-node, cursor}; /// A builder for creating compilation units. /// Allows incrementally building a transitive list of all files and their imports. @@ -60,7 +60,7 @@ interface compilation { id: func() -> string; /// Returns the syntax tree of this file. - tree: func() -> node; + tree: func() -> nonterminal-node; /// Creates a cursor for traversing the syntax tree of this file. create-tree-cursor: func() -> cursor; diff --git a/crates/codegen/runtime/cargo/wasm/src/runtime/wrappers/compilation/mod.rs b/crates/codegen/runtime/cargo/wasm/src/runtime/wrappers/compilation/mod.rs index 3ecc07023c..38b6e130ca 100644 --- a/crates/codegen/runtime/cargo/wasm/src/runtime/wrappers/compilation/mod.rs +++ b/crates/codegen/runtime/cargo/wasm/src/runtime/wrappers/compilation/mod.rs @@ -11,7 +11,9 @@ mod ffi { Guest, GuestCompilationUnit, GuestFile, GuestInternalCompilationBuilder, InternalCompilationBuilder, InternalCompilationBuilderBorrow, }; - pub use crate::wasm_crate::bindgen::exports::nomic_foundation::slang::cst::{Cursor, Node}; + pub use crate::wasm_crate::bindgen::exports::nomic_foundation::slang::cst::{ + Cursor, NonterminalNode, + }; } mod rust { @@ -110,7 +112,7 @@ define_rc_wrapper! { File { self._borrow_ffi().id().to_owned() } - fn tree(&self) -> ffi::Node { + fn tree(&self) -> ffi::NonterminalNode { self._borrow_ffi().tree().to_owned()._into_ffi() } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/compilation/file.rs b/crates/solidity/outputs/cargo/crate/src/generated/compilation/file.rs index 94eee8ad56..2f5fd5bcc3 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/compilation/file.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/compilation/file.rs @@ -1,21 +1,22 @@ // This file is generated automatically by infrastructure scripts. Please don't edit by hand. use std::collections::BTreeMap; +use std::rc::Rc; use metaslang_cst::text_index::TextIndex; -use crate::cst::{Cursor, Node}; +use crate::cst::{Cursor, NonterminalNode}; #[derive(Clone)] pub struct File { id: String, - tree: Node, + tree: Rc, resolved_imports: BTreeMap, } impl File { - pub(super) fn new(id: String, tree: Node) -> Self { + pub(super) fn new(id: String, tree: Rc) -> Self { Self { id, tree, @@ -28,12 +29,12 @@ impl File { &self.id } - pub fn tree(&self) -> &Node { + pub fn tree(&self) -> &Rc { &self.tree } pub fn create_tree_cursor(&self) -> Cursor { - self.tree.clone().cursor_with_offset(TextIndex::ZERO) + Rc::clone(&self.tree).cursor_with_offset(TextIndex::ZERO) } pub(super) fn resolve_import(&mut self, import_path: &Cursor, destination_file_id: String) { diff --git a/crates/solidity/outputs/cargo/crate/src/generated/compilation/internal_builder.rs b/crates/solidity/outputs/cargo/crate/src/generated/compilation/internal_builder.rs index 0eb3cbdc2e..a0c2ec5e73 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/compilation/internal_builder.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/compilation/internal_builder.rs @@ -3,7 +3,6 @@ use std::collections::BTreeMap; use std::rc::Rc; -use metaslang_cst::nodes::Node; use semver::Version; use crate::compilation::{CompilationUnit, File}; @@ -46,10 +45,7 @@ impl InternalCompilationBuilder { let import_paths = self.imports.extract(parse_output.create_tree_cursor()); - let file = File::new( - id.clone(), - Node::Nonterminal(Rc::clone(parse_output.tree())), - ); + let file = File::new(id.clone(), Rc::clone(parse_output.tree())); self.files.insert(id, file); AddFileResponse { import_paths } diff --git a/crates/solidity/outputs/cargo/wasm/src/generated/interface/generated/compilation.wit b/crates/solidity/outputs/cargo/wasm/src/generated/interface/generated/compilation.wit index c9db286d76..93fd36c7df 100644 --- a/crates/solidity/outputs/cargo/wasm/src/generated/interface/generated/compilation.wit +++ b/crates/solidity/outputs/cargo/wasm/src/generated/interface/generated/compilation.wit @@ -2,7 +2,7 @@ interface compilation { use bindings.{binding-graph}; - use cst.{node, cursor}; + use cst.{nonterminal-node, cursor}; /// A builder for creating compilation units. /// Allows incrementally building a transitive list of all files and their imports. @@ -60,7 +60,7 @@ interface compilation { id: func() -> string; /// Returns the syntax tree of this file. - tree: func() -> node; + tree: func() -> nonterminal-node; /// Creates a cursor for traversing the syntax tree of this file. create-tree-cursor: func() -> cursor; diff --git a/crates/solidity/outputs/cargo/wasm/src/generated/wrappers/compilation/mod.rs b/crates/solidity/outputs/cargo/wasm/src/generated/wrappers/compilation/mod.rs index d168910020..c1d50b6098 100644 --- a/crates/solidity/outputs/cargo/wasm/src/generated/wrappers/compilation/mod.rs +++ b/crates/solidity/outputs/cargo/wasm/src/generated/wrappers/compilation/mod.rs @@ -13,7 +13,9 @@ mod ffi { Guest, GuestCompilationUnit, GuestFile, GuestInternalCompilationBuilder, InternalCompilationBuilder, InternalCompilationBuilderBorrow, }; - pub use crate::wasm_crate::bindgen::exports::nomic_foundation::slang::cst::{Cursor, Node}; + pub use crate::wasm_crate::bindgen::exports::nomic_foundation::slang::cst::{ + Cursor, NonterminalNode, + }; } mod rust { @@ -112,7 +114,7 @@ define_rc_wrapper! { File { self._borrow_ffi().id().to_owned() } - fn tree(&self) -> ffi::Node { + fn tree(&self) -> ffi::NonterminalNode { self._borrow_ffi().tree().to_owned()._into_ffi() } diff --git a/crates/testlang/outputs/cargo/crate/src/generated/compilation/file.rs b/crates/testlang/outputs/cargo/crate/src/generated/compilation/file.rs index 94eee8ad56..2f5fd5bcc3 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/compilation/file.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/compilation/file.rs @@ -1,21 +1,22 @@ // This file is generated automatically by infrastructure scripts. Please don't edit by hand. use std::collections::BTreeMap; +use std::rc::Rc; use metaslang_cst::text_index::TextIndex; -use crate::cst::{Cursor, Node}; +use crate::cst::{Cursor, NonterminalNode}; #[derive(Clone)] pub struct File { id: String, - tree: Node, + tree: Rc, resolved_imports: BTreeMap, } impl File { - pub(super) fn new(id: String, tree: Node) -> Self { + pub(super) fn new(id: String, tree: Rc) -> Self { Self { id, tree, @@ -28,12 +29,12 @@ impl File { &self.id } - pub fn tree(&self) -> &Node { + pub fn tree(&self) -> &Rc { &self.tree } pub fn create_tree_cursor(&self) -> Cursor { - self.tree.clone().cursor_with_offset(TextIndex::ZERO) + Rc::clone(&self.tree).cursor_with_offset(TextIndex::ZERO) } pub(super) fn resolve_import(&mut self, import_path: &Cursor, destination_file_id: String) { diff --git a/crates/testlang/outputs/cargo/crate/src/generated/compilation/internal_builder.rs b/crates/testlang/outputs/cargo/crate/src/generated/compilation/internal_builder.rs index 0eb3cbdc2e..a0c2ec5e73 100644 --- a/crates/testlang/outputs/cargo/crate/src/generated/compilation/internal_builder.rs +++ b/crates/testlang/outputs/cargo/crate/src/generated/compilation/internal_builder.rs @@ -3,7 +3,6 @@ use std::collections::BTreeMap; use std::rc::Rc; -use metaslang_cst::nodes::Node; use semver::Version; use crate::compilation::{CompilationUnit, File}; @@ -46,10 +45,7 @@ impl InternalCompilationBuilder { let import_paths = self.imports.extract(parse_output.create_tree_cursor()); - let file = File::new( - id.clone(), - Node::Nonterminal(Rc::clone(parse_output.tree())), - ); + let file = File::new(id.clone(), Rc::clone(parse_output.tree())); self.files.insert(id, file); AddFileResponse { import_paths } diff --git a/crates/testlang/outputs/cargo/wasm/src/generated/interface/generated/compilation.wit b/crates/testlang/outputs/cargo/wasm/src/generated/interface/generated/compilation.wit index c9db286d76..93fd36c7df 100644 --- a/crates/testlang/outputs/cargo/wasm/src/generated/interface/generated/compilation.wit +++ b/crates/testlang/outputs/cargo/wasm/src/generated/interface/generated/compilation.wit @@ -2,7 +2,7 @@ interface compilation { use bindings.{binding-graph}; - use cst.{node, cursor}; + use cst.{nonterminal-node, cursor}; /// A builder for creating compilation units. /// Allows incrementally building a transitive list of all files and their imports. @@ -60,7 +60,7 @@ interface compilation { id: func() -> string; /// Returns the syntax tree of this file. - tree: func() -> node; + tree: func() -> nonterminal-node; /// Creates a cursor for traversing the syntax tree of this file. create-tree-cursor: func() -> cursor; diff --git a/crates/testlang/outputs/cargo/wasm/src/generated/wrappers/compilation/mod.rs b/crates/testlang/outputs/cargo/wasm/src/generated/wrappers/compilation/mod.rs index d168910020..c1d50b6098 100644 --- a/crates/testlang/outputs/cargo/wasm/src/generated/wrappers/compilation/mod.rs +++ b/crates/testlang/outputs/cargo/wasm/src/generated/wrappers/compilation/mod.rs @@ -13,7 +13,9 @@ mod ffi { Guest, GuestCompilationUnit, GuestFile, GuestInternalCompilationBuilder, InternalCompilationBuilder, InternalCompilationBuilderBorrow, }; - pub use crate::wasm_crate::bindgen::exports::nomic_foundation::slang::cst::{Cursor, Node}; + pub use crate::wasm_crate::bindgen::exports::nomic_foundation::slang::cst::{ + Cursor, NonterminalNode, + }; } mod rust { @@ -112,7 +114,7 @@ define_rc_wrapper! { File { self._borrow_ffi().id().to_owned() } - fn tree(&self) -> ffi::Node { + fn tree(&self) -> ffi::NonterminalNode { self._borrow_ffi().tree().to_owned()._into_ffi() } From 90d72b7ec3eaf915c0372431df7db8a7db8c1331 Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Fri, 10 Jan 2025 16:51:05 -0300 Subject: [PATCH 21/22] Adding missing files --- .../interfaces/nomic-foundation-slang-compilation.d.ts | 6 +++--- .../solidity/outputs/cargo/crate/generated/public_api.txt | 2 +- .../interfaces/nomic-foundation-slang-compilation.d.ts | 6 +++--- .../interfaces/nomic-foundation-slang-compilation.d.ts | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/codegen/runtime/npm/package/wasm/generated/interfaces/nomic-foundation-slang-compilation.d.ts b/crates/codegen/runtime/npm/package/wasm/generated/interfaces/nomic-foundation-slang-compilation.d.ts index 3c1a6831c1..9bf06ecee7 100644 --- a/crates/codegen/runtime/npm/package/wasm/generated/interfaces/nomic-foundation-slang-compilation.d.ts +++ b/crates/codegen/runtime/npm/package/wasm/generated/interfaces/nomic-foundation-slang-compilation.d.ts @@ -7,8 +7,8 @@ export namespace NomicFoundationSlangCompilation { } import type { BindingGraph } from "./nomic-foundation-slang-bindings.js"; export { BindingGraph }; -import type { Node } from "./nomic-foundation-slang-cst.js"; -export { Node }; +import type { NonterminalNode } from "./nomic-foundation-slang-cst.js"; +export { NonterminalNode }; import type { Cursor } from "./nomic-foundation-slang-cst.js"; export { Cursor }; /** @@ -64,7 +64,7 @@ export class File { /** * Returns the syntax tree of this file. */ - get tree(): Node; + get tree(): NonterminalNode; /** * Creates a cursor for traversing the syntax tree of this file. */ diff --git a/crates/solidity/outputs/cargo/crate/generated/public_api.txt b/crates/solidity/outputs/cargo/crate/generated/public_api.txt index 20741305c1..5fd25170bc 100644 --- a/crates/solidity/outputs/cargo/crate/generated/public_api.txt +++ b/crates/solidity/outputs/cargo/crate/generated/public_api.txt @@ -36,7 +36,7 @@ pub struct slang_solidity::compilation::File impl slang_solidity::compilation::File pub fn slang_solidity::compilation::File::create_tree_cursor(&self) -> slang_solidity::cst::Cursor pub fn slang_solidity::compilation::File::id(&self) -> &str -pub fn slang_solidity::compilation::File::tree(&self) -> &slang_solidity::cst::Node +pub fn slang_solidity::compilation::File::tree(&self) -> &alloc::rc::Rc impl core::clone::Clone for slang_solidity::compilation::File pub fn slang_solidity::compilation::File::clone(&self) -> slang_solidity::compilation::File pub struct slang_solidity::compilation::InternalCompilationBuilder diff --git a/crates/solidity/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-compilation.d.ts b/crates/solidity/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-compilation.d.ts index 3c1a6831c1..9bf06ecee7 100644 --- a/crates/solidity/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-compilation.d.ts +++ b/crates/solidity/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-compilation.d.ts @@ -7,8 +7,8 @@ export namespace NomicFoundationSlangCompilation { } import type { BindingGraph } from "./nomic-foundation-slang-bindings.js"; export { BindingGraph }; -import type { Node } from "./nomic-foundation-slang-cst.js"; -export { Node }; +import type { NonterminalNode } from "./nomic-foundation-slang-cst.js"; +export { NonterminalNode }; import type { Cursor } from "./nomic-foundation-slang-cst.js"; export { Cursor }; /** @@ -64,7 +64,7 @@ export class File { /** * Returns the syntax tree of this file. */ - get tree(): Node; + get tree(): NonterminalNode; /** * Creates a cursor for traversing the syntax tree of this file. */ diff --git a/crates/testlang/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-compilation.d.ts b/crates/testlang/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-compilation.d.ts index 3c1a6831c1..9bf06ecee7 100644 --- a/crates/testlang/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-compilation.d.ts +++ b/crates/testlang/outputs/npm/package/wasm/generated/interfaces/nomic-foundation-slang-compilation.d.ts @@ -7,8 +7,8 @@ export namespace NomicFoundationSlangCompilation { } import type { BindingGraph } from "./nomic-foundation-slang-bindings.js"; export { BindingGraph }; -import type { Node } from "./nomic-foundation-slang-cst.js"; -export { Node }; +import type { NonterminalNode } from "./nomic-foundation-slang-cst.js"; +export { NonterminalNode }; import type { Cursor } from "./nomic-foundation-slang-cst.js"; export { Cursor }; /** @@ -64,7 +64,7 @@ export class File { /** * Returns the syntax tree of this file. */ - get tree(): Node; + get tree(): NonterminalNode; /** * Creates a cursor for traversing the syntax tree of this file. */ From 6615c1829445a3eb32025b49d516876ec88521cb Mon Sep 17 00:00:00 2001 From: Beta Ziliani Date: Mon, 13 Jan 2025 12:33:19 -0300 Subject: [PATCH 22/22] Create young-bottles-beam.md --- .changeset/young-bottles-beam.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/young-bottles-beam.md diff --git a/.changeset/young-bottles-beam.md b/.changeset/young-bottles-beam.md new file mode 100644 index 0000000000..24a91c32ef --- /dev/null +++ b/.changeset/young-bottles-beam.md @@ -0,0 +1,5 @@ +--- +"@slang-private/codegen-runtime-npm-package": patch +--- + +Change `ParseOutput` and `File.tree` to return a `NonTerminal` instead of a `Node`