From 08a20b69968dbdd42f0630c9abff6e5d46a9dbfd Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Mon, 6 Nov 2023 15:05:25 +0100 Subject: [PATCH] feat: Migrate the parser codegen to DSL v2 --- .../src/compiler/analysis/references.rs | 6 +- .../language/definition/src/model/types.rs | 65 +- .../duplicate_expression_name/test.rs | 6 +- .../duplicate_expression_name/test.stderr | 2 +- .../inputs/language/src/definition.rs | 876 +- crates/solidity/inputs/language/src/dsl.rs | 4 +- .../solidity/outputs/cargo/build/src/main.rs | 13 +- .../cargo/crate/src/generated/kinds.rs | 479 +- .../cargo/crate/src/generated/language.rs | 13034 ++++++++++------ crates/solidity/outputs/npm/build/src/main.rs | 12 +- .../outputs/npm/crate/src/generated/kinds.rs | 479 +- .../npm/crate/src/generated/language.rs | 13034 ++++++++++------ .../unchecked/generated/0.4.11-failure.yml | 12 +- .../unchecked/generated/0.5.0-failure.yml | 3 +- .../unchecked/generated/0.5.3-failure.yml | 3 +- .../unchecked/generated/0.6.0-failure.yml | 3 +- .../unchecked/generated/0.7.0-failure.yml | 3 +- .../unchecked/generated/0.8.0-success.yml | 6 +- .../int/generated/0.7.4-success.yml | 5 +- .../simple/generated/0.4.22-failure.yml | 17 + .../{0.4.22-success.yml => 0.5.0-success.yml} | 3 + .../generated/0.6.0-success.yml | 1 + .../generated/0.4.11-success.yml | 1 + .../generated/0.4.11-failure.yml | 208 +- .../generated/0.6.2-success.yml | 247 +- .../generated/0.8.0-success.yml | 154 + .../generated/0.4.11-success.yml | 1 + .../generated/0.4.11-success.yml | 24 +- .../generated/0.4.11-failure.yml | 12 +- .../generated/0.4.22-success.yml | 27 - .../generated/0.5.0-success.yml | 31 + .../generated/0.4.11-success.yml | 25 +- .../generated/0.4.11-failure.yml | 18 +- .../generated/0.8.4-success.yml | 17 +- .../generated/0.4.11-success.yml | 42 +- .../generated/0.4.11-failure.yml | 12 +- .../generated/0.6.0-success.yml | 23 +- .../generated/0.4.11-success.yml | 59 +- .../generated/0.4.11-success.yml | 36 +- .../generated/0.4.11-failure.yml | 12 +- .../generated/0.6.0-success.yml | 23 +- .../generated/0.4.11-success.yml | 19 +- .../generated/0.4.11-success.yml | 37 +- .../generated/0.4.11-success.yml | 23 +- .../generated/0.6.0-failure.yml | 20 +- .../generated/0.6.5-failure.yml | 20 +- .../generated/0.4.11-success.yml | 30 +- .../generated/0.6.0-failure.yml | 27 +- .../generated/0.6.5-failure.yml | 27 +- .../generated/0.4.11-failure.yml | 3 +- .../generated/0.4.22-failure.yml | 3 +- .../generated/0.6.0-failure.yml | 3 +- .../generated/0.8.0-failure.yml | 3 +- .../generated/0.8.4-failure.yml | 3 +- .../generated/0.8.8-success.yml | 16 +- .../generated/0.4.11-success.yml | 20 +- .../generated/0.4.11-failure.yml | 16 +- .../generated/0.6.5-failure.yml | 16 +- .../generated/0.4.11-failure.yml | 153 +- .../generated/0.5.0-failure.yml | 143 +- .../generated/0.5.3-failure.yml | 143 +- .../generated/0.6.0-failure.yml | 143 +- .../generated/0.7.0-failure.yml | 143 +- .../generated/0.8.0-failure.yml | 169 +- .../generated/0.4.11-failure.yml | 3 +- .../generated/0.4.22-failure.yml | 3 +- .../generated/0.6.0-failure.yml | 3 +- .../generated/0.8.0-failure.yml | 3 +- .../generated/0.8.4-failure.yml | 3 +- .../generated/0.8.8-failure.yml | 3 +- .../constructor/generated/0.4.11-failure.yml | 1 + .../{0.4.22-success.yml => 0.5.0-success.yml} | 7 +- .../generated/0.4.11-success.yml | 57 +- .../generated/0.4.11-failure.yml | 72 +- .../generated/0.4.21-failure.yml | 72 +- .../generated/0.5.0-failure.yml | 72 +- .../generated/0.5.3-failure.yml | 72 +- .../generated/0.6.0-failure.yml | 72 +- .../generated/0.7.0-failure.yml | 72 +- .../generated/0.8.0-failure.yml | 72 +- .../generated/0.8.4-failure.yml | 72 +- .../generated/0.4.11-failure.yml | 323 +- .../generated/0.5.0-failure.yml | 275 +- .../generated/0.6.2-failure.yml | 427 +- .../generated/0.7.0-failure.yml | 427 +- .../generated/0.8.0-failure.yml | 423 +- .../generated/0.4.11-success.yml | 2 +- .../no_members/generated/0.4.11-success.yml | 1 + .../top_level/generated/0.8.4-success.yml | 6 +- .../transfer/generated/0.4.11-failure.yml | 20 +- .../address_call/generated/0.4.11-success.yml | 16 +- .../generated/0.4.11-success.yml | 18 +- .../generated/0.4.11-success.yml | 17 +- .../generated/0.4.11-success.yml | 34 +- .../generated/0.4.11-success.yml | 21 +- .../generated/0.4.11-success.yml | 11 +- .../generated/0.4.11-success.yml | 12 +- .../generated/0.4.11-success.yml | 6 +- .../generated/0.6.2-success.yml | 49 +- .../generated/0.8.0-success.yml | 43 + .../generated/0.6.2-success.yml | 55 +- .../generated/0.4.11-success.yml | 11 +- .../generated/0.4.11-failure.yml | 4 +- .../generated/0.8.0-failure.yml | 4 +- .../generated/0.4.11-success.yml | 7 +- .../generated/0.4.11-success.yml | 3 +- .../generated/0.4.11-success.yml | 7 +- .../generated/0.4.11-success.yml | 3 +- .../keyword_alias/generated/0.5.0-failure.yml | 2 +- .../keyword_alias/generated/0.5.3-failure.yml | 2 +- .../keyword_alias/generated/0.7.0-failure.yml | 2 +- .../keyword_alias/generated/0.8.0-failure.yml | 2 +- .../keyword_apply/generated/0.5.0-failure.yml | 2 +- .../keyword_apply/generated/0.5.3-failure.yml | 2 +- .../keyword_apply/generated/0.7.0-failure.yml | 2 +- .../keyword_apply/generated/0.8.0-failure.yml | 2 +- .../keyword_auto/generated/0.5.0-failure.yml | 2 +- .../keyword_auto/generated/0.5.3-failure.yml | 2 +- .../keyword_auto/generated/0.7.0-failure.yml | 2 +- .../keyword_auto/generated/0.8.0-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../{0.4.22-failure.yml => 0.5.0-failure.yml} | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../{0.4.21-failure.yml => 0.5.0-failure.yml} | 2 +- .../keyword_emit/generated/0.5.3-failure.yml | 2 +- .../keyword_emit/generated/0.7.0-failure.yml | 2 +- .../keyword_emit/generated/0.8.0-failure.yml | 2 +- .../generated/0.6.0-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.4.11-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../keyword_macro/generated/0.5.0-failure.yml | 2 +- .../keyword_macro/generated/0.5.3-failure.yml | 2 +- .../keyword_macro/generated/0.7.0-failure.yml | 2 +- .../keyword_macro/generated/0.8.0-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.6.0-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.4.11-failure.yml | 2 +- .../keyword_szabo/generated/0.5.3-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.6.0-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.4.11-success.yml | 6 +- .../payable_call/generated/0.4.11-success.yml | 13 +- .../prefix_plus/generated/0.5.0-failure.yml | 2 +- .../prefix_plus/generated/0.5.3-failure.yml | 2 +- .../prefix_plus/generated/0.7.0-failure.yml | 2 +- .../prefix_plus/generated/0.8.0-failure.yml | 2 +- .../returns/generated/0.4.11-failure.yml | 2 +- .../returns/generated/0.5.3-failure.yml | 2 +- .../returns/generated/0.7.0-failure.yml | 2 +- .../returns/generated/0.8.0-failure.yml | 2 +- .../generated/0.7.0-success.yml | 5 +- .../simple/generated/0.6.0-success.yml | 10 +- .../generated/0.4.11-success.yml | 14 +- .../generated/0.5.0-failure.yml | 2 + .../generated/0.4.11-failure.yml | 20 +- .../generated/0.4.11-success.yml | 39 +- .../generated/0.4.11-success.yml | 22 +- .../named_import/generated/0.4.11-success.yml | 14 +- .../path_import/generated/0.4.11-success.yml | 5 +- .../generated/0.4.11-success.yml | 10 +- .../generated/0.4.11-success.yml | 76 +- .../named_both/generated/0.4.11-failure.yml | 6 +- .../named_both/generated/0.8.18-success.yml | 11 +- .../named_key/generated/0.4.11-failure.yml | 6 +- .../named_key/generated/0.8.18-success.yml | 11 +- .../named_value/generated/0.4.11-failure.yml | 11 +- .../named_value/generated/0.8.18-success.yml | 11 +- .../generated/0.4.11-failure.yml | 11 +- .../generated/0.8.18-failure.yml | 11 +- .../unnamed/generated/0.4.11-success.yml | 11 +- .../generated/0.4.11-success.yml | 2 +- .../abi_coder/generated/0.4.11-success.yml | 7 +- .../experimental/generated/0.4.11-success.yml | 8 +- .../generated/0.4.11-success.yml | 8 +- .../version/generated/0.4.11-success.yml | 21 +- .../simple/generated/0.6.0-success.yml | 10 +- .../generated/0.4.11-failure.yml | 2 +- .../SafeMath/generated/0.4.11-failure.yml | 109 +- .../SafeMath/generated/0.5.0-failure.yml | 98 +- .../SafeMath/generated/0.5.3-failure.yml | 98 +- .../SafeMath/generated/0.6.0-failure.yml | 98 +- .../SafeMath/generated/0.7.0-failure.yml | 98 +- .../SafeMath/generated/0.8.0-success.yml | 228 +- .../empty_file/generated/0.4.11-success.yml | 1 + .../generated/0.4.11-failure.yml | 33 + .../generated/0.4.11-success.yml | 23 - .../generated/0.6.0-failure.yml | 33 + .../generated/0.7.1-failure.yml | 33 + .../generated/0.7.4-failure.yml | 33 + .../generated/0.8.0-failure.yml | 33 + .../generated/0.8.13-failure.yml | 33 + .../generated/0.8.22-failure.yml | 33 + .../generated/0.8.4-failure.yml | 33 + .../generated/0.8.8-failure.yml | 33 + .../everything/generated/0.4.11-failure.yml | 51 +- .../everything/generated/0.6.0-failure.yml | 67 + .../everything/generated/0.7.1-failure.yml | 67 + .../everything/generated/0.7.4-failure.yml | 67 + .../everything/generated/0.8.0-failure.yml | 67 + .../everything/generated/0.8.13-failure.yml | 224 +- .../everything/generated/0.8.22-success.yml | 235 +- .../everything/generated/0.8.4-failure.yml | 67 + .../everything/generated/0.8.8-failure.yml | 67 + .../generated/0.4.11-failure.yml | 18 +- .../generated/0.4.11-failure.yml | 3 +- .../generated/0.6.0-failure.yml | 19 + .../generated/0.7.1-failure.yml | 19 + .../generated/0.7.4-failure.yml | 19 + .../generated/0.8.0-failure.yml | 19 + .../generated/0.8.13-failure.yml | 19 + .../generated/0.8.22-success.yml | 27 +- .../generated/0.8.4-failure.yml | 19 + .../generated/0.8.8-failure.yml | 19 + .../generated/0.4.11-failure.yml | 3 +- .../generated/0.6.0-failure.yml | 19 + .../generated/0.7.1-success.yml | 25 +- .../generated/0.4.11-success.yml | 32 +- .../generated/0.4.11-failure.yml | 49 +- .../generated/0.6.0-failure.yml | 63 + .../generated/0.7.1-failure.yml | 63 + .../generated/0.7.4-failure.yml | 63 + .../generated/0.8.0-failure.yml | 63 + .../generated/0.8.13-success.yml | 176 +- .../generated/0.8.4-failure.yml | 63 + .../generated/0.8.8-failure.yml | 63 + .../throw/generated/0.5.0-failure.yml | 2 +- .../throw/generated/0.5.3-failure.yml | 2 +- .../throw/generated/0.6.0-failure.yml | 2 +- .../throw/generated/0.7.0-failure.yml | 2 +- .../throw/generated/0.8.0-failure.yml | 2 +- .../throw/generated/0.8.4-failure.yml | 2 +- .../try_catch/generated/0.4.11-failure.yml | 2 +- .../try_catch/generated/0.4.21-failure.yml | 2 +- .../try_catch/generated/0.5.0-failure.yml | 2 +- .../try_catch/generated/0.5.3-failure.yml | 2 +- .../try_catch/generated/0.6.0-success.yml | 10 +- .../generated/0.4.11-failure.yml | 8 +- .../generated/0.5.0-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.6.0-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 2 +- .../generated/0.8.4-failure.yml | 2 +- .../no_members/generated/0.4.11-success.yml | 1 + .../generated/0.4.11-success.yml | 80 +- .../generated/0.4.11-success.yml | 61 +- .../generated/0.4.11-success.yml | 18 +- .../generated/0.4.11-failure.yml | 30 +- .../generated/0.6.2-failure.yml | 40 +- .../generated/0.8.0-failure.yml | 54 + .../generated/0.4.11-success.yml | 17 +- .../with_type/generated/0.4.11-success.yml | 19 +- .../generated/0.4.11-success.yml | 30 +- .../empty/generated/0.4.11-success.yml | 3 +- .../full/generated/0.4.11-success.yml | 22 +- .../generated/0.4.11-success.yml | 14 +- .../byte/generated/0.4.11-success.yml | 3 +- .../TypeName/byte/generated/0.8.0-failure.yml | 2 +- .../generated/0.4.11-success.yml | 3 +- .../int_no_size/generated/0.4.11-success.yml | 3 +- .../generated/0.4.11-success.yml | 3 +- .../uint_no_size/generated/0.4.11-success.yml | 3 +- .../generated/0.4.11-success.yml | 3 +- .../bool/generated/0.8.8-success.yml | 3 +- .../generated/0.8.13-failure.yml | 24 +- .../generated/0.8.19-success.yml | 56 +- .../generated/0.8.13-success.yml | 22 +- .../path_named/generated/0.4.11-failure.yml | 9 +- .../path_named/generated/0.8.13-success.yml | 9 +- .../path_unnamed/generated/0.4.11-success.yml | 5 +- .../generated/0.8.13-failure.yml | 24 +- .../generated/0.8.19-success.yml | 27 +- .../var/generated/0.4.11-success.yml | 13 +- .../var/generated/0.5.0-failure.yml | 2 +- .../var/generated/0.8.0-failure.yml | 2 +- .../alternatives/generated/0.4.11-success.yml | 2 +- .../generated/0.4.11-success.yml | 2 +- .../generated/0.4.11-success.yml | 2 +- .../generated/0.4.11-success.yml | 2 +- .../generated/0.4.11-success.yml | 2 +- .../generated/0.4.11-success.yml | 2 +- .../ranges/generated/0.4.11-success.yml | 2 +- .../with_trivia/generated/0.4.11-success.yml | 2 +- .../function_def/generated/0.4.11-success.yml | 14 +- .../generated/0.4.11-failure.yml | 16 +- .../generated/0.6.0-failure.yml | 16 +- .../generated/0.4.11-success.yml | 3 +- .../generated/0.4.11-failure.yml | 2 +- .../generated/0.4.11-success.yml | 5 +- .../hex_literal/generated/0.4.11-success.yml | 3 +- .../generated/0.4.11-failure.yml | 2 +- .../{0.6.0-success.yml => 0.7.1-success.yml} | 2 +- 357 files changed, 24496 insertions(+), 12758 deletions(-) create mode 100644 crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.22-failure.yml rename crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/{0.4.22-success.yml => 0.5.0-success.yml} (81%) create mode 100644 crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.8.0-success.yml delete mode 100644 crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.22-success.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.5.0-success.yml rename crates/solidity/testing/snapshots/cst_output/ContractMembersList/constructor/generated/{0.4.22-success.yml => 0.5.0-success.yml} (72%) create mode 100644 crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.8.0-success.yml rename crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/{0.4.22-failure.yml => 0.5.0-failure.yml} (66%) rename crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/{0.4.21-failure.yml => 0.5.0-failure.yml} (64%) create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11-failure.yml delete mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11-success.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.6.0-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.7.1-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.7.4-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.0-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.13-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.22-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.4-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.8-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.6.0-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.7.1-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.7.4-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.0-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.4-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.8-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.6.0-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.7.1-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.7.4-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.0-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.13-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.4-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.8-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.6.0-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.6.0-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.7.1-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.7.4-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.0-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.4-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.8-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.8.0-failure.yml rename crates/solidity/testing/snapshots/cst_output/YulStatement/leave/generated/{0.6.0-success.yml => 0.7.1-success.yml} (85%) diff --git a/crates/codegen/language/definition/src/compiler/analysis/references.rs b/crates/codegen/language/definition/src/compiler/analysis/references.rs index 13ecd219fe..b973e7cf8c 100644 --- a/crates/codegen/language/definition/src/compiler/analysis/references.rs +++ b/crates/codegen/language/definition/src/compiler/analysis/references.rs @@ -171,7 +171,11 @@ fn check_precedence(analysis: &mut Analysis, item: &PrecedenceItem, enablement: let enablement = update_enablement(analysis, &enablement, &enabled); for precedence_expression in precedence_expressions { - let PrecedenceExpression { name: _, operators } = &**precedence_expression; + let PrecedenceExpression { + name: _, + rule_name: _, + operators, + } = &**precedence_expression; for operator in operators { let PrecedenceOperator { diff --git a/crates/codegen/language/definition/src/model/types.rs b/crates/codegen/language/definition/src/model/types.rs index 6acf672285..9f5ad96330 100644 --- a/crates/codegen/language/definition/src/model/types.rs +++ b/crates/codegen/language/definition/src/model/types.rs @@ -1,4 +1,5 @@ pub use self::wrapper::*; +pub use indexmap::{IndexMap, IndexSet}; /// We want to generate all Spanned types in a single module. /// Unfortunately, module-level (inner) attribute macros are not supported yet: @@ -6,8 +7,9 @@ pub use self::wrapper::*; /// More information: https://github.com/rust-lang/rust/issues/54726 #[codegen_language_internal_macros::derive_internals] mod wrapper { + use super::{IndexMap, IndexSet}; + use crate::model::Identifier; - use indexmap::{IndexMap, IndexSet}; use semver::Version; use serde::Serialize; use std::{path::PathBuf, rc::Rc}; @@ -61,7 +63,23 @@ mod wrapper { Fragment { item: FragmentItem }, } - #[derive(Debug, Eq, PartialEq, Serialize)] + impl Item { + pub fn name(&self) -> &Identifier { + match self { + Item::Struct { item } => &item.name, + Item::Enum { item } => &item.name, + Item::Repeated { item } => &item.name, + Item::Separated { item } => &item.name, + Item::Precedence { item } => &item.name, + Item::Trivia { item } => &item.name, + Item::Keyword { item } => &item.name, + Item::Token { item } => &item.name, + Item::Fragment { item } => &item.name, + } + } + } + + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct StructItem { pub name: Identifier, @@ -71,7 +89,7 @@ mod wrapper { pub fields: IndexMap, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct EnumItem { pub name: Identifier, @@ -80,7 +98,7 @@ mod wrapper { pub variants: Vec, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct EnumVariant { pub name: Identifier, @@ -89,7 +107,7 @@ mod wrapper { pub reference: Identifier, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct RepeatedItem { pub name: Identifier, pub repeated: Identifier, @@ -99,7 +117,7 @@ mod wrapper { pub allow_empty: Option, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct SeparatedItem { pub name: Identifier, pub separated: Identifier, @@ -110,7 +128,7 @@ mod wrapper { pub allow_empty: Option, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct PrecedenceItem { pub name: Identifier, @@ -120,14 +138,15 @@ mod wrapper { pub primary_expressions: Vec, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct PrecedenceExpression { pub name: Identifier, + pub rule_name: Identifier, pub operators: Vec, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct PrecedenceOperator { pub model: OperatorModel, @@ -137,7 +156,7 @@ mod wrapper { pub fields: IndexMap, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)] pub enum OperatorModel { Prefix, Postfix, @@ -145,26 +164,26 @@ mod wrapper { BinaryRightAssociative, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct PrimaryExpression { pub expression: Identifier, pub enabled: Option, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct FieldsErrorRecovery { pub terminator: Option, pub delimiters: Option, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct FieldDelimiters { pub open: Identifier, pub close: Identifier, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub enum Field { Required { kind: FieldKind, @@ -176,7 +195,7 @@ mod wrapper { }, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub enum FieldKind { NonTerminal { item: Identifier }, Terminal { items: IndexSet }, @@ -201,7 +220,7 @@ mod wrapper { pub scanner: Scanner, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct KeywordItem { pub name: Identifier, pub identifier: Identifier, @@ -209,7 +228,7 @@ mod wrapper { pub definitions: Vec, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct KeywordDefinition { pub enabled: Option, pub reserved: Option, @@ -217,7 +236,7 @@ mod wrapper { pub value: KeywordValue, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub enum KeywordValue { Sequence { values: Vec }, Optional { value: Box }, @@ -225,21 +244,21 @@ mod wrapper { Atom { atom: String }, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct TokenItem { pub name: Identifier, pub definitions: Vec, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct TokenDefinition { pub enabled: Option, pub scanner: Scanner, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct FragmentItem { pub name: Identifier, @@ -248,7 +267,7 @@ mod wrapper { pub scanner: Scanner, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub enum Scanner { Sequence { scanners: Vec, @@ -284,7 +303,7 @@ mod wrapper { }, } - #[derive(Debug, Eq, PartialEq, Serialize)] + #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub enum VersionSpecifier { Never, From { from: Version }, diff --git a/crates/codegen/language/tests/src/fail/definitions/duplicate_expression_name/test.rs b/crates/codegen/language/tests/src/fail/definitions/duplicate_expression_name/test.rs index f016675938..df4baaacc2 100644 --- a/crates/codegen/language/tests/src/fail/definitions/duplicate_expression_name/test.rs +++ b/crates/codegen/language/tests/src/fail/definitions/duplicate_expression_name/test.rs @@ -14,9 +14,9 @@ codegen_language_macros::compile!(Language( Precedence( name = Bar, precedence_expressions = [ - PrecedenceExpression(name = Expression1, operators = []), - PrecedenceExpression(name = Expression2, operators = []), - PrecedenceExpression(name = Expression1, operators = []) + PrecedenceExpression(name = Expression1, rule_name = X, operators = []), + PrecedenceExpression(name = Expression2, rule_name = X, operators = []), + PrecedenceExpression(name = Expression1, rule_name = X, operators = []) ], primary_expressions = [PrimaryExpression(expression = Baz)] ), diff --git a/crates/codegen/language/tests/src/fail/definitions/duplicate_expression_name/test.stderr b/crates/codegen/language/tests/src/fail/definitions/duplicate_expression_name/test.stderr index 6d6b1ea841..b9f2da2b43 100644 --- a/crates/codegen/language/tests/src/fail/definitions/duplicate_expression_name/test.stderr +++ b/crates/codegen/language/tests/src/fail/definitions/duplicate_expression_name/test.stderr @@ -1,5 +1,5 @@ error: An expression with the name 'Expression1' already exists. --> src/fail/definitions/duplicate_expression_name/test.rs:19:53 | -19 | PrecedenceExpression(name = Expression1, operators = []) +19 | PrecedenceExpression(name = Expression1, rule_name = X, operators = []) | ^^^^^^^^^^^ diff --git a/crates/solidity/inputs/language/src/definition.rs b/crates/solidity/inputs/language/src/definition.rs index 93934da453..8210b0f541 100644 --- a/crates/solidity/inputs/language/src/definition.rs +++ b/crates/solidity/inputs/language/src/definition.rs @@ -1,7 +1,20 @@ +use std::cell::OnceCell; use std::collections::BTreeSet; use std::collections::HashMap; use std::rc::Rc; +use codegen_grammar::GrammarElement; +use codegen_grammar::ParserDefinitionNode; +use codegen_grammar::PrecedenceOperatorModel; +use codegen_grammar::PrecedenceParserDefinitionNode; +use codegen_grammar::ScannerDefinitionNode; +use codegen_grammar::VersionQuality; +use codegen_grammar::VersionQualityRange; +use codegen_language_definition::model::FieldsErrorRecovery; +use codegen_language_definition::model::IndexMap; +use codegen_language_definition::model::VersionSpecifier; +use codegen_language_definition::model::{self, Identifier, Item}; + pub use solidity::SolidityDefinition; pub trait GrammarConstructorDslV2 { @@ -9,29 +22,851 @@ pub trait GrammarConstructorDslV2 { } #[derive(Debug)] -struct DummyTriviaParserDef; -impl codegen_grammar::TriviaParserDefinition for DummyTriviaParserDef { +struct NamedScanner(&'static str, codegen_grammar::ScannerDefinitionNode); +impl codegen_grammar::ScannerDefinition for NamedScanner { fn name(&self) -> &'static str { - todo!() + self.0 + } + fn node(&self) -> &codegen_grammar::ScannerDefinitionNode { + &self.1 } +} + +#[derive(Debug)] +struct NamedTriviaParser( + &'static str, + &'static str, + codegen_grammar::ParserDefinitionNode, +); +impl codegen_grammar::TriviaParserDefinition for NamedTriviaParser { + fn name(&self) -> &'static str { + self.0 + } + fn context(&self) -> &'static str { - todo!() + self.1 } + fn node(&self) -> &codegen_grammar::ParserDefinitionNode { - todo!() + &self.2 + } +} + +#[derive(Debug)] +struct NamedParserThunk(&'static str, &'static str, OnceCell); +impl codegen_grammar::ParserDefinition for NamedParserThunk { + fn name(&self) -> &'static str { + self.0 + } + + fn context(&self) -> &'static str { + self.1 + } + + fn is_inline(&self) -> bool { + // The DSL v2 definition already inlines the elements + false + } + + fn node(&self) -> &codegen_grammar::ParserDefinitionNode { + self.2.get().expect("Thunk to be resolved") + } +} + +#[derive(Debug)] +struct NamedPrecedenceParserThunk( + &'static str, + &'static str, + OnceCell, +); +impl codegen_grammar::PrecedenceParserDefinition for NamedPrecedenceParserThunk { + fn name(&self) -> &'static str { + self.0 + } + + fn context(&self) -> &'static str { + self.1 + } + + fn node(&self) -> &codegen_grammar::PrecedenceParserDefinitionNode { + self.2.get().expect("Thunk to be resolved") + } +} + +fn enabled_to_range(spec: VersionSpecifier) -> Vec { + match spec { + VersionSpecifier::Never => vec![VersionQualityRange { + from: semver::Version::new(0, 0, 0), + quality: VersionQuality::Removed, + }], + VersionSpecifier::From { from } => vec![VersionQualityRange { + from, + quality: VersionQuality::Introduced, + }], + VersionSpecifier::Till { till } => vec![VersionQualityRange { + from: till, + quality: VersionQuality::Removed, + }], + VersionSpecifier::Range { from, till } => vec![ + VersionQualityRange { + from, + quality: VersionQuality::Introduced, + }, + VersionQualityRange { + from: till, + quality: VersionQuality::Removed, + }, + ], + } +} + +fn resolve_scanner( + scanner: model::Scanner, + ctx: &mut ResolveCtx, +) -> codegen_grammar::ScannerDefinitionNode { + use codegen_grammar::ScannerDefinitionNode as ScanDefNode; + + match scanner { + model::Scanner::Optional { scanner } => { + ScanDefNode::Optional(Box::new(resolve_scanner(*scanner, ctx))) + } + model::Scanner::ZeroOrMore { scanner } => { + ScanDefNode::ZeroOrMore(Box::new(resolve_scanner(*scanner, ctx))) + } + model::Scanner::OneOrMore { scanner } => { + ScanDefNode::OneOrMore(Box::new(resolve_scanner(*scanner, ctx))) + } + model::Scanner::Sequence { scanners } => ScanDefNode::Sequence( + scanners + .into_iter() + .map(|scanner| resolve_scanner(scanner, ctx)) + .collect(), + ), + model::Scanner::Choice { scanners } => ScanDefNode::Choice( + scanners + .into_iter() + .map(|scanner| resolve_scanner(scanner, ctx)) + .collect(), + ), + model::Scanner::Not { chars } => ScanDefNode::NoneOf(chars.into_iter().collect()), + model::Scanner::TrailingContext { + scanner, + not_followed_by, + } => ScanDefNode::NotFollowedBy( + Box::new(resolve_scanner(*scanner, ctx)), + Box::new(resolve_scanner(*not_followed_by, ctx)), + ), + model::Scanner::Range { + inclusive_start, + inclusive_end, + } => ScanDefNode::CharRange(inclusive_start, inclusive_end), + model::Scanner::Atom { atom } => ScanDefNode::Literal(atom), + model::Scanner::Fragment { reference } => match resolve_grammar_element(&reference, ctx) { + GrammarElement::ScannerDefinition(parser) => ScanDefNode::ScannerDefinition(parser), + _ => panic!("Expected {reference} to be a ScannerDefinition"), + }, } } +fn resolve_fragment( + fragment: model::FragmentItem, + ctx: &mut ResolveCtx, +) -> codegen_grammar::ScannerDefinitionNode { + resolve_scanner(fragment.scanner, ctx).versioned(fragment.enabled) +} + +fn resolve_token( + token: model::TokenItem, + ctx: &mut ResolveCtx, +) -> codegen_grammar::ScannerDefinitionNode { + let resolved_defs: Vec<_> = token + .definitions + .into_iter() + .map(|def| resolve_scanner(def.scanner, ctx).versioned(def.enabled)) + .collect(); + + match resolved_defs.len() { + 0 => panic!("Token {} has no definitions", token.name), + 1 => resolved_defs.into_iter().next().unwrap(), + _ => ScannerDefinitionNode::Choice(resolved_defs), + } +} + +fn resolve_keyword(keyword: model::KeywordItem) -> codegen_grammar::ScannerDefinitionNode { + // FIXME: Handle reserved keywords using the given "Identifier" parser + let _identifier = keyword.identifier; + + let defs: Vec<_> = keyword + .definitions + .into_iter() + .map(|def| { + // FIXME: Properly support contextual keywords. + // Currently, to minimize the diff and ease the transition to the DSL v2, we treat them as normal keywords. + // Moreover, since the DSL v1 only treats "enablement" as being reserved, we try to preserve that for now. + let value = resolve_keyword_value(def.value); + // If missing, the default is "Always" + match (def.enabled, def.reserved) { + // Contextual keywords (never reserved) + (enabled, Some(VersionSpecifier::Never)) => match enabled { + Some(enabled) => { + ScannerDefinitionNode::Versioned(Box::new(value), enabled_to_range(enabled)) + } + None => value, + }, + (_, Some(reserved)) => { + ScannerDefinitionNode::Versioned(Box::new(value), enabled_to_range(reserved)) + } + // The keyword is always reserved + (_, None) => value, + } + }) + .collect(); + + match defs.len() { + 0 => panic!("Keyword {} has no definitions", keyword.name), + 1 => defs.into_iter().next().unwrap(), + _ => ScannerDefinitionNode::Choice(defs), + } +} + +fn resolve_keyword_value(value: model::KeywordValue) -> codegen_grammar::ScannerDefinitionNode { + match value { + model::KeywordValue::Sequence { values } => { + ScannerDefinitionNode::Sequence(values.into_iter().map(resolve_keyword_value).collect()) + } + model::KeywordValue::Choice { values } => { + ScannerDefinitionNode::Choice(values.into_iter().map(resolve_keyword_value).collect()) + } + model::KeywordValue::Optional { value } => { + ScannerDefinitionNode::Optional(Box::new(resolve_keyword_value(*value))) + } + model::KeywordValue::Atom { atom } => ScannerDefinitionNode::Literal(atom), + } +} + +fn resolve_trivia( + parser: model::TriviaParser, + ctx: &mut ResolveCtx, +) -> codegen_grammar::ParserDefinitionNode { + use codegen_grammar::ParserDefinitionNode as ParseDefNode; + + match parser { + model::TriviaParser::Optional { parser } => { + ParseDefNode::Optional(Box::new(resolve_trivia(*parser, ctx))) + } + model::TriviaParser::OneOrMore { parser } => { + ParseDefNode::OneOrMore(Box::new(resolve_trivia(*parser, ctx))) + } + model::TriviaParser::ZeroOrMore { parser } => { + ParseDefNode::ZeroOrMore(Box::new(resolve_trivia(*parser, ctx))) + } + model::TriviaParser::Sequence { parsers } => ParseDefNode::Sequence( + parsers + .into_iter() + .map(|scanner| resolve_trivia(scanner, ctx)) + .collect(), + ), + model::TriviaParser::Choice { parsers } => ParseDefNode::Choice( + parsers + .into_iter() + .map(|scanner| resolve_trivia(scanner, ctx)) + .collect(), + ), + model::TriviaParser::Trivia { trivia } => match resolve_grammar_element(&trivia, ctx) { + GrammarElement::ScannerDefinition(parser) => ParseDefNode::ScannerDefinition(parser), + _ => panic!("Expected {trivia} to be a ScannerDefinition"), + }, + } +} + +trait IntoParserDefNode { + fn into_parser_def_node(self) -> ParserDefinitionNode; +} + +impl IntoParserDefNode for GrammarElement { + fn into_parser_def_node(self) -> ParserDefinitionNode { + match self { + GrammarElement::ParserDefinition(parser) => { + ParserDefinitionNode::ParserDefinition(parser) + } + GrammarElement::ScannerDefinition(parser) => { + ParserDefinitionNode::ScannerDefinition(parser) + } + GrammarElement::TriviaParserDefinition(parser) => { + ParserDefinitionNode::TriviaParserDefinition(parser) + } + GrammarElement::PrecedenceParserDefinition(parser) => { + ParserDefinitionNode::PrecedenceParserDefinition(parser) + } + } + } +} + +trait VersionWrapped { + fn versioned(self, enabled: Option) -> Self; +} + +impl VersionWrapped for ParserDefinitionNode { + fn versioned(self, enabled: Option) -> Self { + if let Some(enabled) = enabled { + Self::Versioned(Box::new(self), enabled_to_range(enabled)) + } else { + self + } + } +} + +impl VersionWrapped for ScannerDefinitionNode { + fn versioned(self, enabled: Option) -> Self { + if let Some(enabled) = enabled { + Self::Versioned(Box::new(self), enabled_to_range(enabled)) + } else { + self + } + } +} + +fn resolve_field( + field: model::Field, + ctx: &mut ResolveCtx, +) -> codegen_grammar::ParserDefinitionNode { + match field { + model::Field::Required { kind } => resolve_field_kind(kind, ctx), + model::Field::Optional { kind, enabled } => ParserDefinitionNode::Optional(Box::new( + resolve_field_kind(kind, ctx).versioned(enabled), + )), + } +} + +fn resolve_field_kind( + kind: model::FieldKind, + ctx: &mut ResolveCtx, +) -> codegen_grammar::ParserDefinitionNode { + match kind { + model::FieldKind::NonTerminal { item } => { + resolve_grammar_element(&item, ctx).into_parser_def_node() + } + model::FieldKind::Terminal { items } => { + let refs: Vec<_> = items + .iter() + .map(|ident| resolve_grammar_element(ident, ctx).into_parser_def_node()) + .collect(); + + match refs.len() { + 0 => panic!("Field has no definitions"), + 1 => refs.into_iter().next().unwrap(), + _ => ParserDefinitionNode::Choice(refs), + } + } + } +} + +fn resolve_sequence_like( + enabled: Option, + fields: IndexMap, + error_recovery: Option, + ctx: &mut ResolveCtx, +) -> codegen_grammar::ParserDefinitionNode { + let (terminator, delimiters) = match error_recovery { + Some(FieldsErrorRecovery { + terminator: None, + delimiters: None, + }) => panic!("Empty error_recovery"), + None => (None, None), + Some(FieldsErrorRecovery { + terminator, + delimiters, + }) => (terminator, delimiters), + }; + + let mut fields: Vec<_> = fields + .into_iter() + .map(|(name, field)| (name, resolve_field(field, ctx))) + .collect(); + + // Transform inline [.., open, body, close, ..] sequence into single DelimitedBy(open, body, close) node + if let Some(delimiters) = delimiters { + let open_idx = fields.iter().position(|(nam, _)| nam == &delimiters.open); + let close_idx = fields.iter().position(|(nam, _)| nam == &delimiters.close); + let (open_idx, close_idx) = (open_idx.unwrap(), close_idx.unwrap()); + + let delimited_body: Vec<_> = fields + .drain((open_idx + 1)..close_idx) + .map(|(_, field)| field) + .collect(); + + let delimited_body = match delimited_body.len() { + 1 => delimited_body.into_iter().next().unwrap(), + 0 => ParserDefinitionNode::Sequence(vec![]), + _ => ParserDefinitionNode::Sequence(delimited_body), + }; + // Replace the remaining delimiters with the new delimited body + let delimited = { + let mut delims = fields + .drain(open_idx..=open_idx + 1) + .map(|(_, field)| field); + dbg!(delims.size_hint()); + let open = delims.next().unwrap(); + let close = delims.next().unwrap(); + + ParserDefinitionNode::DelimitedBy( + Box::new(open), + Box::new(delimited_body), + Box::new(close), + ) + }; + fields.insert( + open_idx, + ( + delimiters.open, // dummy, identifiers are stripped here anyway + delimited, + ), + ); + } + + let terminator = match terminator { + Some(terminator) => { + let (name, def) = fields.pop().unwrap(); + assert_eq!(name, terminator); + + Some(def) + } + None => None, + }; + + let body = ParserDefinitionNode::Sequence(fields.into_iter().map(|(_, def)| def).collect()); + + if let Some(terminator) = terminator { + ParserDefinitionNode::TerminatedBy(Box::new(body), Box::new(terminator)) + } else { + body + } + .versioned(enabled) +} + +fn resolve_choice( + item: model::EnumItem, + ctx: &mut ResolveCtx, +) -> codegen_grammar::ParserDefinitionNode { + let variants = item + .variants + .into_iter() + .map(|variant| resolve_enum_variant(variant, ctx)) + .collect(); + + ParserDefinitionNode::Choice(variants).versioned(item.enabled) +} + +fn resolve_enum_variant( + item: model::EnumVariant, + ctx: &mut ResolveCtx, +) -> codegen_grammar::ParserDefinitionNode { + match resolve_grammar_element(&item.reference, ctx) { + GrammarElement::ParserDefinition(parser) => { + ParserDefinitionNode::ParserDefinition(parser).versioned(item.enabled) + } + GrammarElement::ScannerDefinition(parser) => { + ParserDefinitionNode::ScannerDefinition(parser).versioned(item.enabled) + } + // TODO: Make sure we do not version precedence parsers in enums + GrammarElement::PrecedenceParserDefinition(parser) => { + ParserDefinitionNode::PrecedenceParserDefinition(parser) + } + GrammarElement::TriviaParserDefinition(..) => unreachable!(), + } +} + +fn resolve_repeated( + item: model::RepeatedItem, + ctx: &mut ResolveCtx, +) -> codegen_grammar::ParserDefinitionNode { + let body = Box::new(resolve_grammar_element(&item.repeated, ctx).into_parser_def_node()); + + let repeated = if item.allow_empty.unwrap_or(false) { + ParserDefinitionNode::ZeroOrMore + } else { + ParserDefinitionNode::OneOrMore + }; + + repeated(body).versioned(item.enabled) +} + +fn resolve_separated( + item: model::SeparatedItem, + ctx: &mut ResolveCtx, +) -> codegen_grammar::ParserDefinitionNode { + let body = resolve_grammar_element(&item.separated, ctx).into_parser_def_node(); + let separator = resolve_grammar_element(&item.separator, ctx).into_parser_def_node(); + + let separated_by = ParserDefinitionNode::SeparatedBy(Box::new(body), Box::new(separator)) + .versioned(item.enabled); + + if item.allow_empty.unwrap_or(false) { + ParserDefinitionNode::Optional(Box::new(separated_by)) + } else { + separated_by + } +} + +fn resolve_precedence( + item: model::PrecedenceItem, + lex_ctx: &'static str, + ctx: &mut ResolveCtx, +) -> codegen_grammar::PrecedenceParserDefinitionNode { + let primaries = item + .primary_expressions + .into_iter() + .map(|prim| { + resolve_grammar_element(&prim.expression, ctx) + .into_parser_def_node() + .versioned(prim.enabled) + }) + .collect(); + let primary_expression = Box::new(ParserDefinitionNode::Choice(primaries)); + + fn model_to_enum(model: model::OperatorModel) -> PrecedenceOperatorModel { + match model { + model::OperatorModel::BinaryLeftAssociative => { + PrecedenceOperatorModel::BinaryLeftAssociative + } + model::OperatorModel::BinaryRightAssociative => { + PrecedenceOperatorModel::BinaryRightAssociative + } + model::OperatorModel::Prefix => PrecedenceOperatorModel::Prefix, + model::OperatorModel::Postfix => PrecedenceOperatorModel::Postfix, + } + } + + let mut operators = vec![]; + for expr in item.precedence_expressions { + let name = expr.name; + + // Register it as a regular parser with a given name, however we need to + // define it as a choice over the "operator" sequences + // Then, when returning, we should actually return a node ref pointing to that combined parser + // And ideally, we shouldn't even use the "enabled" mode of the original DSL + let thunk = Rc::new(NamedParserThunk( + name.to_string().leak(), + lex_ctx, + OnceCell::new(), + )); + + // NOTE: The DSL v1 model defines operators as having the same body definitions but uses a specific + // versioning mechanism. This is in contrast to the DSL v2, which allows for different body definitions and + // different versions. + // Thus, we shoehorn the v2 model into the first one, by creating a single parser definition node as + // a choice over the different versions of the operator body, but still define it multiple times in the DSL v1 + // model with an explicit version, that the codegen handles for us. + for op in &expr.operators { + operators.push(( + op.enabled.clone().map(enabled_to_range).unwrap_or_default(), + model_to_enum(op.model), + // TODO: Don't leak + expr.rule_name.to_string().leak() as &_, + thunk.clone() as Rc, + )); + } + + let defs: Vec<_> = expr + .operators + .into_iter() + .map(|op| resolve_sequence_like(op.enabled, op.fields, op.error_recovery, ctx)) + .collect(); + + let def = match defs.len() { + 0 => panic!("Precedence operator {} has no definitions", name), + 1 => defs.into_iter().next().unwrap(), + _ => ParserDefinitionNode::Choice(defs), + }; + + thunk.2.set(def).unwrap(); + assert!( + !ctx.resolved.contains_key(&name), + "Encountered a duplicate Precedence Operator named {name} when resolving" + ); + ctx.resolved + .insert(name.clone(), GrammarElement::ParserDefinition(thunk)); + } + + PrecedenceParserDefinitionNode { + primary_expression, + operators, + } +} + +use std::cell::RefCell; +thread_local! { + static RESOLVE_PATH: RefCell> = RefCell::default(); +} + +fn resolve_grammar_element(ident: &Identifier, ctx: &mut ResolveCtx) -> GrammarElement { + RESOLVE_PATH.with(|path| path.borrow_mut().push(ident.to_string())); + if RESOLVE_PATH.with(|path| path.borrow().len() > 20) { + panic!( + "Recursion detected: {:?}", + RESOLVE_PATH.with(|path| path.borrow().clone()) + ); + } + + let (lex_ctx, elem) = ctx.items.get(ident).expect("Missing item"); + + // FIXME: Don't leak + let lex_ctx = lex_ctx + .as_ref() + .map(|l| l.to_string().leak() as &_) + .unwrap_or("Default"); + + enum ParserThunk { + Regular(Rc), + Precedence(Rc), + } + impl ParserThunk { + fn as_regular_def(&self) -> &OnceCell { + match self { + ParserThunk::Regular(thunk) => &thunk.2, + _ => panic!("Expected a regular parser thunk"), + } + } + + fn as_precedence_def(&self) -> &OnceCell { + match self { + ParserThunk::Precedence(thunk) => &thunk.2, + _ => panic!("Expected a precedence parser thunk"), + } + } + } + // The non-terminals are mutually recursive (so will be the resolution of their definitions), + // so make sure to insert a thunk for non-terminals to resolve to break the cycle. + let inserted_thunk = match (elem.as_ref(), ctx.resolved.contains_key(ident)) { + ( + Item::Struct { .. } + | Item::Enum { .. } + | Item::Repeated { .. } + | Item::Separated { .. }, + false, + ) => { + let thunk = Rc::new(NamedParserThunk( + ident.to_string().leak(), + lex_ctx, + OnceCell::new(), + )); + ctx.resolved.insert( + ident.clone(), + (thunk.clone() as Rc).into(), + ); + Some(ParserThunk::Regular(thunk)) + } + (Item::Precedence { .. }, false) => { + let thunk = Rc::new(NamedPrecedenceParserThunk( + ident.to_string().leak(), + lex_ctx, + OnceCell::new(), + )); + ctx.resolved.insert( + ident.clone(), + (thunk.clone() as Rc).into(), + ); + Some(ParserThunk::Precedence(thunk)) + } + _ => None, + }; + + let path = RESOLVE_PATH.with(|path| path.borrow().clone().join(" -> ")); + + match (inserted_thunk, ctx.resolved.get(ident)) { + // Already resolved + (None, Some(resolved)) => { + eprintln!("{path}: Reusing {}.", ident); + RESOLVE_PATH.with(|path| path.borrow_mut().pop()); + + resolved.clone() + } + (Some(..), None) => unreachable!("We just inserted a thunk!"), + // First time resolving a non-terminal named `ident` (since we just inserted a thunk) + // Any recursive resolution for this non-terminal will already use the thunk. + // Once we're finished, we initialize the cell with the resolved definition. + (Some(thunk), _) => { + eprintln!("{path}: Resolving non-terminal {}...", ident); + + match elem.as_ref() { + Item::Struct { item } => { + let item = item.clone(); + thunk + .as_regular_def() + .set(resolve_sequence_like( + item.enabled, + item.fields, + item.error_recovery, + ctx, + )) + .unwrap(); + } + Item::Enum { item } => { + thunk + .as_regular_def() + .set(resolve_choice(item.clone(), ctx)) + .unwrap(); + } + Item::Repeated { item } => { + thunk + .as_regular_def() + .set(resolve_repeated(item.clone(), ctx)) + .unwrap(); + } + Item::Separated { item } => { + thunk + .as_regular_def() + .set(resolve_separated(item.clone(), ctx)) + .unwrap(); + } + Item::Precedence { item } => { + thunk + .as_precedence_def() + .set(resolve_precedence(item.clone(), lex_ctx, ctx)) + .unwrap(); + } + _ => unreachable!("Only non-terminals can be resolved here"), + }; + + eprintln!("{path}: Resolved {}!", ident); + RESOLVE_PATH.with(|path| path.borrow_mut().pop()); + + ctx.resolved.get(ident).cloned().unwrap() + } + // First time resolving a terminal named `ident` + (None, None) => { + eprintln!("{path}: Resolving terminal {}...", ident); + + let named_scanner = match elem.as_ref() { + Item::Trivia { item } => NamedScanner( + ident.to_string().leak(), + resolve_scanner(item.scanner.clone(), ctx), + ), + Item::Fragment { item } => NamedScanner( + ident.to_string().leak(), + resolve_fragment(item.clone(), ctx), + ), + Item::Token { item } => { + NamedScanner(ident.to_string().leak(), resolve_token(item.clone(), ctx)) + } + Item::Keyword { item } => { + NamedScanner(ident.to_string().leak(), resolve_keyword(item.clone())) + } + _ => unreachable!("Only terminals can be resolved here"), + }; + + let resolved = GrammarElement::ScannerDefinition(Rc::new(named_scanner)); + ctx.resolved.insert(ident.clone(), resolved.clone()); + + eprintln!("{path}: Resolved {}!", ident); + RESOLVE_PATH.with(|path| path.borrow_mut().pop()); + + resolved + } + } +} + +struct ResolveCtx<'a> { + items: &'a HashMap, Rc)>, + resolved: &'a mut HashMap, +} + impl GrammarConstructorDslV2 for codegen_grammar::Grammar { fn from_dsl_v2() -> Rc { let lang = SolidityDefinition::create(); + let mut items = HashMap::new(); + + for section in lang.sections { + for topic in section.topics { + let ctx = topic.lexical_context; + + for item in topic.items { + items.insert(item.name().clone(), (ctx.clone(), Rc::clone(&item))); + } + } + } + + let mut resolved = HashMap::new(); + let mut ctx = ResolveCtx { + items: &items, + resolved: &mut resolved, + }; + + let leading_trivia = Rc::new(NamedTriviaParser( + "LeadingTrivia", + "Default", + resolve_trivia(lang.leading_trivia, &mut ctx), + )) as Rc; + + let trailing_trivia = Rc::new(NamedTriviaParser( + "TrailingTrivia", + "Default", + resolve_trivia(lang.trailing_trivia, &mut ctx), + )) as Rc; + + for (_lex_ctx, item) in items.values() { + resolve_grammar_element(item.name(), &mut ctx); + } + + // HACK: To make sure the unused (not referred to) keywords are included in the scanner literal trie, + // we replicate the DSL v1 behaviour of introducing a synthetic parser that is only meant to group + // keywords by their lexical context. + let mut keywords_per_ctxt = HashMap::new(); + for (ident, (lex_ctx, item)) in &items { + let lex_ctx = lex_ctx.clone().unwrap_or(Identifier::from("Default")); + if let Item::Keyword { .. } = item.as_ref() { + keywords_per_ctxt + .entry(lex_ctx) + .or_insert_with(Vec::new) + .push(ident); + } + } + for (lex_ctx, mut keywords) in keywords_per_ctxt { + keywords.sort_unstable_by_key(|kw| kw.as_str()); + + let parser_name = Identifier::from(format!("{lex_ctx}AllKeywords")); + let all_keywords = model::EnumItem { + name: parser_name.clone(), + enabled: None, + variants: keywords + .iter() + .map(|&ident| model::EnumVariant { + name: Identifier::from("unused"), + enabled: None, + reference: ident.clone(), + }) + .collect(), + }; + + let def = resolve_choice(all_keywords, &mut ctx); + ctx.resolved.insert( + parser_name.clone(), + GrammarElement::ParserDefinition(Rc::new(NamedParserThunk( + parser_name.to_string().leak(), + lex_ctx.to_string().leak(), + OnceCell::from(def), + ))), + ); + } + + let resolved_items = ctx + .resolved + .into_iter() + .map(|(name, elem)| (name.to_string().leak() as &_, elem.clone())); + Rc::new(codegen_grammar::Grammar { name: lang.name.to_string(), versions: BTreeSet::from_iter(lang.versions.into_iter()), - leading_trivia_parser: Rc::new(DummyTriviaParserDef), - trailing_trivia_parser: Rc::new(DummyTriviaParserDef), - elements: HashMap::from_iter([]), + leading_trivia_parser: leading_trivia.clone(), + trailing_trivia_parser: trailing_trivia.clone(), + elements: HashMap::from_iter( + resolved_items.chain( + [leading_trivia, trailing_trivia] + .into_iter() + .map(|elem| (elem.name(), elem.into())), + ), + ), }) } } @@ -189,6 +1024,7 @@ codegen_language_macros::compile!(Language( precedence_expressions = [ PrecedenceExpression( name = VersionPragmaOrExpression, + rule_name = VersionPragmaBinaryExpression, operators = [PrecedenceOperator( model = BinaryLeftAssociative, fields = (operator = Required(Terminal([BarBar]))) @@ -196,6 +1032,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = VersionPragmaRangeExpression, + rule_name = VersionPragmaBinaryExpression, operators = [PrecedenceOperator( model = BinaryLeftAssociative, fields = (operator = Required(Terminal([Minus]))) @@ -203,6 +1040,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = VersionPragmaPrefixExpression, + rule_name = VersionPragmaUnaryExpression, operators = [PrecedenceOperator( model = Prefix, fields = (operator = Required(Terminal([ @@ -450,7 +1288,7 @@ codegen_language_macros::compile!(Language( ), Trivia( name = SingleLineComment, - scanner = Sequence([Atom("//"), ZeroOrMore(Not(['\r', '\n']))]) + scanner = Sequence([Atom("//"), ZeroOrMore(Not(['\n', '\r']))]) ) ] ), @@ -2738,6 +3576,7 @@ codegen_language_macros::compile!(Language( name = TypeName, precedence_expressions = [PrecedenceExpression( name = ArrayTypeName, + rule_name = ArrayTypeName, operators = [PrecedenceOperator( model = Postfix, error_recovery = FieldsErrorRecovery( @@ -3261,6 +4100,7 @@ codegen_language_macros::compile!(Language( precedence_expressions = [ PrecedenceExpression( name = AssignmentExpression, + rule_name = BinaryExpression, operators = [PrecedenceOperator( model = BinaryLeftAssociative, fields = (operator = Required(Terminal([ @@ -3281,6 +4121,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = ConditionalExpression, + rule_name = ConditionalExpression, operators = [PrecedenceOperator( model = Postfix, fields = ( @@ -3293,6 +4134,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = OrExpression, + rule_name = BinaryExpression, operators = [PrecedenceOperator( model = BinaryLeftAssociative, fields = (operator = Required(Terminal([BarBar]))) @@ -3300,6 +4142,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = AndExpression, + rule_name = BinaryExpression, operators = [PrecedenceOperator( model = BinaryLeftAssociative, fields = @@ -3308,6 +4151,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = EqualityExpression, + rule_name = BinaryExpression, operators = [PrecedenceOperator( model = BinaryLeftAssociative, fields = (operator = @@ -3316,6 +4160,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = ComparisonExpression, + rule_name = BinaryExpression, operators = [PrecedenceOperator( model = BinaryLeftAssociative, fields = (operator = Required(Terminal([ @@ -3328,6 +4173,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = BitwiseOrExpression, + rule_name = BinaryExpression, operators = [PrecedenceOperator( model = BinaryLeftAssociative, fields = (operator = Required(Terminal([Bar]))) @@ -3335,6 +4181,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = BitwiseXorExpression, + rule_name = BinaryExpression, operators = [PrecedenceOperator( model = BinaryLeftAssociative, fields = (operator = Required(Terminal([Caret]))) @@ -3342,6 +4189,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = BitwiseAndExpression, + rule_name = BinaryExpression, operators = [PrecedenceOperator( model = BinaryLeftAssociative, fields = (operator = Required(Terminal([Ampersand]))) @@ -3349,6 +4197,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = ShiftExpression, + rule_name = BinaryExpression, operators = [PrecedenceOperator( model = BinaryLeftAssociative, fields = (operator = Required(Terminal([ @@ -3360,6 +4209,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = AdditiveExpression, + rule_name = BinaryExpression, operators = [PrecedenceOperator( model = BinaryLeftAssociative, fields = (operator = Required(Terminal([Plus, Minus]))) @@ -3367,6 +4217,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = MultiplicativeExpression, + rule_name = BinaryExpression, operators = [PrecedenceOperator( model = BinaryLeftAssociative, fields = (operator = @@ -3375,6 +4226,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = ExponentiationExpression, + rule_name = BinaryExpression, operators = [ // Before '0.6.0', it was left-associative: PrecedenceOperator( @@ -3394,6 +4246,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = PostfixExpression, + rule_name = UnaryPostfixExpression, operators = [PrecedenceOperator( model = Postfix, fields = @@ -3402,6 +4255,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = PrefixExpression, + rule_name = UnaryPrefixExpression, operators = [ // Before '0.5.0', 'Plus' was supported: PrecedenceOperator( @@ -3423,6 +4277,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = FunctionCallExpression, + rule_name = FunctionCallExpression, operators = [PrecedenceOperator( model = Postfix, fields = ( @@ -3436,6 +4291,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = MemberAccessExpression, + rule_name = MemberAccessExpression, operators = [PrecedenceOperator( model = Postfix, fields = ( @@ -3447,6 +4303,7 @@ codegen_language_macros::compile!(Language( ), PrecedenceExpression( name = IndexAccessExpression, + rule_name = IndexAccessExpression, operators = [PrecedenceOperator( model = Postfix, error_recovery = FieldsErrorRecovery( @@ -4240,6 +5097,7 @@ codegen_language_macros::compile!(Language( name = YulExpression, precedence_expressions = [PrecedenceExpression( name = YulFunctionCallExpression, + rule_name = YulFunctionCallExpression, operators = [PrecedenceOperator( model = Postfix, error_recovery = FieldsErrorRecovery( diff --git a/crates/solidity/inputs/language/src/dsl.rs b/crates/solidity/inputs/language/src/dsl.rs index a7faf1c95f..ca230ff635 100644 --- a/crates/solidity/inputs/language/src/dsl.rs +++ b/crates/solidity/inputs/language/src/dsl.rs @@ -576,7 +576,7 @@ slang_grammar! { } ; - lexical context VersionPragma = { + lexical context Pragma = { parser VersionPragma = (SolidityKeyword VersionPragmaExpressionsList) ; @@ -601,7 +601,7 @@ slang_grammar! { } ; - lexical context YulBlock = { + lexical context Yul = { inline parser YulKeywordsOverAllVersions = ( BreakKeyword diff --git a/crates/solidity/outputs/cargo/build/src/main.rs b/crates/solidity/outputs/cargo/build/src/main.rs index 7083694d57..d80be72b76 100644 --- a/crates/solidity/outputs/cargo/build/src/main.rs +++ b/crates/solidity/outputs/cargo/build/src/main.rs @@ -1,12 +1,10 @@ -use std::rc::Rc; - use anyhow::Result; use cargo_emit::rerun_if_changed; use codegen_grammar::Grammar; use codegen_parser_generator::code_generator::CodeGenerator; use infra_utils::{cargo::CargoWorkspace, paths::PathExtensions}; -use solidity_language::{GrammarConstructorDslV1, GrammarConstructorDslV2}; +use solidity_language::GrammarConstructorDslV2; // Instead of the soure crate calling codegen APIs directly in the build script, it invokes this binary, which in turn // calls the codegen APIs (and hence why it's emitting `cargo:` directives). @@ -19,13 +17,8 @@ use solidity_language::{GrammarConstructorDslV1, GrammarConstructorDslV2}; fn main() -> Result<()> { // Generate files in the source crate: { - let v1 = Rc::try_unwrap(Grammar::from_dsl_v1()).unwrap(); - let v2 = Rc::try_unwrap(Grammar::from_dsl_v2()).unwrap(); - let grammar = Rc::new(Grammar { - name: v2.name, - versions: v2.versions, - ..v1 - }); + let grammar = Grammar::from_dsl_v2(); + let crate_dir = CargoWorkspace::locate_source_crate("slang_solidity")?; CodeGenerator::write_source(&crate_dir.join("src/generated"), &grammar)?; diff --git a/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs b/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs index 2907502d19..71b66e7a0b 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs @@ -18,144 +18,213 @@ use {napi::bindgen_prelude::*, napi_derive::napi}; #[cfg_attr(not(feature = "slang_napi_interfaces"), derive(Clone, Copy))] pub enum ProductionKind { ABICoderPragma, + AdditiveExpression, AddressType, + AndExpression, ArgumentsDeclaration, ArrayExpression, - ArrayValuesList, - AsciiStringLiteralsList, - AssemblyFlagsList, + ArrayTypeName, + ArrayValues, + AsciiStringLiterals, + AssemblyFlags, + AssemblyFlagsDeclaration, AssemblyStatement, + AssignmentExpression, + BitwiseAndExpression, + BitwiseOrExpression, + BitwiseXorExpression, Block, BreakStatement, CatchClause, CatchClauseError, - CatchClausesList, + CatchClauses, + ComparisonExpression, + ConditionalExpression, ConstantDefinition, - ConstructorAttributesList, + ConstructorAttribute, + ConstructorAttributes, ConstructorDefinition, ContinueStatement, ContractDefinition, - ContractMembersList, - DeconstructionImport, - DeconstructionImportSymbol, - DeconstructionImportSymbolsList, + ContractMember, + ContractMembers, + DecimalNumberExpression, + DefaultAllKeywords, DeleteStatement, DoWhileStatement, + ElementaryType, + ElseBranch, EmitStatement, - EndOfFileTrivia, EnumDefinition, + EnumMembers, + EqualityExpression, ErrorDefinition, ErrorParameter, - ErrorParametersList, + ErrorParameters, + ErrorParametersDeclaration, EventDefinition, EventParameter, - EventParametersList, + EventParameters, + EventParametersDeclaration, + ExperimentalFeature, ExperimentalPragma, + ExponentiationExpression, Expression, ExpressionStatement, - FallbackFunctionAttributesList, + FallbackFunctionAttribute, + FallbackFunctionAttributes, FallbackFunctionDefinition, ForStatement, - FunctionAttributesList, + ForStatementCondition, + ForStatementInitialization, + FunctionAttribute, + FunctionAttributes, + FunctionBody, + FunctionCallExpression, FunctionCallOptions, FunctionDefinition, FunctionType, - FunctionTypeAttributesList, - HexStringLiteralsList, + FunctionTypeAttribute, + FunctionTypeAttributes, + HexNumberExpression, + HexStringLiterals, IdentifierPath, - IdentifierPathsList, - IdentifiersList, IfStatement, + ImportAlias, + ImportDeconstructionField, + ImportDeconstructionFields, ImportDirective, + ImportSymbol, + ImportSymbolDeconstruction, + IndexAccessEnd, + IndexAccessExpression, InheritanceSpecifier, InheritanceType, - InheritanceTypesList, + InheritanceTypes, InterfaceDefinition, - InterfaceMembersList, + InterfaceMembers, LeadingTrivia, LibraryDefinition, - LibraryMembersList, + LibraryMembers, + MappingKey, MappingKeyType, MappingType, - MappingValueType, - ModifierAttributesList, + MappingValue, + MemberAccessExpression, + ModifierAttribute, + ModifierAttributes, ModifierDefinition, ModifierInvocation, + MultiplicativeExpression, NamedArgument, + NamedArgumentGroup, + NamedArgumentGroups, + NamedArguments, NamedArgumentsDeclaration, - NamedArgumentsList, - NamedImport, + NamedImportSymbol, NewExpression, - NumericExpression, + NumberUnit, + OrExpression, + OverridePaths, OverrideSpecifier, Parameter, + Parameters, ParametersDeclaration, - ParametersList, - PathImport, - PositionalArgumentsList, + PathImportSymbol, + PositionalArguments, + PositionalArgumentsDeclaration, + PostfixExpression, + Pragma, + PragmaAllKeywords, PragmaDirective, - ReceiveFunctionAttributesList, + PrefixExpression, + ReceiveFunctionAttribute, + ReceiveFunctionAttributes, ReceiveFunctionDefinition, ReturnStatement, ReturnsDeclaration, RevertStatement, + ShiftExpression, SourceUnit, - SourceUnitMembersList, - StateVariableAttributesList, + SourceUnitMember, + SourceUnitMembers, + StateVariableAttribute, + StateVariableAttributes, StateVariableDefinition, + StateVariableDefinitionValue, Statement, - StatementsList, + Statements, + StorageLocation, + StringExpression, StructDefinition, StructMember, - StructMembersList, + StructMembers, ThrowStatement, TrailingTrivia, TryStatement, TupleDeconstructionStatement, TupleExpression, TupleMember, - TupleMembersList, - TupleValuesList, + TupleMemberDeconstruction, + TupleMembersDeconstruction, + TupleValue, + TupleValues, TypeExpression, TypeName, + TypedTupleMember, UncheckedBlock, - UnicodeStringLiteralsList, - UnnamedFunctionAttributesList, + UnicodeStringLiterals, + UnnamedFunctionAttribute, + UnnamedFunctionAttributes, UnnamedFunctionDefinition, + UntypedTupleMember, UserDefinedValueTypeDefinition, + UsingAlias, + UsingDeconstructionField, + UsingDeconstructionFields, UsingDirective, - UsingDirectiveDeconstruction, - UsingDirectivePath, - UsingDirectiveSymbol, - UsingDirectiveSymbolsList, - VariableDeclaration, + UsingSymbol, + UsingSymbolDeconstruction, + UsingTarget, VariableDeclarationStatement, + VariableDeclarationType, + VariableDeclarationValue, VersionPragma, VersionPragmaExpression, - VersionPragmaExpressionsList, + VersionPragmaExpressions, + VersionPragmaOrExpression, + VersionPragmaPrefixExpression, + VersionPragmaRangeExpression, VersionPragmaSpecifier, WhileStatement, + YulAllKeywords, + YulArguments, YulAssignmentStatement, YulBlock, YulBreakStatement, YulContinueStatement, - YulDeclarationStatement, + YulDefaultCase, YulExpression, - YulExpressionsList, YulForStatement, + YulFunctionCallExpression, YulFunctionDefinition, YulIdentifierPath, - YulIdentifierPathsList, - YulIdentifiersList, + YulIdentifierPaths, YulIfStatement, YulLeaveStatement, + YulLiteral, + YulParameters, YulParametersDeclaration, + YulReturnVariables, YulReturnsDeclaration, YulStatement, - YulStatementsList, + YulStatements, YulSwitchCase, - YulSwitchCasesList, + YulSwitchCases, YulSwitchStatement, + YulValueCase, + YulVariableDeclarationStatement, + YulVariableDeclarationValue, } #[derive( @@ -173,161 +242,223 @@ pub enum ProductionKind { #[cfg_attr(not(feature = "slang_napi_interfaces"), derive(Clone, Copy))] pub enum RuleKind { ABICoderPragma, + AdditiveExpression, AddressType, + AndExpression, ArgumentsDeclaration, ArrayExpression, ArrayTypeName, - ArrayValuesList, - AsciiStringLiteralsList, - AssemblyFlagsList, + ArrayValues, + AsciiStringLiterals, + AssemblyFlags, + AssemblyFlagsDeclaration, AssemblyStatement, + AssignmentExpression, BinaryExpression, + BitwiseAndExpression, + BitwiseOrExpression, + BitwiseXorExpression, Block, BreakStatement, CatchClause, CatchClauseError, - CatchClausesList, + CatchClauses, + ComparisonExpression, ConditionalExpression, ConstantDefinition, - ConstructorAttributesList, + ConstructorAttribute, + ConstructorAttributes, ConstructorDefinition, ContinueStatement, ContractDefinition, - ContractMembersList, - DeconstructionImport, - DeconstructionImportSymbol, - DeconstructionImportSymbolsList, + ContractMember, + ContractMembers, + DecimalNumberExpression, + DefaultAllKeywords, DeleteStatement, DoWhileStatement, + ElementaryType, + ElseBranch, EmitStatement, - EndOfFileTrivia, EnumDefinition, + EnumMembers, + EqualityExpression, ErrorDefinition, ErrorParameter, - ErrorParametersList, + ErrorParameters, + ErrorParametersDeclaration, EventDefinition, EventParameter, - EventParametersList, + EventParameters, + EventParametersDeclaration, + ExperimentalFeature, ExperimentalPragma, + ExponentiationExpression, Expression, ExpressionStatement, - FallbackFunctionAttributesList, + FallbackFunctionAttribute, + FallbackFunctionAttributes, FallbackFunctionDefinition, ForStatement, - FunctionAttributesList, + ForStatementCondition, + ForStatementInitialization, + FunctionAttribute, + FunctionAttributes, + FunctionBody, FunctionCallExpression, FunctionCallOptions, FunctionDefinition, FunctionType, - FunctionTypeAttributesList, - HexStringLiteralsList, + FunctionTypeAttribute, + FunctionTypeAttributes, + HexNumberExpression, + HexStringLiterals, IdentifierPath, - IdentifierPathsList, - IdentifiersList, IfStatement, + ImportAlias, + ImportDeconstructionField, + ImportDeconstructionFields, ImportDirective, + ImportSymbol, + ImportSymbolDeconstruction, + IndexAccessEnd, IndexAccessExpression, InheritanceSpecifier, InheritanceType, - InheritanceTypesList, + InheritanceTypes, InterfaceDefinition, - InterfaceMembersList, + InterfaceMembers, LeadingTrivia, LibraryDefinition, - LibraryMembersList, + LibraryMembers, + MappingKey, MappingKeyType, MappingType, - MappingValueType, + MappingValue, MemberAccessExpression, - ModifierAttributesList, + ModifierAttribute, + ModifierAttributes, ModifierDefinition, ModifierInvocation, + MultiplicativeExpression, NamedArgument, + NamedArgumentGroup, + NamedArgumentGroups, + NamedArguments, NamedArgumentsDeclaration, - NamedArgumentsList, - NamedImport, + NamedImportSymbol, NewExpression, - NumericExpression, + NumberUnit, + OrExpression, + OverridePaths, OverrideSpecifier, Parameter, + Parameters, ParametersDeclaration, - ParametersList, - PathImport, - PositionalArgumentsList, + PathImportSymbol, + PositionalArguments, + PositionalArgumentsDeclaration, + PostfixExpression, + Pragma, + PragmaAllKeywords, PragmaDirective, - ReceiveFunctionAttributesList, + PrefixExpression, + ReceiveFunctionAttribute, + ReceiveFunctionAttributes, ReceiveFunctionDefinition, ReturnStatement, ReturnsDeclaration, RevertStatement, + ShiftExpression, SourceUnit, - SourceUnitMembersList, - StateVariableAttributesList, + SourceUnitMember, + SourceUnitMembers, + StateVariableAttribute, + StateVariableAttributes, StateVariableDefinition, + StateVariableDefinitionValue, Statement, - StatementsList, + Statements, + StorageLocation, + StringExpression, StructDefinition, StructMember, - StructMembersList, + StructMembers, ThrowStatement, TrailingTrivia, TryStatement, TupleDeconstructionStatement, TupleExpression, TupleMember, - TupleMembersList, - TupleValuesList, + TupleMemberDeconstruction, + TupleMembersDeconstruction, + TupleValue, + TupleValues, TypeExpression, TypeName, + TypedTupleMember, UnaryPostfixExpression, UnaryPrefixExpression, UncheckedBlock, - UnicodeStringLiteralsList, - UnnamedFunctionAttributesList, + UnicodeStringLiterals, + UnnamedFunctionAttribute, + UnnamedFunctionAttributes, UnnamedFunctionDefinition, + UntypedTupleMember, UserDefinedValueTypeDefinition, + UsingAlias, + UsingDeconstructionField, + UsingDeconstructionFields, UsingDirective, - UsingDirectiveDeconstruction, - UsingDirectivePath, - UsingDirectiveSymbol, - UsingDirectiveSymbolsList, - VariableDeclaration, + UsingSymbol, + UsingSymbolDeconstruction, + UsingTarget, VariableDeclarationStatement, + VariableDeclarationType, + VariableDeclarationValue, VersionPragma, VersionPragmaBinaryExpression, VersionPragmaExpression, - VersionPragmaExpressionsList, + VersionPragmaExpressions, + VersionPragmaOrExpression, + VersionPragmaPrefixExpression, + VersionPragmaRangeExpression, VersionPragmaSpecifier, VersionPragmaUnaryExpression, WhileStatement, + YulAllKeywords, + YulArguments, YulAssignmentStatement, YulBlock, YulBreakStatement, YulContinueStatement, - YulDeclarationStatement, + YulDefaultCase, YulExpression, - YulExpressionsList, YulForStatement, YulFunctionCallExpression, YulFunctionDefinition, YulIdentifierPath, - YulIdentifierPathsList, - YulIdentifiersList, + YulIdentifierPaths, YulIfStatement, YulLeaveStatement, + YulLiteral, + YulParameters, YulParametersDeclaration, + YulReturnVariables, YulReturnsDeclaration, YulStatement, - YulStatementsList, + YulStatements, YulSwitchCase, - YulSwitchCasesList, + YulSwitchCases, YulSwitchStatement, + YulValueCase, + YulVariableDeclarationStatement, + YulVariableDeclarationValue, } impl RuleKind { pub fn is_trivia(&self) -> bool { match self { - Self::EndOfFileTrivia => true, Self::LeadingTrivia => true, Self::TrailingTrivia => true, _ => false, @@ -350,7 +481,7 @@ impl RuleKind { #[cfg_attr(not(feature = "slang_napi_interfaces"), derive(Clone, Copy))] pub enum TokenKind { SKIPPED, - ABICoderKeyword, + AbicoderKeyword, AbstractKeyword, AddressKeyword, AfterKeyword, @@ -375,7 +506,8 @@ pub enum TokenKind { BoolKeyword, BreakKeyword, ByteKeyword, - CalldataKeyword, + BytesKeyword, + CallDataKeyword, Caret, CaretEqual, CaseKeyword, @@ -390,7 +522,7 @@ pub enum TokenKind { ConstructorKeyword, ContinueKeyword, ContractKeyword, - CopyofKeyword, + CopyOfKeyword, DaysKeyword, DecimalLiteral, DefaultKeyword, @@ -413,7 +545,7 @@ pub enum TokenKind { FalseKeyword, FinalKeyword, FinneyKeyword, - FixedBytesType, + FixedKeyword, ForKeyword, FromKeyword, FunctionKeyword, @@ -437,10 +569,10 @@ pub enum TokenKind { InKeyword, IndexedKeyword, InlineKeyword, + IntKeyword, InterfaceKeyword, InternalKeyword, IsKeyword, - LeaveKeyword, LessThan, LessThanEqual, LessThanLessThan, @@ -489,10 +621,8 @@ pub enum TokenKind { SealedKeyword, SecondsKeyword, Semicolon, - SignedFixedType, - SignedIntegerType, SingleLineComment, - SizeofKeyword, + SizeOfKeyword, Slash, SlashEqual, SolidityKeyword, @@ -507,13 +637,13 @@ pub enum TokenKind { Tilde, TrueKeyword, TryKeyword, + TypeDefKeyword, TypeKeyword, - TypedefKeyword, - TypeofKeyword, + TypeOfKeyword, + UfixedKeyword, + UintKeyword, UncheckedKeyword, UnicodeStringLiteral, - UnsignedFixedType, - UnsignedIntegerType, UsingKeyword, VarKeyword, VersionPragmaValue, @@ -524,9 +654,116 @@ pub enum TokenKind { WhileKeyword, Whitespace, YearsKeyword, + YulAbstractKeyword, + YulAddressKeyword, + YulAfterKeyword, + YulAliasKeyword, + YulAnonymousKeyword, + YulApplyKeyword, + YulAsKeyword, + YulAssemblyKeyword, + YulAutoKeyword, + YulBoolKeyword, + YulBreakKeyword, + YulByteKeyword, + YulBytesKeyword, + YulCallDataKeyword, + YulCaseKeyword, + YulCatchKeyword, + YulConstantKeyword, + YulConstructorKeyword, + YulContinueKeyword, + YulContractKeyword, + YulCopyOfKeyword, + YulDaysKeyword, YulDecimalLiteral, + YulDefaultKeyword, + YulDefineKeyword, + YulDeleteKeyword, + YulDoKeyword, + YulElseKeyword, + YulEmitKeyword, + YulEnumKeyword, + YulEtherKeyword, + YulEventKeyword, + YulExternalKeyword, + YulFallbackKeyword, + YulFalseKeyword, + YulFinalKeyword, + YulFinneyKeyword, + YulFixedKeyword, + YulForKeyword, + YulFunctionKeyword, + YulGweiKeyword, + YulHexKeyword, YulHexLiteral, + YulHoursKeyword, YulIdentifier, + YulIfKeyword, + YulImmutableKeyword, + YulImplementsKeyword, + YulImportKeyword, + YulInKeyword, + YulIndexedKeyword, + YulInlineKeyword, + YulIntKeyword, + YulInterfaceKeyword, + YulInternalKeyword, + YulIsKeyword, + YulLeaveKeyword, + YulLetKeyword, + YulLibraryKeyword, + YulMacroKeyword, + YulMappingKeyword, + YulMatchKeyword, + YulMemoryKeyword, + YulMinutesKeyword, + YulModifierKeyword, + YulMutableKeyword, + YulNewKeyword, + YulNullKeyword, + YulOfKeyword, + YulOverrideKeyword, + YulPartialKeyword, + YulPayableKeyword, + YulPragmaKeyword, + YulPrivateKeyword, + YulPromiseKeyword, + YulPublicKeyword, + YulPureKeyword, + YulReceiveKeyword, + YulReferenceKeyword, + YulRelocatableKeyword, + YulReturnKeyword, + YulReturnsKeyword, + YulRevertKeyword, + YulSealedKeyword, + YulSecondsKeyword, + YulSizeOfKeyword, + YulStaticKeyword, + YulStorageKeyword, + YulStringKeyword, + YulStructKeyword, + YulSupportsKeyword, + YulSwitchKeyword, + YulSzaboKeyword, + YulThrowKeyword, + YulTrueKeyword, + YulTryKeyword, + YulTypeDefKeyword, + YulTypeKeyword, + YulTypeOfKeyword, + YulUfixedKeyword, + YulUintKeyword, + YulUncheckedKeyword, + YulUsingKeyword, + YulVarKeyword, + YulViewKeyword, + YulVirtualKeyword, + YulWeeksKeyword, + YulWeiKeyword, + YulWhileKeyword, + YulYearsKeyword, } #[derive(strum_macros::FromRepr)] @@ -535,8 +772,8 @@ pub enum TokenKind { #[cfg_attr(not(feature = "slang_napi_interfaces"), derive(Clone, Copy))] pub enum LexicalContext { Default, - VersionPragma, - YulBlock, + Pragma, + Yul, } /// Marker trait for type-level [`LexicalContext`] variants. @@ -554,16 +791,16 @@ pub mod LexicalContextType { LexicalContext::Default } } - pub struct VersionPragma {} - impl IsLexicalContext for VersionPragma { + pub struct Pragma {} + impl IsLexicalContext for Pragma { fn value() -> LexicalContext { - LexicalContext::VersionPragma + LexicalContext::Pragma } } - pub struct YulBlock {} - impl IsLexicalContext for YulBlock { + pub struct Yul {} + impl IsLexicalContext for Yul { fn value() -> LexicalContext { - LexicalContext::YulBlock + LexicalContext::Yul } } } diff --git a/crates/solidity/outputs/cargo/crate/src/generated/language.rs b/crates/solidity/outputs/cargo/crate/src/generated/language.rs index 5068f4002e..70b35a3c9b 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/language.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/language.rs @@ -21,13 +21,16 @@ use super::napi::napi_parse_output::ParseOutput as NAPIParseOutput; #[cfg_attr(feature = "slang_napi_interfaces", napi(namespace = "language"))] pub struct Language { pub(crate) version: Version, + pub(crate) version_is_at_least_0_4_14: bool, pub(crate) version_is_at_least_0_4_21: bool, pub(crate) version_is_at_least_0_4_22: bool, pub(crate) version_is_at_least_0_5_0: bool, pub(crate) version_is_at_least_0_5_3: bool, + pub(crate) version_is_at_least_0_5_10: bool, pub(crate) version_is_at_least_0_6_0: bool, pub(crate) version_is_at_least_0_6_2: bool, pub(crate) version_is_at_least_0_6_5: bool, + pub(crate) version_is_at_least_0_6_8: bool, pub(crate) version_is_at_least_0_6_11: bool, pub(crate) version_is_at_least_0_7_0: bool, pub(crate) version_is_at_least_0_7_1: bool, @@ -142,13 +145,16 @@ impl Language { pub fn new(version: Version) -> std::result::Result { if Self::SUPPORTED_VERSIONS.binary_search(&version).is_ok() { Ok(Self { + version_is_at_least_0_4_14: Version::new(0, 4, 14) <= version, version_is_at_least_0_4_21: Version::new(0, 4, 21) <= version, version_is_at_least_0_4_22: Version::new(0, 4, 22) <= version, version_is_at_least_0_5_0: Version::new(0, 5, 0) <= version, version_is_at_least_0_5_3: Version::new(0, 5, 3) <= version, + version_is_at_least_0_5_10: Version::new(0, 5, 10) <= version, version_is_at_least_0_6_0: Version::new(0, 6, 0) <= version, version_is_at_least_0_6_2: Version::new(0, 6, 2) <= version, version_is_at_least_0_6_5: Version::new(0, 6, 5) <= version, + version_is_at_least_0_6_8: Version::new(0, 6, 8) <= version, version_is_at_least_0_6_11: Version::new(0, 6, 11) <= version, version_is_at_least_0_7_0: Version::new(0, 7, 0) <= version, version_is_at_least_0_7_1: Version::new(0, 7, 1) <= version, @@ -178,11 +184,11 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn abi_coder_pragma(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + seq.elem(self.parse_token_with_trivia::( input, - TokenKind::ABICoderKeyword, + TokenKind::AbicoderKeyword, ))?; - seq.elem(self.parse_token_with_trivia::( + seq.elem(self.parse_token_with_trivia::( input, TokenKind::Identifier, ))?; @@ -192,67 +198,87 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn address_type(&self, input: &mut ParserContext) -> ParserResult { + fn additive_expression(&self, input: &mut ParserContext) -> ParserResult { ChoiceHelper::run(input, |mut choice, input| { - let result = SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::AddressKeyword, - ))?; - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ), - ))?; - seq.finish() - }); + let result = + self.parse_token_with_trivia::(input, TokenKind::Plus); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); + let result = self + .parse_token_with_trivia::(input, TokenKind::Minus); choice.consider(input, result)?; choice.finish(input) }) + .with_kind(RuleKind::AdditiveExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn address_type(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::AddressKeyword, + ))?; + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ), + ))?; + seq.finish() + }) .with_kind(RuleKind::AddressType) } + #[allow(unused_assignments, unused_parens)] + fn and_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::( + input, + TokenKind::AmpersandAmpersand, + ) + .with_kind(RuleKind::AndExpression) + } + #[allow(unused_assignments, unused_parens)] fn arguments_declaration(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.positional_arguments_declaration(input); + choice.consider(input, result)?; + let result = self.named_arguments_declaration(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ArgumentsDeclaration) + } + + #[allow(unused_assignments, unused_parens)] + fn array_expression(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let mut delim_guard = input.open_delim(TokenKind::CloseBracket); let input = delim_guard.ctx(); seq.elem(self.parse_token_with_trivia::( input, - TokenKind::OpenParen, + TokenKind::OpenBracket, ))?; seq.elem( - OptionalHelper::transform(ChoiceHelper::run(input, |mut choice, input| { - let result = self.positional_arguments_list(input); - choice.consider(input, result)?; - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - choice.finish(input) - })) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), + self.array_values(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBracket, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::CloseParen, + TokenKind::CloseBracket, ))?; seq.finish() }) - .with_kind(RuleKind::ArgumentsDeclaration) + .with_kind(RuleKind::ArrayExpression) } #[allow(unused_assignments, unused_parens)] - fn array_expression(&self, input: &mut ParserContext) -> ParserResult { + fn array_type_name(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { let mut delim_guard = input.open_delim(TokenKind::CloseBracket); let input = delim_guard.ctx(); @@ -261,7 +287,7 @@ impl Language { TokenKind::OpenBracket, ))?; seq.elem( - self.array_values_list(input) + OptionalHelper::transform(self.expression(input)) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, @@ -275,88 +301,182 @@ impl Language { ))?; seq.finish() }) - .with_kind(RuleKind::ArrayExpression) + .with_kind(RuleKind::ArrayTypeName) } #[allow(unused_assignments, unused_parens)] - fn array_values_list(&self, input: &mut ParserContext) -> ParserResult { + fn array_values(&self, input: &mut ParserContext) -> ParserResult { SeparatedHelper::run::<_, LexicalContextType::Default>( input, self, |input| self.expression(input), TokenKind::Comma, ) - .with_kind(RuleKind::ArrayValuesList) + .with_kind(RuleKind::ArrayValues) } #[allow(unused_assignments, unused_parens)] - fn ascii_string_literals_list(&self, input: &mut ParserContext) -> ParserResult { + fn ascii_string_literals(&self, input: &mut ParserContext) -> ParserResult { OneOrMoreHelper::run(input, |input| { self.parse_token_with_trivia::( input, TokenKind::AsciiStringLiteral, ) }) - .with_kind(RuleKind::AsciiStringLiteralsList) + .with_kind(RuleKind::AsciiStringLiterals) } #[allow(unused_assignments, unused_parens)] - fn assembly_flags_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( + fn assembly_flags(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Yul>( input, self, |input| { - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::AsciiStringLiteral, ) }, TokenKind::Comma, - ) - .with_kind(RuleKind::AssemblyFlagsList) + )) + .with_kind(RuleKind::AssemblyFlags) + } + + #[allow(unused_assignments, unused_parens)] + fn assembly_flags_declaration(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem( + self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ), + )?; + seq.elem( + self.assembly_flags(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Yul>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem( + self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ), + )?; + seq.finish() + }) + .with_kind(RuleKind::AssemblyFlagsDeclaration) } #[allow(unused_assignments, unused_parens)] fn assembly_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + seq.elem(self.parse_token_with_trivia::( input, TokenKind::AssemblyKeyword, ))?; seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::AsciiStringLiteral, ), ))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - self.assembly_flags_list(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - })))?; + seq.elem(OptionalHelper::transform( + self.assembly_flags_declaration(input), + ))?; seq.elem(self.yul_block(input))?; seq.finish() }) .with_kind(RuleKind::AssemblyStatement) } + #[allow(unused_assignments, unused_parens)] + fn assignment_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::(input, TokenKind::Equal); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::BarEqual); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PlusEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinusEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::CaretEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SlashEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PercentEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AmpersandEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanLessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThanGreaterThanEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::AssignmentExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn bitwise_and_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::(input, TokenKind::Ampersand) + .with_kind(RuleKind::BitwiseAndExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn bitwise_or_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::(input, TokenKind::Bar) + .with_kind(RuleKind::BitwiseOrExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn bitwise_xor_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::(input, TokenKind::Caret) + .with_kind(RuleKind::BitwiseXorExpression) + } + #[allow(unused_assignments, unused_parens)] fn block(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -367,7 +487,7 @@ impl Language { TokenKind::OpenBrace, ))?; seq.elem( - OptionalHelper::transform(self.statements_list(input)) + self.statements(input) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, @@ -446,13 +566,59 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn catch_clauses_list(&self, input: &mut ParserContext) -> ParserResult { + fn catch_clauses(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_6_0 { OneOrMoreHelper::run(input, |input| self.catch_clause(input)) } else { ParserResult::disabled() } - .with_kind(RuleKind::CatchClausesList) + .with_kind(RuleKind::CatchClauses) + } + + #[allow(unused_assignments, unused_parens)] + fn comparison_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::(input, TokenKind::LessThan); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ComparisonExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn conditional_expression(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::QuestionMark, + ))?; + seq.elem(self.expression(input))?; + seq.elem( + self.parse_token_with_trivia::( + input, + TokenKind::Colon, + ), + )?; + seq.elem(self.expression(input))?; + seq.finish() + }) + .with_kind(RuleKind::ConditionalExpression) } #[allow(unused_assignments, unused_parens)] @@ -497,52 +663,51 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn constructor_attributes_list(&self, input: &mut ParserContext) -> ParserResult { + fn constructor_attribute(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_4_22 { - OneOrMoreHelper::run(input, |input| { - if self.version_is_at_least_0_4_22 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PublicKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) } else { ParserResult::disabled() } - .with_kind(RuleKind::ConstructorAttributesList) + .with_kind(RuleKind::ConstructorAttribute) } #[allow(unused_assignments, unused_parens)] - fn constructor_definition(&self, input: &mut ParserContext) -> ParserResult { + fn constructor_attributes(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_4_22 { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::ConstructorKeyword, - ))?; - seq.elem(self.parameters_declaration(input))?; - seq.elem(OptionalHelper::transform( - self.constructor_attributes_list(input), + ZeroOrMoreHelper::run(input, |input| self.constructor_attribute(input)) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ConstructorAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn constructor_definition(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_4_22 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ConstructorKeyword, ))?; + seq.elem(self.parameters_declaration(input))?; + seq.elem(self.constructor_attributes(input))?; seq.elem(self.block(input))?; seq.finish() }) @@ -604,13 +769,13 @@ impl Language { TokenKind::OpenBrace, ))?; seq.elem( - OptionalHelper::transform(self.contract_members_list(input)) + self.contract_members(input) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, - ), + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, @@ -624,1174 +789,2647 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn contract_members_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive(input); - choice.consider(input, result)?; - let result = self.function_definition(input); + fn contract_member(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.using_directive(input); + choice.consider(input, result)?; + let result = self.function_definition(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_4_22 { + let result = self.constructor_definition(input); choice.consider(input, result)?; - let result = self.modifier_definition(input); + } + if self.version_is_at_least_0_6_0 { + let result = self.receive_function_definition(input); choice.consider(input, result)?; - let result = self.struct_definition(input); + } + if self.version_is_at_least_0_6_0 { + let result = self.fallback_function_definition(input); choice.consider(input, result)?; - let result = self.enum_definition(input); + } + if !self.version_is_at_least_0_6_0 { + let result = self.unnamed_function_definition(input); choice.consider(input, result)?; - let result = self.event_definition(input); + } + let result = self.modifier_definition(input); + choice.consider(input, result)?; + let result = self.struct_definition(input); + choice.consider(input, result)?; + let result = self.enum_definition(input); + choice.consider(input, result)?; + let result = self.event_definition(input); + choice.consider(input, result)?; + let result = self.state_variable_definition(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_8_4 { + let result = self.error_definition(input); choice.consider(input, result)?; - let result = self.state_variable_definition(input); + } + if self.version_is_at_least_0_8_8 { + let result = self.user_defined_value_type_definition(input); choice.consider(input, result)?; - if self.version_is_at_least_0_4_22 { - let result = self.constructor_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.fallback_function_definition(input); - choice.consider(input, result)?; - let result = self.receive_function_definition(input); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_6_0 { - let result = self.unnamed_function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + choice.finish(input) }) - .with_kind(RuleKind::ContractMembersList) + .with_kind(RuleKind::ContractMember) } #[allow(unused_assignments, unused_parens)] - fn deconstruction_import(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; - seq.elem( - self.deconstruction_import_symbols_list(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseBrace, - ))?; - seq.finish() - }))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::FromKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ))?; - seq.finish() - }) - .with_kind(RuleKind::DeconstructionImport) + fn contract_members(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.contract_member(input)) + .with_kind(RuleKind::ContractMembers) } #[allow(unused_assignments, unused_parens)] - fn deconstruction_import_symbol(&self, input: &mut ParserContext) -> ParserResult { + fn decimal_number_expression(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Identifier, + TokenKind::DecimalLiteral, ))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::AsKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.finish() - })))?; + seq.elem(OptionalHelper::transform(self.number_unit(input)))?; seq.finish() }) - .with_kind(RuleKind::DeconstructionImportSymbol) - } - - #[allow(unused_assignments, unused_parens)] - fn deconstruction_import_symbols_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.deconstruction_import_symbol(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::DeconstructionImportSymbolsList) + .with_kind(RuleKind::DecimalNumberExpression) } #[allow(unused_assignments, unused_parens)] - fn delete_statement(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::DeleteKeyword, - ))?; - seq.elem(self.expression(input))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + fn default_all_keywords(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - .with_kind(RuleKind::DeleteStatement) - } - - #[allow(unused_assignments, unused_parens)] - fn do_while_statement(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::DoKeyword, - ))?; - seq.elem(self.statement(input))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::WhileKeyword, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - self.expression(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::AbstractKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - .with_kind(RuleKind::DoWhileStatement) - } - - #[allow(unused_assignments, unused_parens)] - fn emit_statement(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_4_21 { - SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::EmitKeyword, - ))?; - seq.elem(self.identifier_path(input))?; - seq.elem(self.arguments_declaration(input))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::EmitStatement) - } - - #[allow(unused_assignments, unused_parens)] - fn end_of_file_trivia(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = - self.parse_token::(input, TokenKind::Whitespace); - choice.consider(input, result)?; - let result = - self.parse_token::(input, TokenKind::EndOfLine); - choice.consider(input, result)?; - let result = self - .parse_token::(input, TokenKind::MultilineComment); - choice.consider(input, result)?; - let result = self.parse_token::( - input, - TokenKind::SingleLineComment, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - }) - .with_kind(RuleKind::EndOfFileTrivia) - } - - #[allow(unused_assignments, unused_parens)] - fn enum_definition(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + TokenKind::AddressKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::EnumKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::AfterKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Identifier, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; - seq.elem( - OptionalHelper::transform(self.identifiers_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseBrace, - ))?; - seq.finish() - }))?; - seq.finish() - }) - .with_kind(RuleKind::EnumDefinition) - } - - #[allow(unused_assignments, unused_parens)] - fn error_definition(&self, input: &mut ParserContext) -> ParserResult { - if self . version_is_at_least_0_8_4 { SequenceHelper :: run (| mut seq | { seq . elem (SequenceHelper :: run (| mut seq | { seq . elem (self . parse_token_with_trivia :: < LexicalContextType :: Default > (input , TokenKind :: ErrorKeyword)) ? ; seq . elem (self . parse_token_with_trivia :: < LexicalContextType :: Default > (input , TokenKind :: Identifier)) ? ; seq . elem (SequenceHelper :: run (| mut seq | { let mut delim_guard = input . open_delim (TokenKind :: CloseParen) ; let input = delim_guard . ctx () ; seq . elem (self . parse_token_with_trivia :: < LexicalContextType :: Default > (input , TokenKind :: OpenParen)) ? ; seq . elem (OptionalHelper :: transform (self . error_parameters_list (input)) . recover_until_with_nested_delims :: < _ , LexicalContextType :: Default > (input , self , TokenKind :: CloseParen , RecoverFromNoMatch :: Yes ,)) ? ; seq . elem (self . parse_token_with_trivia :: < LexicalContextType :: Default > (input , TokenKind :: CloseParen)) ? ; seq . finish () })) ? ; seq . finish () }) . recover_until_with_nested_delims :: < _ , LexicalContextType :: Default > (input , self , TokenKind :: Semicolon , RecoverFromNoMatch :: No ,)) ? ; seq . elem (self . parse_token_with_trivia :: < LexicalContextType :: Default > (input , TokenKind :: Semicolon)) ? ; seq . finish () }) } else { ParserResult :: disabled () } . with_kind (RuleKind :: ErrorDefinition) - } - - #[allow(unused_assignments, unused_parens)] - fn error_parameter(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_8_4 { - SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ), - ))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::ErrorParameter) - } - - #[allow(unused_assignments, unused_parens)] - fn error_parameters_list(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_8_4 { - SeparatedHelper::run::<_, LexicalContextType::Default>( + TokenKind::AliasKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - self, - |input| self.error_parameter(input), - TokenKind::Comma, - ) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::ErrorParametersList) - } - - #[allow(unused_assignments, unused_parens)] - fn event_definition(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::EventKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - OptionalHelper::transform(self.event_parameters_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::AnonymousKeyword, - ), - ))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::AnonymousKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - .with_kind(RuleKind::EventDefinition) - } - - #[allow(unused_assignments, unused_parens)] - fn event_parameter(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::IndexedKeyword, - ), - ))?; - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ), - ))?; - seq.finish() - }) - .with_kind(RuleKind::EventParameter) - } - - #[allow(unused_assignments, unused_parens)] - fn event_parameters_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.event_parameter(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::EventParametersList) - } - - #[allow(unused_assignments, unused_parens)] - fn experimental_pragma(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + TokenKind::ApplyKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::ExperimentalKeyword, - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.finish() - }) - .with_kind(RuleKind::ExperimentalPragma) - } - - #[allow(unused_assignments, unused_parens)] - fn expression(&self, input: &mut ParserContext) -> ParserResult { - let parse_assignment_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 1u8, - 1u8 + 1, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Equal, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::BarEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PlusEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::MinusEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::CaretEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::SlashEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PercentEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsteriskEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AmpersandEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThanLessThanEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThanGreaterThanEqual, - ); + TokenKind::AsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AssemblyKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AutoKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BoolKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BreakKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ByteKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BytesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::CallDataKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::CaseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::CatchKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ConstantKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ConstructorKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ContinueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ContractKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::CopyOfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::DaysKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::DefaultKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::DefineKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::DeleteKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::DoKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ElseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::EmitKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::EnumKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ErrorKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::EtherKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::EventKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FallbackKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FalseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FinalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FinneyKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FixedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ForKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FromKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FunctionKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GlobalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GweiKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::HexKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::HoursKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::IfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ImmutableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ImplementsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ImportKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::IndexedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InlineKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::IntKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InterfaceKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::IsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LetKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LibraryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MacroKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MappingKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MatchKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MemoryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinutesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ModifierKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MutableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::NewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::NullKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::OfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::OverrideKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PartialKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PragmaKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PromiseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ReceiveKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ReferenceKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::RelocatableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ReturnKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ReturnsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::RevertKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SealedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SecondsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SizeOfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StaticKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StorageKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StringKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StructKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SupportsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SwitchKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SzaboKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ThrowKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::TrueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::TryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::TypeDefKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::TypeKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::TypeOfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UfixedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UintKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UncheckedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UsingKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::VarKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::WeeksKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::WeiKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::WhileKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YearsKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::DefaultAllKeywords) + } + + #[allow(unused_assignments, unused_parens)] + fn delete_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::DeleteKeyword, + ))?; + seq.elem(self.expression(input))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + .with_kind(RuleKind::DeleteStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn do_while_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::DoKeyword, + ))?; + seq.elem(self.statement(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::WhileKeyword, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + self.expression(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + .with_kind(RuleKind::DoWhileStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn elementary_type(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::BoolKeyword, + ); + choice.consider(input, result)?; + if !self.version_is_at_least_0_8_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::ByteKeyword, + ); + choice.consider(input, result)?; + } + let result = self.parse_token_with_trivia::( + input, + TokenKind::StringKeyword, + ); + choice.consider(input, result)?; + let result = self.address_type(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BytesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::IntKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UintKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FixedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UfixedKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ElementaryType) + } + + #[allow(unused_assignments, unused_parens)] + fn else_branch(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::ElseKeyword, + ), + ))?; + seq.elem(OptionalHelper::transform(self.statement(input)))?; + seq.finish() + }) + .with_kind(RuleKind::ElseBranch) + } + + #[allow(unused_assignments, unused_parens)] + fn emit_statement(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_4_21 { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::EmitKeyword, + ))?; + seq.elem(self.identifier_path(input))?; + seq.elem(self.arguments_declaration(input))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::EmitStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn enum_definition(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::EnumKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBrace, + ))?; + seq.elem( + self.enum_members(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBrace, + ))?; + seq.finish() + }))?; + seq.finish() + }) + .with_kind(RuleKind::EnumDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn enum_members(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| { + self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ) + }, + TokenKind::Comma, + )) + .with_kind(RuleKind::EnumMembers) + } + + #[allow(unused_assignments, unused_parens)] + fn equality_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::EqualEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BangEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::EqualityExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn error_definition(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_4 { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ErrorKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(self.error_parameters_declaration(input))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ErrorDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn error_parameter(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_4 { + SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ), + ))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ErrorParameter) + } + + #[allow(unused_assignments, unused_parens)] + fn error_parameters(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_4 { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.error_parameter(input), + TokenKind::Comma, + )) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ErrorParameters) + } + + #[allow(unused_assignments, unused_parens)] + fn error_parameters_declaration(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_4 { + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + self.error_parameters(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ErrorParametersDeclaration) + } + + #[allow(unused_assignments, unused_parens)] + fn event_definition(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::EventKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(OptionalHelper::transform( + self.event_parameters_declaration(input), + ))?; + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::AnonymousKeyword, + ), + ))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + .with_kind(RuleKind::EventDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn event_parameter(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::IndexedKeyword, + ), + ))?; + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ), + ))?; + seq.finish() + }) + .with_kind(RuleKind::EventParameter) + } + + #[allow(unused_assignments, unused_parens)] + fn event_parameters(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.event_parameter(input), + TokenKind::Comma, + )) + .with_kind(RuleKind::EventParameters) + } + + #[allow(unused_assignments, unused_parens)] + fn event_parameters_declaration(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + self.event_parameters(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }) + .with_kind(RuleKind::EventParametersDeclaration) + } + + #[allow(unused_assignments, unused_parens)] + fn experimental_feature(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ExperimentalFeature) + } + + #[allow(unused_assignments, unused_parens)] + fn experimental_pragma(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ExperimentalKeyword, + ))?; + seq.elem(self.experimental_feature(input))?; + seq.finish() + }) + .with_kind(RuleKind::ExperimentalPragma) + } + + #[allow(unused_assignments, unused_parens)] + fn exponentiation_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskAsterisk, + ); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskAsterisk, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::ExponentiationExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn expression(&self, input: &mut ParserContext) -> ParserResult { + let parse_assignment_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 1u8, + 1u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Equal, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BarEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PlusEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinusEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::CaretEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SlashEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PercentEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AmpersandEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanLessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThanGreaterThanEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }), + ) + }; + let parse_conditional_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_postfix_operator( + RuleKind::ConditionalExpression, + 3u8, + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::QuestionMark, + ))?; + seq.elem(self.expression(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Colon, + ))?; + seq.elem(self.expression(input))?; + seq.finish() + }), + ) + }; + let parse_or_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 5u8, + 5u8 + 1, + self.parse_token_with_trivia::( + input, + TokenKind::BarBar, + ), + ) + }; + let parse_and_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 7u8, + 7u8 + 1, + self.parse_token_with_trivia::( + input, + TokenKind::AmpersandAmpersand, + ), + ) + }; + let parse_equality_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 9u8, + 9u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::EqualEqual, + ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::GreaterThanGreaterThanGreaterThanEqual, + TokenKind::BangEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }), + ) + }; + let parse_comparison_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 11u8, + 11u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }), + ) + }; + let parse_bitwise_or_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 13u8, + 13u8 + 1, + self.parse_token_with_trivia::(input, TokenKind::Bar), + ) + }; + let parse_bitwise_xor_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 15u8, + 15u8 + 1, + self.parse_token_with_trivia::( + input, + TokenKind::Caret, + ), + ) + }; + let parse_bitwise_and_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 17u8, + 17u8 + 1, + self.parse_token_with_trivia::( + input, + TokenKind::Ampersand, + ), + ) + }; + let parse_shift_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 19u8, + 19u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanLessThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThanGreaterThan, + ); + choice.consider(input, result)?; + choice.finish(input) + }), + ) + }; + let parse_additive_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 21u8, + 21u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Plus, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + choice.finish(input) + }), + ) + }; + let parse_multiplicative_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 23u8, + 23u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Asterisk, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Slash, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Percent, + ); + choice.consider(input, result)?; + choice.finish(input) + }), + ) + }; + let parse_exponentiation_expression_removed_from_0_6_0 = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 25u8, + 25u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskAsterisk, + ); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskAsterisk, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }), + ) + }; + let parse_exponentiation_expression_introduced_from_0_6_0 = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 27u8 + 1, + 27u8, + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskAsterisk, + ); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskAsterisk, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }), + ) + }; + let parse_postfix_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_postfix_operator( + RuleKind::UnaryPostfixExpression, + 29u8, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::PlusPlus, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinusMinus, ); choice.consider(input, result)?; choice.finish(input) }), ) }; - let parse_conditional_operator = |input: &mut ParserContext| { + let parse_prefix_expression_removed_from_0_5_0 = |input: &mut ParserContext| { + PrecedenceHelper::to_prefix_operator( + RuleKind::UnaryPrefixExpression, + 31u8, + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_5_0 { + let result = ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::( + input, + TokenKind::PlusPlus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::MinusMinus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Bang, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Plus, + ); + choice.consider(input, result)?; + choice.finish(input) + }); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_5_0 { + let result = ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::( + input, + TokenKind::PlusPlus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::MinusMinus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Bang, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + choice.finish(input) + }); + choice.consider(input, result)?; + } + choice.finish(input) + }), + ) + }; + let parse_prefix_expression_introduced_from_0_5_0 = |input: &mut ParserContext| { + PrecedenceHelper::to_prefix_operator( + RuleKind::UnaryPrefixExpression, + 33u8, + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_5_0 { + let result = ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::( + input, + TokenKind::PlusPlus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::MinusMinus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Bang, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Plus, + ); + choice.consider(input, result)?; + choice.finish(input) + }); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_5_0 { + let result = ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::( + input, + TokenKind::PlusPlus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::MinusMinus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Bang, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + choice.finish(input) + }); + choice.consider(input, result)?; + } + choice.finish(input) + }), + ) + }; + let parse_function_call_expression = |input: &mut ParserContext| { PrecedenceHelper::to_postfix_operator( - RuleKind::ConditionalExpression, - 3u8, + RuleKind::FunctionCallExpression, + 35u8, + SequenceHelper::run(|mut seq| { + if self.version_is_at_least_0_6_2 { + seq.elem(OptionalHelper::transform(self.function_call_options(input)))?; + } + seq.elem(self.arguments_declaration(input))?; + seq.finish() + }), + ) + }; + let parse_member_access_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_postfix_operator( + RuleKind::MemberAccessExpression, + 37u8, SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::QuestionMark, + TokenKind::Period, ))?; - seq.elem(self.expression(input))?; + seq.elem(ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AddressKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }))?; + seq.finish() + }), + ) + }; + let parse_index_access_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_postfix_operator( + RuleKind::IndexAccessExpression, + 39u8, + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBracket); + let input = delim_guard.ctx(); seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Colon, + TokenKind::OpenBracket, + ))?; + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.elem(OptionalHelper::transform(self.index_access_end(input)))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBracket, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBracket, ))?; - seq.elem(self.expression(input))?; seq.finish() }), ) }; - let parse_or_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 5u8, - 5u8 + 1, - self.parse_token_with_trivia::( - input, - TokenKind::BarBar, - ), - ) + let prefix_operator_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_5_0 { + let result = parse_prefix_expression_removed_from_0_5_0(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_5_0 { + let result = parse_prefix_expression_introduced_from_0_5_0(input); + choice.consider(input, result)?; + } + choice.finish(input) + }) }; - let parse_and_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 7u8, - 7u8 + 1, - self.parse_token_with_trivia::( + let primary_expression_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.new_expression(input); + choice.consider(input, result)?; + let result = self.tuple_expression(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_5_3 { + let result = self.type_expression(input); + choice.consider(input, result)?; + } + let result = self.array_expression(input); + choice.consider(input, result)?; + let result = self.hex_number_expression(input); + choice.consider(input, result)?; + let result = self.decimal_number_expression(input); + choice.consider(input, result)?; + let result = self.string_expression(input); + choice.consider(input, result)?; + let result = self.elementary_type(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::AmpersandAmpersand, - ), - ) + TokenKind::TrueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FalseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + }; + let postfix_operator_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + let result = parse_conditional_expression(input); + choice.consider(input, result)?; + let result = parse_postfix_expression(input); + choice.consider(input, result)?; + let result = parse_function_call_expression(input); + choice.consider(input, result)?; + let result = parse_member_access_expression(input); + choice.consider(input, result)?; + let result = parse_index_access_expression(input); + choice.consider(input, result)?; + choice.finish(input) + }) + }; + let binary_operand_parser = |input: &mut ParserContext| { + SequenceHelper::run(|mut seq| { + seq.elem(ZeroOrMoreHelper::run(input, |input| { + prefix_operator_parser(input) + }))?; + seq.elem(primary_expression_parser(input))?; + seq.elem(ZeroOrMoreHelper::run(input, |input| { + postfix_operator_parser(input) + }))?; + seq.finish() + }) }; - let parse_equality_comparison_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 9u8, - 9u8 + 1, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::EqualEqual, - ); + let binary_operator_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + let result = parse_assignment_expression(input); + choice.consider(input, result)?; + let result = parse_or_expression(input); + choice.consider(input, result)?; + let result = parse_and_expression(input); + choice.consider(input, result)?; + let result = parse_equality_expression(input); + choice.consider(input, result)?; + let result = parse_comparison_expression(input); + choice.consider(input, result)?; + let result = parse_bitwise_or_expression(input); + choice.consider(input, result)?; + let result = parse_bitwise_xor_expression(input); + choice.consider(input, result)?; + let result = parse_bitwise_and_expression(input); + choice.consider(input, result)?; + let result = parse_shift_expression(input); + choice.consider(input, result)?; + let result = parse_additive_expression(input); + choice.consider(input, result)?; + let result = parse_multiplicative_expression(input); + choice.consider(input, result)?; + if !self.version_is_at_least_0_6_0 { + let result = parse_exponentiation_expression_removed_from_0_6_0(input); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::BangEqual, - ); + } + if self.version_is_at_least_0_6_0 { + let result = parse_exponentiation_expression_introduced_from_0_6_0(input); choice.consider(input, result)?; - choice.finish(input) - }), - ) + } + choice.finish(input) + }) }; - let parse_order_comparison_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 11u8, - 11u8 + 1, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let linear_expression_parser = |input: &mut ParserContext| { + SequenceHelper::run(|mut seq| { + seq.elem(binary_operand_parser(input))?; + seq.elem(ZeroOrMoreHelper::run(input, |input| { + SequenceHelper::run(|mut seq| { + seq.elem(binary_operator_parser(input))?; + seq.elem(binary_operand_parser(input))?; + seq.finish() + }) + }))?; + seq.finish() + }) + }; + PrecedenceHelper::reduce_precedence_result( + Some(RuleKind::Expression), + linear_expression_parser(input), + ) + .with_kind(RuleKind::Expression) + } + + #[allow(unused_assignments, unused_parens)] + fn expression_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + self.expression(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::GreaterThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + .with_kind(RuleKind::ExpressionStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn fallback_function_attribute(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_0 { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::FallbackFunctionAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn fallback_function_attributes(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_0 { + ZeroOrMoreHelper::run(input, |input| self.fallback_function_attribute(input)) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::FallbackFunctionAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn fallback_function_definition(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_0 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FallbackKeyword, + ))?; + seq.elem(self.parameters_declaration(input))?; + seq.elem(self.fallback_function_attributes(input))?; + seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; + seq.elem(self.function_body(input))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::FallbackFunctionDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn for_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ForKeyword, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.for_statement_initialization(input))?; + seq.elem(self.for_statement_condition(input))?; + seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::LessThanEqual, - ); + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }))?; + seq.elem(self.statement(input))?; + seq.finish() + }) + .with_kind(RuleKind::ForStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn for_statement_condition(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.expression_statement(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ForStatementCondition) + } + + #[allow(unused_assignments, unused_parens)] + fn for_statement_initialization(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.expression_statement(input); + choice.consider(input, result)?; + let result = self.variable_declaration_statement(input); + choice.consider(input, result)?; + let result = self.tuple_deconstruction_statement(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ForStatementInitialization) + } + + #[allow(unused_assignments, unused_parens)] + fn function_attribute(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::ConstantKeyword, + ); + choice.consider(input, result)?; + } + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::FunctionAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn function_attributes(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.function_attribute(input)) + .with_kind(RuleKind::FunctionAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn function_body(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.block(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::FunctionBody) + } + + #[allow(unused_assignments, unused_parens)] + fn function_call_expression(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + if self.version_is_at_least_0_6_2 { + seq.elem(OptionalHelper::transform(self.function_call_options(input)))?; + } + seq.elem(self.arguments_declaration(input))?; + seq.finish() + }) + .with_kind(RuleKind::FunctionCallExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn function_call_options(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_2 { + ChoiceHelper::run(input, |mut choice, input| { + if self.version_is_at_least_0_6_2 && !self.version_is_at_least_0_8_0 { + let result = self.named_argument_groups(input); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThanEqual, - ); + } + if self.version_is_at_least_0_8_0 { + let result = self.named_argument_group(input); choice.consider(input, result)?; - choice.finish(input) - }), - ) - }; - let parse_bitwise_or_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 13u8, - 13u8 + 1, - self.parse_token_with_trivia::(input, TokenKind::Bar), - ) - }; - let parse_bitwise_x_or_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 15u8, - 15u8 + 1, - self.parse_token_with_trivia::( + } + choice.finish(input) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::FunctionCallOptions) + } + + #[allow(unused_assignments, unused_parens)] + fn function_definition(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FunctionKeyword, + ))?; + seq.elem(ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( input, - TokenKind::Caret, - ), - ) - }; - let parse_bitwise_and_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 17u8, - 17u8 + 1, - self.parse_token_with_trivia::( + TokenKind::Identifier, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Ampersand, - ), - ) - }; - let parse_shift_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 19u8, - 19u8 + 1, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThanLessThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThanGreaterThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThanGreaterThanGreaterThan, - ); - choice.consider(input, result)?; - choice.finish(input) - }), - ) - }; - let parse_add_sub_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 21u8, - 21u8 + 1, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Plus, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Minus, - ); - choice.consider(input, result)?; - choice.finish(input) - }), - ) - }; - let parse_mul_div_mod_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 23u8, - 23u8 + 1, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Asterisk, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Slash, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Percent, - ); - choice.consider(input, result)?; - choice.finish(input) - }), + TokenKind::FallbackKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ReceiveKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }))?; + seq.elem(self.parameters_declaration(input))?; + seq.elem(self.function_attributes(input))?; + seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; + seq.elem(self.function_body(input))?; + seq.finish() + }) + .with_kind(RuleKind::FunctionDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn function_type(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FunctionKeyword, + ))?; + seq.elem(self.parameters_declaration(input))?; + seq.elem(self.function_type_attributes(input))?; + seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; + seq.finish() + }) + .with_kind(RuleKind::FunctionType) + } + + #[allow(unused_assignments, unused_parens)] + fn function_type_attribute(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::FunctionTypeAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn function_type_attributes(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.function_type_attribute(input)) + .with_kind(RuleKind::FunctionTypeAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn hex_number_expression(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::HexLiteral, + ))?; + if !self.version_is_at_least_0_5_0 { + seq.elem(OptionalHelper::transform(self.number_unit(input)))?; + } + seq.finish() + }) + .with_kind(RuleKind::HexNumberExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn hex_string_literals(&self, input: &mut ParserContext) -> ParserResult { + OneOrMoreHelper::run(input, |input| { + self.parse_token_with_trivia::( + input, + TokenKind::HexStringLiteral, ) - }; - let parse_exponentiation_operator_removed_from_0_6_0 = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 25u8, - 25u8 + 1, + }) + .with_kind(RuleKind::HexStringLiterals) + } + + #[allow(unused_assignments, unused_parens)] + fn identifier_path(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| { self.parse_token_with_trivia::( input, - TokenKind::AsteriskAsterisk, - ), - ) - }; - let parse_exponentiation_operator_introduced_from_0_6_0 = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 27u8 + 1, - 27u8, - self.parse_token_with_trivia::( + TokenKind::Identifier, + ) + }, + TokenKind::Period, + ) + .with_kind(RuleKind::IdentifierPath) + } + + #[allow(unused_assignments, unused_parens)] + fn if_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::IfKeyword, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( input, - TokenKind::AsteriskAsterisk, - ), - ) - }; - let parse_unary_postfix_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_postfix_operator( - RuleKind::UnaryPostfixExpression, - 29u8, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::PlusPlus, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::MinusMinus, - ); - choice.consider(input, result)?; - choice.finish(input) - }), - ) - }; - let parse_unary_prefix_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_prefix_operator( - RuleKind::UnaryPrefixExpression, - 31u8, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::PlusPlus, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::MinusMinus, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Tilde, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Bang, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Minus, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( + TokenKind::OpenParen, + ))?; + seq.elem( + self.expression(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::Plus, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }), - ) - }; - let parse_function_call_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_postfix_operator( - RuleKind::FunctionCallExpression, - 33u8, - SequenceHelper::run(|mut seq| { - if self.version_is_at_least_0_6_2 { - seq.elem(OptionalHelper::transform(self.function_call_options(input)))?; - } - seq.elem(self.arguments_declaration(input))?; - seq.finish() - }), - ) - }; - let parse_member_access_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_postfix_operator( - RuleKind::MemberAccessExpression, - 35u8, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }))?; + seq.elem(self.statement(input))?; + seq.elem(OptionalHelper::transform(self.else_branch(input)))?; + seq.finish() + }) + .with_kind(RuleKind::IfStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn import_alias(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::AsKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.finish() + }) + .with_kind(RuleKind::ImportAlias) + } + + #[allow(unused_assignments, unused_parens)] + fn import_deconstruction_field(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(OptionalHelper::transform(self.import_alias(input)))?; + seq.finish() + }) + .with_kind(RuleKind::ImportDeconstructionField) + } + + #[allow(unused_assignments, unused_parens)] + fn import_deconstruction_fields(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.import_deconstruction_field(input), + TokenKind::Comma, + )) + .with_kind(RuleKind::ImportDeconstructionFields) + } + + #[allow(unused_assignments, unused_parens)] + fn import_directive(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Period, + TokenKind::ImportKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AddressKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.import_symbol(input))?; seq.finish() - }), - ) - }; - let parse_index_access_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_postfix_operator( - RuleKind::IndexAccessExpression, - 37u8, + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + .with_kind(RuleKind::ImportDirective) + } + + #[allow(unused_assignments, unused_parens)] + fn import_symbol(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.path_import_symbol(input); + choice.consider(input, result)?; + let result = self.named_import_symbol(input); + choice.consider(input, result)?; + let result = self.import_symbol_deconstruction(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ImportSymbol) + } + + #[allow(unused_assignments, unused_parens)] + fn import_symbol_deconstruction(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBrace, + ))?; + seq.elem( + self.import_deconstruction_fields(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBrace, + ))?; + seq.finish() + }))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FromKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ))?; + seq.finish() + }) + .with_kind(RuleKind::ImportSymbolDeconstruction) + } + + #[allow(unused_assignments, unused_parens)] + fn index_access_end(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + self.parse_token_with_trivia::( + input, + TokenKind::Colon, + ), + )?; + seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.finish() + }) + .with_kind(RuleKind::IndexAccessEnd) + } + + #[allow(unused_assignments, unused_parens)] + fn index_access_expression(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBracket); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBracket, + ))?; + seq.elem( SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBracket); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBracket, - ))?; - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(OptionalHelper::transform(self.expression(input)))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::Colon, - ), - )?; - seq.elem(OptionalHelper::transform(self.expression(input)))?; - seq.finish() - })))?; - seq.finish() - }) + seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.elem(OptionalHelper::transform(self.index_access_end(input)))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBracket, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBracket, + ))?; + seq.finish() + }) + .with_kind(RuleKind::IndexAccessExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn inheritance_specifier(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::IsKeyword, + ))?; + seq.elem(self.inheritance_types(input))?; + seq.finish() + }) + .with_kind(RuleKind::InheritanceSpecifier) + } + + #[allow(unused_assignments, unused_parens)] + fn inheritance_type(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.identifier_path(input))?; + seq.elem(OptionalHelper::transform(self.arguments_declaration(input)))?; + seq.finish() + }) + .with_kind(RuleKind::InheritanceType) + } + + #[allow(unused_assignments, unused_parens)] + fn inheritance_types(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.inheritance_type(input), + TokenKind::Comma, + ) + .with_kind(RuleKind::InheritanceTypes) + } + + #[allow(unused_assignments, unused_parens)] + fn interface_definition(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::InterfaceKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(OptionalHelper::transform(self.inheritance_specifier(input)))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBrace, + ))?; + seq.elem( + self.interface_members(input) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, - TokenKind::CloseBracket, + TokenKind::CloseBrace, RecoverFromNoMatch::Yes, ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseBracket, - ))?; - seq.finish() - }), - ) - }; - let prefix_operator_parser = |input: &mut ParserContext| { - ChoiceHelper::run(input, |mut choice, input| { - let result = parse_unary_prefix_operator(input); - choice.consider(input, result)?; - choice.finish(input) - }) - }; - let primary_expression_parser = |input: &mut ParserContext| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.new_expression(input); - choice.consider(input, result)?; - let result = self.tuple_expression(input); - choice.consider(input, result)?; - let result = self.array_expression(input); - choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::TrueKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FalseKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - let result = self.numeric_expression(input); - choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.hex_string_literals_list(input); - choice.consider(input, result)?; - let result = self.ascii_string_literals_list(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_7_0 { - let result = self.unicode_string_literals_list(input); - choice.consider(input, result)?; - } - choice.finish(input) - }); - choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::BoolKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::StringKeyword, - ); - choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FixedBytesType, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::SignedIntegerType, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UnsignedIntegerType, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::SignedFixedType, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UnsignedFixedType, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + )?; + seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_3 { - let result = self.type_expression(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) - }; - let postfix_operator_parser = |input: &mut ParserContext| { - ChoiceHelper::run(input, |mut choice, input| { - let result = parse_conditional_operator(input); - choice.consider(input, result)?; - let result = parse_unary_postfix_operator(input); - choice.consider(input, result)?; - let result = parse_function_call_operator(input); - choice.consider(input, result)?; - let result = parse_member_access_operator(input); - choice.consider(input, result)?; - let result = parse_index_access_operator(input); - choice.consider(input, result)?; - choice.finish(input) - }) - }; - let binary_operand_parser = |input: &mut ParserContext| { - SequenceHelper::run(|mut seq| { - seq.elem(ZeroOrMoreHelper::run(input, |input| { - prefix_operator_parser(input) - }))?; - seq.elem(primary_expression_parser(input))?; - seq.elem(ZeroOrMoreHelper::run(input, |input| { - postfix_operator_parser(input) - }))?; + TokenKind::CloseBrace, + ))?; seq.finish() - }) - }; - let binary_operator_parser = |input: &mut ParserContext| { + }))?; + seq.finish() + }) + .with_kind(RuleKind::InterfaceDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn interface_members(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.contract_member(input)) + .with_kind(RuleKind::InterfaceMembers) + } + + #[allow(unused_assignments, unused_parens)] + fn leading_trivia(&self, input: &mut ParserContext) -> ParserResult { + OneOrMoreHelper::run(input, |input| { ChoiceHelper::run(input, |mut choice, input| { - let result = parse_assignment_operator(input); - choice.consider(input, result)?; - let result = parse_or_operator(input); - choice.consider(input, result)?; - let result = parse_and_operator(input); - choice.consider(input, result)?; - let result = parse_equality_comparison_operator(input); - choice.consider(input, result)?; - let result = parse_order_comparison_operator(input); - choice.consider(input, result)?; - let result = parse_bitwise_or_operator(input); - choice.consider(input, result)?; - let result = parse_bitwise_x_or_operator(input); - choice.consider(input, result)?; - let result = parse_bitwise_and_operator(input); - choice.consider(input, result)?; - let result = parse_shift_operator(input); + let result = + self.parse_token::(input, TokenKind::Whitespace); choice.consider(input, result)?; - let result = parse_add_sub_operator(input); + let result = + self.parse_token::(input, TokenKind::EndOfLine); choice.consider(input, result)?; - let result = parse_mul_div_mod_operator(input); + let result = self + .parse_token::(input, TokenKind::MultilineComment); choice.consider(input, result)?; - if !self.version_is_at_least_0_6_0 { - let result = parse_exponentiation_operator_removed_from_0_6_0(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = parse_exponentiation_operator_introduced_from_0_6_0(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) - }; - let linear_expression_parser = |input: &mut ParserContext| { - SequenceHelper::run(|mut seq| { - seq.elem(binary_operand_parser(input))?; - seq.elem(ZeroOrMoreHelper::run(input, |input| { - SequenceHelper::run(|mut seq| { - seq.elem(binary_operator_parser(input))?; - seq.elem(binary_operand_parser(input))?; - seq.finish() - }) - }))?; - seq.finish() + let result = self.parse_token::( + input, + TokenKind::SingleLineComment, + ); + choice.consider(input, result)?; + choice.finish(input) }) - }; - PrecedenceHelper::reduce_precedence_result( - Some(RuleKind::Expression), - linear_expression_parser(input), - ) - .with_kind(RuleKind::Expression) + }) + .with_kind(RuleKind::LeadingTrivia) } #[allow(unused_assignments, unused_parens)] - fn expression_statement(&self, input: &mut ParserContext) -> ParserResult { + fn library_definition(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem( - self.expression(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Semicolon, + TokenKind::LibraryKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBrace, + ))?; + seq.elem( + self.library_members(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBrace, + ))?; + seq.finish() + }))?; seq.finish() }) - .with_kind(RuleKind::ExpressionStatement) + .with_kind(RuleKind::LibraryDefinition) } #[allow(unused_assignments, unused_parens)] - fn fallback_function_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_6_0 { - OneOrMoreHelper::run(input, |input| { - if self.version_is_at_least_0_6_0 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PureKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ViewKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::FallbackFunctionAttributesList) + fn library_members(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.contract_member(input)) + .with_kind(RuleKind::LibraryMembers) } #[allow(unused_assignments, unused_parens)] - fn fallback_function_definition(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_6_0 { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::FallbackKeyword, - ))?; - seq.elem(self.parameters_declaration(input))?; + fn mapping_key(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.mapping_key_type(input))?; + if self.version_is_at_least_0_8_18 { seq.elem(OptionalHelper::transform( - self.fallback_function_attributes_list(input), - ))?; - seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::FallbackFunctionDefinition) + TokenKind::Identifier, + ), + ))?; + } + seq.finish() + }) + .with_kind(RuleKind::MappingKey) } #[allow(unused_assignments, unused_parens)] - fn for_statement(&self, input: &mut ParserContext) -> ParserResult { + fn mapping_key_type(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.elementary_type(input); + choice.consider(input, result)?; + let result = self.identifier_path(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::MappingKeyType) + } + + #[allow(unused_assignments, unused_parens)] + fn mapping_type(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::ForKeyword, + TokenKind::MappingKeyword, ))?; seq.elem(SequenceHelper::run(|mut seq| { let mut delim_guard = input.open_delim(TokenKind::CloseParen); @@ -1802,37 +3440,12 @@ impl Language { ))?; seq.elem( SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.elem(self.mapping_key(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::EqualGreaterThan, + ))?; + seq.elem(self.mapping_value(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -1848,259 +3461,348 @@ impl Language { ))?; seq.finish() }))?; - seq.elem(self.statement(input))?; seq.finish() }) - .with_kind(RuleKind::ForStatement) + .with_kind(RuleKind::MappingType) } #[allow(unused_assignments, unused_parens)] - fn function_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + fn mapping_value(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; + if self.version_is_at_least_0_8_18 { + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ), + ))?; + } + seq.finish() + }) + .with_kind(RuleKind::MappingValue) + } + + #[allow(unused_assignments, unused_parens)] + fn member_access_expression(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + self.parse_token_with_trivia::( input, - TokenKind::PrivateKeyword, - ); - choice.consider(input, result)?; + TokenKind::Period, + ), + )?; + seq.elem(ChoiceHelper::run(input, |mut choice, input| { let result = self.parse_token_with_trivia::( input, - TokenKind::PublicKeyword, + TokenKind::Identifier, ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::PureKeyword, + TokenKind::AddressKeyword, ); choice.consider(input, result)?; + choice.finish(input) + }))?; + seq.finish() + }) + .with_kind(RuleKind::MemberAccessExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn modifier_attribute(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.override_specifier(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { let result = self.parse_token_with_trivia::( input, - TokenKind::ViewKeyword, + TokenKind::VirtualKeyword, ); choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ConstantKeyword, - ); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + choice.finish(input) + }) + .with_kind(RuleKind::ModifierAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn modifier_attributes(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.modifier_attribute(input)) + .with_kind(RuleKind::ModifierAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn modifier_definition(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ModifierKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(OptionalHelper::transform( + self.parameters_declaration(input), + ))?; + seq.elem(self.modifier_attributes(input))?; + seq.elem(self.function_body(input))?; + seq.finish() + }) + .with_kind(RuleKind::ModifierDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn modifier_invocation(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.identifier_path(input))?; + seq.elem(OptionalHelper::transform(self.arguments_declaration(input)))?; + seq.finish() }) - .with_kind(RuleKind::FunctionAttributesList) + .with_kind(RuleKind::ModifierInvocation) } #[allow(unused_assignments, unused_parens)] - fn function_call_options(&self, input: &mut ParserContext) -> ParserResult { + fn multiplicative_expression(&self, input: &mut ParserContext) -> ParserResult { ChoiceHelper::run(input, |mut choice, input| { - if self.version_is_at_least_0_6_2 && !self.version_is_at_least_0_8_0 { - let result = - OneOrMoreHelper::run(input, |input| self.named_arguments_declaration(input)); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_0 { - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - } + let result = self + .parse_token_with_trivia::(input, TokenKind::Asterisk); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::Slash); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::Percent); + choice.consider(input, result)?; choice.finish(input) }) - .with_kind(RuleKind::FunctionCallOptions) + .with_kind(RuleKind::MultiplicativeExpression) } #[allow(unused_assignments, unused_parens)] - fn function_definition(&self, input: &mut ParserContext) -> ParserResult { + fn named_argument(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::FunctionKeyword, + TokenKind::Identifier, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FallbackKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + seq.elem( + self.parse_token_with_trivia::( input, - TokenKind::ReceiveKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.elem(self.parameters_declaration(input))?; - seq.elem(OptionalHelper::transform( - self.function_attributes_list(input), + TokenKind::Colon, + ), + )?; + seq.elem(self.expression(input))?; + seq.finish() + }) + .with_kind(RuleKind::NamedArgument) + } + + #[allow(unused_assignments, unused_parens)] + fn named_argument_group(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBrace, ))?; - seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( + seq.elem( + self.named_arguments(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBrace, + ))?; + seq.finish() + }) + .with_kind(RuleKind::NamedArgumentGroup) + } + + #[allow(unused_assignments, unused_parens)] + fn named_argument_groups(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_2 && !self.version_is_at_least_0_8_0 { + OneOrMoreHelper::run(input, |input| self.named_argument_group(input)) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::NamedArgumentGroups) + } + + #[allow(unused_assignments, unused_parens)] + fn named_arguments(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.named_argument(input), + TokenKind::Comma, + )) + .with_kind(RuleKind::NamedArguments) + } + + #[allow(unused_assignments, unused_parens)] + fn named_arguments_declaration(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + OptionalHelper::transform(self.named_argument_group(input)) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; seq.finish() }) - .with_kind(RuleKind::FunctionDefinition) + .with_kind(RuleKind::NamedArgumentsDeclaration) } #[allow(unused_assignments, unused_parens)] - fn function_type(&self, input: &mut ParserContext) -> ParserResult { + fn named_import_symbol(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::FunctionKeyword, + TokenKind::Asterisk, ))?; - seq.elem(self.parameters_declaration(input))?; - seq.elem(OptionalHelper::transform( - self.function_type_attributes_list(input), + seq.elem(self.import_alias(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FromKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, ))?; - seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; seq.finish() }) - .with_kind(RuleKind::FunctionType) + .with_kind(RuleKind::NamedImportSymbol) } #[allow(unused_assignments, unused_parens)] - fn function_type_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PrivateKeyword, - ); - choice.consider(input, result)?; + fn new_expression(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::NewKeyword, + ))?; + seq.elem(self.type_name(input))?; + seq.finish() + }) + .with_kind(RuleKind::NewExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn number_unit(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::WeiKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_11 { let result = self.parse_token_with_trivia::( input, - TokenKind::PublicKeyword, + TokenKind::GweiKeyword, ); choice.consider(input, result)?; + } + if !self.version_is_at_least_0_7_0 { let result = self.parse_token_with_trivia::( input, - TokenKind::PureKeyword, + TokenKind::SzaboKeyword, ); choice.consider(input, result)?; + } + if !self.version_is_at_least_0_7_0 { let result = self.parse_token_with_trivia::( input, - TokenKind::ViewKeyword, + TokenKind::FinneyKeyword, ); choice.consider(input, result)?; + } + let result = self.parse_token_with_trivia::( + input, + TokenKind::EtherKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SecondsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinutesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::HoursKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::DaysKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::WeeksKeyword, + ); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { let result = self.parse_token_with_trivia::( input, - TokenKind::PayableKeyword, + TokenKind::YearsKeyword, ); choice.consider(input, result)?; - choice.finish(input) - }) - }) - .with_kind(RuleKind::FunctionTypeAttributesList) - } - - #[allow(unused_assignments, unused_parens)] - fn hex_string_literals_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - self.parse_token_with_trivia::( - input, - TokenKind::HexStringLiteral, - ) + } + choice.finish(input) }) - .with_kind(RuleKind::HexStringLiteralsList) + .with_kind(RuleKind::NumberUnit) } #[allow(unused_assignments, unused_parens)] - fn identifier_path(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| { - self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ) - }, - TokenKind::Period, - ) - .with_kind(RuleKind::IdentifierPath) + fn or_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::(input, TokenKind::BarBar) + .with_kind(RuleKind::OrExpression) } #[allow(unused_assignments, unused_parens)] - fn identifier_paths_list(&self, input: &mut ParserContext) -> ParserResult { + fn override_paths(&self, input: &mut ParserContext) -> ParserResult { SeparatedHelper::run::<_, LexicalContextType::Default>( input, self, |input| self.identifier_path(input), TokenKind::Comma, ) - .with_kind(RuleKind::IdentifierPathsList) - } - - #[allow(unused_assignments, unused_parens)] - fn identifiers_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| { - self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ) - }, - TokenKind::Comma, - ) - .with_kind(RuleKind::IdentifiersList) + .with_kind(RuleKind::OverridePaths) } #[allow(unused_assignments, unused_parens)] - fn if_statement(&self, input: &mut ParserContext) -> ParserResult { + fn override_specifier(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::IfKeyword, + TokenKind::OverrideKeyword, ))?; seq.elem(SequenceHelper::run(|mut seq| { let mut delim_guard = input.open_delim(TokenKind::CloseParen); @@ -2110,7 +3812,7 @@ impl Language { TokenKind::OpenParen, ))?; seq.elem( - self.expression(input) + self.override_paths(input) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, @@ -2124,923 +3826,729 @@ impl Language { ))?; seq.finish() }))?; - seq.elem(self.statement(input))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + seq.finish() + }) + .with_kind(RuleKind::OverrideSpecifier) + } + + #[allow(unused_assignments, unused_parens)] + fn parameter(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; + seq.elem(OptionalHelper::transform(self.storage_location(input)))?; + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( input, - TokenKind::ElseKeyword, - ))?; - seq.elem(self.statement(input))?; - seq.finish() - })))?; + TokenKind::Identifier, + ), + ))?; seq.finish() }) - .with_kind(RuleKind::IfStatement) + .with_kind(RuleKind::Parameter) } #[allow(unused_assignments, unused_parens)] - fn import_directive(&self, input: &mut ParserContext) -> ParserResult { + fn parameters(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.parameter(input), + TokenKind::Comma, + )) + .with_kind(RuleKind::Parameters) + } + + #[allow(unused_assignments, unused_parens)] + fn parameters_declaration(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + self.parameters(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::ImportKeyword, - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.path_import(input); - choice.consider(input, result)?; - let result = self.named_import(input); - choice.consider(input, result)?; - let result = self.deconstruction_import(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Semicolon, + TokenKind::CloseParen, ))?; seq.finish() }) - .with_kind(RuleKind::ImportDirective) + .with_kind(RuleKind::ParametersDeclaration) } #[allow(unused_assignments, unused_parens)] - fn inheritance_specifier(&self, input: &mut ParserContext) -> ParserResult { + fn path_import_symbol(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::IsKeyword, + TokenKind::AsciiStringLiteral, ))?; - seq.elem(self.inheritance_types_list(input))?; - seq.finish() - }) - .with_kind(RuleKind::InheritanceSpecifier) - } - - #[allow(unused_assignments, unused_parens)] - fn inheritance_type(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.identifier_path(input))?; - seq.elem(OptionalHelper::transform(self.arguments_declaration(input)))?; + seq.elem(OptionalHelper::transform(self.import_alias(input)))?; seq.finish() }) - .with_kind(RuleKind::InheritanceType) + .with_kind(RuleKind::PathImportSymbol) } #[allow(unused_assignments, unused_parens)] - fn inheritance_types_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( + fn positional_arguments(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( input, self, - |input| self.inheritance_type(input), + |input| self.expression(input), TokenKind::Comma, - ) - .with_kind(RuleKind::InheritanceTypesList) + )) + .with_kind(RuleKind::PositionalArguments) } #[allow(unused_assignments, unused_parens)] - fn interface_definition(&self, input: &mut ParserContext) -> ParserResult { + fn positional_arguments_declaration(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); seq.elem(self.parse_token_with_trivia::( input, - TokenKind::InterfaceKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, + TokenKind::OpenParen, ))?; - seq.elem(OptionalHelper::transform(self.inheritance_specifier(input)))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; - seq.elem( - OptionalHelper::transform(self.interface_members_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + seq.elem( + self.positional_arguments(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, - TokenKind::CloseBrace, + TokenKind::CloseParen, RecoverFromNoMatch::Yes, ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseBrace, - ))?; - seq.finish() - }))?; + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; seq.finish() }) - .with_kind(RuleKind::InterfaceDefinition) + .with_kind(RuleKind::PositionalArgumentsDeclaration) } #[allow(unused_assignments, unused_parens)] - fn interface_members_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive(input); - choice.consider(input, result)?; - let result = self.function_definition(input); - choice.consider(input, result)?; - let result = self.modifier_definition(input); - choice.consider(input, result)?; - let result = self.struct_definition(input); - choice.consider(input, result)?; - let result = self.enum_definition(input); - choice.consider(input, result)?; - let result = self.event_definition(input); - choice.consider(input, result)?; - let result = self.state_variable_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_4_22 { - let result = self.constructor_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.fallback_function_definition(input); - choice.consider(input, result)?; - let result = self.receive_function_definition(input); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_6_0 { - let result = self.unnamed_function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) + fn postfix_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::(input, TokenKind::PlusPlus); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinusMinus, + ); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::InterfaceMembersList) + .with_kind(RuleKind::PostfixExpression) } #[allow(unused_assignments, unused_parens)] - fn leading_trivia(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = - self.parse_token::(input, TokenKind::Whitespace); - choice.consider(input, result)?; - let result = - self.parse_token::(input, TokenKind::EndOfLine); - choice.consider(input, result)?; - let result = self - .parse_token::(input, TokenKind::MultilineComment); - choice.consider(input, result)?; - let result = self.parse_token::( - input, - TokenKind::SingleLineComment, - ); - choice.consider(input, result)?; - choice.finish(input) - }) + fn pragma(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.abi_coder_pragma(input); + choice.consider(input, result)?; + let result = self.experimental_pragma(input); + choice.consider(input, result)?; + let result = self.version_pragma(input); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::LeadingTrivia) + .with_kind(RuleKind::Pragma) } #[allow(unused_assignments, unused_parens)] - fn library_definition(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + fn pragma_all_keywords(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( input, - TokenKind::LibraryKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::AbicoderKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Identifier, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; - seq.elem( - OptionalHelper::transform(self.library_members_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + TokenKind::ExperimentalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SolidityKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::PragmaAllKeywords) + } + + #[allow(unused_assignments, unused_parens)] + fn pragma_directive(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( input, - self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::PragmaKeyword, + ))?; + seq.elem(self.pragma(input))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Pragma>( input, - TokenKind::CloseBrace, - ))?; - seq.finish() - }))?; + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; seq.finish() }) - .with_kind(RuleKind::LibraryDefinition) + .with_kind(RuleKind::PragmaDirective) } #[allow(unused_assignments, unused_parens)] - fn library_members_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive(input); - choice.consider(input, result)?; - let result = self.function_definition(input); - choice.consider(input, result)?; - let result = self.modifier_definition(input); - choice.consider(input, result)?; - let result = self.struct_definition(input); - choice.consider(input, result)?; - let result = self.enum_definition(input); - choice.consider(input, result)?; - let result = self.event_definition(input); - choice.consider(input, result)?; - let result = self.state_variable_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_4_22 { - let result = self.constructor_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.fallback_function_definition(input); - choice.consider(input, result)?; - let result = self.receive_function_definition(input); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_6_0 { - let result = self.unnamed_function_definition(input); + fn prefix_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_5_0 { + let result = ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::PlusPlus, + ); choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinusMinus, + ); choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); choice.consider(input, result)?; - } - choice.finish(input) - }) - }) - .with_kind(RuleKind::LibraryMembersList) - } - - #[allow(unused_assignments, unused_parens)] - fn mapping_key_type(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = ChoiceHelper::run(input, |mut choice, input| { let result = self.parse_token_with_trivia::( input, - TokenKind::BoolKeyword, + TokenKind::Bang, ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::StringKeyword, + TokenKind::Minus, ); choice.consider(input, result)?; - let result = self.address_type(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::Plus, + ); choice.consider(input, result)?; + choice.finish(input) + }); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_5_0 { + let result = ChoiceHelper::run(input, |mut choice, input| { let result = self.parse_token_with_trivia::( input, - TokenKind::FixedBytesType, + TokenKind::PlusPlus, ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::SignedIntegerType, + TokenKind::MinusMinus, ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::UnsignedIntegerType, + TokenKind::Tilde, ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::SignedFixedType, + TokenKind::Bang, ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::UnsignedFixedType, + TokenKind::Minus, ); choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } choice.finish(input) }); choice.consider(input, result)?; - let result = self.identifier_path(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - if self.version_is_at_least_0_8_18 { - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ), - ))?; - } - seq.finish() - }) - .with_kind(RuleKind::MappingKeyType) - } - - #[allow(unused_assignments, unused_parens)] - fn mapping_type(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::MappingKeyword, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.mapping_key_type(input))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::EqualGreaterThan, - ))?; - seq.elem(self.mapping_value_type(input))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; - seq.finish() - }) - .with_kind(RuleKind::MappingType) - } - - #[allow(unused_assignments, unused_parens)] - fn mapping_value_type(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - if self.version_is_at_least_0_8_18 { - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ), - ))?; } - seq.finish() + choice.finish(input) }) - .with_kind(RuleKind::MappingValueType) + .with_kind(RuleKind::PrefixExpression) } #[allow(unused_assignments, unused_parens)] - fn modifier_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { + fn receive_function_attribute(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_0 { ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; let result = self.override_specifier(input); choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }) - }) - .with_kind(RuleKind::ModifierAttributesList) - } - - #[allow(unused_assignments, unused_parens)] - fn modifier_definition(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::ModifierKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.elem(OptionalHelper::transform( - self.parameters_declaration(input), - ))?; - seq.elem(OptionalHelper::transform( - self.modifier_attributes_list(input), - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { let result = self.parse_token_with_trivia::( input, - TokenKind::Semicolon, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, ); choice.consider(input, result)?; - let result = self.block(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); choice.consider(input, result)?; choice.finish(input) - }))?; - seq.finish() - }) - .with_kind(RuleKind::ModifierDefinition) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ReceiveFunctionAttribute) } #[allow(unused_assignments, unused_parens)] - fn modifier_invocation(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.identifier_path(input))?; - seq.elem(OptionalHelper::transform(self.arguments_declaration(input)))?; - seq.finish() - }) - .with_kind(RuleKind::ModifierInvocation) + fn receive_function_attributes(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_0 { + ZeroOrMoreHelper::run(input, |input| self.receive_function_attribute(input)) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ReceiveFunctionAttributes) } #[allow(unused_assignments, unused_parens)] - fn named_argument(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.elem( - self.parse_token_with_trivia::( + fn receive_function_definition(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_0 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Colon, - ), - )?; - seq.elem(self.expression(input))?; - seq.finish() - }) - .with_kind(RuleKind::NamedArgument) + TokenKind::ReceiveKeyword, + ))?; + seq.elem(self.parameters_declaration(input))?; + seq.elem(self.receive_function_attributes(input))?; + seq.elem(self.function_body(input))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ReceiveFunctionDefinition) } #[allow(unused_assignments, unused_parens)] - fn named_arguments_declaration(&self, input: &mut ParserContext) -> ParserResult { + fn return_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; seq.elem( - OptionalHelper::transform(self.named_arguments_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ReturnKeyword, + ))?; + seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, + TokenKind::Semicolon, + RecoverFromNoMatch::No, ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::CloseBrace, - ))?; - seq.finish() - }) - .with_kind(RuleKind::NamedArgumentsDeclaration) - } - - #[allow(unused_assignments, unused_parens)] - fn named_arguments_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.named_argument(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::NamedArgumentsList) - } - - #[allow(unused_assignments, unused_parens)] - fn named_import(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Asterisk, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::AsKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::FromKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, + TokenKind::Semicolon, ))?; seq.finish() }) - .with_kind(RuleKind::NamedImport) + .with_kind(RuleKind::ReturnStatement) } #[allow(unused_assignments, unused_parens)] - fn new_expression(&self, input: &mut ParserContext) -> ParserResult { + fn returns_declaration(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::NewKeyword, + TokenKind::ReturnsKeyword, ))?; - seq.elem(self.type_name(input))?; + seq.elem(self.parameters_declaration(input))?; seq.finish() }) - .with_kind(RuleKind::NewExpression) + .with_kind(RuleKind::ReturnsDeclaration) } #[allow(unused_assignments, unused_parens)] - fn numeric_expression(&self, input: &mut ParserContext) -> ParserResult { - ChoiceHelper::run(input, |mut choice, input| { - let result = SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::HexLiteral, - ))?; - if !self.version_is_at_least_0_5_0 { - seq.elem(OptionalHelper::transform(ChoiceHelper::run( + fn revert_statement(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_4 { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::RevertKeyword, + ))?; + seq.elem(OptionalHelper::transform(self.identifier_path(input)))?; + seq.elem(self.arguments_declaration(input))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - |mut choice, input| { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::DaysKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::EtherKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::HoursKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::MinutesKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::SecondsKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::WeeksKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::WeiKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::YearsKeyword, - ); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_11 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::GweiKeyword, - ); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_7_0 { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::FinneyKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::SzaboKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - } - seq.finish() - }); - choice.consider(input, result)?; - let result = SequenceHelper::run(|mut seq| { + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::DecimalLiteral, + TokenKind::Semicolon, ))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::DaysKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::EtherKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HoursKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::MinutesKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::SecondsKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::WeeksKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::WeiKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::YearsKeyword, - ); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_11 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::GweiKeyword, - ); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_7_0 { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::FinneyKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::SzaboKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; seq.finish() - }); + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::RevertStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn shift_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanLessThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThanGreaterThan, + ); choice.consider(input, result)?; choice.finish(input) }) - .with_kind(RuleKind::NumericExpression) + .with_kind(RuleKind::ShiftExpression) } #[allow(unused_assignments, unused_parens)] - fn override_specifier(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + fn source_unit(&self, input: &mut ParserContext) -> ParserResult { + self.source_unit_members(input) + .with_kind(RuleKind::SourceUnit) + } + + #[allow(unused_assignments, unused_parens)] + fn source_unit_member(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.pragma_directive(input); + choice.consider(input, result)?; + let result = self.import_directive(input); + choice.consider(input, result)?; + let result = self.contract_definition(input); + choice.consider(input, result)?; + let result = self.interface_definition(input); + choice.consider(input, result)?; + let result = self.library_definition(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { + let result = self.struct_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.enum_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_7_1 { + let result = self.function_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_7_4 { + let result = self.constant_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_4 { + let result = self.error_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_8 { + let result = self.user_defined_value_type_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_13 { + let result = self.using_directive(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_22 { + let result = self.event_definition(input); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::SourceUnitMember) + } + + #[allow(unused_assignments, unused_parens)] + fn source_unit_members(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.source_unit_member(input)) + .with_kind(RuleKind::SourceUnitMembers) + } + + #[allow(unused_assignments, unused_parens)] + fn state_variable_attribute(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::OverrideKeyword, - ))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - OptionalHelper::transform(self.identifier_paths_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::ConstantKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_5 { + let result = self.parse_token_with_trivia::( input, - TokenKind::CloseParen, - ))?; - seq.finish() - })))?; - seq.finish() + TokenKind::ImmutableKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) }) - .with_kind(RuleKind::OverrideSpecifier) + .with_kind(RuleKind::StateVariableAttribute) } #[allow(unused_assignments, unused_parens)] - fn parameter(&self, input: &mut ParserContext) -> ParserResult { + fn state_variable_attributes(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.state_variable_attribute(input)) + .with_kind(RuleKind::StateVariableAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn state_variable_definition(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::MemoryKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; + seq.elem(self.state_variable_attributes(input))?; + seq.elem(self.parse_token_with_trivia::( input, - TokenKind::StorageKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::CalldataKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( + TokenKind::Identifier, + ))?; + seq.elem(OptionalHelper::transform( + self.state_variable_definition_value(input), + ))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::Identifier, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, ))?; seq.finish() }) - .with_kind(RuleKind::Parameter) + .with_kind(RuleKind::StateVariableDefinition) } #[allow(unused_assignments, unused_parens)] - fn parameters_declaration(&self, input: &mut ParserContext) -> ParserResult { + fn state_variable_definition_value(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; seq.elem( - OptionalHelper::transform(self.parameters_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), + self.parse_token_with_trivia::( + input, + TokenKind::Equal, + ), )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; + seq.elem(self.expression(input))?; seq.finish() }) - .with_kind(RuleKind::ParametersDeclaration) + .with_kind(RuleKind::StateVariableDefinitionValue) } #[allow(unused_assignments, unused_parens)] - fn parameters_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.parameter(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::ParametersList) + fn statement(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.tuple_deconstruction_statement(input); + choice.consider(input, result)?; + let result = self.variable_declaration_statement(input); + choice.consider(input, result)?; + let result = self.if_statement(input); + choice.consider(input, result)?; + let result = self.for_statement(input); + choice.consider(input, result)?; + let result = self.while_statement(input); + choice.consider(input, result)?; + let result = self.do_while_statement(input); + choice.consider(input, result)?; + let result = self.continue_statement(input); + choice.consider(input, result)?; + let result = self.break_statement(input); + choice.consider(input, result)?; + let result = self.delete_statement(input); + choice.consider(input, result)?; + let result = self.return_statement(input); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { + let result = self.throw_statement(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_4_21 { + let result = self.emit_statement(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.try_statement(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_4 { + let result = self.revert_statement(input); + choice.consider(input, result)?; + } + let result = self.assembly_statement(input); + choice.consider(input, result)?; + let result = self.block(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_8_0 { + let result = self.unchecked_block(input); + choice.consider(input, result)?; + } + let result = self.expression_statement(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::Statement) + } + + #[allow(unused_assignments, unused_parens)] + fn statements(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.statement(input)).with_kind(RuleKind::Statements) + } + + #[allow(unused_assignments, unused_parens)] + fn storage_location(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::MemoryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StorageKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::CallDataKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::StorageLocation) + } + + #[allow(unused_assignments, unused_parens)] + fn string_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.hex_string_literals(input); + choice.consider(input, result)?; + let result = self.ascii_string_literals(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_7_0 { + let result = self.unicode_string_literals(input); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::StringExpression) } #[allow(unused_assignments, unused_parens)] - fn path_import(&self, input: &mut ParserContext) -> ParserResult { + fn struct_definition(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::AsciiStringLiteral, + TokenKind::StructKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, ))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); seq.elem(self.parse_token_with_trivia::( input, - TokenKind::AsKeyword, + TokenKind::OpenBrace, ))?; + seq.elem( + self.struct_members(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), + )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Identifier, + TokenKind::CloseBrace, ))?; seq.finish() - })))?; + }))?; seq.finish() }) - .with_kind(RuleKind::PathImport) - } - - #[allow(unused_assignments, unused_parens)] - fn positional_arguments_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.expression(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::PositionalArgumentsList) + .with_kind(RuleKind::StructDefinition) } #[allow(unused_assignments, unused_parens)] - fn pragma_directive(&self, input: &mut ParserContext) -> ParserResult { + fn struct_member(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem( SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::PragmaKeyword, + TokenKind::Identifier, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.abi_coder_pragma(input); - choice.consider(input, result)?; - let result = self.experimental_pragma(input); - choice.consider(input, result)?; - let result = self.version_pragma(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -3056,86 +4564,113 @@ impl Language { ))?; seq.finish() }) - .with_kind(RuleKind::PragmaDirective) + .with_kind(RuleKind::StructMember) } #[allow(unused_assignments, unused_parens)] - fn receive_function_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_6_0 { - OneOrMoreHelper::run(input, |input| { - if self.version_is_at_least_0_6_0 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } + fn struct_members(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.struct_member(input)) + .with_kind(RuleKind::StructMembers) + } + + #[allow(unused_assignments, unused_parens)] + fn throw_statement(&self, input: &mut ParserContext) -> ParserResult { + if !self.version_is_at_least_0_5_0 { + SequenceHelper::run(|mut seq| { + seq.elem( + self.parse_token_with_trivia::( + input, + TokenKind::ThrowKeyword, + ) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() }) } else { ParserResult::disabled() } - .with_kind(RuleKind::ReceiveFunctionAttributesList) + .with_kind(RuleKind::ThrowStatement) } #[allow(unused_assignments, unused_parens)] - fn receive_function_definition(&self, input: &mut ParserContext) -> ParserResult { + fn trailing_trivia(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(OptionalHelper::transform( + self.parse_token::(input, TokenKind::Whitespace), + ))?; + seq.elem(OptionalHelper::transform( + self.parse_token::( + input, + TokenKind::SingleLineComment, + ), + ))?; + seq.elem(self.parse_token::(input, TokenKind::EndOfLine))?; + seq.finish() + }) + .with_kind(RuleKind::TrailingTrivia) + } + + #[allow(unused_assignments, unused_parens)] + fn try_statement(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_6_0 { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::ReceiveKeyword, - ))?; - seq.elem(self.parameters_declaration(input))?; - seq.elem(OptionalHelper::transform( - self.receive_function_attributes_list(input), + TokenKind::TryKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.expression(input))?; + seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; + seq.elem(self.block(input))?; + seq.elem(self.catch_clauses(input))?; seq.finish() }) } else { ParserResult::disabled() } - .with_kind(RuleKind::ReceiveFunctionDefinition) + .with_kind(RuleKind::TryStatement) } #[allow(unused_assignments, unused_parens)] - fn return_statement(&self, input: &mut ParserContext) -> ParserResult { + fn tuple_deconstruction_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem( SequenceHelper::run(|mut seq| { + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + self.tuple_members_deconstruction(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }))?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::ReturnKeyword, + TokenKind::Equal, ))?; - seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.elem(self.expression(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -3151,311 +4686,497 @@ impl Language { ))?; seq.finish() }) - .with_kind(RuleKind::ReturnStatement) + .with_kind(RuleKind::TupleDeconstructionStatement) } #[allow(unused_assignments, unused_parens)] - fn returns_declaration(&self, input: &mut ParserContext) -> ParserResult { + fn tuple_expression(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); seq.elem(self.parse_token_with_trivia::( input, - TokenKind::ReturnsKeyword, + TokenKind::OpenParen, ))?; - seq.elem(self.parameters_declaration(input))?; - seq.finish() - }) - .with_kind(RuleKind::ReturnsDeclaration) - } - - #[allow(unused_assignments, unused_parens)] - fn revert_statement(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + self.tuple_values(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::RevertKeyword, - ))?; - seq.elem(OptionalHelper::transform(self.identifier_path(input)))?; - seq.elem(self.arguments_declaration(input))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Semicolon, + TokenKind::CloseParen, ))?; seq.finish() }) - .with_kind(RuleKind::RevertStatement) + .with_kind(RuleKind::TupleExpression) } #[allow(unused_assignments, unused_parens)] - fn source_unit(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(OptionalHelper::transform( - self.source_unit_members_list(input), - ))?; - seq.elem(OptionalHelper::transform(self.end_of_file_trivia(input)))?; - seq.finish() + fn tuple_member(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.typed_tuple_member(input); + choice.consider(input, result)?; + let result = self.untyped_tuple_member(input); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::SourceUnit) + .with_kind(RuleKind::TupleMember) } #[allow(unused_assignments, unused_parens)] - fn source_unit_members_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.pragma_directive(input); - choice.consider(input, result)?; - let result = self.import_directive(input); - choice.consider(input, result)?; - let result = self.contract_definition(input); - choice.consider(input, result)?; - let result = self.interface_definition(input); - choice.consider(input, result)?; - let result = self.library_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.struct_definition(input); - choice.consider(input, result)?; - let result = self.enum_definition(input); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_7_1 { - let result = self.function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_7_4 { - let result = self.constant_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_13 { - let result = self.using_directive(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_22 { - let result = self.event_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) + fn tuple_member_deconstruction(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(self.tuple_member(input)) + .with_kind(RuleKind::TupleMemberDeconstruction) + } + + #[allow(unused_assignments, unused_parens)] + fn tuple_members_deconstruction(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.tuple_member_deconstruction(input), + TokenKind::Comma, + )) + .with_kind(RuleKind::TupleMembersDeconstruction) + } + + #[allow(unused_assignments, unused_parens)] + fn tuple_value(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(self.expression(input)).with_kind(RuleKind::TupleValue) + } + + #[allow(unused_assignments, unused_parens)] + fn tuple_values(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.tuple_value(input), + TokenKind::Comma, + ) + .with_kind(RuleKind::TupleValues) + } + + #[allow(unused_assignments, unused_parens)] + fn type_expression(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_5_3 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::TypeKeyword, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + self.type_name(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }))?; + seq.finish() }) - }) - .with_kind(RuleKind::SourceUnitMembersList) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::TypeExpression) } #[allow(unused_assignments, unused_parens)] - fn state_variable_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { + fn type_name(&self, input: &mut ParserContext) -> ParserResult { + let parse_array_type_name = |input: &mut ParserContext| { + PrecedenceHelper::to_postfix_operator( + RuleKind::ArrayTypeName, + 1u8, + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBracket); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBracket, + ))?; + seq.elem( + OptionalHelper::transform(self.expression(input)) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBracket, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBracket, + ))?; + seq.finish() + }), + ) + }; + let primary_expression_parser = |input: &mut ParserContext| { ChoiceHelper::run(input, |mut choice, input| { - let result = self.override_specifier(input); + let result = self.function_type(input); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ConstantKeyword, - ); + let result = self.mapping_type(input); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); + let result = self.elementary_type(input); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PrivateKeyword, - ); + let result = self.identifier_path(input); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PublicKeyword, - ); + choice.finish(input) + }) + }; + let postfix_operator_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + let result = parse_array_type_name(input); choice.consider(input, result)?; - if self.version_is_at_least_0_6_5 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ImmutableKeyword, - ); - choice.consider(input, result)?; - } choice.finish(input) }) - }) - .with_kind(RuleKind::StateVariableAttributesList) + }; + let linear_expression_parser = |input: &mut ParserContext| { + SequenceHelper::run(|mut seq| { + seq.elem(primary_expression_parser(input))?; + seq.elem(ZeroOrMoreHelper::run(input, |input| { + postfix_operator_parser(input) + }))?; + seq.finish() + }) + }; + PrecedenceHelper::reduce_precedence_result( + Some(RuleKind::TypeName), + linear_expression_parser(input), + ) + .with_kind(RuleKind::TypeName) } #[allow(unused_assignments, unused_parens)] - fn state_variable_definition(&self, input: &mut ParserContext) -> ParserResult { + fn typed_tuple_member(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - seq.elem(OptionalHelper::transform( - self.state_variable_attributes_list(input), - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Equal, - ))?; - seq.elem(self.expression(input))?; - seq.finish() - })))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + seq.elem(self.type_name(input))?; + seq.elem(OptionalHelper::transform(self.storage_location(input)))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.finish() + }) + .with_kind(RuleKind::TypedTupleMember) + } + + #[allow(unused_assignments, unused_parens)] + fn unchecked_block(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_0 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::UncheckedKeyword, + ))?; + seq.elem(self.block(input))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UncheckedBlock) + } + + #[allow(unused_assignments, unused_parens)] + fn unicode_string_literals(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_7_0 { + OneOrMoreHelper::run(input, |input| { + self.parse_token_with_trivia::( input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - .with_kind(RuleKind::StateVariableDefinition) + TokenKind::UnicodeStringLiteral, + ) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UnicodeStringLiterals) } #[allow(unused_assignments, unused_parens)] - fn statement(&self, input: &mut ParserContext) -> ParserResult { - ChoiceHelper::run(input, |mut choice, input| { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); + fn unnamed_function_attribute(&self, input: &mut ParserContext) -> ParserResult { + if !self.version_is_at_least_0_6_0 { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); choice.consider(input, result)?; - let result = self.do_while_statement(input); + let result = self.override_specifier(input); choice.consider(input, result)?; - let result = self.continue_statement(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); choice.consider(input, result)?; - let result = self.break_statement(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); choice.consider(input, result)?; - let result = self.delete_statement(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); choice.consider(input, result)?; - let result = self.return_statement(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); choice.consider(input, result)?; - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } choice.finish(input) - }); - choice.consider(input, result)?; - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) - .with_kind(RuleKind::Statement) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UnnamedFunctionAttribute) } #[allow(unused_assignments, unused_parens)] - fn statements_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| self.statement(input)) - .with_kind(RuleKind::StatementsList) + fn unnamed_function_attributes(&self, input: &mut ParserContext) -> ParserResult { + if !self.version_is_at_least_0_6_0 { + ZeroOrMoreHelper::run(input, |input| self.unnamed_function_attribute(input)) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UnnamedFunctionAttributes) } #[allow(unused_assignments, unused_parens)] - fn struct_definition(&self, input: &mut ParserContext) -> ParserResult { + fn unnamed_function_definition(&self, input: &mut ParserContext) -> ParserResult { + if !self.version_is_at_least_0_6_0 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FunctionKeyword, + ))?; + seq.elem(self.parameters_declaration(input))?; + seq.elem(self.unnamed_function_attributes(input))?; + seq.elem(self.function_body(input))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UnnamedFunctionDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn untyped_tuple_member(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::StructKeyword, - ))?; + seq.elem(OptionalHelper::transform(self.storage_location(input)))?; seq.elem(self.parse_token_with_trivia::( input, TokenKind::Identifier, ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; + seq.finish() + }) + .with_kind(RuleKind::UntypedTupleMember) + } + + #[allow(unused_assignments, unused_parens)] + fn user_defined_value_type_definition(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_8 { + SequenceHelper::run(|mut seq| { seq.elem( - OptionalHelper::transform(self.struct_members_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::TypeKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::IsKeyword, + ))?; + seq.elem(self.elementary_type(input))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, + TokenKind::Semicolon, + RecoverFromNoMatch::No, ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::CloseBrace, + TokenKind::Semicolon, ))?; seq.finish() - }))?; - seq.finish() - }) - .with_kind(RuleKind::StructDefinition) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UserDefinedValueTypeDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn using_alias(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_19 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::AsKeyword, + ))?; + seq.elem(ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Ampersand, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Asterisk, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BangEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Bar, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Caret, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::EqualEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Percent, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Plus, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Slash, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); + choice.consider(input, result)?; + choice.finish(input) + }))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UsingAlias) + } + + #[allow(unused_assignments, unused_parens)] + fn using_deconstruction_field(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_13 { + SequenceHelper::run(|mut seq| { + seq.elem(self.identifier_path(input))?; + if self.version_is_at_least_0_8_19 { + seq.elem(OptionalHelper::transform(self.using_alias(input)))?; + } + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UsingDeconstructionField) + } + + #[allow(unused_assignments, unused_parens)] + fn using_deconstruction_fields(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_13 { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.using_deconstruction_field(input), + TokenKind::Comma, + )) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UsingDeconstructionFields) } #[allow(unused_assignments, unused_parens)] - fn struct_member(&self, input: &mut ParserContext) -> ParserResult { + fn using_directive(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem( SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Identifier, + TokenKind::UsingKeyword, + ))?; + seq.elem(self.using_symbol(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ForKeyword, ))?; + seq.elem(self.using_target(input))?; + if self.version_is_at_least_0_8_13 { + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::GlobalKeyword, + ), + ))?; + } seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -3471,113 +5192,81 @@ impl Language { ))?; seq.finish() }) - .with_kind(RuleKind::StructMember) + .with_kind(RuleKind::UsingDirective) } #[allow(unused_assignments, unused_parens)] - fn struct_members_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| self.struct_member(input)) - .with_kind(RuleKind::StructMembersList) + fn using_symbol(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.identifier_path(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_8_13 { + let result = self.using_symbol_deconstruction(input); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::UsingSymbol) } #[allow(unused_assignments, unused_parens)] - fn throw_statement(&self, input: &mut ParserContext) -> ParserResult { - if !self.version_is_at_least_0_5_0 { + fn using_symbol_deconstruction(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_13 { SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBrace, + ))?; seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::ThrowKeyword, - ) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), + self.using_deconstruction_fields(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Semicolon, + TokenKind::CloseBrace, ))?; seq.finish() }) } else { ParserResult::disabled() } - .with_kind(RuleKind::ThrowStatement) + .with_kind(RuleKind::UsingSymbolDeconstruction) } #[allow(unused_assignments, unused_parens)] - fn trailing_trivia(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(OptionalHelper::transform( - self.parse_token::(input, TokenKind::Whitespace), - ))?; - seq.elem(OptionalHelper::transform( - self.parse_token::( - input, - TokenKind::SingleLineComment, - ), - ))?; - seq.elem(self.parse_token::(input, TokenKind::EndOfLine))?; - seq.finish() + fn using_target(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.type_name(input); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::Asterisk); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::TrailingTrivia) - } - - #[allow(unused_assignments, unused_parens)] - fn try_statement(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_6_0 { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::TryKeyword, - ))?; - seq.elem(self.expression(input))?; - seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; - seq.elem(self.block(input))?; - seq.elem(self.catch_clauses_list(input))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::TryStatement) + .with_kind(RuleKind::UsingTarget) } #[allow(unused_assignments, unused_parens)] - fn tuple_deconstruction_statement(&self, input: &mut ParserContext) -> ParserResult { + fn variable_declaration_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem( SequenceHelper::run(|mut seq| { - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - OptionalHelper::transform(self.tuple_members_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; + seq.elem(self.variable_declaration_type(input))?; + seq.elem(OptionalHelper::transform(self.storage_location(input)))?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Equal, + TokenKind::Identifier, + ))?; + seq.elem(OptionalHelper::transform( + self.variable_declaration_value(input), ))?; - seq.elem(self.expression(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -3593,970 +5282,823 @@ impl Language { ))?; seq.finish() }) - .with_kind(RuleKind::TupleDeconstructionStatement) - } - - #[allow(unused_assignments, unused_parens)] - fn tuple_expression(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - self.tuple_values_list(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }) - .with_kind(RuleKind::TupleExpression) + .with_kind(RuleKind::VariableDeclarationStatement) } #[allow(unused_assignments, unused_parens)] - fn tuple_member(&self, input: &mut ParserContext) -> ParserResult { - OptionalHelper::transform(ChoiceHelper::run(input, |mut choice, input| { - let result = SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::MemoryKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::StorageKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::CalldataKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.finish() - }); + fn variable_declaration_type(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.type_name(input); choice.consider(input, result)?; - let result = SequenceHelper::run(|mut seq| { - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::MemoryKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::StorageKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::CalldataKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - seq.elem(self.parse_token_with_trivia::( + if !self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( input, - TokenKind::Identifier, - ))?; - seq.finish() - }); - choice.consider(input, result)?; + TokenKind::VarKeyword, + ); + choice.consider(input, result)?; + } choice.finish(input) - })) - .with_kind(RuleKind::TupleMember) - } - - #[allow(unused_assignments, unused_parens)] - fn tuple_members_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.tuple_member(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::TupleMembersList) - } - - #[allow(unused_assignments, unused_parens)] - fn tuple_values_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| OptionalHelper::transform(self.expression(input)), - TokenKind::Comma, - ) - .with_kind(RuleKind::TupleValuesList) + }) + .with_kind(RuleKind::VariableDeclarationType) } #[allow(unused_assignments, unused_parens)] - fn type_expression(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_5_3 { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::TypeKeyword, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - self.type_name(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::TypeExpression) + fn variable_declaration_value(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + self.parse_token_with_trivia::( + input, + TokenKind::Equal, + ), + )?; + seq.elem(self.expression(input))?; + seq.finish() + }) + .with_kind(RuleKind::VariableDeclarationValue) } #[allow(unused_assignments, unused_parens)] - fn type_name(&self, input: &mut ParserContext) -> ParserResult { - let parse_array_type_name_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_postfix_operator( - RuleKind::ArrayTypeName, + fn version_pragma(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::SolidityKeyword, + ))?; + seq.elem(self.version_pragma_expressions(input))?; + seq.finish() + }) + .with_kind(RuleKind::VersionPragma) + } + + #[allow(unused_assignments, unused_parens)] + fn version_pragma_expression(&self, input: &mut ParserContext) -> ParserResult { + let parse_version_pragma_or_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::VersionPragmaBinaryExpression, 1u8, - SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBracket); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBracket, - ))?; - seq.elem( - OptionalHelper::transform(self.expression(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseBracket, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseBracket, - ))?; - seq.finish() - }), + 1u8 + 1, + self.parse_token_with_trivia::( + input, + TokenKind::BarBar, + ), ) }; - let primary_expression_parser = |input: &mut ParserContext| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.function_type(input); - choice.consider(input, result)?; - let result = self.mapping_type(input); - choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( + let parse_version_pragma_range_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::VersionPragmaBinaryExpression, + 3u8, + 3u8 + 1, + self.parse_token_with_trivia::(input, TokenKind::Minus), + ) + }; + let parse_version_pragma_prefix_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_prefix_operator( + RuleKind::VersionPragmaUnaryExpression, + 5u8, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( input, - TokenKind::BoolKeyword, + TokenKind::Caret, ); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let result = self.parse_token_with_trivia::( input, - TokenKind::StringKeyword, + TokenKind::Tilde, ); choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let result = self.parse_token_with_trivia::( input, - TokenKind::FixedBytesType, + TokenKind::Equal, ); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let result = self.parse_token_with_trivia::( input, - TokenKind::SignedIntegerType, + TokenKind::LessThan, ); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let result = self.parse_token_with_trivia::( input, - TokenKind::UnsignedIntegerType, + TokenKind::GreaterThan, ); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let result = self.parse_token_with_trivia::( input, - TokenKind::SignedFixedType, + TokenKind::LessThanEqual, ); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let result = self.parse_token_with_trivia::( input, - TokenKind::UnsignedFixedType, + TokenKind::GreaterThanEqual, ); choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } choice.finish(input) - }); + }), + ) + }; + let prefix_operator_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + let result = parse_version_pragma_prefix_expression(input); choice.consider(input, result)?; - let result = self.identifier_path(input); + choice.finish(input) + }) + }; + let primary_expression_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.version_pragma_specifier(input); choice.consider(input, result)?; choice.finish(input) }) }; - let postfix_operator_parser = |input: &mut ParserContext| { + let binary_operand_parser = |input: &mut ParserContext| { + SequenceHelper::run(|mut seq| { + seq.elem(ZeroOrMoreHelper::run(input, |input| { + prefix_operator_parser(input) + }))?; + seq.elem(primary_expression_parser(input))?; + seq.finish() + }) + }; + let binary_operator_parser = |input: &mut ParserContext| { ChoiceHelper::run(input, |mut choice, input| { - let result = parse_array_type_name_operator(input); + let result = parse_version_pragma_or_expression(input); + choice.consider(input, result)?; + let result = parse_version_pragma_range_expression(input); choice.consider(input, result)?; choice.finish(input) }) }; let linear_expression_parser = |input: &mut ParserContext| { SequenceHelper::run(|mut seq| { - seq.elem(primary_expression_parser(input))?; + seq.elem(binary_operand_parser(input))?; seq.elem(ZeroOrMoreHelper::run(input, |input| { - postfix_operator_parser(input) + SequenceHelper::run(|mut seq| { + seq.elem(binary_operator_parser(input))?; + seq.elem(binary_operand_parser(input))?; + seq.finish() + }) }))?; seq.finish() }) }; PrecedenceHelper::reduce_precedence_result( - Some(RuleKind::TypeName), + Some(RuleKind::VersionPragmaExpression), linear_expression_parser(input), ) - .with_kind(RuleKind::TypeName) + .with_kind(RuleKind::VersionPragmaExpression) } #[allow(unused_assignments, unused_parens)] - fn unchecked_block(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_8_0 { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::UncheckedKeyword, - ))?; - seq.elem(self.block(input))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::UncheckedBlock) + fn version_pragma_expressions(&self, input: &mut ParserContext) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.version_pragma_expression(input)) + .with_kind(RuleKind::VersionPragmaExpressions) } #[allow(unused_assignments, unused_parens)] - fn unicode_string_literals_list(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_7_0 { - OneOrMoreHelper::run(input, |input| { - self.parse_token_with_trivia::( - input, - TokenKind::UnicodeStringLiteral, - ) - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::UnicodeStringLiteralsList) + fn version_pragma_or_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::(input, TokenKind::BarBar) + .with_kind(RuleKind::VersionPragmaOrExpression) } #[allow(unused_assignments, unused_parens)] - fn unnamed_function_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - if !self.version_is_at_least_0_6_0 { - OneOrMoreHelper::run(input, |input| { - if !self.version_is_at_least_0_6_0 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PureKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ViewKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::UnnamedFunctionAttributesList) + fn version_pragma_prefix_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = + self.parse_token_with_trivia::(input, TokenKind::Caret); + choice.consider(input, result)?; + let result = + self.parse_token_with_trivia::(input, TokenKind::Tilde); + choice.consider(input, result)?; + let result = + self.parse_token_with_trivia::(input, TokenKind::Equal); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::LessThan); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::VersionPragmaPrefixExpression) } #[allow(unused_assignments, unused_parens)] - fn unnamed_function_definition(&self, input: &mut ParserContext) -> ParserResult { - if !self.version_is_at_least_0_6_0 { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + fn version_pragma_range_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::(input, TokenKind::Minus) + .with_kind(RuleKind::VersionPragmaRangeExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn version_pragma_specifier(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Pragma>( + input, + self, + |input| { + self.parse_token_with_trivia::( input, - TokenKind::FunctionKeyword, - ))?; - seq.elem(self.parameters_declaration(input))?; - seq.elem(OptionalHelper::transform( - self.unnamed_function_attributes_list(input), - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::UnnamedFunctionDefinition) + TokenKind::VersionPragmaValue, + ) + }, + TokenKind::Period, + ) + .with_kind(RuleKind::VersionPragmaSpecifier) } #[allow(unused_assignments, unused_parens)] - fn user_defined_value_type_definition(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_8_8 { - SequenceHelper::run(|mut seq| { + fn while_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::WhileKeyword, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::TypeKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.elem(self.parse_token_with_trivia::( + self.expression(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::IsKeyword, - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::BoolKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::StringKeyword, - ); - choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::FixedBytesType, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::SignedIntegerType, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::UnsignedIntegerType, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::SignedFixedType, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::UnsignedFixedType, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Semicolon, + TokenKind::CloseParen, ))?; seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::UserDefinedValueTypeDefinition) + }))?; + seq.elem(self.statement(input))?; + seq.finish() + }) + .with_kind(RuleKind::WhileStatement) } #[allow(unused_assignments, unused_parens)] - fn using_directive(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::UsingKeyword, - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive_path(input); - choice.consider(input, result)?; - let result = self.using_directive_deconstruction(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::ForKeyword, - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Asterisk, - ); - choice.consider(input, result)?; - let result = self.type_name(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - if self.version_is_at_least_0_8_13 { - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::GlobalKeyword, - ), - ))?; - } - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + fn yul_all_keywords(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAbstractKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAddressKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAfterKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAliasKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAnonymousKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulApplyKeyword, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::YulAsKeyword); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAssemblyKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAutoKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulBoolKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulBreakKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulByteKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulBytesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulCallDataKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulCaseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulCatchKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulConstantKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulConstructorKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulContinueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulContractKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulCopyOfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulDaysKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulDefaultKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulDefineKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulDeleteKeyword, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::YulDoKeyword); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulElseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulEmitKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulEnumKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulEtherKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulEventKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFallbackKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFalseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFinalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFinneyKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFixedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulForKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFunctionKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulGweiKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulHexKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulHoursKeyword, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::YulIfKeyword); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulImmutableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulImplementsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulImportKeyword, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::YulInKeyword); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulIndexedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulInlineKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulIntKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulInterfaceKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulInternalKeyword, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::YulIsKeyword); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - .with_kind(RuleKind::UsingDirective) - } - - #[allow(unused_assignments, unused_parens)] - fn using_directive_deconstruction(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_8_13 { - SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; - seq.elem( - self.using_directive_symbols_list(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseBrace, - ))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::UsingDirectiveDeconstruction) - } - - #[allow(unused_assignments, unused_parens)] - fn using_directive_path(&self, input: &mut ParserContext) -> ParserResult { - self.identifier_path(input) - .with_kind(RuleKind::UsingDirectivePath) - } - - #[allow(unused_assignments, unused_parens)] - fn using_directive_symbol(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.identifier_path(input))?; - if self.version_is_at_least_0_8_19 { - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::AsKeyword, - ))?; - seq.elem(if self.version_is_at_least_0_8_19 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Ampersand, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Asterisk, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::BangEqual, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Bar, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Caret, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::EqualEqual, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::GreaterThan, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::GreaterThanEqual, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::LessThan, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::LessThanEqual, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Minus, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Percent, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Plus, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Slash, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Tilde, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - })?; - seq.finish() - })))?; - } - seq.finish() - }) - .with_kind(RuleKind::UsingDirectiveSymbol) - } - - #[allow(unused_assignments, unused_parens)] - fn using_directive_symbols_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.using_directive_symbol(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::UsingDirectiveSymbolsList) - } - - #[allow(unused_assignments, unused_parens)] - fn variable_declaration(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - if !self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::VarKeyword, - ); - choice.consider(input, result)?; - } - let result = self.type_name(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( + TokenKind::YulLeaveKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulLetKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulLibraryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulMacroKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulMappingKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulMatchKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulMemoryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulMinutesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulModifierKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulMutableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulNewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulNullKeyword, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::YulOfKeyword); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulOverrideKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPartialKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPragmaKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPromiseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPublicKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulReceiveKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulReferenceKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulRelocatableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulReturnKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulReturnsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulRevertKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulSealedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulSecondsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulSizeOfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulStaticKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulStorageKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulStringKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulStructKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulSupportsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulSwitchKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::MemoryKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::StorageKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::CalldataKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::YulSzaboKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Identifier, - ))?; - seq.finish() - }) - .with_kind(RuleKind::VariableDeclaration) - } - - #[allow(unused_assignments, unused_parens)] - fn variable_declaration_statement(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.variable_declaration(input))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Equal, - ))?; - seq.elem(self.expression(input))?; - seq.finish() - })))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::YulThrowKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - .with_kind(RuleKind::VariableDeclarationStatement) - } - - #[allow(unused_assignments, unused_parens)] - fn version_pragma(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::SolidityKeyword, - ), - )?; - seq.elem(self.version_pragma_expressions_list(input))?; - seq.finish() - }) - .with_kind(RuleKind::VersionPragma) - } - - #[allow(unused_assignments, unused_parens)] - fn version_pragma_expression(&self, input: &mut ParserContext) -> ParserResult { - let parse_version_pragma_or_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::VersionPragmaBinaryExpression, - 1u8, - 1u8 + 1, - self.parse_token_with_trivia::( - input, - TokenKind::BarBar, - ), - ) - }; - let parse_version_pragma_range_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::VersionPragmaBinaryExpression, - 3u8, - 3u8 + 1, - self.parse_token_with_trivia::( - input, - TokenKind::Minus, - ), - ) - }; - let parse_version_pragma_unary_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_prefix_operator( - RuleKind::VersionPragmaUnaryExpression, - 5u8, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Caret, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Tilde, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Equal, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThanEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThanEqual, - ); - choice.consider(input, result)?; - choice.finish(input) - }), - ) - }; - let prefix_operator_parser = |input: &mut ParserContext| { - ChoiceHelper::run(input, |mut choice, input| { - let result = parse_version_pragma_unary_operator(input); - choice.consider(input, result)?; - choice.finish(input) - }) - }; - let primary_expression_parser = - |input: &mut ParserContext| self.version_pragma_specifier(input); - let binary_operand_parser = |input: &mut ParserContext| { - SequenceHelper::run(|mut seq| { - seq.elem(ZeroOrMoreHelper::run(input, |input| { - prefix_operator_parser(input) - }))?; - seq.elem(primary_expression_parser(input))?; - seq.finish() - }) - }; - let binary_operator_parser = |input: &mut ParserContext| { - ChoiceHelper::run(input, |mut choice, input| { - let result = parse_version_pragma_or_operator(input); - choice.consider(input, result)?; - let result = parse_version_pragma_range_operator(input); - choice.consider(input, result)?; - choice.finish(input) - }) - }; - let linear_expression_parser = |input: &mut ParserContext| { - SequenceHelper::run(|mut seq| { - seq.elem(binary_operand_parser(input))?; - seq.elem(ZeroOrMoreHelper::run(input, |input| { - SequenceHelper::run(|mut seq| { - seq.elem(binary_operator_parser(input))?; - seq.elem(binary_operand_parser(input))?; - seq.finish() - }) - }))?; - seq.finish() - }) - }; - PrecedenceHelper::reduce_precedence_result( - Some(RuleKind::VersionPragmaExpression), - linear_expression_parser(input), - ) - .with_kind(RuleKind::VersionPragmaExpression) - } - - #[allow(unused_assignments, unused_parens)] - fn version_pragma_expressions_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| self.version_pragma_expression(input)) - .with_kind(RuleKind::VersionPragmaExpressionsList) - } - - #[allow(unused_assignments, unused_parens)] - fn version_pragma_specifier(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::VersionPragma>( - input, - self, - |input| { - self.parse_token_with_trivia::( - input, - TokenKind::VersionPragmaValue, - ) - }, - TokenKind::Period, - ) - .with_kind(RuleKind::VersionPragmaSpecifier) - } - - #[allow(unused_assignments, unused_parens)] - fn while_statement(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + TokenKind::YulTrueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::WhileKeyword, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - self.expression(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; - seq.elem(self.statement(input))?; - seq.finish() + TokenKind::YulTryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulTypeDefKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulTypeKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulTypeOfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulUfixedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulUintKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulUncheckedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulUsingKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulVarKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulViewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulVirtualKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulWeeksKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulWeiKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulWhileKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulYearsKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::WhileStatement) + .with_kind(RuleKind::YulAllKeywords) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_arguments(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Yul>( + input, + self, + |input| self.yul_expression(input), + TokenKind::Comma, + )) + .with_kind(RuleKind::YulArguments) } #[allow(unused_assignments, unused_parens)] fn yul_assignment_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem(self.yul_identifier_paths_list(input))?; + seq.elem(self.yul_identifier_paths(input))?; seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::ColonEqual, ), @@ -4573,22 +6115,22 @@ impl Language { let mut delim_guard = input.open_delim(TokenKind::CloseBrace); let input = delim_guard.ctx(); seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::OpenBrace, ), )?; seq.elem( - OptionalHelper::transform(self.yul_statements_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::YulBlock>( - input, - self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, - ), + self.yul_statements(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Yul>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), )?; seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::CloseBrace, ), @@ -4600,113 +6142,65 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn yul_break_statement(&self, input: &mut ParserContext) -> ParserResult { - self.parse_token_with_trivia::(input, TokenKind::BreakKeyword) + self.parse_token_with_trivia::(input, TokenKind::YulBreakKeyword) .with_kind(RuleKind::YulBreakStatement) } #[allow(unused_assignments, unused_parens)] fn yul_continue_statement(&self, input: &mut ParserContext) -> ParserResult { - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, - TokenKind::ContinueKeyword, + TokenKind::YulContinueKeyword, ) .with_kind(RuleKind::YulContinueStatement) } #[allow(unused_assignments, unused_parens)] - fn yul_declaration_statement(&self, input: &mut ParserContext) -> ParserResult { + fn yul_default_case(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::LetKeyword, - ), - )?; - seq.elem(self.yul_identifier_paths_list(input))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::ColonEqual, - ), - )?; - seq.elem(self.yul_expression(input))?; - seq.finish() - })))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulDefaultKeyword, + ))?; + seq.elem(self.yul_block(input))?; seq.finish() }) - .with_kind(RuleKind::YulDeclarationStatement) + .with_kind(RuleKind::YulDefaultCase) } #[allow(unused_assignments, unused_parens)] fn yul_expression(&self, input: &mut ParserContext) -> ParserResult { - let parse_yul_function_call_operator = |input: &mut ParserContext| { + let parse_yul_function_call_expression = |input: &mut ParserContext| { PrecedenceHelper::to_postfix_operator( RuleKind::YulFunctionCallExpression, 1u8, SequenceHelper::run(|mut seq| { let mut delim_guard = input.open_delim(TokenKind::CloseParen); let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ), - )?; - seq.elem( - OptionalHelper::transform(self.yul_expressions_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::YulBlock>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ), + self.yul_arguments(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Yul>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; seq.finish() }), ) }; let primary_expression_parser = |input: &mut ParserContext| { ChoiceHelper::run(input, |mut choice, input| { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::TrueKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FalseKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulHexLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulDecimalLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HexStringLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ); - choice.consider(input, result)?; - choice.finish(input) - }); + let result = self.yul_literal(input); choice.consider(input, result)?; let result = self.yul_identifier_path(input); choice.consider(input, result)?; @@ -4715,7 +6209,7 @@ impl Language { }; let postfix_operator_parser = |input: &mut ParserContext| { ChoiceHelper::run(input, |mut choice, input| { - let result = parse_yul_function_call_operator(input); + let result = parse_yul_function_call_expression(input); choice.consider(input, result)?; choice.finish(input) }) @@ -4736,26 +6230,13 @@ impl Language { .with_kind(RuleKind::YulExpression) } - #[allow(unused_assignments, unused_parens)] - fn yul_expressions_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::YulBlock>( - input, - self, - |input| self.yul_expression(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::YulExpressionsList) - } - #[allow(unused_assignments, unused_parens)] fn yul_for_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::ForKeyword, - ), - )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulForKeyword, + ))?; seq.elem(self.yul_block(input))?; seq.elem(self.yul_expression(input))?; seq.elem(self.yul_block(input))?; @@ -4766,20 +6247,47 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn yul_function_definition(&self, input: &mut ParserContext) -> ParserResult { + fn yul_function_call_expression(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, - TokenKind::FunctionKeyword, + TokenKind::OpenParen, ), )?; seq.elem( - self.parse_token_with_trivia::( + self.yul_arguments(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Yul>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem( + self.parse_token_with_trivia::( input, - TokenKind::YulIdentifier, + TokenKind::CloseParen, ), )?; + seq.finish() + }) + .with_kind(RuleKind::YulFunctionCallExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_function_definition(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulFunctionKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulIdentifier, + ))?; seq.elem(self.yul_parameters_declaration(input))?; seq.elem(OptionalHelper::transform( self.yul_returns_declaration(input), @@ -4792,11 +6300,11 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn yul_identifier_path(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::YulBlock>( + SeparatedHelper::run::<_, LexicalContextType::Yul>( input, self, |input| { - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::YulIdentifier, ) @@ -4807,41 +6315,23 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn yul_identifier_paths_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::YulBlock>( + fn yul_identifier_paths(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Yul>( input, self, |input| self.yul_identifier_path(input), TokenKind::Comma, ) - .with_kind(RuleKind::YulIdentifierPathsList) - } - - #[allow(unused_assignments, unused_parens)] - fn yul_identifiers_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::YulBlock>( - input, - self, - |input| { - self.parse_token_with_trivia::( - input, - TokenKind::YulIdentifier, - ) - }, - TokenKind::Comma, - ) - .with_kind(RuleKind::YulIdentifiersList) + .with_kind(RuleKind::YulIdentifierPaths) } #[allow(unused_assignments, unused_parens)] fn yul_if_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::IfKeyword, - ), - )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulIfKeyword, + ))?; seq.elem(self.yul_expression(input))?; seq.elem(self.yul_block(input))?; seq.finish() @@ -4852,9 +6342,9 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn yul_leave_statement(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_6_0 { - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, - TokenKind::LeaveKeyword, + TokenKind::YulLeaveKeyword, ) } else { ParserResult::disabled() @@ -4862,28 +6352,82 @@ impl Language { .with_kind(RuleKind::YulLeaveStatement) } + #[allow(unused_assignments, unused_parens)] + fn yul_literal(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulTrueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFalseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulDecimalLiteral, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulHexLiteral, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::HexStringLiteral, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::YulLiteral) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_parameters(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Yul>( + input, + self, + |input| { + self.parse_token_with_trivia::( + input, + TokenKind::YulIdentifier, + ) + }, + TokenKind::Comma, + )) + .with_kind(RuleKind::YulParameters) + } + #[allow(unused_assignments, unused_parens)] fn yul_parameters_declaration(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { let mut delim_guard = input.open_delim(TokenKind::CloseParen); let input = delim_guard.ctx(); seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::OpenParen, ), )?; seq.elem( - OptionalHelper::transform(self.yul_identifiers_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::YulBlock>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), + self.yul_parameters(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Yul>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), )?; seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::CloseParen, ), @@ -4893,16 +6437,30 @@ impl Language { .with_kind(RuleKind::YulParametersDeclaration) } + #[allow(unused_assignments, unused_parens)] + fn yul_return_variables(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Yul>( + input, + self, + |input| { + self.parse_token_with_trivia::( + input, + TokenKind::YulIdentifier, + ) + }, + TokenKind::Comma, + ) + .with_kind(RuleKind::YulReturnVariables) + } + #[allow(unused_assignments, unused_parens)] fn yul_returns_declaration(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::MinusGreaterThan, - ), - )?; - seq.elem(self.yul_identifiers_list(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::MinusGreaterThan, + ))?; + seq.elem(self.yul_return_variables(input))?; seq.finish() }) .with_kind(RuleKind::YulReturnsDeclaration) @@ -4915,7 +6473,7 @@ impl Language { choice.consider(input, result)?; let result = self.yul_function_definition(input); choice.consider(input, result)?; - let result = self.yul_declaration_statement(input); + let result = self.yul_variable_declaration_statement(input); choice.consider(input, result)?; let result = self.yul_assignment_statement(input); choice.consider(input, result)?; @@ -4925,107 +6483,102 @@ impl Language { choice.consider(input, result)?; let result = self.yul_switch_statement(input); choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { + let result = self.yul_leave_statement(input); + choice.consider(input, result)?; + } let result = self.yul_break_statement(input); choice.consider(input, result)?; let result = self.yul_continue_statement(input); choice.consider(input, result)?; let result = self.yul_expression(input); choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = self.yul_leave_statement(input); - choice.consider(input, result)?; - } choice.finish(input) }) .with_kind(RuleKind::YulStatement) } #[allow(unused_assignments, unused_parens)] - fn yul_statements_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| self.yul_statement(input)) - .with_kind(RuleKind::YulStatementsList) + fn yul_statements(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.yul_statement(input)) + .with_kind(RuleKind::YulStatements) } #[allow(unused_assignments, unused_parens)] fn yul_switch_case(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::DefaultKeyword, - ); - choice.consider(input, result)?; - let result = SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::CaseKeyword, - ), - )?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::TrueKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FalseKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulHexLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulDecimalLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HexStringLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.finish() - }); - choice.consider(input, result)?; - choice.finish(input) - }))?; + ChoiceHelper::run(input, |mut choice, input| { + let result = self.yul_default_case(input); + choice.consider(input, result)?; + let result = self.yul_value_case(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::YulSwitchCase) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_switch_cases(&self, input: &mut ParserContext) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.yul_switch_case(input)) + .with_kind(RuleKind::YulSwitchCases) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_switch_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulSwitchKeyword, + ))?; + seq.elem(self.yul_expression(input))?; + seq.elem(self.yul_switch_cases(input))?; + seq.finish() + }) + .with_kind(RuleKind::YulSwitchStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_value_case(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulCaseKeyword, + ))?; + seq.elem(self.yul_literal(input))?; seq.elem(self.yul_block(input))?; seq.finish() }) - .with_kind(RuleKind::YulSwitchCase) + .with_kind(RuleKind::YulValueCase) } #[allow(unused_assignments, unused_parens)] - fn yul_switch_cases_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| self.yul_switch_case(input)) - .with_kind(RuleKind::YulSwitchCasesList) + fn yul_variable_declaration_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulLetKeyword, + ))?; + seq.elem(self.yul_identifier_paths(input))?; + seq.elem(OptionalHelper::transform( + self.yul_variable_declaration_value(input), + ))?; + seq.finish() + }) + .with_kind(RuleKind::YulVariableDeclarationStatement) } #[allow(unused_assignments, unused_parens)] - fn yul_switch_statement(&self, input: &mut ParserContext) -> ParserResult { + fn yul_variable_declaration_value(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, - TokenKind::SwitchKeyword, + TokenKind::ColonEqual, ), )?; seq.elem(self.yul_expression(input))?; - seq.elem(self.yul_switch_cases_list(input))?; seq.finish() }) - .with_kind(RuleKind::YulSwitchStatement) + .with_kind(RuleKind::YulVariableDeclarationValue) } /******************************************** @@ -5033,22 +6586,11 @@ impl Language { ********************************************/ #[allow(unused_assignments, unused_parens)] - fn ascii_character_without_double_quote_or_backslash(&self, input: &mut ParserContext) -> bool { - scan_choice!( - input, - scan_char_range!(input, ' ', '!'), - scan_char_range!(input, '#', '['), - scan_char_range!(input, ']', '~') - ) - } - - #[allow(unused_assignments, unused_parens)] - fn ascii_character_without_single_quote_or_backslash(&self, input: &mut ParserContext) -> bool { - scan_choice!( + fn ampersand(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( input, - scan_char_range!(input, ' ', '&'), - scan_char_range!(input, '(', '['), - scan_char_range!(input, ']', '~') + scan_chars!(input, '&'), + scan_choice!(input, scan_chars!(input, '='), scan_chars!(input, '&')) ) } @@ -5077,19 +6619,89 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn decimal_digit(&self, input: &mut ParserContext) -> bool { - scan_char_range!(input, '0', '9') + fn asterisk(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '*'), + scan_choice!(input, scan_chars!(input, '='), scan_chars!(input, '*')) + ) + } + + #[allow(unused_assignments, unused_parens)] + fn bang(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!(input, scan_chars!(input, '!'), scan_chars!(input, '=')) + } + + #[allow(unused_assignments, unused_parens)] + fn bar(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '|'), + scan_choice!(input, scan_chars!(input, '|'), scan_chars!(input, '=')) + ) + } + + #[allow(unused_assignments, unused_parens)] + fn bytes_keyword(&self, input: &mut ParserContext) -> bool { + scan_sequence!( + scan_chars!(input, 'b', 'y', 't', 'e', 's'), + scan_choice!( + input, + scan_chars!(input, '9'), + scan_chars!(input, '8'), + scan_chars!(input, '7'), + scan_chars!(input, '6'), + scan_chars!(input, '5'), + scan_chars!(input, '4'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '3', '1'), + scan_chars!(input, '3', '0'), + scan_chars!(input, '3'), + scan_chars!(input, '2', '9'), + scan_chars!(input, '2', '8'), + scan_chars!(input, '2', '7'), + scan_chars!(input, '2', '6'), + scan_chars!(input, '2', '5'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3'), + scan_chars!(input, '2', '2'), + scan_chars!(input, '2', '1'), + scan_chars!(input, '2', '0'), + scan_chars!(input, '2'), + scan_chars!(input, '1', '9'), + scan_chars!(input, '1', '8'), + scan_chars!(input, '1', '7'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5'), + scan_chars!(input, '1', '4'), + scan_chars!(input, '1', '3'), + scan_chars!(input, '1', '2'), + scan_chars!(input, '1', '1'), + scan_chars!(input, '1', '0'), + scan_chars!(input, '1') + ) + ) + } + + #[allow(unused_assignments, unused_parens)] + fn caret(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!(input, scan_chars!(input, '^'), scan_chars!(input, '=')) + } + + #[allow(unused_assignments, unused_parens)] + fn colon(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!(input, scan_chars!(input, ':'), scan_chars!(input, '=')) } #[allow(unused_assignments, unused_parens)] fn decimal_digits(&self, input: &mut ParserContext) -> bool { scan_sequence!( - scan_one_or_more!(input, self.decimal_digit(input)), + scan_one_or_more!(input, scan_char_range!(input, '0', '9')), scan_zero_or_more!( input, scan_sequence!( scan_chars!(input, '_'), - scan_one_or_more!(input, self.decimal_digit(input)) + scan_one_or_more!(input, scan_char_range!(input, '0', '9')) ) ) ) @@ -5106,35 +6718,55 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn decimal_literal(&self, input: &mut ParserContext) -> bool { - scan_not_followed_by!( + scan_choice!( input, - scan_sequence!( - scan_choice!( - input, + scan_not_followed_by!( + input, + scan_sequence!( scan_not_followed_by!( input, self.decimal_digits(input), scan_chars!(input, '.') ), - if !self.version_is_at_least_0_5_0 { + scan_optional!(input, self.decimal_exponent(input)) + ), + self.identifier_start(input) + ), + if !self.version_is_at_least_0_5_0 { + scan_not_followed_by!( + input, + scan_sequence!( scan_not_followed_by!( input, scan_sequence!(self.decimal_digits(input), scan_chars!(input, '.')), self.decimal_digits(input) - ) - } else { - false - }, - scan_sequence!(scan_chars!(input, '.'), self.decimal_digits(input)), - scan_sequence!( - self.decimal_digits(input), - scan_chars!(input, '.'), - self.decimal_digits(input) - ) + ), + scan_optional!(input, self.decimal_exponent(input)) + ), + self.identifier_start(input) + ) + } else { + false + }, + scan_not_followed_by!( + input, + scan_sequence!( + scan_chars!(input, '.'), + self.decimal_digits(input), + scan_optional!(input, self.decimal_exponent(input)) ), - scan_optional!(input, self.decimal_exponent(input)) + self.identifier_start(input) ), - self.identifier_start(input) + scan_not_followed_by!( + input, + scan_sequence!( + self.decimal_digits(input), + scan_chars!(input, '.'), + self.decimal_digits(input), + scan_optional!(input, self.decimal_exponent(input)) + ), + self.identifier_start(input) + ) ) } @@ -5147,7 +6779,9 @@ impl Language { scan_choice!( input, self.escape_sequence(input), - self.ascii_character_without_double_quote_or_backslash(input) + scan_char_range!(input, ' ', '!'), + scan_char_range!(input, '#', '['), + scan_char_range!(input, ']', '~') ) ), scan_chars!(input, '"') @@ -5173,7 +6807,7 @@ impl Language { scan_choice!( input, self.escape_sequence(input), - scan_none_of!(input, '\n', '\r', '"', '\\') + scan_none_of!(input, '"', '\\', '\r', '\n') ) ), scan_chars!(input, '"') @@ -5191,6 +6825,15 @@ impl Language { ) } + #[allow(unused_assignments, unused_parens)] + fn equal(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '='), + scan_choice!(input, scan_chars!(input, '>'), scan_chars!(input, '=')) + ) + } + #[allow(unused_assignments, unused_parens)] fn escape_sequence(&self, input: &mut ParserContext) -> bool { scan_sequence!( @@ -5205,58 +6848,312 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn fixed_bytes_type(&self, input: &mut ParserContext) -> bool { - scan_sequence!( - scan_chars!(input, 'b', 'y', 't', 'e', 's'), - self.fixed_bytes_type_size(input) + fn fixed_keyword(&self, input: &mut ParserContext) -> bool { + scan_choice!( + input, + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '6') + ) + ), + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '4', '8', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '1', '6'), + scan_chars!(input, '2', '3', '2', 'x', '8'), + scan_chars!(input, '2', '3', '2', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '1', '6'), + scan_chars!(input, '2', '2', '4', 'x', '8'), + scan_chars!(input, '2', '2', '4', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '2', '4'), + scan_chars!(input, '2', '2', '4', 'x', '1', '6'), + scan_chars!(input, '2', '1', '6', 'x', '8'), + scan_chars!(input, '2', '1', '6', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '3', '2'), + scan_chars!(input, '2', '1', '6', 'x', '2', '4'), + scan_chars!(input, '2', '1', '6', 'x', '1', '6'), + scan_chars!(input, '2', '0', '8', 'x', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '0'), + scan_chars!(input, '2', '0', '8', 'x', '3', '2'), + scan_chars!(input, '2', '0', '8', 'x', '2', '4'), + scan_chars!(input, '2', '0', '8', 'x', '1', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8'), + scan_chars!(input, '2', '0', '0', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '4', '8'), + scan_chars!(input, '2', '0', '0', 'x', '4', '0'), + scan_chars!(input, '2', '0', '0', 'x', '3', '2'), + scan_chars!(input, '2', '0', '0', 'x', '2', '4'), + scan_chars!(input, '2', '0', '0', 'x', '1', '6'), + scan_chars!(input, '1', '9', '2', 'x', '8'), + scan_chars!(input, '1', '9', '2', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '5', '6'), + scan_chars!(input, '1', '9', '2', 'x', '4', '8'), + scan_chars!(input, '1', '9', '2', 'x', '4', '0'), + scan_chars!(input, '1', '9', '2', 'x', '3', '2'), + scan_chars!(input, '1', '9', '2', 'x', '2', '4'), + scan_chars!(input, '1', '9', '2', 'x', '1', '6'), + scan_chars!(input, '1', '8', '4', 'x', '8'), + scan_chars!(input, '1', '8', '4', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '6', '4'), + scan_chars!(input, '1', '8', '4', 'x', '5', '6'), + scan_chars!(input, '1', '8', '4', 'x', '4', '8'), + scan_chars!(input, '1', '8', '4', 'x', '4', '0'), + scan_chars!(input, '1', '8', '4', 'x', '3', '2'), + scan_chars!(input, '1', '8', '4', 'x', '2', '4'), + scan_chars!(input, '1', '8', '4', 'x', '1', '6') + ) + ), + if self.version_is_at_least_0_4_14 { + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '5', '6', 'x', '8', '0'), + scan_chars!(input, '2', '5', '6', 'x', '8'), + scan_chars!(input, '2', '5', '6', 'x', '7', '2'), + scan_chars!(input, '2', '5', '6', 'x', '6', '4'), + scan_chars!(input, '2', '5', '6', 'x', '5', '6'), + scan_chars!(input, '2', '5', '6', 'x', '4', '8'), + scan_chars!(input, '2', '5', '6', 'x', '4', '0'), + scan_chars!(input, '2', '5', '6', 'x', '3', '2'), + scan_chars!(input, '2', '5', '6', 'x', '2', '4'), + scan_chars!(input, '2', '5', '6', 'x', '1', '6'), + scan_chars!(input, '2', '4', '8', 'x', '8', '0'), + scan_chars!(input, '2', '4', '8', 'x', '7', '2'), + scan_chars!(input, '2', '4', '8', 'x', '6', '4'), + scan_chars!(input, '2', '4', '8', 'x', '5', '6'), + scan_chars!(input, '2', '4', '8', 'x', '4', '8'), + scan_chars!(input, '2', '4', '8', 'x', '4', '0'), + scan_chars!(input, '2', '4', '8', 'x', '3', '2'), + scan_chars!(input, '2', '4', '8', 'x', '2', '4'), + scan_chars!(input, '2', '4', '8', 'x', '1', '6'), + scan_chars!(input, '2', '4', '0', 'x', '8', '0'), + scan_chars!(input, '2', '4', '0', 'x', '7', '2'), + scan_chars!(input, '2', '4', '0', 'x', '6', '4'), + scan_chars!(input, '2', '4', '0', 'x', '5', '6'), + scan_chars!(input, '2', '4', '0', 'x', '4', '8'), + scan_chars!(input, '2', '4', '0', 'x', '4', '0'), + scan_chars!(input, '2', '4', '0', 'x', '3', '2'), + scan_chars!(input, '2', '4', '0', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '8', '0'), + scan_chars!(input, '2', '3', '2', 'x', '7', '2'), + scan_chars!(input, '2', '3', '2', 'x', '6', '4'), + scan_chars!(input, '2', '3', '2', 'x', '5', '6'), + scan_chars!(input, '2', '3', '2', 'x', '4', '8'), + scan_chars!(input, '2', '3', '2', 'x', '4', '0'), + scan_chars!(input, '2', '3', '2', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '8', '0'), + scan_chars!(input, '2', '2', '4', 'x', '7', '2'), + scan_chars!(input, '2', '2', '4', 'x', '6', '4'), + scan_chars!(input, '2', '2', '4', 'x', '5', '6'), + scan_chars!(input, '2', '2', '4', 'x', '4', '8'), + scan_chars!(input, '2', '2', '4', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '8', '0'), + scan_chars!(input, '2', '1', '6', 'x', '7', '2'), + scan_chars!(input, '2', '1', '6', 'x', '6', '4'), + scan_chars!(input, '2', '1', '6', 'x', '5', '6'), + scan_chars!(input, '2', '1', '6', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '8', '0'), + scan_chars!(input, '2', '0', '8', 'x', '7', '2'), + scan_chars!(input, '2', '0', '8', 'x', '6', '4'), + scan_chars!(input, '2', '0', '8', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8', '0'), + scan_chars!(input, '2', '0', '0', 'x', '7', '2'), + scan_chars!(input, '2', '0', '0', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '8', '0'), + scan_chars!(input, '1', '9', '2', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '8', '0') + ) + ) + } else { + false + }, + if self.version_is_at_least_0_4_14 { + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '9'), + scan_chars!(input, '7', '9'), + scan_chars!(input, '7', '8'), + scan_chars!(input, '7', '7'), + scan_chars!(input, '7', '6'), + scan_chars!(input, '7', '5'), + scan_chars!(input, '7', '4'), + scan_chars!(input, '7', '3'), + scan_chars!(input, '7', '1'), + scan_chars!(input, '7', '0'), + scan_chars!(input, '7'), + scan_chars!(input, '6', '9'), + scan_chars!(input, '6', '8'), + scan_chars!(input, '6', '7'), + scan_chars!(input, '6', '6'), + scan_chars!(input, '6', '5'), + scan_chars!(input, '6', '3'), + scan_chars!(input, '6', '2'), + scan_chars!(input, '6', '1'), + scan_chars!(input, '6', '0'), + scan_chars!(input, '6'), + scan_chars!(input, '5', '9'), + scan_chars!(input, '5', '8'), + scan_chars!(input, '5', '7'), + scan_chars!(input, '5', '5'), + scan_chars!(input, '5', '4'), + scan_chars!(input, '5', '3'), + scan_chars!(input, '5', '2'), + scan_chars!(input, '5', '1'), + scan_chars!(input, '5', '0'), + scan_chars!(input, '5'), + scan_chars!(input, '4', '9'), + scan_chars!(input, '4', '7'), + scan_chars!(input, '4', '6'), + scan_chars!(input, '4', '5'), + scan_chars!(input, '4', '4'), + scan_chars!(input, '4', '3'), + scan_chars!(input, '4', '2'), + scan_chars!(input, '4', '1'), + scan_chars!(input, '4'), + scan_chars!(input, '3', '9'), + scan_chars!(input, '3', '8'), + scan_chars!(input, '3', '7'), + scan_chars!(input, '3', '6'), + scan_chars!(input, '3', '5'), + scan_chars!(input, '3', '4'), + scan_chars!(input, '3', '3'), + scan_chars!(input, '3', '1'), + scan_chars!(input, '3', '0'), + scan_chars!(input, '3'), + scan_chars!(input, '2', '9'), + scan_chars!(input, '2', '8'), + scan_chars!(input, '2', '7'), + scan_chars!(input, '2', '6'), + scan_chars!(input, '2', '5'), + scan_chars!(input, '2', '3'), + scan_chars!(input, '2', '2'), + scan_chars!(input, '2', '1'), + scan_chars!(input, '2', '0'), + scan_chars!(input, '2'), + scan_chars!(input, '1', '9'), + scan_chars!(input, '1', '8'), + scan_chars!(input, '1', '7'), + scan_chars!(input, '1', '5'), + scan_chars!(input, '1', '4'), + scan_chars!(input, '1', '3'), + scan_chars!(input, '1', '2'), + scan_chars!(input, '1', '1'), + scan_chars!(input, '1', '0'), + scan_chars!(input, '1'), + scan_chars!(input, '0') + ) + ) + } else { + false + } ) } #[allow(unused_assignments, unused_parens)] - fn fixed_bytes_type_size(&self, input: &mut ParserContext) -> bool { - scan_choice!( + fn greater_than(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( input, - scan_chars!(input, '9'), - scan_chars!(input, '8'), - scan_chars!(input, '7'), - scan_chars!(input, '6'), - scan_chars!(input, '5'), - scan_chars!(input, '4'), - scan_chars!(input, '3', '2'), - scan_chars!(input, '3', '1'), - scan_chars!(input, '3', '0'), - scan_chars!(input, '3'), - scan_chars!(input, '2', '9'), - scan_chars!(input, '2', '8'), - scan_chars!(input, '2', '7'), - scan_chars!(input, '2', '6'), - scan_chars!(input, '2', '5'), - scan_chars!(input, '2', '4'), - scan_chars!(input, '2', '3'), - scan_chars!(input, '2', '2'), - scan_chars!(input, '2', '1'), - scan_chars!(input, '2', '0'), - scan_chars!(input, '2'), - scan_chars!(input, '1', '9'), - scan_chars!(input, '1', '8'), - scan_chars!(input, '1', '7'), - scan_chars!(input, '1', '6'), - scan_chars!(input, '1', '5'), - scan_chars!(input, '1', '4'), - scan_chars!(input, '1', '3'), - scan_chars!(input, '1', '2'), - scan_chars!(input, '1', '1'), - scan_chars!(input, '1', '0'), - scan_chars!(input, '1') + scan_chars!(input, '>'), + scan_choice!(input, scan_chars!(input, '>'), scan_chars!(input, '=')) ) } #[allow(unused_assignments, unused_parens)] - fn fixed_type_size(&self, input: &mut ParserContext) -> bool { - scan_sequence!( - scan_one_or_more!(input, scan_char_range!(input, '0', '9')), - scan_chars!(input, 'x'), - scan_one_or_more!(input, scan_char_range!(input, '0', '9')) + fn greater_than_greater_than(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '>', '>'), + scan_choice!(input, scan_chars!(input, '>'), scan_chars!(input, '=')) + ) + } + + #[allow(unused_assignments, unused_parens)] + fn greater_than_greater_than_greater_than(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '>', '>', '>'), + scan_chars!(input, '=') ) } @@ -5273,36 +7170,50 @@ impl Language { fn hex_character(&self, input: &mut ParserContext) -> bool { scan_choice!( input, - self.decimal_digit(input), - scan_char_range!(input, 'A', 'F'), - scan_char_range!(input, 'a', 'f') + scan_char_range!(input, '0', '9'), + scan_char_range!(input, 'a', 'f'), + scan_char_range!(input, 'A', 'F') ) } #[allow(unused_assignments, unused_parens)] fn hex_literal(&self, input: &mut ParserContext) -> bool { - scan_not_followed_by!( + scan_choice!( input, - scan_sequence!( - scan_choice!( - input, + scan_not_followed_by!( + input, + scan_sequence!( scan_chars!(input, '0', 'x'), - if !self.version_is_at_least_0_5_0 { - scan_chars!(input, '0', 'X') - } else { - false - } + scan_one_or_more!(input, self.hex_character(input)), + scan_zero_or_more!( + input, + scan_sequence!( + scan_chars!(input, '_'), + scan_one_or_more!(input, self.hex_character(input)) + ) + ) ), - scan_one_or_more!(input, self.hex_character(input)), - scan_zero_or_more!( + self.identifier_start(input) + ), + if !self.version_is_at_least_0_5_0 { + scan_not_followed_by!( input, scan_sequence!( - scan_chars!(input, '_'), - scan_one_or_more!(input, self.hex_character(input)) - ) + scan_chars!(input, '0', 'X'), + scan_one_or_more!(input, self.hex_character(input)), + scan_zero_or_more!( + input, + scan_sequence!( + scan_chars!(input, '_'), + scan_one_or_more!(input, self.hex_character(input)) + ) + ) + ), + self.identifier_start(input) ) - ), - self.identifier_start(input) + } else { + false + } ) } @@ -5351,47 +7262,81 @@ impl Language { input, scan_chars!(input, '_'), scan_chars!(input, '$'), - scan_char_range!(input, 'A', 'Z'), - scan_char_range!(input, 'a', 'z') + scan_char_range!(input, 'a', 'z'), + scan_char_range!(input, 'A', 'Z') ) } #[allow(unused_assignments, unused_parens)] - fn integer_type_size(&self, input: &mut ParserContext) -> bool { - scan_choice!( + fn int_keyword(&self, input: &mut ParserContext) -> bool { + scan_sequence!( + scan_chars!(input, 'i', 'n', 't'), + scan_optional!( + input, + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ) + ) + ) + } + + #[allow(unused_assignments, unused_parens)] + fn less_than(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '<'), + scan_choice!(input, scan_chars!(input, '='), scan_chars!(input, '<')) + ) + } + + #[allow(unused_assignments, unused_parens)] + fn less_than_less_than(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!(input, scan_chars!(input, '<', '<'), scan_chars!(input, '=')) + } + + #[allow(unused_assignments, unused_parens)] + fn minus(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( input, - scan_chars!(input, '9', '6'), - scan_chars!(input, '8', '8'), - scan_chars!(input, '8', '0'), - scan_chars!(input, '8'), - scan_chars!(input, '7', '2'), - scan_chars!(input, '6', '4'), - scan_chars!(input, '5', '6'), - scan_chars!(input, '4', '8'), - scan_chars!(input, '4', '0'), - scan_chars!(input, '3', '2'), - scan_chars!(input, '2', '5', '6'), - scan_chars!(input, '2', '4', '8'), - scan_chars!(input, '2', '4', '0'), - scan_chars!(input, '2', '4'), - scan_chars!(input, '2', '3', '2'), - scan_chars!(input, '2', '2', '4'), - scan_chars!(input, '2', '1', '6'), - scan_chars!(input, '2', '0', '8'), - scan_chars!(input, '2', '0', '0'), - scan_chars!(input, '1', '9', '2'), - scan_chars!(input, '1', '8', '4'), - scan_chars!(input, '1', '7', '6'), - scan_chars!(input, '1', '6', '8'), - scan_chars!(input, '1', '6', '0'), - scan_chars!(input, '1', '6'), - scan_chars!(input, '1', '5', '2'), - scan_chars!(input, '1', '4', '4'), - scan_chars!(input, '1', '3', '6'), - scan_chars!(input, '1', '2', '8'), - scan_chars!(input, '1', '2', '0'), - scan_chars!(input, '1', '1', '2'), - scan_chars!(input, '1', '0', '4') + scan_chars!(input, '-'), + scan_choice!( + input, + scan_chars!(input, '>'), + scan_chars!(input, '='), + scan_chars!(input, '-') + ) ) } @@ -5414,26 +7359,24 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn raw_identifier(&self, input: &mut ParserContext) -> bool { - scan_sequence!( - self.identifier_start(input), - scan_zero_or_more!(input, self.identifier_part(input)) - ) + fn percent(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!(input, scan_chars!(input, '%'), scan_chars!(input, '=')) } #[allow(unused_assignments, unused_parens)] - fn signed_fixed_type(&self, input: &mut ParserContext) -> bool { - scan_sequence!( - scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), - scan_optional!(input, self.fixed_type_size(input)) + fn plus(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '+'), + scan_choice!(input, scan_chars!(input, '='), scan_chars!(input, '+')) ) } #[allow(unused_assignments, unused_parens)] - fn signed_integer_type(&self, input: &mut ParserContext) -> bool { + fn raw_identifier(&self, input: &mut ParserContext) -> bool { scan_sequence!( - scan_chars!(input, 'i', 'n', 't'), - scan_optional!(input, self.integer_type_size(input)) + self.identifier_start(input), + scan_zero_or_more!(input, self.identifier_part(input)) ) } @@ -5454,7 +7397,9 @@ impl Language { scan_choice!( input, self.escape_sequence(input), - self.ascii_character_without_single_quote_or_backslash(input) + scan_char_range!(input, ' ', '&'), + scan_char_range!(input, '(', '['), + scan_char_range!(input, ']', '~') ) ), scan_chars!(input, '\'') @@ -5480,7 +7425,7 @@ impl Language { scan_choice!( input, self.escape_sequence(input), - scan_none_of!(input, '\n', '\r', '\'', '\\') + scan_none_of!(input, '\'', '\\', '\r', '\n') ) ), scan_chars!(input, '\'') @@ -5491,42 +7436,363 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn unicode_escape(&self, input: &mut ParserContext) -> bool { - scan_sequence!( - scan_chars!(input, 'u'), - self.hex_character(input), - self.hex_character(input), - self.hex_character(input), - self.hex_character(input) + fn slash(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!(input, scan_chars!(input, '/'), scan_chars!(input, '=')) + } + + #[allow(unused_assignments, unused_parens)] + fn ufixed_keyword(&self, input: &mut ParserContext) -> bool { + scan_choice!( + input, + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '6') + ) + ), + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '4', '8', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '1', '6'), + scan_chars!(input, '2', '3', '2', 'x', '8'), + scan_chars!(input, '2', '3', '2', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '1', '6'), + scan_chars!(input, '2', '2', '4', 'x', '8'), + scan_chars!(input, '2', '2', '4', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '2', '4'), + scan_chars!(input, '2', '2', '4', 'x', '1', '6'), + scan_chars!(input, '2', '1', '6', 'x', '8'), + scan_chars!(input, '2', '1', '6', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '3', '2'), + scan_chars!(input, '2', '1', '6', 'x', '2', '4'), + scan_chars!(input, '2', '1', '6', 'x', '1', '6'), + scan_chars!(input, '2', '0', '8', 'x', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '0'), + scan_chars!(input, '2', '0', '8', 'x', '3', '2'), + scan_chars!(input, '2', '0', '8', 'x', '2', '4'), + scan_chars!(input, '2', '0', '8', 'x', '1', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8'), + scan_chars!(input, '2', '0', '0', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '4', '8'), + scan_chars!(input, '2', '0', '0', 'x', '4', '0'), + scan_chars!(input, '2', '0', '0', 'x', '3', '2'), + scan_chars!(input, '2', '0', '0', 'x', '2', '4'), + scan_chars!(input, '2', '0', '0', 'x', '1', '6'), + scan_chars!(input, '1', '9', '2', 'x', '8'), + scan_chars!(input, '1', '9', '2', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '5', '6'), + scan_chars!(input, '1', '9', '2', 'x', '4', '8'), + scan_chars!(input, '1', '9', '2', 'x', '4', '0'), + scan_chars!(input, '1', '9', '2', 'x', '3', '2'), + scan_chars!(input, '1', '9', '2', 'x', '2', '4'), + scan_chars!(input, '1', '9', '2', 'x', '1', '6'), + scan_chars!(input, '1', '8', '4', 'x', '8'), + scan_chars!(input, '1', '8', '4', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '6', '4'), + scan_chars!(input, '1', '8', '4', 'x', '5', '6'), + scan_chars!(input, '1', '8', '4', 'x', '4', '8'), + scan_chars!(input, '1', '8', '4', 'x', '4', '0'), + scan_chars!(input, '1', '8', '4', 'x', '3', '2'), + scan_chars!(input, '1', '8', '4', 'x', '2', '4'), + scan_chars!(input, '1', '8', '4', 'x', '1', '6') + ) + ), + if self.version_is_at_least_0_4_14 { + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '5', '6', 'x', '8', '0'), + scan_chars!(input, '2', '5', '6', 'x', '8'), + scan_chars!(input, '2', '5', '6', 'x', '7', '2'), + scan_chars!(input, '2', '5', '6', 'x', '6', '4'), + scan_chars!(input, '2', '5', '6', 'x', '5', '6'), + scan_chars!(input, '2', '5', '6', 'x', '4', '8'), + scan_chars!(input, '2', '5', '6', 'x', '4', '0'), + scan_chars!(input, '2', '5', '6', 'x', '3', '2'), + scan_chars!(input, '2', '5', '6', 'x', '2', '4'), + scan_chars!(input, '2', '5', '6', 'x', '1', '6'), + scan_chars!(input, '2', '4', '8', 'x', '8', '0'), + scan_chars!(input, '2', '4', '8', 'x', '7', '2'), + scan_chars!(input, '2', '4', '8', 'x', '6', '4'), + scan_chars!(input, '2', '4', '8', 'x', '5', '6'), + scan_chars!(input, '2', '4', '8', 'x', '4', '8'), + scan_chars!(input, '2', '4', '8', 'x', '4', '0'), + scan_chars!(input, '2', '4', '8', 'x', '3', '2'), + scan_chars!(input, '2', '4', '8', 'x', '2', '4'), + scan_chars!(input, '2', '4', '8', 'x', '1', '6'), + scan_chars!(input, '2', '4', '0', 'x', '8', '0'), + scan_chars!(input, '2', '4', '0', 'x', '7', '2'), + scan_chars!(input, '2', '4', '0', 'x', '6', '4'), + scan_chars!(input, '2', '4', '0', 'x', '5', '6'), + scan_chars!(input, '2', '4', '0', 'x', '4', '8'), + scan_chars!(input, '2', '4', '0', 'x', '4', '0'), + scan_chars!(input, '2', '4', '0', 'x', '3', '2'), + scan_chars!(input, '2', '4', '0', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '8', '0'), + scan_chars!(input, '2', '3', '2', 'x', '7', '2'), + scan_chars!(input, '2', '3', '2', 'x', '6', '4'), + scan_chars!(input, '2', '3', '2', 'x', '5', '6'), + scan_chars!(input, '2', '3', '2', 'x', '4', '8'), + scan_chars!(input, '2', '3', '2', 'x', '4', '0'), + scan_chars!(input, '2', '3', '2', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '8', '0'), + scan_chars!(input, '2', '2', '4', 'x', '7', '2'), + scan_chars!(input, '2', '2', '4', 'x', '6', '4'), + scan_chars!(input, '2', '2', '4', 'x', '5', '6'), + scan_chars!(input, '2', '2', '4', 'x', '4', '8'), + scan_chars!(input, '2', '2', '4', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '8', '0'), + scan_chars!(input, '2', '1', '6', 'x', '7', '2'), + scan_chars!(input, '2', '1', '6', 'x', '6', '4'), + scan_chars!(input, '2', '1', '6', 'x', '5', '6'), + scan_chars!(input, '2', '1', '6', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '8', '0'), + scan_chars!(input, '2', '0', '8', 'x', '7', '2'), + scan_chars!(input, '2', '0', '8', 'x', '6', '4'), + scan_chars!(input, '2', '0', '8', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8', '0'), + scan_chars!(input, '2', '0', '0', 'x', '7', '2'), + scan_chars!(input, '2', '0', '0', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '8', '0'), + scan_chars!(input, '1', '9', '2', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '8', '0') + ) + ) + } else { + false + }, + if self.version_is_at_least_0_4_14 { + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '9'), + scan_chars!(input, '7', '9'), + scan_chars!(input, '7', '8'), + scan_chars!(input, '7', '7'), + scan_chars!(input, '7', '6'), + scan_chars!(input, '7', '5'), + scan_chars!(input, '7', '4'), + scan_chars!(input, '7', '3'), + scan_chars!(input, '7', '1'), + scan_chars!(input, '7', '0'), + scan_chars!(input, '7'), + scan_chars!(input, '6', '9'), + scan_chars!(input, '6', '8'), + scan_chars!(input, '6', '7'), + scan_chars!(input, '6', '6'), + scan_chars!(input, '6', '5'), + scan_chars!(input, '6', '3'), + scan_chars!(input, '6', '2'), + scan_chars!(input, '6', '1'), + scan_chars!(input, '6', '0'), + scan_chars!(input, '6'), + scan_chars!(input, '5', '9'), + scan_chars!(input, '5', '8'), + scan_chars!(input, '5', '7'), + scan_chars!(input, '5', '5'), + scan_chars!(input, '5', '4'), + scan_chars!(input, '5', '3'), + scan_chars!(input, '5', '2'), + scan_chars!(input, '5', '1'), + scan_chars!(input, '5', '0'), + scan_chars!(input, '5'), + scan_chars!(input, '4', '9'), + scan_chars!(input, '4', '7'), + scan_chars!(input, '4', '6'), + scan_chars!(input, '4', '5'), + scan_chars!(input, '4', '4'), + scan_chars!(input, '4', '3'), + scan_chars!(input, '4', '2'), + scan_chars!(input, '4', '1'), + scan_chars!(input, '4'), + scan_chars!(input, '3', '9'), + scan_chars!(input, '3', '8'), + scan_chars!(input, '3', '7'), + scan_chars!(input, '3', '6'), + scan_chars!(input, '3', '5'), + scan_chars!(input, '3', '4'), + scan_chars!(input, '3', '3'), + scan_chars!(input, '3', '1'), + scan_chars!(input, '3', '0'), + scan_chars!(input, '3'), + scan_chars!(input, '2', '9'), + scan_chars!(input, '2', '8'), + scan_chars!(input, '2', '7'), + scan_chars!(input, '2', '6'), + scan_chars!(input, '2', '5'), + scan_chars!(input, '2', '3'), + scan_chars!(input, '2', '2'), + scan_chars!(input, '2', '1'), + scan_chars!(input, '2', '0'), + scan_chars!(input, '2'), + scan_chars!(input, '1', '9'), + scan_chars!(input, '1', '8'), + scan_chars!(input, '1', '7'), + scan_chars!(input, '1', '5'), + scan_chars!(input, '1', '4'), + scan_chars!(input, '1', '3'), + scan_chars!(input, '1', '2'), + scan_chars!(input, '1', '1'), + scan_chars!(input, '1', '0'), + scan_chars!(input, '1'), + scan_chars!(input, '0') + ) + ) + } else { + false + } ) } #[allow(unused_assignments, unused_parens)] - fn unicode_string_literal(&self, input: &mut ParserContext) -> bool { - if self.version_is_at_least_0_7_0 { - scan_choice!( + fn uint_keyword(&self, input: &mut ParserContext) -> bool { + scan_sequence!( + scan_chars!(input, 'u', 'i', 'n', 't'), + scan_optional!( input, - self.single_quoted_unicode_string_literal(input), - self.double_quoted_unicode_string_literal(input) + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ) ) - } else { - false - } + ) } #[allow(unused_assignments, unused_parens)] - fn unsigned_fixed_type(&self, input: &mut ParserContext) -> bool { + fn unicode_escape(&self, input: &mut ParserContext) -> bool { scan_sequence!( - scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), - scan_optional!(input, self.fixed_type_size(input)) + scan_chars!(input, 'u'), + self.hex_character(input), + self.hex_character(input), + self.hex_character(input), + self.hex_character(input) ) } #[allow(unused_assignments, unused_parens)] - fn unsigned_integer_type(&self, input: &mut ParserContext) -> bool { - scan_sequence!( - scan_chars!(input, 'u', 'i', 'n', 't'), - scan_optional!(input, self.integer_type_size(input)) + fn unicode_string_literal(&self, input: &mut ParserContext) -> bool { + scan_choice!( + input, + if self.version_is_at_least_0_7_0 { + self.single_quoted_unicode_string_literal(input) + } else { + false + }, + if self.version_is_at_least_0_7_0 { + self.double_quoted_unicode_string_literal(input) + } else { + false + } ) } @@ -5552,6 +7818,52 @@ impl Language { ) } + #[allow(unused_assignments, unused_parens)] + fn yul_bytes_keyword(&self, input: &mut ParserContext) -> bool { + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'b', 'y', 't', 'e', 's'), + scan_choice!( + input, + scan_chars!(input, '9'), + scan_chars!(input, '8'), + scan_chars!(input, '7'), + scan_chars!(input, '6'), + scan_chars!(input, '5'), + scan_chars!(input, '4'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '3', '1'), + scan_chars!(input, '3', '0'), + scan_chars!(input, '3'), + scan_chars!(input, '2', '9'), + scan_chars!(input, '2', '8'), + scan_chars!(input, '2', '7'), + scan_chars!(input, '2', '6'), + scan_chars!(input, '2', '5'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3'), + scan_chars!(input, '2', '2'), + scan_chars!(input, '2', '1'), + scan_chars!(input, '2', '0'), + scan_chars!(input, '2'), + scan_chars!(input, '1', '9'), + scan_chars!(input, '1', '8'), + scan_chars!(input, '1', '7'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5'), + scan_chars!(input, '1', '4'), + scan_chars!(input, '1', '3'), + scan_chars!(input, '1', '2'), + scan_chars!(input, '1', '1'), + scan_chars!(input, '1', '0'), + scan_chars!(input, '1') + ) + ) + } else { + false + } + } + #[allow(unused_assignments, unused_parens)] fn yul_decimal_literal(&self, input: &mut ParserContext) -> bool { scan_not_followed_by!( @@ -5561,13 +7873,308 @@ impl Language { scan_chars!(input, '0'), scan_sequence!( scan_char_range!(input, '1', '9'), - scan_zero_or_more!(input, self.decimal_digit(input)) + scan_zero_or_more!(input, scan_char_range!(input, '0', '9')) ) ), self.identifier_start(input) ) } + #[allow(unused_assignments, unused_parens)] + fn yul_fixed_keyword(&self, input: &mut ParserContext) -> bool { + scan_choice!( + input, + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'f', 'i', 'x', 'e', 'd') + } else { + false + }, + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '6') + ) + ) + } else { + false + }, + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '4', '8', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '1', '6'), + scan_chars!(input, '2', '3', '2', 'x', '8'), + scan_chars!(input, '2', '3', '2', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '1', '6'), + scan_chars!(input, '2', '2', '4', 'x', '8'), + scan_chars!(input, '2', '2', '4', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '2', '4'), + scan_chars!(input, '2', '2', '4', 'x', '1', '6'), + scan_chars!(input, '2', '1', '6', 'x', '8'), + scan_chars!(input, '2', '1', '6', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '3', '2'), + scan_chars!(input, '2', '1', '6', 'x', '2', '4'), + scan_chars!(input, '2', '1', '6', 'x', '1', '6'), + scan_chars!(input, '2', '0', '8', 'x', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '0'), + scan_chars!(input, '2', '0', '8', 'x', '3', '2'), + scan_chars!(input, '2', '0', '8', 'x', '2', '4'), + scan_chars!(input, '2', '0', '8', 'x', '1', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8'), + scan_chars!(input, '2', '0', '0', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '4', '8'), + scan_chars!(input, '2', '0', '0', 'x', '4', '0'), + scan_chars!(input, '2', '0', '0', 'x', '3', '2'), + scan_chars!(input, '2', '0', '0', 'x', '2', '4'), + scan_chars!(input, '2', '0', '0', 'x', '1', '6'), + scan_chars!(input, '1', '9', '2', 'x', '8'), + scan_chars!(input, '1', '9', '2', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '5', '6'), + scan_chars!(input, '1', '9', '2', 'x', '4', '8'), + scan_chars!(input, '1', '9', '2', 'x', '4', '0'), + scan_chars!(input, '1', '9', '2', 'x', '3', '2'), + scan_chars!(input, '1', '9', '2', 'x', '2', '4'), + scan_chars!(input, '1', '9', '2', 'x', '1', '6'), + scan_chars!(input, '1', '8', '4', 'x', '8'), + scan_chars!(input, '1', '8', '4', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '6', '4'), + scan_chars!(input, '1', '8', '4', 'x', '5', '6'), + scan_chars!(input, '1', '8', '4', 'x', '4', '8'), + scan_chars!(input, '1', '8', '4', 'x', '4', '0'), + scan_chars!(input, '1', '8', '4', 'x', '3', '2'), + scan_chars!(input, '1', '8', '4', 'x', '2', '4'), + scan_chars!(input, '1', '8', '4', 'x', '1', '6') + ) + ) + } else { + false + }, + if self.version_is_at_least_0_4_14 && !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '5', '6', 'x', '8', '0'), + scan_chars!(input, '2', '5', '6', 'x', '8'), + scan_chars!(input, '2', '5', '6', 'x', '7', '2'), + scan_chars!(input, '2', '5', '6', 'x', '6', '4'), + scan_chars!(input, '2', '5', '6', 'x', '5', '6'), + scan_chars!(input, '2', '5', '6', 'x', '4', '8'), + scan_chars!(input, '2', '5', '6', 'x', '4', '0'), + scan_chars!(input, '2', '5', '6', 'x', '3', '2'), + scan_chars!(input, '2', '5', '6', 'x', '2', '4'), + scan_chars!(input, '2', '5', '6', 'x', '1', '6'), + scan_chars!(input, '2', '4', '8', 'x', '8', '0'), + scan_chars!(input, '2', '4', '8', 'x', '7', '2'), + scan_chars!(input, '2', '4', '8', 'x', '6', '4'), + scan_chars!(input, '2', '4', '8', 'x', '5', '6'), + scan_chars!(input, '2', '4', '8', 'x', '4', '8'), + scan_chars!(input, '2', '4', '8', 'x', '4', '0'), + scan_chars!(input, '2', '4', '8', 'x', '3', '2'), + scan_chars!(input, '2', '4', '8', 'x', '2', '4'), + scan_chars!(input, '2', '4', '8', 'x', '1', '6'), + scan_chars!(input, '2', '4', '0', 'x', '8', '0'), + scan_chars!(input, '2', '4', '0', 'x', '7', '2'), + scan_chars!(input, '2', '4', '0', 'x', '6', '4'), + scan_chars!(input, '2', '4', '0', 'x', '5', '6'), + scan_chars!(input, '2', '4', '0', 'x', '4', '8'), + scan_chars!(input, '2', '4', '0', 'x', '4', '0'), + scan_chars!(input, '2', '4', '0', 'x', '3', '2'), + scan_chars!(input, '2', '4', '0', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '8', '0'), + scan_chars!(input, '2', '3', '2', 'x', '7', '2'), + scan_chars!(input, '2', '3', '2', 'x', '6', '4'), + scan_chars!(input, '2', '3', '2', 'x', '5', '6'), + scan_chars!(input, '2', '3', '2', 'x', '4', '8'), + scan_chars!(input, '2', '3', '2', 'x', '4', '0'), + scan_chars!(input, '2', '3', '2', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '8', '0'), + scan_chars!(input, '2', '2', '4', 'x', '7', '2'), + scan_chars!(input, '2', '2', '4', 'x', '6', '4'), + scan_chars!(input, '2', '2', '4', 'x', '5', '6'), + scan_chars!(input, '2', '2', '4', 'x', '4', '8'), + scan_chars!(input, '2', '2', '4', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '8', '0'), + scan_chars!(input, '2', '1', '6', 'x', '7', '2'), + scan_chars!(input, '2', '1', '6', 'x', '6', '4'), + scan_chars!(input, '2', '1', '6', 'x', '5', '6'), + scan_chars!(input, '2', '1', '6', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '8', '0'), + scan_chars!(input, '2', '0', '8', 'x', '7', '2'), + scan_chars!(input, '2', '0', '8', 'x', '6', '4'), + scan_chars!(input, '2', '0', '8', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8', '0'), + scan_chars!(input, '2', '0', '0', 'x', '7', '2'), + scan_chars!(input, '2', '0', '0', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '8', '0'), + scan_chars!(input, '1', '9', '2', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '8', '0') + ) + ) + } else { + false + }, + if self.version_is_at_least_0_4_14 && !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '9'), + scan_chars!(input, '7', '9'), + scan_chars!(input, '7', '8'), + scan_chars!(input, '7', '7'), + scan_chars!(input, '7', '6'), + scan_chars!(input, '7', '5'), + scan_chars!(input, '7', '4'), + scan_chars!(input, '7', '3'), + scan_chars!(input, '7', '1'), + scan_chars!(input, '7', '0'), + scan_chars!(input, '7'), + scan_chars!(input, '6', '9'), + scan_chars!(input, '6', '8'), + scan_chars!(input, '6', '7'), + scan_chars!(input, '6', '6'), + scan_chars!(input, '6', '5'), + scan_chars!(input, '6', '3'), + scan_chars!(input, '6', '2'), + scan_chars!(input, '6', '1'), + scan_chars!(input, '6', '0'), + scan_chars!(input, '6'), + scan_chars!(input, '5', '9'), + scan_chars!(input, '5', '8'), + scan_chars!(input, '5', '7'), + scan_chars!(input, '5', '5'), + scan_chars!(input, '5', '4'), + scan_chars!(input, '5', '3'), + scan_chars!(input, '5', '2'), + scan_chars!(input, '5', '1'), + scan_chars!(input, '5', '0'), + scan_chars!(input, '5'), + scan_chars!(input, '4', '9'), + scan_chars!(input, '4', '7'), + scan_chars!(input, '4', '6'), + scan_chars!(input, '4', '5'), + scan_chars!(input, '4', '4'), + scan_chars!(input, '4', '3'), + scan_chars!(input, '4', '2'), + scan_chars!(input, '4', '1'), + scan_chars!(input, '4'), + scan_chars!(input, '3', '9'), + scan_chars!(input, '3', '8'), + scan_chars!(input, '3', '7'), + scan_chars!(input, '3', '6'), + scan_chars!(input, '3', '5'), + scan_chars!(input, '3', '4'), + scan_chars!(input, '3', '3'), + scan_chars!(input, '3', '1'), + scan_chars!(input, '3', '0'), + scan_chars!(input, '3'), + scan_chars!(input, '2', '9'), + scan_chars!(input, '2', '8'), + scan_chars!(input, '2', '7'), + scan_chars!(input, '2', '6'), + scan_chars!(input, '2', '5'), + scan_chars!(input, '2', '3'), + scan_chars!(input, '2', '2'), + scan_chars!(input, '2', '1'), + scan_chars!(input, '2', '0'), + scan_chars!(input, '2'), + scan_chars!(input, '1', '9'), + scan_chars!(input, '1', '8'), + scan_chars!(input, '1', '7'), + scan_chars!(input, '1', '5'), + scan_chars!(input, '1', '4'), + scan_chars!(input, '1', '3'), + scan_chars!(input, '1', '2'), + scan_chars!(input, '1', '1'), + scan_chars!(input, '1', '0'), + scan_chars!(input, '1'), + scan_chars!(input, '0') + ) + ) + } else { + false + } + ) + } + #[allow(unused_assignments, unused_parens)] fn yul_hex_literal(&self, input: &mut ParserContext) -> bool { scan_not_followed_by!( @@ -5585,130 +8192,590 @@ impl Language { self.raw_identifier(input) } + #[allow(unused_assignments, unused_parens)] + fn yul_int_keyword(&self, input: &mut ParserContext) -> bool { + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'i', 'n', 't'), + scan_optional!( + input, + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ) + ) + ) + } else { + false + } + } + + #[allow(unused_assignments, unused_parens)] + fn yul_ufixed_keyword(&self, input: &mut ParserContext) -> bool { + scan_choice!( + input, + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd') + } else { + false + }, + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '6') + ) + ) + } else { + false + }, + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '4', '8', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '1', '6'), + scan_chars!(input, '2', '3', '2', 'x', '8'), + scan_chars!(input, '2', '3', '2', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '1', '6'), + scan_chars!(input, '2', '2', '4', 'x', '8'), + scan_chars!(input, '2', '2', '4', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '2', '4'), + scan_chars!(input, '2', '2', '4', 'x', '1', '6'), + scan_chars!(input, '2', '1', '6', 'x', '8'), + scan_chars!(input, '2', '1', '6', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '3', '2'), + scan_chars!(input, '2', '1', '6', 'x', '2', '4'), + scan_chars!(input, '2', '1', '6', 'x', '1', '6'), + scan_chars!(input, '2', '0', '8', 'x', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '0'), + scan_chars!(input, '2', '0', '8', 'x', '3', '2'), + scan_chars!(input, '2', '0', '8', 'x', '2', '4'), + scan_chars!(input, '2', '0', '8', 'x', '1', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8'), + scan_chars!(input, '2', '0', '0', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '4', '8'), + scan_chars!(input, '2', '0', '0', 'x', '4', '0'), + scan_chars!(input, '2', '0', '0', 'x', '3', '2'), + scan_chars!(input, '2', '0', '0', 'x', '2', '4'), + scan_chars!(input, '2', '0', '0', 'x', '1', '6'), + scan_chars!(input, '1', '9', '2', 'x', '8'), + scan_chars!(input, '1', '9', '2', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '5', '6'), + scan_chars!(input, '1', '9', '2', 'x', '4', '8'), + scan_chars!(input, '1', '9', '2', 'x', '4', '0'), + scan_chars!(input, '1', '9', '2', 'x', '3', '2'), + scan_chars!(input, '1', '9', '2', 'x', '2', '4'), + scan_chars!(input, '1', '9', '2', 'x', '1', '6'), + scan_chars!(input, '1', '8', '4', 'x', '8'), + scan_chars!(input, '1', '8', '4', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '6', '4'), + scan_chars!(input, '1', '8', '4', 'x', '5', '6'), + scan_chars!(input, '1', '8', '4', 'x', '4', '8'), + scan_chars!(input, '1', '8', '4', 'x', '4', '0'), + scan_chars!(input, '1', '8', '4', 'x', '3', '2'), + scan_chars!(input, '1', '8', '4', 'x', '2', '4'), + scan_chars!(input, '1', '8', '4', 'x', '1', '6') + ) + ) + } else { + false + }, + if self.version_is_at_least_0_4_14 && !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '5', '6', 'x', '8', '0'), + scan_chars!(input, '2', '5', '6', 'x', '8'), + scan_chars!(input, '2', '5', '6', 'x', '7', '2'), + scan_chars!(input, '2', '5', '6', 'x', '6', '4'), + scan_chars!(input, '2', '5', '6', 'x', '5', '6'), + scan_chars!(input, '2', '5', '6', 'x', '4', '8'), + scan_chars!(input, '2', '5', '6', 'x', '4', '0'), + scan_chars!(input, '2', '5', '6', 'x', '3', '2'), + scan_chars!(input, '2', '5', '6', 'x', '2', '4'), + scan_chars!(input, '2', '5', '6', 'x', '1', '6'), + scan_chars!(input, '2', '4', '8', 'x', '8', '0'), + scan_chars!(input, '2', '4', '8', 'x', '7', '2'), + scan_chars!(input, '2', '4', '8', 'x', '6', '4'), + scan_chars!(input, '2', '4', '8', 'x', '5', '6'), + scan_chars!(input, '2', '4', '8', 'x', '4', '8'), + scan_chars!(input, '2', '4', '8', 'x', '4', '0'), + scan_chars!(input, '2', '4', '8', 'x', '3', '2'), + scan_chars!(input, '2', '4', '8', 'x', '2', '4'), + scan_chars!(input, '2', '4', '8', 'x', '1', '6'), + scan_chars!(input, '2', '4', '0', 'x', '8', '0'), + scan_chars!(input, '2', '4', '0', 'x', '7', '2'), + scan_chars!(input, '2', '4', '0', 'x', '6', '4'), + scan_chars!(input, '2', '4', '0', 'x', '5', '6'), + scan_chars!(input, '2', '4', '0', 'x', '4', '8'), + scan_chars!(input, '2', '4', '0', 'x', '4', '0'), + scan_chars!(input, '2', '4', '0', 'x', '3', '2'), + scan_chars!(input, '2', '4', '0', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '8', '0'), + scan_chars!(input, '2', '3', '2', 'x', '7', '2'), + scan_chars!(input, '2', '3', '2', 'x', '6', '4'), + scan_chars!(input, '2', '3', '2', 'x', '5', '6'), + scan_chars!(input, '2', '3', '2', 'x', '4', '8'), + scan_chars!(input, '2', '3', '2', 'x', '4', '0'), + scan_chars!(input, '2', '3', '2', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '8', '0'), + scan_chars!(input, '2', '2', '4', 'x', '7', '2'), + scan_chars!(input, '2', '2', '4', 'x', '6', '4'), + scan_chars!(input, '2', '2', '4', 'x', '5', '6'), + scan_chars!(input, '2', '2', '4', 'x', '4', '8'), + scan_chars!(input, '2', '2', '4', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '8', '0'), + scan_chars!(input, '2', '1', '6', 'x', '7', '2'), + scan_chars!(input, '2', '1', '6', 'x', '6', '4'), + scan_chars!(input, '2', '1', '6', 'x', '5', '6'), + scan_chars!(input, '2', '1', '6', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '8', '0'), + scan_chars!(input, '2', '0', '8', 'x', '7', '2'), + scan_chars!(input, '2', '0', '8', 'x', '6', '4'), + scan_chars!(input, '2', '0', '8', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8', '0'), + scan_chars!(input, '2', '0', '0', 'x', '7', '2'), + scan_chars!(input, '2', '0', '0', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '8', '0'), + scan_chars!(input, '1', '9', '2', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '8', '0') + ) + ) + } else { + false + }, + if self.version_is_at_least_0_4_14 && !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '9'), + scan_chars!(input, '7', '9'), + scan_chars!(input, '7', '8'), + scan_chars!(input, '7', '7'), + scan_chars!(input, '7', '6'), + scan_chars!(input, '7', '5'), + scan_chars!(input, '7', '4'), + scan_chars!(input, '7', '3'), + scan_chars!(input, '7', '1'), + scan_chars!(input, '7', '0'), + scan_chars!(input, '7'), + scan_chars!(input, '6', '9'), + scan_chars!(input, '6', '8'), + scan_chars!(input, '6', '7'), + scan_chars!(input, '6', '6'), + scan_chars!(input, '6', '5'), + scan_chars!(input, '6', '3'), + scan_chars!(input, '6', '2'), + scan_chars!(input, '6', '1'), + scan_chars!(input, '6', '0'), + scan_chars!(input, '6'), + scan_chars!(input, '5', '9'), + scan_chars!(input, '5', '8'), + scan_chars!(input, '5', '7'), + scan_chars!(input, '5', '5'), + scan_chars!(input, '5', '4'), + scan_chars!(input, '5', '3'), + scan_chars!(input, '5', '2'), + scan_chars!(input, '5', '1'), + scan_chars!(input, '5', '0'), + scan_chars!(input, '5'), + scan_chars!(input, '4', '9'), + scan_chars!(input, '4', '7'), + scan_chars!(input, '4', '6'), + scan_chars!(input, '4', '5'), + scan_chars!(input, '4', '4'), + scan_chars!(input, '4', '3'), + scan_chars!(input, '4', '2'), + scan_chars!(input, '4', '1'), + scan_chars!(input, '4'), + scan_chars!(input, '3', '9'), + scan_chars!(input, '3', '8'), + scan_chars!(input, '3', '7'), + scan_chars!(input, '3', '6'), + scan_chars!(input, '3', '5'), + scan_chars!(input, '3', '4'), + scan_chars!(input, '3', '3'), + scan_chars!(input, '3', '1'), + scan_chars!(input, '3', '0'), + scan_chars!(input, '3'), + scan_chars!(input, '2', '9'), + scan_chars!(input, '2', '8'), + scan_chars!(input, '2', '7'), + scan_chars!(input, '2', '6'), + scan_chars!(input, '2', '5'), + scan_chars!(input, '2', '3'), + scan_chars!(input, '2', '2'), + scan_chars!(input, '2', '1'), + scan_chars!(input, '2', '0'), + scan_chars!(input, '2'), + scan_chars!(input, '1', '9'), + scan_chars!(input, '1', '8'), + scan_chars!(input, '1', '7'), + scan_chars!(input, '1', '5'), + scan_chars!(input, '1', '4'), + scan_chars!(input, '1', '3'), + scan_chars!(input, '1', '2'), + scan_chars!(input, '1', '1'), + scan_chars!(input, '1', '0'), + scan_chars!(input, '1'), + scan_chars!(input, '0') + ) + ) + } else { + false + } + ) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_uint_keyword(&self, input: &mut ParserContext) -> bool { + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'u', 'i', 'n', 't'), + scan_optional!( + input, + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ) + ) + ) + } else { + false + } + } + pub fn scan(&self, lexical_context: LexicalContext, input: &str) -> Option { let mut input = ParserContext::new(input); match lexical_context { LexicalContext::Default => { Lexer::next_token::(self, &mut input) } - LexicalContext::VersionPragma => { - Lexer::next_token::(self, &mut input) - } - LexicalContext::YulBlock => { - Lexer::next_token::(self, &mut input) + LexicalContext::Pragma => { + Lexer::next_token::(self, &mut input) } + LexicalContext::Yul => Lexer::next_token::(self, &mut input), } } pub fn parse(&self, production_kind: ProductionKind, input: &str) -> ParseOutput { match production_kind { ProductionKind::ABICoderPragma => Self::abi_coder_pragma.parse(self, input), + ProductionKind::AdditiveExpression => Self::additive_expression.parse(self, input), ProductionKind::AddressType => Self::address_type.parse(self, input), + ProductionKind::AndExpression => Self::and_expression.parse(self, input), ProductionKind::ArgumentsDeclaration => Self::arguments_declaration.parse(self, input), ProductionKind::ArrayExpression => Self::array_expression.parse(self, input), - ProductionKind::ArrayValuesList => Self::array_values_list.parse(self, input), - ProductionKind::AsciiStringLiteralsList => { - Self::ascii_string_literals_list.parse(self, input) + ProductionKind::ArrayTypeName => Self::array_type_name.parse(self, input), + ProductionKind::ArrayValues => Self::array_values.parse(self, input), + ProductionKind::AsciiStringLiterals => Self::ascii_string_literals.parse(self, input), + ProductionKind::AssemblyFlags => Self::assembly_flags.parse(self, input), + ProductionKind::AssemblyFlagsDeclaration => { + Self::assembly_flags_declaration.parse(self, input) } - ProductionKind::AssemblyFlagsList => Self::assembly_flags_list.parse(self, input), ProductionKind::AssemblyStatement => Self::assembly_statement.parse(self, input), + ProductionKind::AssignmentExpression => Self::assignment_expression.parse(self, input), + ProductionKind::BitwiseAndExpression => Self::bitwise_and_expression.parse(self, input), + ProductionKind::BitwiseOrExpression => Self::bitwise_or_expression.parse(self, input), + ProductionKind::BitwiseXorExpression => Self::bitwise_xor_expression.parse(self, input), ProductionKind::Block => Self::block.parse(self, input), ProductionKind::BreakStatement => Self::break_statement.parse(self, input), ProductionKind::CatchClause => Self::catch_clause.parse(self, input), ProductionKind::CatchClauseError => Self::catch_clause_error.parse(self, input), - ProductionKind::CatchClausesList => Self::catch_clauses_list.parse(self, input), + ProductionKind::CatchClauses => Self::catch_clauses.parse(self, input), + ProductionKind::ComparisonExpression => Self::comparison_expression.parse(self, input), + ProductionKind::ConditionalExpression => { + Self::conditional_expression.parse(self, input) + } ProductionKind::ConstantDefinition => Self::constant_definition.parse(self, input), - ProductionKind::ConstructorAttributesList => { - Self::constructor_attributes_list.parse(self, input) + ProductionKind::ConstructorAttribute => Self::constructor_attribute.parse(self, input), + ProductionKind::ConstructorAttributes => { + Self::constructor_attributes.parse(self, input) } ProductionKind::ConstructorDefinition => { Self::constructor_definition.parse(self, input) } ProductionKind::ContinueStatement => Self::continue_statement.parse(self, input), ProductionKind::ContractDefinition => Self::contract_definition.parse(self, input), - ProductionKind::ContractMembersList => Self::contract_members_list.parse(self, input), - ProductionKind::DeconstructionImport => Self::deconstruction_import.parse(self, input), - ProductionKind::DeconstructionImportSymbol => { - Self::deconstruction_import_symbol.parse(self, input) - } - ProductionKind::DeconstructionImportSymbolsList => { - Self::deconstruction_import_symbols_list.parse(self, input) + ProductionKind::ContractMember => Self::contract_member.parse(self, input), + ProductionKind::ContractMembers => Self::contract_members.parse(self, input), + ProductionKind::DecimalNumberExpression => { + Self::decimal_number_expression.parse(self, input) } + ProductionKind::DefaultAllKeywords => Self::default_all_keywords.parse(self, input), ProductionKind::DeleteStatement => Self::delete_statement.parse(self, input), ProductionKind::DoWhileStatement => Self::do_while_statement.parse(self, input), + ProductionKind::ElementaryType => Self::elementary_type.parse(self, input), + ProductionKind::ElseBranch => Self::else_branch.parse(self, input), ProductionKind::EmitStatement => Self::emit_statement.parse(self, input), - ProductionKind::EndOfFileTrivia => Self::end_of_file_trivia.parse(self, input), ProductionKind::EnumDefinition => Self::enum_definition.parse(self, input), + ProductionKind::EnumMembers => Self::enum_members.parse(self, input), + ProductionKind::EqualityExpression => Self::equality_expression.parse(self, input), ProductionKind::ErrorDefinition => Self::error_definition.parse(self, input), ProductionKind::ErrorParameter => Self::error_parameter.parse(self, input), - ProductionKind::ErrorParametersList => Self::error_parameters_list.parse(self, input), + ProductionKind::ErrorParameters => Self::error_parameters.parse(self, input), + ProductionKind::ErrorParametersDeclaration => { + Self::error_parameters_declaration.parse(self, input) + } ProductionKind::EventDefinition => Self::event_definition.parse(self, input), ProductionKind::EventParameter => Self::event_parameter.parse(self, input), - ProductionKind::EventParametersList => Self::event_parameters_list.parse(self, input), + ProductionKind::EventParameters => Self::event_parameters.parse(self, input), + ProductionKind::EventParametersDeclaration => { + Self::event_parameters_declaration.parse(self, input) + } + ProductionKind::ExperimentalFeature => Self::experimental_feature.parse(self, input), ProductionKind::ExperimentalPragma => Self::experimental_pragma.parse(self, input), + ProductionKind::ExponentiationExpression => { + Self::exponentiation_expression.parse(self, input) + } ProductionKind::Expression => Self::expression.parse(self, input), ProductionKind::ExpressionStatement => Self::expression_statement.parse(self, input), - ProductionKind::FallbackFunctionAttributesList => { - Self::fallback_function_attributes_list.parse(self, input) + ProductionKind::FallbackFunctionAttribute => { + Self::fallback_function_attribute.parse(self, input) + } + ProductionKind::FallbackFunctionAttributes => { + Self::fallback_function_attributes.parse(self, input) } ProductionKind::FallbackFunctionDefinition => { Self::fallback_function_definition.parse(self, input) } ProductionKind::ForStatement => Self::for_statement.parse(self, input), - ProductionKind::FunctionAttributesList => { - Self::function_attributes_list.parse(self, input) + ProductionKind::ForStatementCondition => { + Self::for_statement_condition.parse(self, input) + } + ProductionKind::ForStatementInitialization => { + Self::for_statement_initialization.parse(self, input) + } + ProductionKind::FunctionAttribute => Self::function_attribute.parse(self, input), + ProductionKind::FunctionAttributes => Self::function_attributes.parse(self, input), + ProductionKind::FunctionBody => Self::function_body.parse(self, input), + ProductionKind::FunctionCallExpression => { + Self::function_call_expression.parse(self, input) } ProductionKind::FunctionCallOptions => Self::function_call_options.parse(self, input), ProductionKind::FunctionDefinition => Self::function_definition.parse(self, input), ProductionKind::FunctionType => Self::function_type.parse(self, input), - ProductionKind::FunctionTypeAttributesList => { - Self::function_type_attributes_list.parse(self, input) + ProductionKind::FunctionTypeAttribute => { + Self::function_type_attribute.parse(self, input) } - ProductionKind::HexStringLiteralsList => { - Self::hex_string_literals_list.parse(self, input) + ProductionKind::FunctionTypeAttributes => { + Self::function_type_attributes.parse(self, input) } + ProductionKind::HexNumberExpression => Self::hex_number_expression.parse(self, input), + ProductionKind::HexStringLiterals => Self::hex_string_literals.parse(self, input), ProductionKind::IdentifierPath => Self::identifier_path.parse(self, input), - ProductionKind::IdentifierPathsList => Self::identifier_paths_list.parse(self, input), - ProductionKind::IdentifiersList => Self::identifiers_list.parse(self, input), ProductionKind::IfStatement => Self::if_statement.parse(self, input), + ProductionKind::ImportAlias => Self::import_alias.parse(self, input), + ProductionKind::ImportDeconstructionField => { + Self::import_deconstruction_field.parse(self, input) + } + ProductionKind::ImportDeconstructionFields => { + Self::import_deconstruction_fields.parse(self, input) + } ProductionKind::ImportDirective => Self::import_directive.parse(self, input), + ProductionKind::ImportSymbol => Self::import_symbol.parse(self, input), + ProductionKind::ImportSymbolDeconstruction => { + Self::import_symbol_deconstruction.parse(self, input) + } + ProductionKind::IndexAccessEnd => Self::index_access_end.parse(self, input), + ProductionKind::IndexAccessExpression => { + Self::index_access_expression.parse(self, input) + } ProductionKind::InheritanceSpecifier => Self::inheritance_specifier.parse(self, input), ProductionKind::InheritanceType => Self::inheritance_type.parse(self, input), - ProductionKind::InheritanceTypesList => Self::inheritance_types_list.parse(self, input), + ProductionKind::InheritanceTypes => Self::inheritance_types.parse(self, input), ProductionKind::InterfaceDefinition => Self::interface_definition.parse(self, input), - ProductionKind::InterfaceMembersList => Self::interface_members_list.parse(self, input), + ProductionKind::InterfaceMembers => Self::interface_members.parse(self, input), ProductionKind::LeadingTrivia => Self::leading_trivia.parse(self, input), ProductionKind::LibraryDefinition => Self::library_definition.parse(self, input), - ProductionKind::LibraryMembersList => Self::library_members_list.parse(self, input), + ProductionKind::LibraryMembers => Self::library_members.parse(self, input), + ProductionKind::MappingKey => Self::mapping_key.parse(self, input), ProductionKind::MappingKeyType => Self::mapping_key_type.parse(self, input), ProductionKind::MappingType => Self::mapping_type.parse(self, input), - ProductionKind::MappingValueType => Self::mapping_value_type.parse(self, input), - ProductionKind::ModifierAttributesList => { - Self::modifier_attributes_list.parse(self, input) + ProductionKind::MappingValue => Self::mapping_value.parse(self, input), + ProductionKind::MemberAccessExpression => { + Self::member_access_expression.parse(self, input) } + ProductionKind::ModifierAttribute => Self::modifier_attribute.parse(self, input), + ProductionKind::ModifierAttributes => Self::modifier_attributes.parse(self, input), ProductionKind::ModifierDefinition => Self::modifier_definition.parse(self, input), ProductionKind::ModifierInvocation => Self::modifier_invocation.parse(self, input), + ProductionKind::MultiplicativeExpression => { + Self::multiplicative_expression.parse(self, input) + } ProductionKind::NamedArgument => Self::named_argument.parse(self, input), + ProductionKind::NamedArgumentGroup => Self::named_argument_group.parse(self, input), + ProductionKind::NamedArgumentGroups => Self::named_argument_groups.parse(self, input), + ProductionKind::NamedArguments => Self::named_arguments.parse(self, input), ProductionKind::NamedArgumentsDeclaration => { Self::named_arguments_declaration.parse(self, input) } - ProductionKind::NamedArgumentsList => Self::named_arguments_list.parse(self, input), - ProductionKind::NamedImport => Self::named_import.parse(self, input), + ProductionKind::NamedImportSymbol => Self::named_import_symbol.parse(self, input), ProductionKind::NewExpression => Self::new_expression.parse(self, input), - ProductionKind::NumericExpression => Self::numeric_expression.parse(self, input), + ProductionKind::NumberUnit => Self::number_unit.parse(self, input), + ProductionKind::OrExpression => Self::or_expression.parse(self, input), + ProductionKind::OverridePaths => Self::override_paths.parse(self, input), ProductionKind::OverrideSpecifier => Self::override_specifier.parse(self, input), ProductionKind::Parameter => Self::parameter.parse(self, input), + ProductionKind::Parameters => Self::parameters.parse(self, input), ProductionKind::ParametersDeclaration => { Self::parameters_declaration.parse(self, input) } - ProductionKind::ParametersList => Self::parameters_list.parse(self, input), - ProductionKind::PathImport => Self::path_import.parse(self, input), - ProductionKind::PositionalArgumentsList => { - Self::positional_arguments_list.parse(self, input) + ProductionKind::PathImportSymbol => Self::path_import_symbol.parse(self, input), + ProductionKind::PositionalArguments => Self::positional_arguments.parse(self, input), + ProductionKind::PositionalArgumentsDeclaration => { + Self::positional_arguments_declaration.parse(self, input) } + ProductionKind::PostfixExpression => Self::postfix_expression.parse(self, input), + ProductionKind::Pragma => Self::pragma.parse(self, input), + ProductionKind::PragmaAllKeywords => Self::pragma_all_keywords.parse(self, input), ProductionKind::PragmaDirective => Self::pragma_directive.parse(self, input), - ProductionKind::ReceiveFunctionAttributesList => { - Self::receive_function_attributes_list.parse(self, input) + ProductionKind::PrefixExpression => Self::prefix_expression.parse(self, input), + ProductionKind::ReceiveFunctionAttribute => { + Self::receive_function_attribute.parse(self, input) + } + ProductionKind::ReceiveFunctionAttributes => { + Self::receive_function_attributes.parse(self, input) } ProductionKind::ReceiveFunctionDefinition => { Self::receive_function_definition.parse(self, input) @@ -5716,21 +8783,29 @@ impl Language { ProductionKind::ReturnStatement => Self::return_statement.parse(self, input), ProductionKind::ReturnsDeclaration => Self::returns_declaration.parse(self, input), ProductionKind::RevertStatement => Self::revert_statement.parse(self, input), + ProductionKind::ShiftExpression => Self::shift_expression.parse(self, input), ProductionKind::SourceUnit => Self::source_unit.parse(self, input), - ProductionKind::SourceUnitMembersList => { - Self::source_unit_members_list.parse(self, input) + ProductionKind::SourceUnitMember => Self::source_unit_member.parse(self, input), + ProductionKind::SourceUnitMembers => Self::source_unit_members.parse(self, input), + ProductionKind::StateVariableAttribute => { + Self::state_variable_attribute.parse(self, input) } - ProductionKind::StateVariableAttributesList => { - Self::state_variable_attributes_list.parse(self, input) + ProductionKind::StateVariableAttributes => { + Self::state_variable_attributes.parse(self, input) } ProductionKind::StateVariableDefinition => { Self::state_variable_definition.parse(self, input) } + ProductionKind::StateVariableDefinitionValue => { + Self::state_variable_definition_value.parse(self, input) + } ProductionKind::Statement => Self::statement.parse(self, input), - ProductionKind::StatementsList => Self::statements_list.parse(self, input), + ProductionKind::Statements => Self::statements.parse(self, input), + ProductionKind::StorageLocation => Self::storage_location.parse(self, input), + ProductionKind::StringExpression => Self::string_expression.parse(self, input), ProductionKind::StructDefinition => Self::struct_definition.parse(self, input), ProductionKind::StructMember => Self::struct_member.parse(self, input), - ProductionKind::StructMembersList => Self::struct_members_list.parse(self, input), + ProductionKind::StructMembers => Self::struct_members.parse(self, input), ProductionKind::ThrowStatement => Self::throw_statement.parse(self, input), ProductionKind::TrailingTrivia => Self::trailing_trivia.parse(self, input), ProductionKind::TryStatement => Self::try_statement.parse(self, input), @@ -5739,115 +8814,1125 @@ impl Language { } ProductionKind::TupleExpression => Self::tuple_expression.parse(self, input), ProductionKind::TupleMember => Self::tuple_member.parse(self, input), - ProductionKind::TupleMembersList => Self::tuple_members_list.parse(self, input), - ProductionKind::TupleValuesList => Self::tuple_values_list.parse(self, input), + ProductionKind::TupleMemberDeconstruction => { + Self::tuple_member_deconstruction.parse(self, input) + } + ProductionKind::TupleMembersDeconstruction => { + Self::tuple_members_deconstruction.parse(self, input) + } + ProductionKind::TupleValue => Self::tuple_value.parse(self, input), + ProductionKind::TupleValues => Self::tuple_values.parse(self, input), ProductionKind::TypeExpression => Self::type_expression.parse(self, input), ProductionKind::TypeName => Self::type_name.parse(self, input), + ProductionKind::TypedTupleMember => Self::typed_tuple_member.parse(self, input), ProductionKind::UncheckedBlock => Self::unchecked_block.parse(self, input), - ProductionKind::UnicodeStringLiteralsList => { - Self::unicode_string_literals_list.parse(self, input) + ProductionKind::UnicodeStringLiterals => { + Self::unicode_string_literals.parse(self, input) } - ProductionKind::UnnamedFunctionAttributesList => { - Self::unnamed_function_attributes_list.parse(self, input) + ProductionKind::UnnamedFunctionAttribute => { + Self::unnamed_function_attribute.parse(self, input) + } + ProductionKind::UnnamedFunctionAttributes => { + Self::unnamed_function_attributes.parse(self, input) } ProductionKind::UnnamedFunctionDefinition => { Self::unnamed_function_definition.parse(self, input) } + ProductionKind::UntypedTupleMember => Self::untyped_tuple_member.parse(self, input), ProductionKind::UserDefinedValueTypeDefinition => { Self::user_defined_value_type_definition.parse(self, input) } - ProductionKind::UsingDirective => Self::using_directive.parse(self, input), - ProductionKind::UsingDirectiveDeconstruction => { - Self::using_directive_deconstruction.parse(self, input) + ProductionKind::UsingAlias => Self::using_alias.parse(self, input), + ProductionKind::UsingDeconstructionField => { + Self::using_deconstruction_field.parse(self, input) } - ProductionKind::UsingDirectivePath => Self::using_directive_path.parse(self, input), - ProductionKind::UsingDirectiveSymbol => Self::using_directive_symbol.parse(self, input), - ProductionKind::UsingDirectiveSymbolsList => { - Self::using_directive_symbols_list.parse(self, input) + ProductionKind::UsingDeconstructionFields => { + Self::using_deconstruction_fields.parse(self, input) + } + ProductionKind::UsingDirective => Self::using_directive.parse(self, input), + ProductionKind::UsingSymbol => Self::using_symbol.parse(self, input), + ProductionKind::UsingSymbolDeconstruction => { + Self::using_symbol_deconstruction.parse(self, input) } - ProductionKind::VariableDeclaration => Self::variable_declaration.parse(self, input), + ProductionKind::UsingTarget => Self::using_target.parse(self, input), ProductionKind::VariableDeclarationStatement => { Self::variable_declaration_statement.parse(self, input) } + ProductionKind::VariableDeclarationType => { + Self::variable_declaration_type.parse(self, input) + } + ProductionKind::VariableDeclarationValue => { + Self::variable_declaration_value.parse(self, input) + } ProductionKind::VersionPragma => Self::version_pragma.parse(self, input), ProductionKind::VersionPragmaExpression => { Self::version_pragma_expression.parse(self, input) } - ProductionKind::VersionPragmaExpressionsList => { - Self::version_pragma_expressions_list.parse(self, input) + ProductionKind::VersionPragmaExpressions => { + Self::version_pragma_expressions.parse(self, input) + } + ProductionKind::VersionPragmaOrExpression => { + Self::version_pragma_or_expression.parse(self, input) + } + ProductionKind::VersionPragmaPrefixExpression => { + Self::version_pragma_prefix_expression.parse(self, input) + } + ProductionKind::VersionPragmaRangeExpression => { + Self::version_pragma_range_expression.parse(self, input) } ProductionKind::VersionPragmaSpecifier => { Self::version_pragma_specifier.parse(self, input) } ProductionKind::WhileStatement => Self::while_statement.parse(self, input), + ProductionKind::YulAllKeywords => Self::yul_all_keywords.parse(self, input), + ProductionKind::YulArguments => Self::yul_arguments.parse(self, input), ProductionKind::YulAssignmentStatement => { Self::yul_assignment_statement.parse(self, input) } ProductionKind::YulBlock => Self::yul_block.parse(self, input), ProductionKind::YulBreakStatement => Self::yul_break_statement.parse(self, input), ProductionKind::YulContinueStatement => Self::yul_continue_statement.parse(self, input), - ProductionKind::YulDeclarationStatement => { - Self::yul_declaration_statement.parse(self, input) - } + ProductionKind::YulDefaultCase => Self::yul_default_case.parse(self, input), ProductionKind::YulExpression => Self::yul_expression.parse(self, input), - ProductionKind::YulExpressionsList => Self::yul_expressions_list.parse(self, input), ProductionKind::YulForStatement => Self::yul_for_statement.parse(self, input), + ProductionKind::YulFunctionCallExpression => { + Self::yul_function_call_expression.parse(self, input) + } ProductionKind::YulFunctionDefinition => { Self::yul_function_definition.parse(self, input) } ProductionKind::YulIdentifierPath => Self::yul_identifier_path.parse(self, input), - ProductionKind::YulIdentifierPathsList => { - Self::yul_identifier_paths_list.parse(self, input) - } - ProductionKind::YulIdentifiersList => Self::yul_identifiers_list.parse(self, input), + ProductionKind::YulIdentifierPaths => Self::yul_identifier_paths.parse(self, input), ProductionKind::YulIfStatement => Self::yul_if_statement.parse(self, input), ProductionKind::YulLeaveStatement => Self::yul_leave_statement.parse(self, input), + ProductionKind::YulLiteral => Self::yul_literal.parse(self, input), + ProductionKind::YulParameters => Self::yul_parameters.parse(self, input), ProductionKind::YulParametersDeclaration => { Self::yul_parameters_declaration.parse(self, input) } + ProductionKind::YulReturnVariables => Self::yul_return_variables.parse(self, input), ProductionKind::YulReturnsDeclaration => { Self::yul_returns_declaration.parse(self, input) } ProductionKind::YulStatement => Self::yul_statement.parse(self, input), - ProductionKind::YulStatementsList => Self::yul_statements_list.parse(self, input), + ProductionKind::YulStatements => Self::yul_statements.parse(self, input), ProductionKind::YulSwitchCase => Self::yul_switch_case.parse(self, input), - ProductionKind::YulSwitchCasesList => Self::yul_switch_cases_list.parse(self, input), + ProductionKind::YulSwitchCases => Self::yul_switch_cases.parse(self, input), ProductionKind::YulSwitchStatement => Self::yul_switch_statement.parse(self, input), + ProductionKind::YulValueCase => Self::yul_value_case.parse(self, input), + ProductionKind::YulVariableDeclarationStatement => { + Self::yul_variable_declaration_statement.parse(self, input) + } + ProductionKind::YulVariableDeclarationValue => { + Self::yul_variable_declaration_value.parse(self, input) + } } } } -impl Lexer for Language { - fn leading_trivia(&self, input: &mut ParserContext) -> ParserResult { - Language::leading_trivia(self, input) - } +impl Lexer for Language { + fn leading_trivia(&self, input: &mut ParserContext) -> ParserResult { + Language::leading_trivia(self, input) + } + + fn trailing_trivia(&self, input: &mut ParserContext) -> ParserResult { + Language::trailing_trivia(self, input) + } + + fn delimiters() -> &'static [(TokenKind, TokenKind)] { + match LexCtx::value() { + LexicalContext::Default => &[ + (TokenKind::OpenBrace, TokenKind::CloseBrace), + (TokenKind::OpenBracket, TokenKind::CloseBracket), + (TokenKind::OpenParen, TokenKind::CloseParen), + ], + LexicalContext::Pragma => &[], + LexicalContext::Yul => &[ + (TokenKind::OpenBrace, TokenKind::CloseBrace), + (TokenKind::OpenParen, TokenKind::CloseParen), + ], + } + } + + fn next_token(&self, input: &mut ParserContext) -> Option { + let save = input.position(); + let mut furthest_position = input.position(); + let mut longest_token = None; + + match LexCtx::value() { + LexicalContext::Default => { + macro_rules! longest_match { + ($( { $kind:ident = $function:ident } )*) => { + $( + if self.$function(input) && input.position() > furthest_position { + furthest_position = input.position(); + longest_token = Some(TokenKind::$kind); + } + input.set_position(save); + )* + }; + } + + if let Some(kind) = match input.next() { + Some('a') => match input.next() { + Some('b') => scan_chars!(input, 's', 't', 'r', 'a', 'c', 't') + .then_some(TokenKind::AbstractKeyword), + Some('d') => scan_chars!(input, 'd', 'r', 'e', 's', 's') + .then_some(TokenKind::AddressKeyword), + Some('f') => { + scan_chars!(input, 't', 'e', 'r').then_some(TokenKind::AfterKeyword) + } + Some('l') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'i', 'a', 's').then_some(TokenKind::AliasKeyword) + } else { + None + } + } + Some('n') => scan_chars!(input, 'o', 'n', 'y', 'm', 'o', 'u', 's') + .then_some(TokenKind::AnonymousKeyword), + Some('p') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'p', 'l', 'y').then_some(TokenKind::ApplyKeyword) + } else { + None + } + } + Some('s') => match input.next() { + Some('s') => scan_chars!(input, 'e', 'm', 'b', 'l', 'y') + .then_some(TokenKind::AssemblyKeyword), + Some(_) => { + input.undo(); + Some(TokenKind::AsKeyword) + } + None => Some(TokenKind::AsKeyword), + }, + Some('u') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 't', 'o').then_some(TokenKind::AutoKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('b') => match input.next() { + Some('o') => scan_chars!(input, 'o', 'l').then_some(TokenKind::BoolKeyword), + Some('r') => { + scan_chars!(input, 'e', 'a', 'k').then_some(TokenKind::BreakKeyword) + } + Some('y') => scan_chars!(input, 't', 'e').then_some(TokenKind::ByteKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('c') => match input.next() { + Some('a') => match input.next() { + Some('l') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'l', 'd', 'a', 't', 'a') + .then_some(TokenKind::CallDataKeyword) + } else { + None + } + } + Some('s') => scan_chars!(input, 'e').then_some(TokenKind::CaseKeyword), + Some('t') => { + scan_chars!(input, 'c', 'h').then_some(TokenKind::CatchKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('o') => match input.next() { + Some('n') => match input.next() { + Some('s') => { + if scan_chars!(input, 't') { + match input.next() { + Some('a') => scan_chars!(input, 'n', 't') + .then_some(TokenKind::ConstantKeyword), + Some('r') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'u', 'c', 't', 'o', 'r') + .then_some(TokenKind::ConstructorKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + } + } else { + None + } + } + Some('t') => match input.next() { + Some('i') => scan_chars!(input, 'n', 'u', 'e') + .then_some(TokenKind::ContinueKeyword), + Some('r') => scan_chars!(input, 'a', 'c', 't') + .then_some(TokenKind::ContractKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('p') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'y', 'o', 'f') + .then_some(TokenKind::CopyOfKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('d') => match input.next() { + Some('a') => scan_chars!(input, 'y', 's').then_some(TokenKind::DaysKeyword), + Some('e') => match input.next() { + Some('f') => match input.next() { + Some('a') => scan_chars!(input, 'u', 'l', 't') + .then_some(TokenKind::DefaultKeyword), + Some('i') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'n', 'e') + .then_some(TokenKind::DefineKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('l') => scan_chars!(input, 'e', 't', 'e') + .then_some(TokenKind::DeleteKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('o') => Some(TokenKind::DoKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('e') => match input.next() { + Some('l') => scan_chars!(input, 's', 'e').then_some(TokenKind::ElseKeyword), + Some('m') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'i', 't').then_some(TokenKind::EmitKeyword) + } else { + None + } + } + Some('n') => scan_chars!(input, 'u', 'm').then_some(TokenKind::EnumKeyword), + Some('r') => { + if self.version_is_at_least_0_8_4 { + scan_chars!(input, 'r', 'o', 'r').then_some(TokenKind::ErrorKeyword) + } else { + None + } + } + Some('t') => { + scan_chars!(input, 'h', 'e', 'r').then_some(TokenKind::EtherKeyword) + } + Some('v') => { + scan_chars!(input, 'e', 'n', 't').then_some(TokenKind::EventKeyword) + } + Some('x') => scan_chars!(input, 't', 'e', 'r', 'n', 'a', 'l') + .then_some(TokenKind::ExternalKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('f') => match input.next() { + Some('a') => { + if scan_chars!(input, 'l') { + match input.next() { + Some('l') => { + if self.version_is_at_least_0_6_0 { + scan_chars!(input, 'b', 'a', 'c', 'k') + .then_some(TokenKind::FallbackKeyword) + } else { + None + } + } + Some('s') => { + scan_chars!(input, 'e').then_some(TokenKind::FalseKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + } + } else { + None + } + } + Some('i') => { + if scan_chars!(input, 'n') { + match input.next() { + Some('a') => { + scan_chars!(input, 'l').then_some(TokenKind::FinalKeyword) + } + Some('n') => { + if !self.version_is_at_least_0_7_0 { + scan_chars!(input, 'e', 'y') + .then_some(TokenKind::FinneyKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + } + } else { + None + } + } + Some('o') => scan_chars!(input, 'r').then_some(TokenKind::ForKeyword), + Some('r') => scan_chars!(input, 'o', 'm').then_some(TokenKind::FromKeyword), + Some('u') => scan_chars!(input, 'n', 'c', 't', 'i', 'o', 'n') + .then_some(TokenKind::FunctionKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('g') => match input.next() { + Some('l') => { + if self.version_is_at_least_0_8_13 { + scan_chars!(input, 'o', 'b', 'a', 'l') + .then_some(TokenKind::GlobalKeyword) + } else { + None + } + } + Some('w') => { + if self.version_is_at_least_0_7_0 { + scan_chars!(input, 'e', 'i').then_some(TokenKind::GweiKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('h') => match input.next() { + Some('e') => scan_chars!(input, 'x').then_some(TokenKind::HexKeyword), + Some('o') => { + scan_chars!(input, 'u', 'r', 's').then_some(TokenKind::HoursKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('i') => match input.next() { + Some('f') => Some(TokenKind::IfKeyword), + Some('m') => match input.next() { + Some('m') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'u', 't', 'a', 'b', 'l', 'e') + .then_some(TokenKind::ImmutableKeyword) + } else { + None + } + } + Some('p') => match input.next() { + Some('l') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'e', 'm', 'e', 'n', 't', 's') + .then_some(TokenKind::ImplementsKeyword) + } else { + None + } + } + Some('o') => { + scan_chars!(input, 'r', 't').then_some(TokenKind::ImportKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('n') => match input.next() { + Some('d') => scan_chars!(input, 'e', 'x', 'e', 'd') + .then_some(TokenKind::IndexedKeyword), + Some('l') => scan_chars!(input, 'i', 'n', 'e') + .then_some(TokenKind::InlineKeyword), + Some('t') => { + if scan_chars!(input, 'e', 'r') { + match input.next() { + Some('f') => scan_chars!(input, 'a', 'c', 'e') + .then_some(TokenKind::InterfaceKeyword), + Some('n') => scan_chars!(input, 'a', 'l') + .then_some(TokenKind::InternalKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + } + } else { + None + } + } + Some(_) => { + input.undo(); + Some(TokenKind::InKeyword) + } + None => Some(TokenKind::InKeyword), + }, + Some('s') => Some(TokenKind::IsKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('l') => match input.next() { + Some('e') => scan_chars!(input, 't').then_some(TokenKind::LetKeyword), + Some('i') => scan_chars!(input, 'b', 'r', 'a', 'r', 'y') + .then_some(TokenKind::LibraryKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('m') => match input.next() { + Some('a') => match input.next() { + Some('c') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'r', 'o').then_some(TokenKind::MacroKeyword) + } else { + None + } + } + Some('p') => scan_chars!(input, 'p', 'i', 'n', 'g') + .then_some(TokenKind::MappingKeyword), + Some('t') => { + scan_chars!(input, 'c', 'h').then_some(TokenKind::MatchKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('e') => scan_chars!(input, 'm', 'o', 'r', 'y') + .then_some(TokenKind::MemoryKeyword), + Some('i') => scan_chars!(input, 'n', 'u', 't', 'e', 's') + .then_some(TokenKind::MinutesKeyword), + Some('o') => scan_chars!(input, 'd', 'i', 'f', 'i', 'e', 'r') + .then_some(TokenKind::ModifierKeyword), + Some('u') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 't', 'a', 'b', 'l', 'e') + .then_some(TokenKind::MutableKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('n') => match input.next() { + Some('e') => scan_chars!(input, 'w').then_some(TokenKind::NewKeyword), + Some('u') => scan_chars!(input, 'l', 'l').then_some(TokenKind::NullKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('o') => match input.next() { + Some('f') => Some(TokenKind::OfKeyword), + Some('v') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'e', 'r', 'r', 'i', 'd', 'e') + .then_some(TokenKind::OverrideKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('p') => match input.next() { + Some('a') => match input.next() { + Some('r') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 't', 'i', 'a', 'l') + .then_some(TokenKind::PartialKeyword) + } else { + None + } + } + Some('y') => scan_chars!(input, 'a', 'b', 'l', 'e') + .then_some(TokenKind::PayableKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('r') => match input.next() { + Some('a') => scan_chars!(input, 'g', 'm', 'a') + .then_some(TokenKind::PragmaKeyword), + Some('i') => scan_chars!(input, 'v', 'a', 't', 'e') + .then_some(TokenKind::PrivateKeyword), + Some('o') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'm', 'i', 's', 'e') + .then_some(TokenKind::PromiseKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('u') => match input.next() { + Some('b') => scan_chars!(input, 'l', 'i', 'c') + .then_some(TokenKind::PublicKeyword), + Some('r') => scan_chars!(input, 'e').then_some(TokenKind::PureKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('r') => { + if scan_chars!(input, 'e') { + match input.next() { + Some('c') => { + if self.version_is_at_least_0_6_0 { + scan_chars!(input, 'e', 'i', 'v', 'e') + .then_some(TokenKind::ReceiveKeyword) + } else { + None + } + } + Some('f') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'e', 'r', 'e', 'n', 'c', 'e') + .then_some(TokenKind::ReferenceKeyword) + } else { + None + } + } + Some('l') => { + scan_chars!(input, 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e') + .then_some(TokenKind::RelocatableKeyword) + } + Some('t') => { + if scan_chars!(input, 'u', 'r', 'n') { + match input.next() { + Some('s') => Some(TokenKind::ReturnsKeyword), + Some(_) => { + input.undo(); + Some(TokenKind::ReturnKeyword) + } + None => Some(TokenKind::ReturnKeyword), + } + } else { + None + } + } + Some('v') => { + if self.version_is_at_least_0_8_4 { + scan_chars!(input, 'e', 'r', 't') + .then_some(TokenKind::RevertKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + } + } else { + None + } + } + Some('s') => match input.next() { + Some('e') => match input.next() { + Some('a') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'l', 'e', 'd') + .then_some(TokenKind::SealedKeyword) + } else { + None + } + } + Some('c') => scan_chars!(input, 'o', 'n', 'd', 's') + .then_some(TokenKind::SecondsKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('i') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'z', 'e', 'o', 'f') + .then_some(TokenKind::SizeOfKeyword) + } else { + None + } + } + Some('t') => { + match input.next() { + Some('a') => scan_chars!(input, 't', 'i', 'c') + .then_some(TokenKind::StaticKeyword), + Some('o') => scan_chars!(input, 'r', 'a', 'g', 'e') + .then_some(TokenKind::StorageKeyword), + Some('r') => match input.next() { + Some('i') => scan_chars!(input, 'n', 'g') + .then_some(TokenKind::StringKeyword), + Some('u') => scan_chars!(input, 'c', 't') + .then_some(TokenKind::StructKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + } + } + Some('u') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'p', 'p', 'o', 'r', 't', 's') + .then_some(TokenKind::SupportsKeyword) + } else { + None + } + } + Some('w') => scan_chars!(input, 'i', 't', 'c', 'h') + .then_some(TokenKind::SwitchKeyword), + Some('z') => { + if !self.version_is_at_least_0_7_0 { + scan_chars!(input, 'a', 'b', 'o').then_some(TokenKind::SzaboKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('t') => match input.next() { + Some('h') => { + scan_chars!(input, 'r', 'o', 'w').then_some(TokenKind::ThrowKeyword) + } + Some('r') => match input.next() { + Some('u') => scan_chars!(input, 'e').then_some(TokenKind::TrueKeyword), + Some('y') => Some(TokenKind::TryKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('y') => { + if scan_chars!(input, 'p', 'e') { + match input.next() { + Some('d') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'e', 'f') + .then_some(TokenKind::TypeDefKeyword) + } else { + None + } + } + Some('o') => { + scan_chars!(input, 'f').then_some(TokenKind::TypeOfKeyword) + } + Some(_) => { + input.undo(); + Some(TokenKind::TypeKeyword) + } + None => Some(TokenKind::TypeKeyword), + } + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('u') => match input.next() { + Some('n') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'c', 'h', 'e', 'c', 'k', 'e', 'd') + .then_some(TokenKind::UncheckedKeyword) + } else { + None + } + } + Some('s') => { + scan_chars!(input, 'i', 'n', 'g').then_some(TokenKind::UsingKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('v') => match input.next() { + Some('a') => scan_chars!(input, 'r').then_some(TokenKind::VarKeyword), + Some('i') => match input.next() { + Some('e') => scan_chars!(input, 'w').then_some(TokenKind::ViewKeyword), + Some('r') => { + if self.version_is_at_least_0_6_0 { + scan_chars!(input, 't', 'u', 'a', 'l') + .then_some(TokenKind::VirtualKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('w') => match input.next() { + Some('e') => match input.next() { + Some('e') => { + scan_chars!(input, 'k', 's').then_some(TokenKind::WeeksKeyword) + } + Some('i') => Some(TokenKind::WeiKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('h') => { + scan_chars!(input, 'i', 'l', 'e').then_some(TokenKind::WhileKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('y') => { + scan_chars!(input, 'e', 'a', 'r', 's').then_some(TokenKind::YearsKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + } { + // Make sure that this is not the start of an identifier + if !self.identifier_part(input) { + furthest_position = input.position(); + longest_token = Some(kind); + } + } + input.set_position(save); + + if let Some(kind) = match input.next() { + Some('!') => scan_chars!(input, '=').then_some(TokenKind::BangEqual), + Some('%') => scan_chars!(input, '=').then_some(TokenKind::PercentEqual), + Some('&') => match input.next() { + Some('&') => Some(TokenKind::AmpersandAmpersand), + Some('=') => Some(TokenKind::AmpersandEqual), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('(') => Some(TokenKind::OpenParen), + Some(')') => Some(TokenKind::CloseParen), + Some('*') => match input.next() { + Some('*') => Some(TokenKind::AsteriskAsterisk), + Some('=') => Some(TokenKind::AsteriskEqual), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('+') => match input.next() { + Some('+') => Some(TokenKind::PlusPlus), + Some('=') => Some(TokenKind::PlusEqual), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(',') => Some(TokenKind::Comma), + Some('-') => match input.next() { + Some('-') => Some(TokenKind::MinusMinus), + Some('=') => Some(TokenKind::MinusEqual), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('.') => Some(TokenKind::Period), + Some('/') => scan_chars!(input, '=').then_some(TokenKind::SlashEqual), + Some(';') => Some(TokenKind::Semicolon), + Some('<') => match input.next() { + Some('<') => { + scan_chars!(input, '=').then_some(TokenKind::LessThanLessThanEqual) + } + Some('=') => Some(TokenKind::LessThanEqual), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('=') => match input.next() { + Some('=') => Some(TokenKind::EqualEqual), + Some('>') => Some(TokenKind::EqualGreaterThan), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('>') => match input.next() { + Some('=') => Some(TokenKind::GreaterThanEqual), + Some('>') => match input.next() { + Some('=') => Some(TokenKind::GreaterThanGreaterThanEqual), + Some('>') => scan_chars!(input, '=') + .then_some(TokenKind::GreaterThanGreaterThanGreaterThanEqual), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('?') => Some(TokenKind::QuestionMark), + Some('[') => Some(TokenKind::OpenBracket), + Some(']') => Some(TokenKind::CloseBracket), + Some('^') => scan_chars!(input, '=').then_some(TokenKind::CaretEqual), + Some('{') => Some(TokenKind::OpenBrace), + Some('|') => match input.next() { + Some('=') => Some(TokenKind::BarEqual), + Some('|') => Some(TokenKind::BarBar), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('}') => Some(TokenKind::CloseBrace), + Some('~') => Some(TokenKind::Tilde), + Some(_) => { + input.undo(); + None + } + None => None, + } { + furthest_position = input.position(); + longest_token = Some(kind); + } + input.set_position(save); - fn trailing_trivia(&self, input: &mut ParserContext) -> ParserResult { - Language::trailing_trivia(self, input) - } + longest_match! { + { Ampersand = ampersand } + { AsciiStringLiteral = ascii_string_literal } + { Asterisk = asterisk } + { Bang = bang } + { Bar = bar } + { BytesKeyword = bytes_keyword } + { Caret = caret } + { Colon = colon } + { DecimalLiteral = decimal_literal } + { EndOfLine = end_of_line } + { Equal = equal } + { FixedKeyword = fixed_keyword } + { GreaterThan = greater_than } + { GreaterThanGreaterThan = greater_than_greater_than } + { GreaterThanGreaterThanGreaterThan = greater_than_greater_than_greater_than } + { HexLiteral = hex_literal } + { HexStringLiteral = hex_string_literal } + { IntKeyword = int_keyword } + { LessThan = less_than } + { LessThanLessThan = less_than_less_than } + { Minus = minus } + { MultilineComment = multiline_comment } + { Percent = percent } + { Plus = plus } + { SingleLineComment = single_line_comment } + { Slash = slash } + { UfixedKeyword = ufixed_keyword } + { UintKeyword = uint_keyword } + { UnicodeStringLiteral = unicode_string_literal } + { Whitespace = whitespace } + { Identifier = identifier } + } + } + LexicalContext::Pragma => { + macro_rules! longest_match { + ($( { $kind:ident = $function:ident } )*) => { + $( + if self.$function(input) && input.position() > furthest_position { + furthest_position = input.position(); + longest_token = Some(TokenKind::$kind); + } + input.set_position(save); + )* + }; + } - fn delimiters() -> &'static [(TokenKind, TokenKind)] { - match LexCtx::value() { - LexicalContext::Default => &[ - (TokenKind::OpenBrace, TokenKind::CloseBrace), - (TokenKind::OpenBracket, TokenKind::CloseBracket), - (TokenKind::OpenParen, TokenKind::CloseParen), - ], - LexicalContext::VersionPragma => &[], - LexicalContext::YulBlock => &[ - (TokenKind::OpenBrace, TokenKind::CloseBrace), - (TokenKind::OpenParen, TokenKind::CloseParen), - ], - } - } + if let Some(kind) = match input.next() { + Some('a') => scan_chars!(input, 'b', 'i', 'c', 'o', 'd', 'e', 'r') + .then_some(TokenKind::AbicoderKeyword), + Some('e') => { + scan_chars!(input, 'x', 'p', 'e', 'r', 'i', 'm', 'e', 'n', 't', 'a', 'l') + .then_some(TokenKind::ExperimentalKeyword) + } + Some('p') => scan_chars!(input, 'r', 'a', 'g', 'm', 'a') + .then_some(TokenKind::PragmaKeyword), + Some('s') => scan_chars!(input, 'o', 'l', 'i', 'd', 'i', 't', 'y') + .then_some(TokenKind::SolidityKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + } { + // Make sure that this is not the start of an identifier + if !self.identifier_part(input) { + furthest_position = input.position(); + longest_token = Some(kind); + } + } + input.set_position(save); - fn next_token(&self, input: &mut ParserContext) -> Option { - let save = input.position(); - let mut furthest_position = input.position(); - let mut longest_token = None; + if let Some(kind) = match input.next() { + Some('.') => Some(TokenKind::Period), + Some(';') => Some(TokenKind::Semicolon), + Some('<') => scan_chars!(input, '=').then_some(TokenKind::LessThanEqual), + Some('>') => scan_chars!(input, '=').then_some(TokenKind::GreaterThanEqual), + Some('|') => scan_chars!(input, '|').then_some(TokenKind::BarBar), + Some('~') => Some(TokenKind::Tilde), + Some(_) => { + input.undo(); + None + } + None => None, + } { + furthest_position = input.position(); + longest_token = Some(kind); + } + input.set_position(save); - match LexCtx::value() { - LexicalContext::Default => { + longest_match! { + { AsciiStringLiteral = ascii_string_literal } + { Caret = caret } + { Equal = equal } + { GreaterThan = greater_than } + { LessThan = less_than } + { Minus = minus } + { VersionPragmaValue = version_pragma_value } + { Identifier = identifier } + } + } + LexicalContext::Yul => { macro_rules! longest_match { ($( { $kind:ident = $function:ident } )*) => { $( @@ -5862,50 +9947,76 @@ impl Lexer for Language { if let Some(kind) = match input.next() { Some('a') => match input.next() { - Some('b') => match input.next() { - Some('i') => scan_chars!(input, 'c', 'o', 'd', 'e', 'r') - .then_some(TokenKind::ABICoderKeyword), - Some('s') => scan_chars!(input, 't', 'r', 'a', 'c', 't') - .then_some(TokenKind::AbstractKeyword), - Some(_) => { - input.undo(); + Some('b') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 's', 't', 'r', 'a', 'c', 't') + .then_some(TokenKind::YulAbstractKeyword) + } else { None } - None => None, - }, + } Some('d') => scan_chars!(input, 'd', 'r', 'e', 's', 's') - .then_some(TokenKind::AddressKeyword), + .then_some(TokenKind::YulAddressKeyword), Some('f') => { - scan_chars!(input, 't', 'e', 'r').then_some(TokenKind::AfterKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 't', 'e', 'r') + .then_some(TokenKind::YulAfterKeyword) + } else { + None + } } Some('l') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'i', 'a', 's').then_some(TokenKind::AliasKeyword) + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'i', 'a', 's') + .then_some(TokenKind::YulAliasKeyword) + } else { + None + } + } + Some('n') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'o', 'n', 'y', 'm', 'o', 'u', 's') + .then_some(TokenKind::YulAnonymousKeyword) } else { None } } - Some('n') => scan_chars!(input, 'o', 'n', 'y', 'm', 'o', 'u', 's') - .then_some(TokenKind::AnonymousKeyword), Some('p') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'p', 'l', 'y').then_some(TokenKind::ApplyKeyword) + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'p', 'l', 'y') + .then_some(TokenKind::YulApplyKeyword) } else { None } } Some('s') => match input.next() { - Some('s') => scan_chars!(input, 'e', 'm', 'b', 'l', 'y') - .then_some(TokenKind::AssemblyKeyword), + Some('s') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e', 'm', 'b', 'l', 'y') + .then_some(TokenKind::YulAssemblyKeyword) + } else { + None + } + } Some(_) => { input.undo(); - Some(TokenKind::AsKeyword) + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulAsKeyword) + } else { + None + } + } + None => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulAsKeyword) + } else { + None + } } - None => Some(TokenKind::AsKeyword), }, Some('u') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 't', 'o').then_some(TokenKind::AutoKeyword) + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 't', 'o').then_some(TokenKind::YulAutoKeyword) } else { None } @@ -5917,11 +10028,19 @@ impl Lexer for Language { None => None, }, Some('b') => match input.next() { - Some('o') => scan_chars!(input, 'o', 'l').then_some(TokenKind::BoolKeyword), + Some('o') => { + if !self.version_is_at_least_0_5_10 { + scan_chars!(input, 'o', 'l').then_some(TokenKind::YulBoolKeyword) + } else { + None + } + } Some('r') => { - scan_chars!(input, 'e', 'a', 'k').then_some(TokenKind::BreakKeyword) + scan_chars!(input, 'e', 'a', 'k').then_some(TokenKind::YulBreakKeyword) + } + Some('y') => { + scan_chars!(input, 't', 'e').then_some(TokenKind::YulByteKeyword) } - Some('y') => scan_chars!(input, 't', 'e').then_some(TokenKind::ByteKeyword), Some(_) => { input.undo(); None @@ -5931,16 +10050,24 @@ impl Lexer for Language { Some('c') => match input.next() { Some('a') => match input.next() { Some('l') => { - if self.version_is_at_least_0_5_0 { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'l', 'd', 'a', 't', 'a') - .then_some(TokenKind::CalldataKeyword) + .then_some(TokenKind::YulCallDataKeyword) } else { None } } - Some('s') => scan_chars!(input, 'e').then_some(TokenKind::CaseKeyword), + Some('s') => { + scan_chars!(input, 'e').then_some(TokenKind::YulCaseKeyword) + } Some('t') => { - scan_chars!(input, 'c', 'h').then_some(TokenKind::CatchKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'c', 'h') + .then_some(TokenKind::YulCatchKeyword) + } else { + None + } } Some(_) => { input.undo(); @@ -5953,12 +10080,20 @@ impl Lexer for Language { Some('s') => { if scan_chars!(input, 't') { match input.next() { - Some('a') => scan_chars!(input, 'n', 't') - .then_some(TokenKind::ConstantKeyword), + Some('a') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'n', 't') + .then_some(TokenKind::YulConstantKeyword) + } else { + None + } + } Some('r') => { - if self.version_is_at_least_0_4_22 { + if self.version_is_at_least_0_5_0 + && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'u', 'c', 't', 'o', 'r') - .then_some(TokenKind::ConstructorKeyword) + .then_some(TokenKind::YulConstructorKeyword) } else { None } @@ -5975,9 +10110,15 @@ impl Lexer for Language { } Some('t') => match input.next() { Some('i') => scan_chars!(input, 'n', 'u', 'e') - .then_some(TokenKind::ContinueKeyword), - Some('r') => scan_chars!(input, 'a', 'c', 't') - .then_some(TokenKind::ContractKeyword), + .then_some(TokenKind::YulContinueKeyword), + Some('r') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'a', 'c', 't') + .then_some(TokenKind::YulContractKeyword) + } else { + None + } + } Some(_) => { input.undo(); None @@ -5991,9 +10132,10 @@ impl Lexer for Language { None => None, }, Some('p') => { - if self.version_is_at_least_0_5_0 { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'y', 'o', 'f') - .then_some(TokenKind::CopyofKeyword) + .then_some(TokenKind::YulCopyOfKeyword) } else { None } @@ -6011,15 +10153,23 @@ impl Lexer for Language { None => None, }, Some('d') => match input.next() { - Some('a') => scan_chars!(input, 'y', 's').then_some(TokenKind::DaysKeyword), + Some('a') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'y', 's').then_some(TokenKind::YulDaysKeyword) + } else { + None + } + } Some('e') => match input.next() { Some('f') => match input.next() { Some('a') => scan_chars!(input, 'u', 'l', 't') - .then_some(TokenKind::DefaultKeyword), + .then_some(TokenKind::YulDefaultKeyword), Some('i') => { - if self.version_is_at_least_0_5_0 { + if self.version_is_at_least_0_5_0 + && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'n', 'e') - .then_some(TokenKind::DefineKeyword) + .then_some(TokenKind::YulDefineKeyword) } else { None } @@ -6030,15 +10180,27 @@ impl Lexer for Language { } None => None, }, - Some('l') => scan_chars!(input, 'e', 't', 'e') - .then_some(TokenKind::DeleteKeyword), + Some('l') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e', 't', 'e') + .then_some(TokenKind::YulDeleteKeyword) + } else { + None + } + } Some(_) => { input.undo(); None } None => None, }, - Some('o') => Some(TokenKind::DoKeyword), + Some('o') => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulDoKeyword) + } else { + None + } + } Some(_) => { input.undo(); None @@ -6046,41 +10208,51 @@ impl Lexer for Language { None => None, }, Some('e') => match input.next() { - Some('l') => scan_chars!(input, 's', 'e').then_some(TokenKind::ElseKeyword), + Some('l') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 's', 'e').then_some(TokenKind::YulElseKeyword) + } else { + None + } + } Some('m') => { - if self.version_is_at_least_0_4_21 { - scan_chars!(input, 'i', 't').then_some(TokenKind::EmitKeyword) + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'i', 't').then_some(TokenKind::YulEmitKeyword) } else { None } } - Some('n') => scan_chars!(input, 'u', 'm').then_some(TokenKind::EnumKeyword), - Some('r') => { - if self.version_is_at_least_0_8_4 { - scan_chars!(input, 'r', 'o', 'r').then_some(TokenKind::ErrorKeyword) + Some('n') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'u', 'm').then_some(TokenKind::YulEnumKeyword) } else { None } } Some('t') => { - scan_chars!(input, 'h', 'e', 'r').then_some(TokenKind::EtherKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'h', 'e', 'r') + .then_some(TokenKind::YulEtherKeyword) + } else { + None + } } Some('v') => { - scan_chars!(input, 'e', 'n', 't').then_some(TokenKind::EventKeyword) - } - Some('x') => match input.next() { - Some('p') => { - scan_chars!(input, 'e', 'r', 'i', 'm', 'e', 'n', 't', 'a', 'l') - .then_some(TokenKind::ExperimentalKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e', 'n', 't') + .then_some(TokenKind::YulEventKeyword) + } else { + None } - Some('t') => scan_chars!(input, 'e', 'r', 'n', 'a', 'l') - .then_some(TokenKind::ExternalKeyword), - Some(_) => { - input.undo(); + } + Some('x') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 't', 'e', 'r', 'n', 'a', 'l') + .then_some(TokenKind::YulExternalKeyword) + } else { None } - None => None, - }, + } Some(_) => { input.undo(); None @@ -6092,16 +10264,17 @@ impl Lexer for Language { if scan_chars!(input, 'l') { match input.next() { Some('l') => { - if self.version_is_at_least_0_6_0 { + if self.version_is_at_least_0_6_0 + && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'b', 'a', 'c', 'k') - .then_some(TokenKind::FallbackKeyword) + .then_some(TokenKind::YulFallbackKeyword) } else { None } } - Some('s') => { - scan_chars!(input, 'e').then_some(TokenKind::FalseKeyword) - } + Some('s') => scan_chars!(input, 'e') + .then_some(TokenKind::YulFalseKeyword), Some(_) => { input.undo(); None @@ -6116,12 +10289,17 @@ impl Lexer for Language { if scan_chars!(input, 'n') { match input.next() { Some('a') => { - scan_chars!(input, 'l').then_some(TokenKind::FinalKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'l') + .then_some(TokenKind::YulFinalKeyword) + } else { + None + } } Some('n') => { if !self.version_is_at_least_0_7_0 { scan_chars!(input, 'e', 'y') - .then_some(TokenKind::FinneyKeyword) + .then_some(TokenKind::YulFinneyKeyword) } else { None } @@ -6136,42 +10314,31 @@ impl Lexer for Language { None } } - Some('o') => scan_chars!(input, 'r').then_some(TokenKind::ForKeyword), - Some('r') => scan_chars!(input, 'o', 'm').then_some(TokenKind::FromKeyword), + Some('o') => scan_chars!(input, 'r').then_some(TokenKind::YulForKeyword), Some('u') => scan_chars!(input, 'n', 'c', 't', 'i', 'o', 'n') - .then_some(TokenKind::FunctionKeyword), + .then_some(TokenKind::YulFunctionKeyword), Some(_) => { input.undo(); None } None => None, }, - Some('g') => match input.next() { - Some('l') => { - if self.version_is_at_least_0_8_13 { - scan_chars!(input, 'o', 'b', 'a', 'l') - .then_some(TokenKind::GlobalKeyword) - } else { - None - } - } - Some('w') => { - if self.version_is_at_least_0_6_11 { - scan_chars!(input, 'e', 'i').then_some(TokenKind::GweiKeyword) - } else { - None - } - } - Some(_) => { - input.undo(); + Some('g') => { + if self.version_is_at_least_0_7_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'w', 'e', 'i').then_some(TokenKind::YulGweiKeyword) + } else { None } - None => None, - }, + } Some('h') => match input.next() { - Some('e') => scan_chars!(input, 'x').then_some(TokenKind::HexKeyword), + Some('e') => scan_chars!(input, 'x').then_some(TokenKind::YulHexKeyword), Some('o') => { - scan_chars!(input, 'u', 'r', 's').then_some(TokenKind::HoursKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'u', 'r', 's') + .then_some(TokenKind::YulHoursKeyword) + } else { + None + } } Some(_) => { input.undo(); @@ -6180,27 +10347,35 @@ impl Lexer for Language { None => None, }, Some('i') => match input.next() { - Some('f') => Some(TokenKind::IfKeyword), + Some('f') => Some(TokenKind::YulIfKeyword), Some('m') => match input.next() { Some('m') => { - if self.version_is_at_least_0_5_0 { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'u', 't', 'a', 'b', 'l', 'e') - .then_some(TokenKind::ImmutableKeyword) + .then_some(TokenKind::YulImmutableKeyword) } else { None } } Some('p') => match input.next() { Some('l') => { - if self.version_is_at_least_0_5_0 { + if self.version_is_at_least_0_5_0 + && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'e', 'm', 'e', 'n', 't', 's') - .then_some(TokenKind::ImplementsKeyword) + .then_some(TokenKind::YulImplementsKeyword) } else { None } } Some('o') => { - scan_chars!(input, 'r', 't').then_some(TokenKind::ImportKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'r', 't') + .then_some(TokenKind::YulImportKeyword) + } else { + None + } } Some(_) => { input.undo(); @@ -6215,17 +10390,41 @@ impl Lexer for Language { None => None, }, Some('n') => match input.next() { - Some('d') => scan_chars!(input, 'e', 'x', 'e', 'd') - .then_some(TokenKind::IndexedKeyword), - Some('l') => scan_chars!(input, 'i', 'n', 'e') - .then_some(TokenKind::InlineKeyword), + Some('d') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e', 'x', 'e', 'd') + .then_some(TokenKind::YulIndexedKeyword) + } else { + None + } + } + Some('l') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'i', 'n', 'e') + .then_some(TokenKind::YulInlineKeyword) + } else { + None + } + } Some('t') => { if scan_chars!(input, 'e', 'r') { match input.next() { - Some('f') => scan_chars!(input, 'a', 'c', 'e') - .then_some(TokenKind::InterfaceKeyword), - Some('n') => scan_chars!(input, 'a', 'l') - .then_some(TokenKind::InternalKeyword), + Some('f') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'a', 'c', 'e') + .then_some(TokenKind::YulInterfaceKeyword) + } else { + None + } + } + Some('n') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'a', 'l') + .then_some(TokenKind::YulInternalKeyword) + } else { + None + } + } Some(_) => { input.undo(); None @@ -6238,96 +10437,54 @@ impl Lexer for Language { } Some(_) => { input.undo(); - Some(TokenKind::InKeyword) + if !self.version_is_at_least_0_6_8 { + Some(TokenKind::YulInKeyword) + } else { + None + } } - None => Some(TokenKind::InKeyword), - }, - Some('s') => Some(TokenKind::IsKeyword), - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('l') => match input.next() { - Some('e') => match input.next() { - Some('a') => { - if self.version_is_at_least_0_6_0 { - scan_chars!(input, 'v', 'e').then_some(TokenKind::LeaveKeyword) + None => { + if !self.version_is_at_least_0_6_8 { + Some(TokenKind::YulInKeyword) } else { None } } - Some('t') => Some(TokenKind::LetKeyword), - Some(_) => { - input.undo(); + }, + Some('s') => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulIsKeyword) + } else { None } - None => None, - }, - Some('i') => scan_chars!(input, 'b', 'r', 'a', 'r', 'y') - .then_some(TokenKind::LibraryKeyword), + } Some(_) => { input.undo(); None } None => None, }, - Some('m') => match input.next() { - Some('a') => match input.next() { - Some('c') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'r', 'o').then_some(TokenKind::MacroKeyword) + Some('l') => match input.next() { + Some('e') => match input.next() { + Some('a') => { + if self.version_is_at_least_0_7_1 { + scan_chars!(input, 'v', 'e') + .then_some(TokenKind::YulLeaveKeyword) } else { None } } - Some('p') => scan_chars!(input, 'p', 'i', 'n', 'g') - .then_some(TokenKind::MappingKeyword), - Some('t') => { - scan_chars!(input, 'c', 'h').then_some(TokenKind::MatchKeyword) - } + Some('t') => Some(TokenKind::YulLetKeyword), Some(_) => { input.undo(); None } None => None, }, - Some('e') => scan_chars!(input, 'm', 'o', 'r', 'y') - .then_some(TokenKind::MemoryKeyword), - Some('i') => scan_chars!(input, 'n', 'u', 't', 'e', 's') - .then_some(TokenKind::MinutesKeyword), - Some('o') => scan_chars!(input, 'd', 'i', 'f', 'i', 'e', 'r') - .then_some(TokenKind::ModifierKeyword), - Some('u') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 't', 'a', 'b', 'l', 'e') - .then_some(TokenKind::MutableKeyword) - } else { - None - } - } - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('n') => match input.next() { - Some('e') => scan_chars!(input, 'w').then_some(TokenKind::NewKeyword), - Some('u') => scan_chars!(input, 'l', 'l').then_some(TokenKind::NullKeyword), - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('o') => match input.next() { - Some('f') => Some(TokenKind::OfKeyword), - Some('v') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'e', 'r', 'r', 'i', 'd', 'e') - .then_some(TokenKind::OverrideKeyword) + Some('i') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'b', 'r', 'a', 'r', 'y') + .then_some(TokenKind::YulLibraryKeyword) } else { None } @@ -6338,179 +10495,67 @@ impl Lexer for Language { } None => None, }, - Some('p') => match input.next() { + Some('m') => match input.next() { Some('a') => match input.next() { - Some('r') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 't', 'i', 'a', 'l') - .then_some(TokenKind::PartialKeyword) + Some('c') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 'r', 'o') + .then_some(TokenKind::YulMacroKeyword) } else { None } } - Some('y') => scan_chars!(input, 'a', 'b', 'l', 'e') - .then_some(TokenKind::PayableKeyword), - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('r') => match input.next() { - Some('a') => scan_chars!(input, 'g', 'm', 'a') - .then_some(TokenKind::PragmaKeyword), - Some('i') => scan_chars!(input, 'v', 'a', 't', 'e') - .then_some(TokenKind::PrivateKeyword), - Some('o') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'm', 'i', 's', 'e') - .then_some(TokenKind::PromiseKeyword) + Some('p') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'p', 'i', 'n', 'g') + .then_some(TokenKind::YulMappingKeyword) } else { None } } - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('u') => match input.next() { - Some('b') => scan_chars!(input, 'l', 'i', 'c') - .then_some(TokenKind::PublicKeyword), - Some('r') => scan_chars!(input, 'e').then_some(TokenKind::PureKeyword), - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('r') => { - if scan_chars!(input, 'e') { - match input.next() { - Some('c') => { - if self.version_is_at_least_0_6_0 { - scan_chars!(input, 'e', 'i', 'v', 'e') - .then_some(TokenKind::ReceiveKeyword) - } else { - None - } - } - Some('f') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'e', 'r', 'e', 'n', 'c', 'e') - .then_some(TokenKind::ReferenceKeyword) - } else { - None - } - } - Some('l') => { - scan_chars!(input, 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e') - .then_some(TokenKind::RelocatableKeyword) - } - Some('t') => { - if scan_chars!(input, 'u', 'r', 'n') { - match input.next() { - Some('s') => Some(TokenKind::ReturnsKeyword), - Some(_) => { - input.undo(); - Some(TokenKind::ReturnKeyword) - } - None => Some(TokenKind::ReturnKeyword), - } - } else { - None - } - } - Some('v') => { - if self.version_is_at_least_0_8_4 { - scan_chars!(input, 'e', 'r', 't') - .then_some(TokenKind::RevertKeyword) - } else { - None - } - } - Some(_) => { - input.undo(); - None - } - None => None, - } - } else { - None - } - } - Some('s') => match input.next() { - Some('e') => match input.next() { - Some('a') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'l', 'e', 'd') - .then_some(TokenKind::SealedKeyword) + Some('t') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'c', 'h') + .then_some(TokenKind::YulMatchKeyword) } else { None } } - Some('c') => scan_chars!(input, 'o', 'n', 'd', 's') - .then_some(TokenKind::SecondsKeyword), Some(_) => { input.undo(); None } None => None, }, - Some('i') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'z', 'e', 'o', 'f') - .then_some(TokenKind::SizeofKeyword) + Some('e') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'm', 'o', 'r', 'y') + .then_some(TokenKind::YulMemoryKeyword) } else { None } } - Some('o') => scan_chars!(input, 'l', 'i', 'd', 'i', 't', 'y') - .then_some(TokenKind::SolidityKeyword), - Some('t') => { - match input.next() { - Some('a') => scan_chars!(input, 't', 'i', 'c') - .then_some(TokenKind::StaticKeyword), - Some('o') => scan_chars!(input, 'r', 'a', 'g', 'e') - .then_some(TokenKind::StorageKeyword), - Some('r') => match input.next() { - Some('i') => scan_chars!(input, 'n', 'g') - .then_some(TokenKind::StringKeyword), - Some('u') => scan_chars!(input, 'c', 't') - .then_some(TokenKind::StructKeyword), - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some(_) => { - input.undo(); - None - } - None => None, + Some('i') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'n', 'u', 't', 'e', 's') + .then_some(TokenKind::YulMinutesKeyword) + } else { + None } } - Some('u') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'p', 'p', 'o', 'r', 't', 's') - .then_some(TokenKind::SupportsKeyword) + Some('o') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'd', 'i', 'f', 'i', 'e', 'r') + .then_some(TokenKind::YulModifierKeyword) } else { None } } - Some('w') => scan_chars!(input, 'i', 't', 'c', 'h') - .then_some(TokenKind::SwitchKeyword), - Some('z') => { - if !self.version_is_at_least_0_7_0 { - scan_chars!(input, 'a', 'b', 'o').then_some(TokenKind::SzaboKeyword) + Some('u') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 't', 'a', 'b', 'l', 'e') + .then_some(TokenKind::YulMutableKeyword) } else { None } @@ -6521,39 +10566,17 @@ impl Lexer for Language { } None => None, }, - Some('t') => match input.next() { - Some('h') => { - scan_chars!(input, 'r', 'o', 'w').then_some(TokenKind::ThrowKeyword) - } - Some('r') => match input.next() { - Some('u') => scan_chars!(input, 'e').then_some(TokenKind::TrueKeyword), - Some('y') => Some(TokenKind::TryKeyword), - Some(_) => { - input.undo(); + Some('n') => match input.next() { + Some('e') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'w').then_some(TokenKind::YulNewKeyword) + } else { None } - None => None, - }, - Some('y') => { - if scan_chars!(input, 'p', 'e') { - match input.next() { - Some('d') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'e', 'f') - .then_some(TokenKind::TypedefKeyword) - } else { - None - } - } - Some('o') => { - scan_chars!(input, 'f').then_some(TokenKind::TypeofKeyword) - } - Some(_) => { - input.undo(); - Some(TokenKind::TypeKeyword) - } - None => Some(TokenKind::TypeKeyword), - } + } + Some('u') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'l', 'l').then_some(TokenKind::YulNullKeyword) } else { None } @@ -6564,17 +10587,21 @@ impl Lexer for Language { } None => None, }, - Some('u') => match input.next() { - Some('n') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'c', 'h', 'e', 'c', 'k', 'e', 'd') - .then_some(TokenKind::UncheckedKeyword) + Some('o') => match input.next() { + Some('f') => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulOfKeyword) } else { None } } - Some('s') => { - scan_chars!(input, 'i', 'n', 'g').then_some(TokenKind::UsingKeyword) + Some('v') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e', 'r', 'r', 'i', 'd', 'e') + .then_some(TokenKind::YulOverrideKeyword) + } else { + None + } } Some(_) => { input.undo(); @@ -6582,14 +10609,21 @@ impl Lexer for Language { } None => None, }, - Some('v') => match input.next() { - Some('a') => scan_chars!(input, 'r').then_some(TokenKind::VarKeyword), - Some('i') => match input.next() { - Some('e') => scan_chars!(input, 'w').then_some(TokenKind::ViewKeyword), + Some('p') => match input.next() { + Some('a') => match input.next() { Some('r') => { - if self.version_is_at_least_0_6_0 { - scan_chars!(input, 't', 'u', 'a', 'l') - .then_some(TokenKind::VirtualKeyword) + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 't', 'i', 'a', 'l') + .then_some(TokenKind::YulPartialKeyword) + } else { + None + } + } + Some('y') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'a', 'b', 'l', 'e') + .then_some(TokenKind::YulPayableKeyword) } else { None } @@ -6600,353 +10634,410 @@ impl Lexer for Language { } None => None, }, - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('w') => match input.next() { - Some('e') => match input.next() { - Some('e') => { - scan_chars!(input, 'k', 's').then_some(TokenKind::WeeksKeyword) + Some('r') => match input.next() { + Some('a') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'g', 'm', 'a') + .then_some(TokenKind::YulPragmaKeyword) + } else { + None + } + } + Some('i') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'v', 'a', 't', 'e') + .then_some(TokenKind::YulPrivateKeyword) + } else { + None + } + } + Some('o') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 'm', 'i', 's', 'e') + .then_some(TokenKind::YulPromiseKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('u') => match input.next() { + Some('b') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'l', 'i', 'c') + .then_some(TokenKind::YulPublicKeyword) + } else { + None + } + } + Some('r') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e').then_some(TokenKind::YulPureKeyword) + } else { + None + } } - Some('i') => Some(TokenKind::WeiKeyword), Some(_) => { input.undo(); None } None => None, }, - Some('h') => { - scan_chars!(input, 'i', 'l', 'e').then_some(TokenKind::WhileKeyword) - } Some(_) => { input.undo(); None } None => None, }, - Some('y') => { - scan_chars!(input, 'e', 'a', 'r', 's').then_some(TokenKind::YearsKeyword) - } - Some(_) => { - input.undo(); - None - } - None => None, - } { - // Make sure that this is not the start of an identifier - if !self.identifier_part(input) { - furthest_position = input.position(); - longest_token = Some(kind); - } - } - input.set_position(save); - - if let Some(kind) = match input.next() { - Some('!') => match input.next() { - Some('=') => Some(TokenKind::BangEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Bang) - } - None => Some(TokenKind::Bang), - }, - Some('%') => match input.next() { - Some('=') => Some(TokenKind::PercentEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Percent) - } - None => Some(TokenKind::Percent), - }, - Some('&') => match input.next() { - Some('&') => Some(TokenKind::AmpersandAmpersand), - Some('=') => Some(TokenKind::AmpersandEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Ampersand) - } - None => Some(TokenKind::Ampersand), - }, - Some('(') => Some(TokenKind::OpenParen), - Some(')') => Some(TokenKind::CloseParen), - Some('*') => match input.next() { - Some('*') => Some(TokenKind::AsteriskAsterisk), - Some('=') => Some(TokenKind::AsteriskEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Asterisk) - } - None => Some(TokenKind::Asterisk), - }, - Some('+') => match input.next() { - Some('+') => Some(TokenKind::PlusPlus), - Some('=') => Some(TokenKind::PlusEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Plus) - } - None => Some(TokenKind::Plus), - }, - Some(',') => Some(TokenKind::Comma), - Some('-') => match input.next() { - Some('-') => Some(TokenKind::MinusMinus), - Some('=') => Some(TokenKind::MinusEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Minus) - } - None => Some(TokenKind::Minus), - }, - Some('.') => Some(TokenKind::Period), - Some('/') => match input.next() { - Some('=') => Some(TokenKind::SlashEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Slash) + Some('r') => { + if scan_chars!(input, 'e') { + match input.next() { + Some('c') => { + if self.version_is_at_least_0_6_0 + && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 'e', 'i', 'v', 'e') + .then_some(TokenKind::YulReceiveKeyword) + } else { + None + } + } + Some('f') => { + if self.version_is_at_least_0_5_0 + && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 'e', 'r', 'e', 'n', 'c', 'e') + .then_some(TokenKind::YulReferenceKeyword) + } else { + None + } + } + Some('l') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e') + .then_some(TokenKind::YulRelocatableKeyword) + } else { + None + } + } + Some('t') => { + if scan_chars!(input, 'u', 'r', 'n') { + match input.next() { + Some('s') => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulReturnsKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + Some(TokenKind::YulReturnKeyword) + } + None => Some(TokenKind::YulReturnKeyword), + } + } else { + None + } + } + Some('v') => scan_chars!(input, 'e', 'r', 't') + .then_some(TokenKind::YulRevertKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + } + } else { + None } - None => Some(TokenKind::Slash), - }, - Some(':') => Some(TokenKind::Colon), - Some(';') => Some(TokenKind::Semicolon), - Some('<') => match input.next() { - Some('<') => match input.next() { - Some('=') => Some(TokenKind::LessThanLessThanEqual), + } + Some('s') => match input.next() { + Some('e') => match input.next() { + Some('a') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 'l', 'e', 'd') + .then_some(TokenKind::YulSealedKeyword) + } else { + None + } + } + Some('c') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'o', 'n', 'd', 's') + .then_some(TokenKind::YulSecondsKeyword) + } else { + None + } + } Some(_) => { input.undo(); - Some(TokenKind::LessThanLessThan) + None } - None => Some(TokenKind::LessThanLessThan), + None => None, }, - Some('=') => Some(TokenKind::LessThanEqual), - Some(_) => { - input.undo(); - Some(TokenKind::LessThan) - } - None => Some(TokenKind::LessThan), - }, - Some('=') => match input.next() { - Some('=') => Some(TokenKind::EqualEqual), - Some('>') => Some(TokenKind::EqualGreaterThan), - Some(_) => { - input.undo(); - Some(TokenKind::Equal) - } - None => Some(TokenKind::Equal), - }, - Some('>') => match input.next() { - Some('=') => Some(TokenKind::GreaterThanEqual), - Some('>') => match input.next() { - Some('=') => Some(TokenKind::GreaterThanGreaterThanEqual), - Some('>') => match input.next() { - Some('=') => { - Some(TokenKind::GreaterThanGreaterThanGreaterThanEqual) + Some('i') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'z', 'e', 'o', 'f') + .then_some(TokenKind::YulSizeOfKeyword) + } else { + None + } + } + Some('t') => match input.next() { + Some('a') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 't', 'i', 'c') + .then_some(TokenKind::YulStaticKeyword) + } else { + None + } + } + Some('o') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'r', 'a', 'g', 'e') + .then_some(TokenKind::YulStorageKeyword) + } else { + None + } + } + Some('r') => match input.next() { + Some('i') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'n', 'g') + .then_some(TokenKind::YulStringKeyword) + } else { + None + } + } + Some('u') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'c', 't') + .then_some(TokenKind::YulStructKeyword) + } else { + None + } } Some(_) => { input.undo(); - Some(TokenKind::GreaterThanGreaterThanGreaterThan) + None } - None => Some(TokenKind::GreaterThanGreaterThanGreaterThan), + None => None, }, Some(_) => { input.undo(); - Some(TokenKind::GreaterThanGreaterThan) + None } - None => Some(TokenKind::GreaterThanGreaterThan), + None => None, }, - Some(_) => { - input.undo(); - Some(TokenKind::GreaterThan) + Some('u') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'p', 'p', 'o', 'r', 't', 's') + .then_some(TokenKind::YulSupportsKeyword) + } else { + None + } } - None => Some(TokenKind::GreaterThan), - }, - Some('?') => Some(TokenKind::QuestionMark), - Some('[') => Some(TokenKind::OpenBracket), - Some(']') => Some(TokenKind::CloseBracket), - Some('^') => match input.next() { - Some('=') => Some(TokenKind::CaretEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Caret) + Some('w') => scan_chars!(input, 'i', 't', 'c', 'h') + .then_some(TokenKind::YulSwitchKeyword), + Some('z') => { + if !self.version_is_at_least_0_7_0 { + scan_chars!(input, 'a', 'b', 'o') + .then_some(TokenKind::YulSzaboKeyword) + } else { + None + } } - None => Some(TokenKind::Caret), - }, - Some('{') => Some(TokenKind::OpenBrace), - Some('|') => match input.next() { - Some('=') => Some(TokenKind::BarEqual), - Some('|') => Some(TokenKind::BarBar), Some(_) => { input.undo(); - Some(TokenKind::Bar) + None } - None => Some(TokenKind::Bar), + None => None, }, - Some('}') => Some(TokenKind::CloseBrace), - Some('~') => Some(TokenKind::Tilde), - Some(_) => { - input.undo(); - None - } - None => None, - } { - furthest_position = input.position(); - longest_token = Some(kind); - } - input.set_position(save); - - longest_match! { - { AsciiStringLiteral = ascii_string_literal } - { DecimalLiteral = decimal_literal } - { EndOfLine = end_of_line } - { FixedBytesType = fixed_bytes_type } - { HexLiteral = hex_literal } - { HexStringLiteral = hex_string_literal } - { MultilineComment = multiline_comment } - { SignedFixedType = signed_fixed_type } - { SignedIntegerType = signed_integer_type } - { SingleLineComment = single_line_comment } - { UnicodeStringLiteral = unicode_string_literal } - { UnsignedFixedType = unsigned_fixed_type } - { UnsignedIntegerType = unsigned_integer_type } - { Whitespace = whitespace } - { Identifier = identifier } - } - } - LexicalContext::VersionPragma => { - macro_rules! longest_match { - ($( { $kind:ident = $function:ident } )*) => { - $( - if self.$function(input) && input.position() > furthest_position { - furthest_position = input.position(); - longest_token = Some(TokenKind::$kind); + Some('t') => match input.next() { + Some('h') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'r', 'o', 'w') + .then_some(TokenKind::YulThrowKeyword) + } else { + None + } + } + Some('r') => match input.next() { + Some('u') => { + scan_chars!(input, 'e').then_some(TokenKind::YulTrueKeyword) + } + Some('y') => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulTryKeyword) + } else { + None } - input.set_position(save); - )* - }; - } - - if let Some(kind) = scan_chars!(input, 's', 'o', 'l', 'i', 'd', 'i', 't', 'y') - .then_some(TokenKind::SolidityKeyword) - { - // Make sure that this is not the start of an identifier - if !self.identifier_part(input) { - furthest_position = input.position(); - longest_token = Some(kind); - } - } - input.set_position(save); - - if let Some(kind) = match input.next() { - Some('-') => Some(TokenKind::Minus), - Some('.') => Some(TokenKind::Period), - Some('<') => match input.next() { - Some('=') => Some(TokenKind::LessThanEqual), - Some(_) => { - input.undo(); - Some(TokenKind::LessThan) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('y') => { + if scan_chars!(input, 'p', 'e') { + match input.next() { + Some('d') => { + if self.version_is_at_least_0_5_0 + && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 'e', 'f') + .then_some(TokenKind::YulTypeDefKeyword) + } else { + None + } + } + Some('o') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'f') + .then_some(TokenKind::YulTypeOfKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulTypeKeyword) + } else { + None + } + } + None => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulTypeKeyword) + } else { + None + } + } + } + } else { + None + } } - None => Some(TokenKind::LessThan), - }, - Some('=') => Some(TokenKind::Equal), - Some('>') => match input.next() { - Some('=') => Some(TokenKind::GreaterThanEqual), Some(_) => { input.undo(); - Some(TokenKind::GreaterThan) + None } - None => Some(TokenKind::GreaterThan), + None => None, }, - Some('^') => Some(TokenKind::Caret), - Some('|') => scan_chars!(input, '|').then_some(TokenKind::BarBar), - Some('~') => Some(TokenKind::Tilde), - Some(_) => { - input.undo(); - None - } - None => None, - } { - furthest_position = input.position(); - longest_token = Some(kind); - } - input.set_position(save); - - longest_match! { - { VersionPragmaValue = version_pragma_value } - } - } - LexicalContext::YulBlock => { - macro_rules! longest_match { - ($( { $kind:ident = $function:ident } )*) => { - $( - if self.$function(input) && input.position() > furthest_position { - furthest_position = input.position(); - longest_token = Some(TokenKind::$kind); - } - input.set_position(save); - )* - }; - } - - if let Some(kind) = match input.next() { - Some('b') => { - scan_chars!(input, 'r', 'e', 'a', 'k').then_some(TokenKind::BreakKeyword) - } - Some('c') => match input.next() { - Some('a') => scan_chars!(input, 's', 'e').then_some(TokenKind::CaseKeyword), - Some('o') => scan_chars!(input, 'n', 't', 'i', 'n', 'u', 'e') - .then_some(TokenKind::ContinueKeyword), + Some('u') => match input.next() { + Some('n') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'c', 'h', 'e', 'c', 'k', 'e', 'd') + .then_some(TokenKind::YulUncheckedKeyword) + } else { + None + } + } + Some('s') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'i', 'n', 'g') + .then_some(TokenKind::YulUsingKeyword) + } else { + None + } + } Some(_) => { input.undo(); None } None => None, }, - Some('d') => scan_chars!(input, 'e', 'f', 'a', 'u', 'l', 't') - .then_some(TokenKind::DefaultKeyword), - Some('f') => match input.next() { + Some('v') => match input.next() { Some('a') => { - scan_chars!(input, 'l', 's', 'e').then_some(TokenKind::FalseKeyword) + if !self.version_is_at_least_0_6_5 { + scan_chars!(input, 'r').then_some(TokenKind::YulVarKeyword) + } else { + None + } } - Some('o') => scan_chars!(input, 'r').then_some(TokenKind::ForKeyword), - Some('u') => scan_chars!(input, 'n', 'c', 't', 'i', 'o', 'n') - .then_some(TokenKind::FunctionKeyword), + Some('i') => match input.next() { + Some('e') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'w').then_some(TokenKind::YulViewKeyword) + } else { + None + } + } + Some('r') => { + if self.version_is_at_least_0_6_0 && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 't', 'u', 'a', 'l') + .then_some(TokenKind::YulVirtualKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, Some(_) => { input.undo(); None } None => None, }, - Some('h') => scan_chars!(input, 'e', 'x').then_some(TokenKind::HexKeyword), - Some('i') => scan_chars!(input, 'f').then_some(TokenKind::IfKeyword), - Some('l') => { - if scan_chars!(input, 'e') { - match input.next() { - Some('a') => { - if self.version_is_at_least_0_6_0 { - scan_chars!(input, 'v', 'e') - .then_some(TokenKind::LeaveKeyword) - } else { - None - } + Some('w') => match input.next() { + Some('e') => match input.next() { + Some('e') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'k', 's') + .then_some(TokenKind::YulWeeksKeyword) + } else { + None } - Some('t') => Some(TokenKind::LetKeyword), - Some(_) => { - input.undo(); + } + Some('i') => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulWeiKeyword) + } else { None } - None => None, } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('h') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'i', 'l', 'e') + .then_some(TokenKind::YulWhileKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('y') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e', 'a', 'r', 's') + .then_some(TokenKind::YulYearsKeyword) } else { None } } - Some('s') => scan_chars!(input, 'w', 'i', 't', 'c', 'h') - .then_some(TokenKind::SwitchKeyword), - Some('t') => { - scan_chars!(input, 'r', 'u', 'e').then_some(TokenKind::TrueKeyword) - } Some(_) => { input.undo(); None @@ -6984,9 +11075,14 @@ impl Lexer for Language { longest_match! { { AsciiStringLiteral = ascii_string_literal } { HexStringLiteral = hex_string_literal } + { YulBytesKeyword = yul_bytes_keyword } { YulDecimalLiteral = yul_decimal_literal } + { YulFixedKeyword = yul_fixed_keyword } { YulHexLiteral = yul_hex_literal } { YulIdentifier = yul_identifier } + { YulIntKeyword = yul_int_keyword } + { YulUfixedKeyword = yul_ufixed_keyword } + { YulUintKeyword = yul_uint_keyword } } } } diff --git a/crates/solidity/outputs/npm/build/src/main.rs b/crates/solidity/outputs/npm/build/src/main.rs index 9b72a67cb0..9b44f5cc5a 100644 --- a/crates/solidity/outputs/npm/build/src/main.rs +++ b/crates/solidity/outputs/npm/build/src/main.rs @@ -1,11 +1,10 @@ use anyhow::Result; use cargo_emit::rerun_if_changed; -use std::rc::Rc; use codegen_grammar::Grammar; use codegen_parser_generator::code_generator::CodeGenerator; use infra_utils::{cargo::CargoWorkspace, paths::PathExtensions}; -use solidity_language::{GrammarConstructorDslV1, GrammarConstructorDslV2}; +use solidity_language::GrammarConstructorDslV2; // Instead of the soure crate calling codegen APIs directly in the build script, it invokes this binary, which in turn // calls the codegen APIs (and hence why it's emitting `cargo:` directives). @@ -18,13 +17,8 @@ use solidity_language::{GrammarConstructorDslV1, GrammarConstructorDslV2}; fn main() -> Result<()> { // Generate files in the source crate: { - let v1 = Rc::try_unwrap(Grammar::from_dsl_v1()).unwrap(); - let v2 = Rc::try_unwrap(Grammar::from_dsl_v2()).unwrap(); - let grammar = Rc::new(Grammar { - name: v2.name, - versions: v2.versions, - ..v1 - }); + let grammar = Grammar::from_dsl_v2(); + let crate_dir = CargoWorkspace::locate_source_crate("solidity_npm_crate")?; CodeGenerator::write_source(&crate_dir.join("src/generated"), &grammar)?; diff --git a/crates/solidity/outputs/npm/crate/src/generated/kinds.rs b/crates/solidity/outputs/npm/crate/src/generated/kinds.rs index 2907502d19..71b66e7a0b 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/kinds.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/kinds.rs @@ -18,144 +18,213 @@ use {napi::bindgen_prelude::*, napi_derive::napi}; #[cfg_attr(not(feature = "slang_napi_interfaces"), derive(Clone, Copy))] pub enum ProductionKind { ABICoderPragma, + AdditiveExpression, AddressType, + AndExpression, ArgumentsDeclaration, ArrayExpression, - ArrayValuesList, - AsciiStringLiteralsList, - AssemblyFlagsList, + ArrayTypeName, + ArrayValues, + AsciiStringLiterals, + AssemblyFlags, + AssemblyFlagsDeclaration, AssemblyStatement, + AssignmentExpression, + BitwiseAndExpression, + BitwiseOrExpression, + BitwiseXorExpression, Block, BreakStatement, CatchClause, CatchClauseError, - CatchClausesList, + CatchClauses, + ComparisonExpression, + ConditionalExpression, ConstantDefinition, - ConstructorAttributesList, + ConstructorAttribute, + ConstructorAttributes, ConstructorDefinition, ContinueStatement, ContractDefinition, - ContractMembersList, - DeconstructionImport, - DeconstructionImportSymbol, - DeconstructionImportSymbolsList, + ContractMember, + ContractMembers, + DecimalNumberExpression, + DefaultAllKeywords, DeleteStatement, DoWhileStatement, + ElementaryType, + ElseBranch, EmitStatement, - EndOfFileTrivia, EnumDefinition, + EnumMembers, + EqualityExpression, ErrorDefinition, ErrorParameter, - ErrorParametersList, + ErrorParameters, + ErrorParametersDeclaration, EventDefinition, EventParameter, - EventParametersList, + EventParameters, + EventParametersDeclaration, + ExperimentalFeature, ExperimentalPragma, + ExponentiationExpression, Expression, ExpressionStatement, - FallbackFunctionAttributesList, + FallbackFunctionAttribute, + FallbackFunctionAttributes, FallbackFunctionDefinition, ForStatement, - FunctionAttributesList, + ForStatementCondition, + ForStatementInitialization, + FunctionAttribute, + FunctionAttributes, + FunctionBody, + FunctionCallExpression, FunctionCallOptions, FunctionDefinition, FunctionType, - FunctionTypeAttributesList, - HexStringLiteralsList, + FunctionTypeAttribute, + FunctionTypeAttributes, + HexNumberExpression, + HexStringLiterals, IdentifierPath, - IdentifierPathsList, - IdentifiersList, IfStatement, + ImportAlias, + ImportDeconstructionField, + ImportDeconstructionFields, ImportDirective, + ImportSymbol, + ImportSymbolDeconstruction, + IndexAccessEnd, + IndexAccessExpression, InheritanceSpecifier, InheritanceType, - InheritanceTypesList, + InheritanceTypes, InterfaceDefinition, - InterfaceMembersList, + InterfaceMembers, LeadingTrivia, LibraryDefinition, - LibraryMembersList, + LibraryMembers, + MappingKey, MappingKeyType, MappingType, - MappingValueType, - ModifierAttributesList, + MappingValue, + MemberAccessExpression, + ModifierAttribute, + ModifierAttributes, ModifierDefinition, ModifierInvocation, + MultiplicativeExpression, NamedArgument, + NamedArgumentGroup, + NamedArgumentGroups, + NamedArguments, NamedArgumentsDeclaration, - NamedArgumentsList, - NamedImport, + NamedImportSymbol, NewExpression, - NumericExpression, + NumberUnit, + OrExpression, + OverridePaths, OverrideSpecifier, Parameter, + Parameters, ParametersDeclaration, - ParametersList, - PathImport, - PositionalArgumentsList, + PathImportSymbol, + PositionalArguments, + PositionalArgumentsDeclaration, + PostfixExpression, + Pragma, + PragmaAllKeywords, PragmaDirective, - ReceiveFunctionAttributesList, + PrefixExpression, + ReceiveFunctionAttribute, + ReceiveFunctionAttributes, ReceiveFunctionDefinition, ReturnStatement, ReturnsDeclaration, RevertStatement, + ShiftExpression, SourceUnit, - SourceUnitMembersList, - StateVariableAttributesList, + SourceUnitMember, + SourceUnitMembers, + StateVariableAttribute, + StateVariableAttributes, StateVariableDefinition, + StateVariableDefinitionValue, Statement, - StatementsList, + Statements, + StorageLocation, + StringExpression, StructDefinition, StructMember, - StructMembersList, + StructMembers, ThrowStatement, TrailingTrivia, TryStatement, TupleDeconstructionStatement, TupleExpression, TupleMember, - TupleMembersList, - TupleValuesList, + TupleMemberDeconstruction, + TupleMembersDeconstruction, + TupleValue, + TupleValues, TypeExpression, TypeName, + TypedTupleMember, UncheckedBlock, - UnicodeStringLiteralsList, - UnnamedFunctionAttributesList, + UnicodeStringLiterals, + UnnamedFunctionAttribute, + UnnamedFunctionAttributes, UnnamedFunctionDefinition, + UntypedTupleMember, UserDefinedValueTypeDefinition, + UsingAlias, + UsingDeconstructionField, + UsingDeconstructionFields, UsingDirective, - UsingDirectiveDeconstruction, - UsingDirectivePath, - UsingDirectiveSymbol, - UsingDirectiveSymbolsList, - VariableDeclaration, + UsingSymbol, + UsingSymbolDeconstruction, + UsingTarget, VariableDeclarationStatement, + VariableDeclarationType, + VariableDeclarationValue, VersionPragma, VersionPragmaExpression, - VersionPragmaExpressionsList, + VersionPragmaExpressions, + VersionPragmaOrExpression, + VersionPragmaPrefixExpression, + VersionPragmaRangeExpression, VersionPragmaSpecifier, WhileStatement, + YulAllKeywords, + YulArguments, YulAssignmentStatement, YulBlock, YulBreakStatement, YulContinueStatement, - YulDeclarationStatement, + YulDefaultCase, YulExpression, - YulExpressionsList, YulForStatement, + YulFunctionCallExpression, YulFunctionDefinition, YulIdentifierPath, - YulIdentifierPathsList, - YulIdentifiersList, + YulIdentifierPaths, YulIfStatement, YulLeaveStatement, + YulLiteral, + YulParameters, YulParametersDeclaration, + YulReturnVariables, YulReturnsDeclaration, YulStatement, - YulStatementsList, + YulStatements, YulSwitchCase, - YulSwitchCasesList, + YulSwitchCases, YulSwitchStatement, + YulValueCase, + YulVariableDeclarationStatement, + YulVariableDeclarationValue, } #[derive( @@ -173,161 +242,223 @@ pub enum ProductionKind { #[cfg_attr(not(feature = "slang_napi_interfaces"), derive(Clone, Copy))] pub enum RuleKind { ABICoderPragma, + AdditiveExpression, AddressType, + AndExpression, ArgumentsDeclaration, ArrayExpression, ArrayTypeName, - ArrayValuesList, - AsciiStringLiteralsList, - AssemblyFlagsList, + ArrayValues, + AsciiStringLiterals, + AssemblyFlags, + AssemblyFlagsDeclaration, AssemblyStatement, + AssignmentExpression, BinaryExpression, + BitwiseAndExpression, + BitwiseOrExpression, + BitwiseXorExpression, Block, BreakStatement, CatchClause, CatchClauseError, - CatchClausesList, + CatchClauses, + ComparisonExpression, ConditionalExpression, ConstantDefinition, - ConstructorAttributesList, + ConstructorAttribute, + ConstructorAttributes, ConstructorDefinition, ContinueStatement, ContractDefinition, - ContractMembersList, - DeconstructionImport, - DeconstructionImportSymbol, - DeconstructionImportSymbolsList, + ContractMember, + ContractMembers, + DecimalNumberExpression, + DefaultAllKeywords, DeleteStatement, DoWhileStatement, + ElementaryType, + ElseBranch, EmitStatement, - EndOfFileTrivia, EnumDefinition, + EnumMembers, + EqualityExpression, ErrorDefinition, ErrorParameter, - ErrorParametersList, + ErrorParameters, + ErrorParametersDeclaration, EventDefinition, EventParameter, - EventParametersList, + EventParameters, + EventParametersDeclaration, + ExperimentalFeature, ExperimentalPragma, + ExponentiationExpression, Expression, ExpressionStatement, - FallbackFunctionAttributesList, + FallbackFunctionAttribute, + FallbackFunctionAttributes, FallbackFunctionDefinition, ForStatement, - FunctionAttributesList, + ForStatementCondition, + ForStatementInitialization, + FunctionAttribute, + FunctionAttributes, + FunctionBody, FunctionCallExpression, FunctionCallOptions, FunctionDefinition, FunctionType, - FunctionTypeAttributesList, - HexStringLiteralsList, + FunctionTypeAttribute, + FunctionTypeAttributes, + HexNumberExpression, + HexStringLiterals, IdentifierPath, - IdentifierPathsList, - IdentifiersList, IfStatement, + ImportAlias, + ImportDeconstructionField, + ImportDeconstructionFields, ImportDirective, + ImportSymbol, + ImportSymbolDeconstruction, + IndexAccessEnd, IndexAccessExpression, InheritanceSpecifier, InheritanceType, - InheritanceTypesList, + InheritanceTypes, InterfaceDefinition, - InterfaceMembersList, + InterfaceMembers, LeadingTrivia, LibraryDefinition, - LibraryMembersList, + LibraryMembers, + MappingKey, MappingKeyType, MappingType, - MappingValueType, + MappingValue, MemberAccessExpression, - ModifierAttributesList, + ModifierAttribute, + ModifierAttributes, ModifierDefinition, ModifierInvocation, + MultiplicativeExpression, NamedArgument, + NamedArgumentGroup, + NamedArgumentGroups, + NamedArguments, NamedArgumentsDeclaration, - NamedArgumentsList, - NamedImport, + NamedImportSymbol, NewExpression, - NumericExpression, + NumberUnit, + OrExpression, + OverridePaths, OverrideSpecifier, Parameter, + Parameters, ParametersDeclaration, - ParametersList, - PathImport, - PositionalArgumentsList, + PathImportSymbol, + PositionalArguments, + PositionalArgumentsDeclaration, + PostfixExpression, + Pragma, + PragmaAllKeywords, PragmaDirective, - ReceiveFunctionAttributesList, + PrefixExpression, + ReceiveFunctionAttribute, + ReceiveFunctionAttributes, ReceiveFunctionDefinition, ReturnStatement, ReturnsDeclaration, RevertStatement, + ShiftExpression, SourceUnit, - SourceUnitMembersList, - StateVariableAttributesList, + SourceUnitMember, + SourceUnitMembers, + StateVariableAttribute, + StateVariableAttributes, StateVariableDefinition, + StateVariableDefinitionValue, Statement, - StatementsList, + Statements, + StorageLocation, + StringExpression, StructDefinition, StructMember, - StructMembersList, + StructMembers, ThrowStatement, TrailingTrivia, TryStatement, TupleDeconstructionStatement, TupleExpression, TupleMember, - TupleMembersList, - TupleValuesList, + TupleMemberDeconstruction, + TupleMembersDeconstruction, + TupleValue, + TupleValues, TypeExpression, TypeName, + TypedTupleMember, UnaryPostfixExpression, UnaryPrefixExpression, UncheckedBlock, - UnicodeStringLiteralsList, - UnnamedFunctionAttributesList, + UnicodeStringLiterals, + UnnamedFunctionAttribute, + UnnamedFunctionAttributes, UnnamedFunctionDefinition, + UntypedTupleMember, UserDefinedValueTypeDefinition, + UsingAlias, + UsingDeconstructionField, + UsingDeconstructionFields, UsingDirective, - UsingDirectiveDeconstruction, - UsingDirectivePath, - UsingDirectiveSymbol, - UsingDirectiveSymbolsList, - VariableDeclaration, + UsingSymbol, + UsingSymbolDeconstruction, + UsingTarget, VariableDeclarationStatement, + VariableDeclarationType, + VariableDeclarationValue, VersionPragma, VersionPragmaBinaryExpression, VersionPragmaExpression, - VersionPragmaExpressionsList, + VersionPragmaExpressions, + VersionPragmaOrExpression, + VersionPragmaPrefixExpression, + VersionPragmaRangeExpression, VersionPragmaSpecifier, VersionPragmaUnaryExpression, WhileStatement, + YulAllKeywords, + YulArguments, YulAssignmentStatement, YulBlock, YulBreakStatement, YulContinueStatement, - YulDeclarationStatement, + YulDefaultCase, YulExpression, - YulExpressionsList, YulForStatement, YulFunctionCallExpression, YulFunctionDefinition, YulIdentifierPath, - YulIdentifierPathsList, - YulIdentifiersList, + YulIdentifierPaths, YulIfStatement, YulLeaveStatement, + YulLiteral, + YulParameters, YulParametersDeclaration, + YulReturnVariables, YulReturnsDeclaration, YulStatement, - YulStatementsList, + YulStatements, YulSwitchCase, - YulSwitchCasesList, + YulSwitchCases, YulSwitchStatement, + YulValueCase, + YulVariableDeclarationStatement, + YulVariableDeclarationValue, } impl RuleKind { pub fn is_trivia(&self) -> bool { match self { - Self::EndOfFileTrivia => true, Self::LeadingTrivia => true, Self::TrailingTrivia => true, _ => false, @@ -350,7 +481,7 @@ impl RuleKind { #[cfg_attr(not(feature = "slang_napi_interfaces"), derive(Clone, Copy))] pub enum TokenKind { SKIPPED, - ABICoderKeyword, + AbicoderKeyword, AbstractKeyword, AddressKeyword, AfterKeyword, @@ -375,7 +506,8 @@ pub enum TokenKind { BoolKeyword, BreakKeyword, ByteKeyword, - CalldataKeyword, + BytesKeyword, + CallDataKeyword, Caret, CaretEqual, CaseKeyword, @@ -390,7 +522,7 @@ pub enum TokenKind { ConstructorKeyword, ContinueKeyword, ContractKeyword, - CopyofKeyword, + CopyOfKeyword, DaysKeyword, DecimalLiteral, DefaultKeyword, @@ -413,7 +545,7 @@ pub enum TokenKind { FalseKeyword, FinalKeyword, FinneyKeyword, - FixedBytesType, + FixedKeyword, ForKeyword, FromKeyword, FunctionKeyword, @@ -437,10 +569,10 @@ pub enum TokenKind { InKeyword, IndexedKeyword, InlineKeyword, + IntKeyword, InterfaceKeyword, InternalKeyword, IsKeyword, - LeaveKeyword, LessThan, LessThanEqual, LessThanLessThan, @@ -489,10 +621,8 @@ pub enum TokenKind { SealedKeyword, SecondsKeyword, Semicolon, - SignedFixedType, - SignedIntegerType, SingleLineComment, - SizeofKeyword, + SizeOfKeyword, Slash, SlashEqual, SolidityKeyword, @@ -507,13 +637,13 @@ pub enum TokenKind { Tilde, TrueKeyword, TryKeyword, + TypeDefKeyword, TypeKeyword, - TypedefKeyword, - TypeofKeyword, + TypeOfKeyword, + UfixedKeyword, + UintKeyword, UncheckedKeyword, UnicodeStringLiteral, - UnsignedFixedType, - UnsignedIntegerType, UsingKeyword, VarKeyword, VersionPragmaValue, @@ -524,9 +654,116 @@ pub enum TokenKind { WhileKeyword, Whitespace, YearsKeyword, + YulAbstractKeyword, + YulAddressKeyword, + YulAfterKeyword, + YulAliasKeyword, + YulAnonymousKeyword, + YulApplyKeyword, + YulAsKeyword, + YulAssemblyKeyword, + YulAutoKeyword, + YulBoolKeyword, + YulBreakKeyword, + YulByteKeyword, + YulBytesKeyword, + YulCallDataKeyword, + YulCaseKeyword, + YulCatchKeyword, + YulConstantKeyword, + YulConstructorKeyword, + YulContinueKeyword, + YulContractKeyword, + YulCopyOfKeyword, + YulDaysKeyword, YulDecimalLiteral, + YulDefaultKeyword, + YulDefineKeyword, + YulDeleteKeyword, + YulDoKeyword, + YulElseKeyword, + YulEmitKeyword, + YulEnumKeyword, + YulEtherKeyword, + YulEventKeyword, + YulExternalKeyword, + YulFallbackKeyword, + YulFalseKeyword, + YulFinalKeyword, + YulFinneyKeyword, + YulFixedKeyword, + YulForKeyword, + YulFunctionKeyword, + YulGweiKeyword, + YulHexKeyword, YulHexLiteral, + YulHoursKeyword, YulIdentifier, + YulIfKeyword, + YulImmutableKeyword, + YulImplementsKeyword, + YulImportKeyword, + YulInKeyword, + YulIndexedKeyword, + YulInlineKeyword, + YulIntKeyword, + YulInterfaceKeyword, + YulInternalKeyword, + YulIsKeyword, + YulLeaveKeyword, + YulLetKeyword, + YulLibraryKeyword, + YulMacroKeyword, + YulMappingKeyword, + YulMatchKeyword, + YulMemoryKeyword, + YulMinutesKeyword, + YulModifierKeyword, + YulMutableKeyword, + YulNewKeyword, + YulNullKeyword, + YulOfKeyword, + YulOverrideKeyword, + YulPartialKeyword, + YulPayableKeyword, + YulPragmaKeyword, + YulPrivateKeyword, + YulPromiseKeyword, + YulPublicKeyword, + YulPureKeyword, + YulReceiveKeyword, + YulReferenceKeyword, + YulRelocatableKeyword, + YulReturnKeyword, + YulReturnsKeyword, + YulRevertKeyword, + YulSealedKeyword, + YulSecondsKeyword, + YulSizeOfKeyword, + YulStaticKeyword, + YulStorageKeyword, + YulStringKeyword, + YulStructKeyword, + YulSupportsKeyword, + YulSwitchKeyword, + YulSzaboKeyword, + YulThrowKeyword, + YulTrueKeyword, + YulTryKeyword, + YulTypeDefKeyword, + YulTypeKeyword, + YulTypeOfKeyword, + YulUfixedKeyword, + YulUintKeyword, + YulUncheckedKeyword, + YulUsingKeyword, + YulVarKeyword, + YulViewKeyword, + YulVirtualKeyword, + YulWeeksKeyword, + YulWeiKeyword, + YulWhileKeyword, + YulYearsKeyword, } #[derive(strum_macros::FromRepr)] @@ -535,8 +772,8 @@ pub enum TokenKind { #[cfg_attr(not(feature = "slang_napi_interfaces"), derive(Clone, Copy))] pub enum LexicalContext { Default, - VersionPragma, - YulBlock, + Pragma, + Yul, } /// Marker trait for type-level [`LexicalContext`] variants. @@ -554,16 +791,16 @@ pub mod LexicalContextType { LexicalContext::Default } } - pub struct VersionPragma {} - impl IsLexicalContext for VersionPragma { + pub struct Pragma {} + impl IsLexicalContext for Pragma { fn value() -> LexicalContext { - LexicalContext::VersionPragma + LexicalContext::Pragma } } - pub struct YulBlock {} - impl IsLexicalContext for YulBlock { + pub struct Yul {} + impl IsLexicalContext for Yul { fn value() -> LexicalContext { - LexicalContext::YulBlock + LexicalContext::Yul } } } diff --git a/crates/solidity/outputs/npm/crate/src/generated/language.rs b/crates/solidity/outputs/npm/crate/src/generated/language.rs index 5068f4002e..70b35a3c9b 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/language.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/language.rs @@ -21,13 +21,16 @@ use super::napi::napi_parse_output::ParseOutput as NAPIParseOutput; #[cfg_attr(feature = "slang_napi_interfaces", napi(namespace = "language"))] pub struct Language { pub(crate) version: Version, + pub(crate) version_is_at_least_0_4_14: bool, pub(crate) version_is_at_least_0_4_21: bool, pub(crate) version_is_at_least_0_4_22: bool, pub(crate) version_is_at_least_0_5_0: bool, pub(crate) version_is_at_least_0_5_3: bool, + pub(crate) version_is_at_least_0_5_10: bool, pub(crate) version_is_at_least_0_6_0: bool, pub(crate) version_is_at_least_0_6_2: bool, pub(crate) version_is_at_least_0_6_5: bool, + pub(crate) version_is_at_least_0_6_8: bool, pub(crate) version_is_at_least_0_6_11: bool, pub(crate) version_is_at_least_0_7_0: bool, pub(crate) version_is_at_least_0_7_1: bool, @@ -142,13 +145,16 @@ impl Language { pub fn new(version: Version) -> std::result::Result { if Self::SUPPORTED_VERSIONS.binary_search(&version).is_ok() { Ok(Self { + version_is_at_least_0_4_14: Version::new(0, 4, 14) <= version, version_is_at_least_0_4_21: Version::new(0, 4, 21) <= version, version_is_at_least_0_4_22: Version::new(0, 4, 22) <= version, version_is_at_least_0_5_0: Version::new(0, 5, 0) <= version, version_is_at_least_0_5_3: Version::new(0, 5, 3) <= version, + version_is_at_least_0_5_10: Version::new(0, 5, 10) <= version, version_is_at_least_0_6_0: Version::new(0, 6, 0) <= version, version_is_at_least_0_6_2: Version::new(0, 6, 2) <= version, version_is_at_least_0_6_5: Version::new(0, 6, 5) <= version, + version_is_at_least_0_6_8: Version::new(0, 6, 8) <= version, version_is_at_least_0_6_11: Version::new(0, 6, 11) <= version, version_is_at_least_0_7_0: Version::new(0, 7, 0) <= version, version_is_at_least_0_7_1: Version::new(0, 7, 1) <= version, @@ -178,11 +184,11 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn abi_coder_pragma(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + seq.elem(self.parse_token_with_trivia::( input, - TokenKind::ABICoderKeyword, + TokenKind::AbicoderKeyword, ))?; - seq.elem(self.parse_token_with_trivia::( + seq.elem(self.parse_token_with_trivia::( input, TokenKind::Identifier, ))?; @@ -192,67 +198,87 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn address_type(&self, input: &mut ParserContext) -> ParserResult { + fn additive_expression(&self, input: &mut ParserContext) -> ParserResult { ChoiceHelper::run(input, |mut choice, input| { - let result = SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::AddressKeyword, - ))?; - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ), - ))?; - seq.finish() - }); + let result = + self.parse_token_with_trivia::(input, TokenKind::Plus); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); + let result = self + .parse_token_with_trivia::(input, TokenKind::Minus); choice.consider(input, result)?; choice.finish(input) }) + .with_kind(RuleKind::AdditiveExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn address_type(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::AddressKeyword, + ))?; + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ), + ))?; + seq.finish() + }) .with_kind(RuleKind::AddressType) } + #[allow(unused_assignments, unused_parens)] + fn and_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::( + input, + TokenKind::AmpersandAmpersand, + ) + .with_kind(RuleKind::AndExpression) + } + #[allow(unused_assignments, unused_parens)] fn arguments_declaration(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.positional_arguments_declaration(input); + choice.consider(input, result)?; + let result = self.named_arguments_declaration(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ArgumentsDeclaration) + } + + #[allow(unused_assignments, unused_parens)] + fn array_expression(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let mut delim_guard = input.open_delim(TokenKind::CloseBracket); let input = delim_guard.ctx(); seq.elem(self.parse_token_with_trivia::( input, - TokenKind::OpenParen, + TokenKind::OpenBracket, ))?; seq.elem( - OptionalHelper::transform(ChoiceHelper::run(input, |mut choice, input| { - let result = self.positional_arguments_list(input); - choice.consider(input, result)?; - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - choice.finish(input) - })) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), + self.array_values(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBracket, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::CloseParen, + TokenKind::CloseBracket, ))?; seq.finish() }) - .with_kind(RuleKind::ArgumentsDeclaration) + .with_kind(RuleKind::ArrayExpression) } #[allow(unused_assignments, unused_parens)] - fn array_expression(&self, input: &mut ParserContext) -> ParserResult { + fn array_type_name(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { let mut delim_guard = input.open_delim(TokenKind::CloseBracket); let input = delim_guard.ctx(); @@ -261,7 +287,7 @@ impl Language { TokenKind::OpenBracket, ))?; seq.elem( - self.array_values_list(input) + OptionalHelper::transform(self.expression(input)) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, @@ -275,88 +301,182 @@ impl Language { ))?; seq.finish() }) - .with_kind(RuleKind::ArrayExpression) + .with_kind(RuleKind::ArrayTypeName) } #[allow(unused_assignments, unused_parens)] - fn array_values_list(&self, input: &mut ParserContext) -> ParserResult { + fn array_values(&self, input: &mut ParserContext) -> ParserResult { SeparatedHelper::run::<_, LexicalContextType::Default>( input, self, |input| self.expression(input), TokenKind::Comma, ) - .with_kind(RuleKind::ArrayValuesList) + .with_kind(RuleKind::ArrayValues) } #[allow(unused_assignments, unused_parens)] - fn ascii_string_literals_list(&self, input: &mut ParserContext) -> ParserResult { + fn ascii_string_literals(&self, input: &mut ParserContext) -> ParserResult { OneOrMoreHelper::run(input, |input| { self.parse_token_with_trivia::( input, TokenKind::AsciiStringLiteral, ) }) - .with_kind(RuleKind::AsciiStringLiteralsList) + .with_kind(RuleKind::AsciiStringLiterals) } #[allow(unused_assignments, unused_parens)] - fn assembly_flags_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( + fn assembly_flags(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Yul>( input, self, |input| { - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::AsciiStringLiteral, ) }, TokenKind::Comma, - ) - .with_kind(RuleKind::AssemblyFlagsList) + )) + .with_kind(RuleKind::AssemblyFlags) + } + + #[allow(unused_assignments, unused_parens)] + fn assembly_flags_declaration(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem( + self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ), + )?; + seq.elem( + self.assembly_flags(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Yul>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem( + self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ), + )?; + seq.finish() + }) + .with_kind(RuleKind::AssemblyFlagsDeclaration) } #[allow(unused_assignments, unused_parens)] fn assembly_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + seq.elem(self.parse_token_with_trivia::( input, TokenKind::AssemblyKeyword, ))?; seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::AsciiStringLiteral, ), ))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - self.assembly_flags_list(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - })))?; + seq.elem(OptionalHelper::transform( + self.assembly_flags_declaration(input), + ))?; seq.elem(self.yul_block(input))?; seq.finish() }) .with_kind(RuleKind::AssemblyStatement) } + #[allow(unused_assignments, unused_parens)] + fn assignment_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::(input, TokenKind::Equal); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::BarEqual); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PlusEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinusEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::CaretEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SlashEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PercentEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AmpersandEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanLessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThanGreaterThanEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::AssignmentExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn bitwise_and_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::(input, TokenKind::Ampersand) + .with_kind(RuleKind::BitwiseAndExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn bitwise_or_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::(input, TokenKind::Bar) + .with_kind(RuleKind::BitwiseOrExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn bitwise_xor_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::(input, TokenKind::Caret) + .with_kind(RuleKind::BitwiseXorExpression) + } + #[allow(unused_assignments, unused_parens)] fn block(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -367,7 +487,7 @@ impl Language { TokenKind::OpenBrace, ))?; seq.elem( - OptionalHelper::transform(self.statements_list(input)) + self.statements(input) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, @@ -446,13 +566,59 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn catch_clauses_list(&self, input: &mut ParserContext) -> ParserResult { + fn catch_clauses(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_6_0 { OneOrMoreHelper::run(input, |input| self.catch_clause(input)) } else { ParserResult::disabled() } - .with_kind(RuleKind::CatchClausesList) + .with_kind(RuleKind::CatchClauses) + } + + #[allow(unused_assignments, unused_parens)] + fn comparison_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::(input, TokenKind::LessThan); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ComparisonExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn conditional_expression(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::QuestionMark, + ))?; + seq.elem(self.expression(input))?; + seq.elem( + self.parse_token_with_trivia::( + input, + TokenKind::Colon, + ), + )?; + seq.elem(self.expression(input))?; + seq.finish() + }) + .with_kind(RuleKind::ConditionalExpression) } #[allow(unused_assignments, unused_parens)] @@ -497,52 +663,51 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn constructor_attributes_list(&self, input: &mut ParserContext) -> ParserResult { + fn constructor_attribute(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_4_22 { - OneOrMoreHelper::run(input, |input| { - if self.version_is_at_least_0_4_22 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PublicKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) } else { ParserResult::disabled() } - .with_kind(RuleKind::ConstructorAttributesList) + .with_kind(RuleKind::ConstructorAttribute) } #[allow(unused_assignments, unused_parens)] - fn constructor_definition(&self, input: &mut ParserContext) -> ParserResult { + fn constructor_attributes(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_4_22 { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::ConstructorKeyword, - ))?; - seq.elem(self.parameters_declaration(input))?; - seq.elem(OptionalHelper::transform( - self.constructor_attributes_list(input), + ZeroOrMoreHelper::run(input, |input| self.constructor_attribute(input)) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ConstructorAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn constructor_definition(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_4_22 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ConstructorKeyword, ))?; + seq.elem(self.parameters_declaration(input))?; + seq.elem(self.constructor_attributes(input))?; seq.elem(self.block(input))?; seq.finish() }) @@ -604,13 +769,13 @@ impl Language { TokenKind::OpenBrace, ))?; seq.elem( - OptionalHelper::transform(self.contract_members_list(input)) + self.contract_members(input) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, - ), + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, @@ -624,1174 +789,2647 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn contract_members_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive(input); - choice.consider(input, result)?; - let result = self.function_definition(input); + fn contract_member(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.using_directive(input); + choice.consider(input, result)?; + let result = self.function_definition(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_4_22 { + let result = self.constructor_definition(input); choice.consider(input, result)?; - let result = self.modifier_definition(input); + } + if self.version_is_at_least_0_6_0 { + let result = self.receive_function_definition(input); choice.consider(input, result)?; - let result = self.struct_definition(input); + } + if self.version_is_at_least_0_6_0 { + let result = self.fallback_function_definition(input); choice.consider(input, result)?; - let result = self.enum_definition(input); + } + if !self.version_is_at_least_0_6_0 { + let result = self.unnamed_function_definition(input); choice.consider(input, result)?; - let result = self.event_definition(input); + } + let result = self.modifier_definition(input); + choice.consider(input, result)?; + let result = self.struct_definition(input); + choice.consider(input, result)?; + let result = self.enum_definition(input); + choice.consider(input, result)?; + let result = self.event_definition(input); + choice.consider(input, result)?; + let result = self.state_variable_definition(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_8_4 { + let result = self.error_definition(input); choice.consider(input, result)?; - let result = self.state_variable_definition(input); + } + if self.version_is_at_least_0_8_8 { + let result = self.user_defined_value_type_definition(input); choice.consider(input, result)?; - if self.version_is_at_least_0_4_22 { - let result = self.constructor_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.fallback_function_definition(input); - choice.consider(input, result)?; - let result = self.receive_function_definition(input); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_6_0 { - let result = self.unnamed_function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + choice.finish(input) }) - .with_kind(RuleKind::ContractMembersList) + .with_kind(RuleKind::ContractMember) } #[allow(unused_assignments, unused_parens)] - fn deconstruction_import(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; - seq.elem( - self.deconstruction_import_symbols_list(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseBrace, - ))?; - seq.finish() - }))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::FromKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ))?; - seq.finish() - }) - .with_kind(RuleKind::DeconstructionImport) + fn contract_members(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.contract_member(input)) + .with_kind(RuleKind::ContractMembers) } #[allow(unused_assignments, unused_parens)] - fn deconstruction_import_symbol(&self, input: &mut ParserContext) -> ParserResult { + fn decimal_number_expression(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Identifier, + TokenKind::DecimalLiteral, ))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::AsKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.finish() - })))?; + seq.elem(OptionalHelper::transform(self.number_unit(input)))?; seq.finish() }) - .with_kind(RuleKind::DeconstructionImportSymbol) - } - - #[allow(unused_assignments, unused_parens)] - fn deconstruction_import_symbols_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.deconstruction_import_symbol(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::DeconstructionImportSymbolsList) + .with_kind(RuleKind::DecimalNumberExpression) } #[allow(unused_assignments, unused_parens)] - fn delete_statement(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::DeleteKeyword, - ))?; - seq.elem(self.expression(input))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + fn default_all_keywords(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - .with_kind(RuleKind::DeleteStatement) - } - - #[allow(unused_assignments, unused_parens)] - fn do_while_statement(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::DoKeyword, - ))?; - seq.elem(self.statement(input))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::WhileKeyword, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - self.expression(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::AbstractKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - .with_kind(RuleKind::DoWhileStatement) - } - - #[allow(unused_assignments, unused_parens)] - fn emit_statement(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_4_21 { - SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::EmitKeyword, - ))?; - seq.elem(self.identifier_path(input))?; - seq.elem(self.arguments_declaration(input))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::EmitStatement) - } - - #[allow(unused_assignments, unused_parens)] - fn end_of_file_trivia(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = - self.parse_token::(input, TokenKind::Whitespace); - choice.consider(input, result)?; - let result = - self.parse_token::(input, TokenKind::EndOfLine); - choice.consider(input, result)?; - let result = self - .parse_token::(input, TokenKind::MultilineComment); - choice.consider(input, result)?; - let result = self.parse_token::( - input, - TokenKind::SingleLineComment, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - }) - .with_kind(RuleKind::EndOfFileTrivia) - } - - #[allow(unused_assignments, unused_parens)] - fn enum_definition(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + TokenKind::AddressKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::EnumKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::AfterKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Identifier, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; - seq.elem( - OptionalHelper::transform(self.identifiers_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseBrace, - ))?; - seq.finish() - }))?; - seq.finish() - }) - .with_kind(RuleKind::EnumDefinition) - } - - #[allow(unused_assignments, unused_parens)] - fn error_definition(&self, input: &mut ParserContext) -> ParserResult { - if self . version_is_at_least_0_8_4 { SequenceHelper :: run (| mut seq | { seq . elem (SequenceHelper :: run (| mut seq | { seq . elem (self . parse_token_with_trivia :: < LexicalContextType :: Default > (input , TokenKind :: ErrorKeyword)) ? ; seq . elem (self . parse_token_with_trivia :: < LexicalContextType :: Default > (input , TokenKind :: Identifier)) ? ; seq . elem (SequenceHelper :: run (| mut seq | { let mut delim_guard = input . open_delim (TokenKind :: CloseParen) ; let input = delim_guard . ctx () ; seq . elem (self . parse_token_with_trivia :: < LexicalContextType :: Default > (input , TokenKind :: OpenParen)) ? ; seq . elem (OptionalHelper :: transform (self . error_parameters_list (input)) . recover_until_with_nested_delims :: < _ , LexicalContextType :: Default > (input , self , TokenKind :: CloseParen , RecoverFromNoMatch :: Yes ,)) ? ; seq . elem (self . parse_token_with_trivia :: < LexicalContextType :: Default > (input , TokenKind :: CloseParen)) ? ; seq . finish () })) ? ; seq . finish () }) . recover_until_with_nested_delims :: < _ , LexicalContextType :: Default > (input , self , TokenKind :: Semicolon , RecoverFromNoMatch :: No ,)) ? ; seq . elem (self . parse_token_with_trivia :: < LexicalContextType :: Default > (input , TokenKind :: Semicolon)) ? ; seq . finish () }) } else { ParserResult :: disabled () } . with_kind (RuleKind :: ErrorDefinition) - } - - #[allow(unused_assignments, unused_parens)] - fn error_parameter(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_8_4 { - SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ), - ))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::ErrorParameter) - } - - #[allow(unused_assignments, unused_parens)] - fn error_parameters_list(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_8_4 { - SeparatedHelper::run::<_, LexicalContextType::Default>( + TokenKind::AliasKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - self, - |input| self.error_parameter(input), - TokenKind::Comma, - ) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::ErrorParametersList) - } - - #[allow(unused_assignments, unused_parens)] - fn event_definition(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::EventKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - OptionalHelper::transform(self.event_parameters_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::AnonymousKeyword, - ), - ))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::AnonymousKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - .with_kind(RuleKind::EventDefinition) - } - - #[allow(unused_assignments, unused_parens)] - fn event_parameter(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::IndexedKeyword, - ), - ))?; - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ), - ))?; - seq.finish() - }) - .with_kind(RuleKind::EventParameter) - } - - #[allow(unused_assignments, unused_parens)] - fn event_parameters_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.event_parameter(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::EventParametersList) - } - - #[allow(unused_assignments, unused_parens)] - fn experimental_pragma(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + TokenKind::ApplyKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::ExperimentalKeyword, - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.finish() - }) - .with_kind(RuleKind::ExperimentalPragma) - } - - #[allow(unused_assignments, unused_parens)] - fn expression(&self, input: &mut ParserContext) -> ParserResult { - let parse_assignment_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 1u8, - 1u8 + 1, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Equal, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::BarEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PlusEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::MinusEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::CaretEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::SlashEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PercentEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsteriskEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AmpersandEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThanLessThanEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThanGreaterThanEqual, - ); + TokenKind::AsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AssemblyKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AutoKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BoolKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BreakKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ByteKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BytesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::CallDataKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::CaseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::CatchKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ConstantKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ConstructorKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ContinueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ContractKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::CopyOfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::DaysKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::DefaultKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::DefineKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::DeleteKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::DoKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ElseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::EmitKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::EnumKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ErrorKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::EtherKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::EventKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FallbackKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FalseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FinalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FinneyKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FixedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ForKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FromKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FunctionKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GlobalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GweiKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::HexKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::HoursKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::IfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ImmutableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ImplementsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ImportKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::IndexedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InlineKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::IntKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InterfaceKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::IsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LetKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LibraryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MacroKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MappingKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MatchKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MemoryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinutesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ModifierKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MutableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::NewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::NullKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::OfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::OverrideKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PartialKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PragmaKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PromiseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ReceiveKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ReferenceKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::RelocatableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ReturnKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ReturnsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::RevertKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SealedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SecondsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SizeOfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StaticKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StorageKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StringKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StructKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SupportsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SwitchKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SzaboKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ThrowKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::TrueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::TryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::TypeDefKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::TypeKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::TypeOfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UfixedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UintKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UncheckedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UsingKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::VarKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::WeeksKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::WeiKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::WhileKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YearsKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::DefaultAllKeywords) + } + + #[allow(unused_assignments, unused_parens)] + fn delete_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::DeleteKeyword, + ))?; + seq.elem(self.expression(input))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + .with_kind(RuleKind::DeleteStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn do_while_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::DoKeyword, + ))?; + seq.elem(self.statement(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::WhileKeyword, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + self.expression(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + .with_kind(RuleKind::DoWhileStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn elementary_type(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::BoolKeyword, + ); + choice.consider(input, result)?; + if !self.version_is_at_least_0_8_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::ByteKeyword, + ); + choice.consider(input, result)?; + } + let result = self.parse_token_with_trivia::( + input, + TokenKind::StringKeyword, + ); + choice.consider(input, result)?; + let result = self.address_type(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BytesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::IntKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UintKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FixedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UfixedKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ElementaryType) + } + + #[allow(unused_assignments, unused_parens)] + fn else_branch(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::ElseKeyword, + ), + ))?; + seq.elem(OptionalHelper::transform(self.statement(input)))?; + seq.finish() + }) + .with_kind(RuleKind::ElseBranch) + } + + #[allow(unused_assignments, unused_parens)] + fn emit_statement(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_4_21 { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::EmitKeyword, + ))?; + seq.elem(self.identifier_path(input))?; + seq.elem(self.arguments_declaration(input))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::EmitStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn enum_definition(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::EnumKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBrace, + ))?; + seq.elem( + self.enum_members(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBrace, + ))?; + seq.finish() + }))?; + seq.finish() + }) + .with_kind(RuleKind::EnumDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn enum_members(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| { + self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ) + }, + TokenKind::Comma, + )) + .with_kind(RuleKind::EnumMembers) + } + + #[allow(unused_assignments, unused_parens)] + fn equality_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::EqualEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BangEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::EqualityExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn error_definition(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_4 { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ErrorKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(self.error_parameters_declaration(input))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ErrorDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn error_parameter(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_4 { + SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ), + ))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ErrorParameter) + } + + #[allow(unused_assignments, unused_parens)] + fn error_parameters(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_4 { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.error_parameter(input), + TokenKind::Comma, + )) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ErrorParameters) + } + + #[allow(unused_assignments, unused_parens)] + fn error_parameters_declaration(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_4 { + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + self.error_parameters(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ErrorParametersDeclaration) + } + + #[allow(unused_assignments, unused_parens)] + fn event_definition(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::EventKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(OptionalHelper::transform( + self.event_parameters_declaration(input), + ))?; + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::AnonymousKeyword, + ), + ))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + .with_kind(RuleKind::EventDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn event_parameter(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::IndexedKeyword, + ), + ))?; + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ), + ))?; + seq.finish() + }) + .with_kind(RuleKind::EventParameter) + } + + #[allow(unused_assignments, unused_parens)] + fn event_parameters(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.event_parameter(input), + TokenKind::Comma, + )) + .with_kind(RuleKind::EventParameters) + } + + #[allow(unused_assignments, unused_parens)] + fn event_parameters_declaration(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + self.event_parameters(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }) + .with_kind(RuleKind::EventParametersDeclaration) + } + + #[allow(unused_assignments, unused_parens)] + fn experimental_feature(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ExperimentalFeature) + } + + #[allow(unused_assignments, unused_parens)] + fn experimental_pragma(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ExperimentalKeyword, + ))?; + seq.elem(self.experimental_feature(input))?; + seq.finish() + }) + .with_kind(RuleKind::ExperimentalPragma) + } + + #[allow(unused_assignments, unused_parens)] + fn exponentiation_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskAsterisk, + ); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskAsterisk, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::ExponentiationExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn expression(&self, input: &mut ParserContext) -> ParserResult { + let parse_assignment_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 1u8, + 1u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Equal, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BarEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PlusEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinusEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::CaretEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SlashEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PercentEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AmpersandEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanLessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThanGreaterThanEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }), + ) + }; + let parse_conditional_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_postfix_operator( + RuleKind::ConditionalExpression, + 3u8, + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::QuestionMark, + ))?; + seq.elem(self.expression(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Colon, + ))?; + seq.elem(self.expression(input))?; + seq.finish() + }), + ) + }; + let parse_or_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 5u8, + 5u8 + 1, + self.parse_token_with_trivia::( + input, + TokenKind::BarBar, + ), + ) + }; + let parse_and_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 7u8, + 7u8 + 1, + self.parse_token_with_trivia::( + input, + TokenKind::AmpersandAmpersand, + ), + ) + }; + let parse_equality_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 9u8, + 9u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::EqualEqual, + ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::GreaterThanGreaterThanGreaterThanEqual, + TokenKind::BangEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }), + ) + }; + let parse_comparison_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 11u8, + 11u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }), + ) + }; + let parse_bitwise_or_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 13u8, + 13u8 + 1, + self.parse_token_with_trivia::(input, TokenKind::Bar), + ) + }; + let parse_bitwise_xor_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 15u8, + 15u8 + 1, + self.parse_token_with_trivia::( + input, + TokenKind::Caret, + ), + ) + }; + let parse_bitwise_and_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 17u8, + 17u8 + 1, + self.parse_token_with_trivia::( + input, + TokenKind::Ampersand, + ), + ) + }; + let parse_shift_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 19u8, + 19u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanLessThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThanGreaterThan, + ); + choice.consider(input, result)?; + choice.finish(input) + }), + ) + }; + let parse_additive_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 21u8, + 21u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Plus, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + choice.finish(input) + }), + ) + }; + let parse_multiplicative_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 23u8, + 23u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Asterisk, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Slash, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Percent, + ); + choice.consider(input, result)?; + choice.finish(input) + }), + ) + }; + let parse_exponentiation_expression_removed_from_0_6_0 = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 25u8, + 25u8 + 1, + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskAsterisk, + ); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskAsterisk, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }), + ) + }; + let parse_exponentiation_expression_introduced_from_0_6_0 = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::BinaryExpression, + 27u8 + 1, + 27u8, + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskAsterisk, + ); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsteriskAsterisk, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }), + ) + }; + let parse_postfix_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_postfix_operator( + RuleKind::UnaryPostfixExpression, + 29u8, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::PlusPlus, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinusMinus, ); choice.consider(input, result)?; choice.finish(input) }), ) }; - let parse_conditional_operator = |input: &mut ParserContext| { + let parse_prefix_expression_removed_from_0_5_0 = |input: &mut ParserContext| { + PrecedenceHelper::to_prefix_operator( + RuleKind::UnaryPrefixExpression, + 31u8, + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_5_0 { + let result = ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::( + input, + TokenKind::PlusPlus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::MinusMinus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Bang, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Plus, + ); + choice.consider(input, result)?; + choice.finish(input) + }); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_5_0 { + let result = ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::( + input, + TokenKind::PlusPlus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::MinusMinus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Bang, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + choice.finish(input) + }); + choice.consider(input, result)?; + } + choice.finish(input) + }), + ) + }; + let parse_prefix_expression_introduced_from_0_5_0 = |input: &mut ParserContext| { + PrecedenceHelper::to_prefix_operator( + RuleKind::UnaryPrefixExpression, + 33u8, + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_5_0 { + let result = ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::( + input, + TokenKind::PlusPlus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::MinusMinus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Bang, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Plus, + ); + choice.consider(input, result)?; + choice.finish(input) + }); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_5_0 { + let result = ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::( + input, + TokenKind::PlusPlus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::MinusMinus, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Bang, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + choice.finish(input) + }); + choice.consider(input, result)?; + } + choice.finish(input) + }), + ) + }; + let parse_function_call_expression = |input: &mut ParserContext| { PrecedenceHelper::to_postfix_operator( - RuleKind::ConditionalExpression, - 3u8, + RuleKind::FunctionCallExpression, + 35u8, + SequenceHelper::run(|mut seq| { + if self.version_is_at_least_0_6_2 { + seq.elem(OptionalHelper::transform(self.function_call_options(input)))?; + } + seq.elem(self.arguments_declaration(input))?; + seq.finish() + }), + ) + }; + let parse_member_access_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_postfix_operator( + RuleKind::MemberAccessExpression, + 37u8, SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::QuestionMark, + TokenKind::Period, ))?; - seq.elem(self.expression(input))?; + seq.elem(ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AddressKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }))?; + seq.finish() + }), + ) + }; + let parse_index_access_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_postfix_operator( + RuleKind::IndexAccessExpression, + 39u8, + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBracket); + let input = delim_guard.ctx(); seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Colon, + TokenKind::OpenBracket, + ))?; + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.elem(OptionalHelper::transform(self.index_access_end(input)))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBracket, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBracket, ))?; - seq.elem(self.expression(input))?; seq.finish() }), ) }; - let parse_or_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 5u8, - 5u8 + 1, - self.parse_token_with_trivia::( - input, - TokenKind::BarBar, - ), - ) + let prefix_operator_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_5_0 { + let result = parse_prefix_expression_removed_from_0_5_0(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_5_0 { + let result = parse_prefix_expression_introduced_from_0_5_0(input); + choice.consider(input, result)?; + } + choice.finish(input) + }) }; - let parse_and_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 7u8, - 7u8 + 1, - self.parse_token_with_trivia::( + let primary_expression_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.new_expression(input); + choice.consider(input, result)?; + let result = self.tuple_expression(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_5_3 { + let result = self.type_expression(input); + choice.consider(input, result)?; + } + let result = self.array_expression(input); + choice.consider(input, result)?; + let result = self.hex_number_expression(input); + choice.consider(input, result)?; + let result = self.decimal_number_expression(input); + choice.consider(input, result)?; + let result = self.string_expression(input); + choice.consider(input, result)?; + let result = self.elementary_type(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::AmpersandAmpersand, - ), - ) + TokenKind::TrueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FalseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + }; + let postfix_operator_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + let result = parse_conditional_expression(input); + choice.consider(input, result)?; + let result = parse_postfix_expression(input); + choice.consider(input, result)?; + let result = parse_function_call_expression(input); + choice.consider(input, result)?; + let result = parse_member_access_expression(input); + choice.consider(input, result)?; + let result = parse_index_access_expression(input); + choice.consider(input, result)?; + choice.finish(input) + }) + }; + let binary_operand_parser = |input: &mut ParserContext| { + SequenceHelper::run(|mut seq| { + seq.elem(ZeroOrMoreHelper::run(input, |input| { + prefix_operator_parser(input) + }))?; + seq.elem(primary_expression_parser(input))?; + seq.elem(ZeroOrMoreHelper::run(input, |input| { + postfix_operator_parser(input) + }))?; + seq.finish() + }) }; - let parse_equality_comparison_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 9u8, - 9u8 + 1, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::EqualEqual, - ); + let binary_operator_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + let result = parse_assignment_expression(input); + choice.consider(input, result)?; + let result = parse_or_expression(input); + choice.consider(input, result)?; + let result = parse_and_expression(input); + choice.consider(input, result)?; + let result = parse_equality_expression(input); + choice.consider(input, result)?; + let result = parse_comparison_expression(input); + choice.consider(input, result)?; + let result = parse_bitwise_or_expression(input); + choice.consider(input, result)?; + let result = parse_bitwise_xor_expression(input); + choice.consider(input, result)?; + let result = parse_bitwise_and_expression(input); + choice.consider(input, result)?; + let result = parse_shift_expression(input); + choice.consider(input, result)?; + let result = parse_additive_expression(input); + choice.consider(input, result)?; + let result = parse_multiplicative_expression(input); + choice.consider(input, result)?; + if !self.version_is_at_least_0_6_0 { + let result = parse_exponentiation_expression_removed_from_0_6_0(input); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::BangEqual, - ); + } + if self.version_is_at_least_0_6_0 { + let result = parse_exponentiation_expression_introduced_from_0_6_0(input); choice.consider(input, result)?; - choice.finish(input) - }), - ) + } + choice.finish(input) + }) }; - let parse_order_comparison_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 11u8, - 11u8 + 1, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let linear_expression_parser = |input: &mut ParserContext| { + SequenceHelper::run(|mut seq| { + seq.elem(binary_operand_parser(input))?; + seq.elem(ZeroOrMoreHelper::run(input, |input| { + SequenceHelper::run(|mut seq| { + seq.elem(binary_operator_parser(input))?; + seq.elem(binary_operand_parser(input))?; + seq.finish() + }) + }))?; + seq.finish() + }) + }; + PrecedenceHelper::reduce_precedence_result( + Some(RuleKind::Expression), + linear_expression_parser(input), + ) + .with_kind(RuleKind::Expression) + } + + #[allow(unused_assignments, unused_parens)] + fn expression_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + self.expression(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::GreaterThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + .with_kind(RuleKind::ExpressionStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn fallback_function_attribute(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_0 { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::FallbackFunctionAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn fallback_function_attributes(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_0 { + ZeroOrMoreHelper::run(input, |input| self.fallback_function_attribute(input)) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::FallbackFunctionAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn fallback_function_definition(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_0 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FallbackKeyword, + ))?; + seq.elem(self.parameters_declaration(input))?; + seq.elem(self.fallback_function_attributes(input))?; + seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; + seq.elem(self.function_body(input))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::FallbackFunctionDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn for_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ForKeyword, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.for_statement_initialization(input))?; + seq.elem(self.for_statement_condition(input))?; + seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::LessThanEqual, - ); + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }))?; + seq.elem(self.statement(input))?; + seq.finish() + }) + .with_kind(RuleKind::ForStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn for_statement_condition(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.expression_statement(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ForStatementCondition) + } + + #[allow(unused_assignments, unused_parens)] + fn for_statement_initialization(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.expression_statement(input); + choice.consider(input, result)?; + let result = self.variable_declaration_statement(input); + choice.consider(input, result)?; + let result = self.tuple_deconstruction_statement(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ForStatementInitialization) + } + + #[allow(unused_assignments, unused_parens)] + fn function_attribute(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::ConstantKeyword, + ); + choice.consider(input, result)?; + } + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::FunctionAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn function_attributes(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.function_attribute(input)) + .with_kind(RuleKind::FunctionAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn function_body(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.block(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::FunctionBody) + } + + #[allow(unused_assignments, unused_parens)] + fn function_call_expression(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + if self.version_is_at_least_0_6_2 { + seq.elem(OptionalHelper::transform(self.function_call_options(input)))?; + } + seq.elem(self.arguments_declaration(input))?; + seq.finish() + }) + .with_kind(RuleKind::FunctionCallExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn function_call_options(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_2 { + ChoiceHelper::run(input, |mut choice, input| { + if self.version_is_at_least_0_6_2 && !self.version_is_at_least_0_8_0 { + let result = self.named_argument_groups(input); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThanEqual, - ); + } + if self.version_is_at_least_0_8_0 { + let result = self.named_argument_group(input); choice.consider(input, result)?; - choice.finish(input) - }), - ) - }; - let parse_bitwise_or_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 13u8, - 13u8 + 1, - self.parse_token_with_trivia::(input, TokenKind::Bar), - ) - }; - let parse_bitwise_x_or_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 15u8, - 15u8 + 1, - self.parse_token_with_trivia::( + } + choice.finish(input) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::FunctionCallOptions) + } + + #[allow(unused_assignments, unused_parens)] + fn function_definition(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FunctionKeyword, + ))?; + seq.elem(ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( input, - TokenKind::Caret, - ), - ) - }; - let parse_bitwise_and_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 17u8, - 17u8 + 1, - self.parse_token_with_trivia::( + TokenKind::Identifier, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Ampersand, - ), - ) - }; - let parse_shift_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 19u8, - 19u8 + 1, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThanLessThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThanGreaterThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThanGreaterThanGreaterThan, - ); - choice.consider(input, result)?; - choice.finish(input) - }), - ) - }; - let parse_add_sub_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 21u8, - 21u8 + 1, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Plus, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Minus, - ); - choice.consider(input, result)?; - choice.finish(input) - }), - ) - }; - let parse_mul_div_mod_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 23u8, - 23u8 + 1, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Asterisk, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Slash, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Percent, - ); - choice.consider(input, result)?; - choice.finish(input) - }), + TokenKind::FallbackKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ReceiveKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }))?; + seq.elem(self.parameters_declaration(input))?; + seq.elem(self.function_attributes(input))?; + seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; + seq.elem(self.function_body(input))?; + seq.finish() + }) + .with_kind(RuleKind::FunctionDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn function_type(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FunctionKeyword, + ))?; + seq.elem(self.parameters_declaration(input))?; + seq.elem(self.function_type_attributes(input))?; + seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; + seq.finish() + }) + .with_kind(RuleKind::FunctionType) + } + + #[allow(unused_assignments, unused_parens)] + fn function_type_attribute(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::FunctionTypeAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn function_type_attributes(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.function_type_attribute(input)) + .with_kind(RuleKind::FunctionTypeAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn hex_number_expression(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::HexLiteral, + ))?; + if !self.version_is_at_least_0_5_0 { + seq.elem(OptionalHelper::transform(self.number_unit(input)))?; + } + seq.finish() + }) + .with_kind(RuleKind::HexNumberExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn hex_string_literals(&self, input: &mut ParserContext) -> ParserResult { + OneOrMoreHelper::run(input, |input| { + self.parse_token_with_trivia::( + input, + TokenKind::HexStringLiteral, ) - }; - let parse_exponentiation_operator_removed_from_0_6_0 = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 25u8, - 25u8 + 1, + }) + .with_kind(RuleKind::HexStringLiterals) + } + + #[allow(unused_assignments, unused_parens)] + fn identifier_path(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| { self.parse_token_with_trivia::( input, - TokenKind::AsteriskAsterisk, - ), - ) - }; - let parse_exponentiation_operator_introduced_from_0_6_0 = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::BinaryExpression, - 27u8 + 1, - 27u8, - self.parse_token_with_trivia::( + TokenKind::Identifier, + ) + }, + TokenKind::Period, + ) + .with_kind(RuleKind::IdentifierPath) + } + + #[allow(unused_assignments, unused_parens)] + fn if_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::IfKeyword, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( input, - TokenKind::AsteriskAsterisk, - ), - ) - }; - let parse_unary_postfix_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_postfix_operator( - RuleKind::UnaryPostfixExpression, - 29u8, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::PlusPlus, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::MinusMinus, - ); - choice.consider(input, result)?; - choice.finish(input) - }), - ) - }; - let parse_unary_prefix_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_prefix_operator( - RuleKind::UnaryPrefixExpression, - 31u8, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::PlusPlus, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::MinusMinus, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Tilde, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Bang, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Minus, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( + TokenKind::OpenParen, + ))?; + seq.elem( + self.expression(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::Plus, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }), - ) - }; - let parse_function_call_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_postfix_operator( - RuleKind::FunctionCallExpression, - 33u8, - SequenceHelper::run(|mut seq| { - if self.version_is_at_least_0_6_2 { - seq.elem(OptionalHelper::transform(self.function_call_options(input)))?; - } - seq.elem(self.arguments_declaration(input))?; - seq.finish() - }), - ) - }; - let parse_member_access_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_postfix_operator( - RuleKind::MemberAccessExpression, - 35u8, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }))?; + seq.elem(self.statement(input))?; + seq.elem(OptionalHelper::transform(self.else_branch(input)))?; + seq.finish() + }) + .with_kind(RuleKind::IfStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn import_alias(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::AsKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.finish() + }) + .with_kind(RuleKind::ImportAlias) + } + + #[allow(unused_assignments, unused_parens)] + fn import_deconstruction_field(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(OptionalHelper::transform(self.import_alias(input)))?; + seq.finish() + }) + .with_kind(RuleKind::ImportDeconstructionField) + } + + #[allow(unused_assignments, unused_parens)] + fn import_deconstruction_fields(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.import_deconstruction_field(input), + TokenKind::Comma, + )) + .with_kind(RuleKind::ImportDeconstructionFields) + } + + #[allow(unused_assignments, unused_parens)] + fn import_directive(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Period, + TokenKind::ImportKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AddressKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.import_symbol(input))?; seq.finish() - }), - ) - }; - let parse_index_access_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_postfix_operator( - RuleKind::IndexAccessExpression, - 37u8, + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() + }) + .with_kind(RuleKind::ImportDirective) + } + + #[allow(unused_assignments, unused_parens)] + fn import_symbol(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.path_import_symbol(input); + choice.consider(input, result)?; + let result = self.named_import_symbol(input); + choice.consider(input, result)?; + let result = self.import_symbol_deconstruction(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ImportSymbol) + } + + #[allow(unused_assignments, unused_parens)] + fn import_symbol_deconstruction(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBrace, + ))?; + seq.elem( + self.import_deconstruction_fields(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBrace, + ))?; + seq.finish() + }))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FromKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ))?; + seq.finish() + }) + .with_kind(RuleKind::ImportSymbolDeconstruction) + } + + #[allow(unused_assignments, unused_parens)] + fn index_access_end(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + self.parse_token_with_trivia::( + input, + TokenKind::Colon, + ), + )?; + seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.finish() + }) + .with_kind(RuleKind::IndexAccessEnd) + } + + #[allow(unused_assignments, unused_parens)] + fn index_access_expression(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBracket); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBracket, + ))?; + seq.elem( SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBracket); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBracket, - ))?; - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(OptionalHelper::transform(self.expression(input)))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::Colon, - ), - )?; - seq.elem(OptionalHelper::transform(self.expression(input)))?; - seq.finish() - })))?; - seq.finish() - }) + seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.elem(OptionalHelper::transform(self.index_access_end(input)))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBracket, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBracket, + ))?; + seq.finish() + }) + .with_kind(RuleKind::IndexAccessExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn inheritance_specifier(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::IsKeyword, + ))?; + seq.elem(self.inheritance_types(input))?; + seq.finish() + }) + .with_kind(RuleKind::InheritanceSpecifier) + } + + #[allow(unused_assignments, unused_parens)] + fn inheritance_type(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.identifier_path(input))?; + seq.elem(OptionalHelper::transform(self.arguments_declaration(input)))?; + seq.finish() + }) + .with_kind(RuleKind::InheritanceType) + } + + #[allow(unused_assignments, unused_parens)] + fn inheritance_types(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.inheritance_type(input), + TokenKind::Comma, + ) + .with_kind(RuleKind::InheritanceTypes) + } + + #[allow(unused_assignments, unused_parens)] + fn interface_definition(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::InterfaceKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(OptionalHelper::transform(self.inheritance_specifier(input)))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBrace, + ))?; + seq.elem( + self.interface_members(input) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, - TokenKind::CloseBracket, + TokenKind::CloseBrace, RecoverFromNoMatch::Yes, ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseBracket, - ))?; - seq.finish() - }), - ) - }; - let prefix_operator_parser = |input: &mut ParserContext| { - ChoiceHelper::run(input, |mut choice, input| { - let result = parse_unary_prefix_operator(input); - choice.consider(input, result)?; - choice.finish(input) - }) - }; - let primary_expression_parser = |input: &mut ParserContext| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.new_expression(input); - choice.consider(input, result)?; - let result = self.tuple_expression(input); - choice.consider(input, result)?; - let result = self.array_expression(input); - choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::TrueKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FalseKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - let result = self.numeric_expression(input); - choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.hex_string_literals_list(input); - choice.consider(input, result)?; - let result = self.ascii_string_literals_list(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_7_0 { - let result = self.unicode_string_literals_list(input); - choice.consider(input, result)?; - } - choice.finish(input) - }); - choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::BoolKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::StringKeyword, - ); - choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FixedBytesType, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::SignedIntegerType, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UnsignedIntegerType, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::SignedFixedType, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UnsignedFixedType, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + )?; + seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_3 { - let result = self.type_expression(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) - }; - let postfix_operator_parser = |input: &mut ParserContext| { - ChoiceHelper::run(input, |mut choice, input| { - let result = parse_conditional_operator(input); - choice.consider(input, result)?; - let result = parse_unary_postfix_operator(input); - choice.consider(input, result)?; - let result = parse_function_call_operator(input); - choice.consider(input, result)?; - let result = parse_member_access_operator(input); - choice.consider(input, result)?; - let result = parse_index_access_operator(input); - choice.consider(input, result)?; - choice.finish(input) - }) - }; - let binary_operand_parser = |input: &mut ParserContext| { - SequenceHelper::run(|mut seq| { - seq.elem(ZeroOrMoreHelper::run(input, |input| { - prefix_operator_parser(input) - }))?; - seq.elem(primary_expression_parser(input))?; - seq.elem(ZeroOrMoreHelper::run(input, |input| { - postfix_operator_parser(input) - }))?; + TokenKind::CloseBrace, + ))?; seq.finish() - }) - }; - let binary_operator_parser = |input: &mut ParserContext| { + }))?; + seq.finish() + }) + .with_kind(RuleKind::InterfaceDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn interface_members(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.contract_member(input)) + .with_kind(RuleKind::InterfaceMembers) + } + + #[allow(unused_assignments, unused_parens)] + fn leading_trivia(&self, input: &mut ParserContext) -> ParserResult { + OneOrMoreHelper::run(input, |input| { ChoiceHelper::run(input, |mut choice, input| { - let result = parse_assignment_operator(input); - choice.consider(input, result)?; - let result = parse_or_operator(input); - choice.consider(input, result)?; - let result = parse_and_operator(input); - choice.consider(input, result)?; - let result = parse_equality_comparison_operator(input); - choice.consider(input, result)?; - let result = parse_order_comparison_operator(input); - choice.consider(input, result)?; - let result = parse_bitwise_or_operator(input); - choice.consider(input, result)?; - let result = parse_bitwise_x_or_operator(input); - choice.consider(input, result)?; - let result = parse_bitwise_and_operator(input); - choice.consider(input, result)?; - let result = parse_shift_operator(input); + let result = + self.parse_token::(input, TokenKind::Whitespace); choice.consider(input, result)?; - let result = parse_add_sub_operator(input); + let result = + self.parse_token::(input, TokenKind::EndOfLine); choice.consider(input, result)?; - let result = parse_mul_div_mod_operator(input); + let result = self + .parse_token::(input, TokenKind::MultilineComment); choice.consider(input, result)?; - if !self.version_is_at_least_0_6_0 { - let result = parse_exponentiation_operator_removed_from_0_6_0(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = parse_exponentiation_operator_introduced_from_0_6_0(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) - }; - let linear_expression_parser = |input: &mut ParserContext| { - SequenceHelper::run(|mut seq| { - seq.elem(binary_operand_parser(input))?; - seq.elem(ZeroOrMoreHelper::run(input, |input| { - SequenceHelper::run(|mut seq| { - seq.elem(binary_operator_parser(input))?; - seq.elem(binary_operand_parser(input))?; - seq.finish() - }) - }))?; - seq.finish() + let result = self.parse_token::( + input, + TokenKind::SingleLineComment, + ); + choice.consider(input, result)?; + choice.finish(input) }) - }; - PrecedenceHelper::reduce_precedence_result( - Some(RuleKind::Expression), - linear_expression_parser(input), - ) - .with_kind(RuleKind::Expression) + }) + .with_kind(RuleKind::LeadingTrivia) } #[allow(unused_assignments, unused_parens)] - fn expression_statement(&self, input: &mut ParserContext) -> ParserResult { + fn library_definition(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem( - self.expression(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Semicolon, + TokenKind::LibraryKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBrace, + ))?; + seq.elem( + self.library_members(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBrace, + ))?; + seq.finish() + }))?; seq.finish() }) - .with_kind(RuleKind::ExpressionStatement) + .with_kind(RuleKind::LibraryDefinition) } #[allow(unused_assignments, unused_parens)] - fn fallback_function_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_6_0 { - OneOrMoreHelper::run(input, |input| { - if self.version_is_at_least_0_6_0 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PureKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ViewKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::FallbackFunctionAttributesList) + fn library_members(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.contract_member(input)) + .with_kind(RuleKind::LibraryMembers) } #[allow(unused_assignments, unused_parens)] - fn fallback_function_definition(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_6_0 { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::FallbackKeyword, - ))?; - seq.elem(self.parameters_declaration(input))?; + fn mapping_key(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.mapping_key_type(input))?; + if self.version_is_at_least_0_8_18 { seq.elem(OptionalHelper::transform( - self.fallback_function_attributes_list(input), - ))?; - seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::FallbackFunctionDefinition) + TokenKind::Identifier, + ), + ))?; + } + seq.finish() + }) + .with_kind(RuleKind::MappingKey) } #[allow(unused_assignments, unused_parens)] - fn for_statement(&self, input: &mut ParserContext) -> ParserResult { + fn mapping_key_type(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.elementary_type(input); + choice.consider(input, result)?; + let result = self.identifier_path(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::MappingKeyType) + } + + #[allow(unused_assignments, unused_parens)] + fn mapping_type(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::ForKeyword, + TokenKind::MappingKeyword, ))?; seq.elem(SequenceHelper::run(|mut seq| { let mut delim_guard = input.open_delim(TokenKind::CloseParen); @@ -1802,37 +3440,12 @@ impl Language { ))?; seq.elem( SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.elem(self.mapping_key(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::EqualGreaterThan, + ))?; + seq.elem(self.mapping_value(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -1848,259 +3461,348 @@ impl Language { ))?; seq.finish() }))?; - seq.elem(self.statement(input))?; seq.finish() }) - .with_kind(RuleKind::ForStatement) + .with_kind(RuleKind::MappingType) } #[allow(unused_assignments, unused_parens)] - fn function_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + fn mapping_value(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; + if self.version_is_at_least_0_8_18 { + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ), + ))?; + } + seq.finish() + }) + .with_kind(RuleKind::MappingValue) + } + + #[allow(unused_assignments, unused_parens)] + fn member_access_expression(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + self.parse_token_with_trivia::( input, - TokenKind::PrivateKeyword, - ); - choice.consider(input, result)?; + TokenKind::Period, + ), + )?; + seq.elem(ChoiceHelper::run(input, |mut choice, input| { let result = self.parse_token_with_trivia::( input, - TokenKind::PublicKeyword, + TokenKind::Identifier, ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::PureKeyword, + TokenKind::AddressKeyword, ); choice.consider(input, result)?; + choice.finish(input) + }))?; + seq.finish() + }) + .with_kind(RuleKind::MemberAccessExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn modifier_attribute(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.override_specifier(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { let result = self.parse_token_with_trivia::( input, - TokenKind::ViewKeyword, + TokenKind::VirtualKeyword, ); choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ConstantKeyword, - ); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + choice.finish(input) + }) + .with_kind(RuleKind::ModifierAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn modifier_attributes(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.modifier_attribute(input)) + .with_kind(RuleKind::ModifierAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn modifier_definition(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ModifierKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(OptionalHelper::transform( + self.parameters_declaration(input), + ))?; + seq.elem(self.modifier_attributes(input))?; + seq.elem(self.function_body(input))?; + seq.finish() + }) + .with_kind(RuleKind::ModifierDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn modifier_invocation(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.identifier_path(input))?; + seq.elem(OptionalHelper::transform(self.arguments_declaration(input)))?; + seq.finish() }) - .with_kind(RuleKind::FunctionAttributesList) + .with_kind(RuleKind::ModifierInvocation) } #[allow(unused_assignments, unused_parens)] - fn function_call_options(&self, input: &mut ParserContext) -> ParserResult { + fn multiplicative_expression(&self, input: &mut ParserContext) -> ParserResult { ChoiceHelper::run(input, |mut choice, input| { - if self.version_is_at_least_0_6_2 && !self.version_is_at_least_0_8_0 { - let result = - OneOrMoreHelper::run(input, |input| self.named_arguments_declaration(input)); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_0 { - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - } + let result = self + .parse_token_with_trivia::(input, TokenKind::Asterisk); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::Slash); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::Percent); + choice.consider(input, result)?; choice.finish(input) }) - .with_kind(RuleKind::FunctionCallOptions) + .with_kind(RuleKind::MultiplicativeExpression) } #[allow(unused_assignments, unused_parens)] - fn function_definition(&self, input: &mut ParserContext) -> ParserResult { + fn named_argument(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::FunctionKeyword, + TokenKind::Identifier, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FallbackKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + seq.elem( + self.parse_token_with_trivia::( input, - TokenKind::ReceiveKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.elem(self.parameters_declaration(input))?; - seq.elem(OptionalHelper::transform( - self.function_attributes_list(input), + TokenKind::Colon, + ), + )?; + seq.elem(self.expression(input))?; + seq.finish() + }) + .with_kind(RuleKind::NamedArgument) + } + + #[allow(unused_assignments, unused_parens)] + fn named_argument_group(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBrace, ))?; - seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( + seq.elem( + self.named_arguments(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBrace, + ))?; + seq.finish() + }) + .with_kind(RuleKind::NamedArgumentGroup) + } + + #[allow(unused_assignments, unused_parens)] + fn named_argument_groups(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_2 && !self.version_is_at_least_0_8_0 { + OneOrMoreHelper::run(input, |input| self.named_argument_group(input)) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::NamedArgumentGroups) + } + + #[allow(unused_assignments, unused_parens)] + fn named_arguments(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.named_argument(input), + TokenKind::Comma, + )) + .with_kind(RuleKind::NamedArguments) + } + + #[allow(unused_assignments, unused_parens)] + fn named_arguments_declaration(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + OptionalHelper::transform(self.named_argument_group(input)) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; seq.finish() }) - .with_kind(RuleKind::FunctionDefinition) + .with_kind(RuleKind::NamedArgumentsDeclaration) } #[allow(unused_assignments, unused_parens)] - fn function_type(&self, input: &mut ParserContext) -> ParserResult { + fn named_import_symbol(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::FunctionKeyword, + TokenKind::Asterisk, ))?; - seq.elem(self.parameters_declaration(input))?; - seq.elem(OptionalHelper::transform( - self.function_type_attributes_list(input), + seq.elem(self.import_alias(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FromKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, ))?; - seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; seq.finish() }) - .with_kind(RuleKind::FunctionType) + .with_kind(RuleKind::NamedImportSymbol) } #[allow(unused_assignments, unused_parens)] - fn function_type_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PrivateKeyword, - ); - choice.consider(input, result)?; + fn new_expression(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::NewKeyword, + ))?; + seq.elem(self.type_name(input))?; + seq.finish() + }) + .with_kind(RuleKind::NewExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn number_unit(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::WeiKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_11 { let result = self.parse_token_with_trivia::( input, - TokenKind::PublicKeyword, + TokenKind::GweiKeyword, ); choice.consider(input, result)?; + } + if !self.version_is_at_least_0_7_0 { let result = self.parse_token_with_trivia::( input, - TokenKind::PureKeyword, + TokenKind::SzaboKeyword, ); choice.consider(input, result)?; + } + if !self.version_is_at_least_0_7_0 { let result = self.parse_token_with_trivia::( input, - TokenKind::ViewKeyword, + TokenKind::FinneyKeyword, ); choice.consider(input, result)?; + } + let result = self.parse_token_with_trivia::( + input, + TokenKind::EtherKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SecondsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinutesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::HoursKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::DaysKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::WeeksKeyword, + ); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { let result = self.parse_token_with_trivia::( input, - TokenKind::PayableKeyword, + TokenKind::YearsKeyword, ); choice.consider(input, result)?; - choice.finish(input) - }) - }) - .with_kind(RuleKind::FunctionTypeAttributesList) - } - - #[allow(unused_assignments, unused_parens)] - fn hex_string_literals_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - self.parse_token_with_trivia::( - input, - TokenKind::HexStringLiteral, - ) + } + choice.finish(input) }) - .with_kind(RuleKind::HexStringLiteralsList) + .with_kind(RuleKind::NumberUnit) } #[allow(unused_assignments, unused_parens)] - fn identifier_path(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| { - self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ) - }, - TokenKind::Period, - ) - .with_kind(RuleKind::IdentifierPath) + fn or_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::(input, TokenKind::BarBar) + .with_kind(RuleKind::OrExpression) } #[allow(unused_assignments, unused_parens)] - fn identifier_paths_list(&self, input: &mut ParserContext) -> ParserResult { + fn override_paths(&self, input: &mut ParserContext) -> ParserResult { SeparatedHelper::run::<_, LexicalContextType::Default>( input, self, |input| self.identifier_path(input), TokenKind::Comma, ) - .with_kind(RuleKind::IdentifierPathsList) - } - - #[allow(unused_assignments, unused_parens)] - fn identifiers_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| { - self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ) - }, - TokenKind::Comma, - ) - .with_kind(RuleKind::IdentifiersList) + .with_kind(RuleKind::OverridePaths) } #[allow(unused_assignments, unused_parens)] - fn if_statement(&self, input: &mut ParserContext) -> ParserResult { + fn override_specifier(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::IfKeyword, + TokenKind::OverrideKeyword, ))?; seq.elem(SequenceHelper::run(|mut seq| { let mut delim_guard = input.open_delim(TokenKind::CloseParen); @@ -2110,7 +3812,7 @@ impl Language { TokenKind::OpenParen, ))?; seq.elem( - self.expression(input) + self.override_paths(input) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, @@ -2124,923 +3826,729 @@ impl Language { ))?; seq.finish() }))?; - seq.elem(self.statement(input))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + seq.finish() + }) + .with_kind(RuleKind::OverrideSpecifier) + } + + #[allow(unused_assignments, unused_parens)] + fn parameter(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; + seq.elem(OptionalHelper::transform(self.storage_location(input)))?; + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( input, - TokenKind::ElseKeyword, - ))?; - seq.elem(self.statement(input))?; - seq.finish() - })))?; + TokenKind::Identifier, + ), + ))?; seq.finish() }) - .with_kind(RuleKind::IfStatement) + .with_kind(RuleKind::Parameter) } #[allow(unused_assignments, unused_parens)] - fn import_directive(&self, input: &mut ParserContext) -> ParserResult { + fn parameters(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.parameter(input), + TokenKind::Comma, + )) + .with_kind(RuleKind::Parameters) + } + + #[allow(unused_assignments, unused_parens)] + fn parameters_declaration(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + self.parameters(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::ImportKeyword, - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.path_import(input); - choice.consider(input, result)?; - let result = self.named_import(input); - choice.consider(input, result)?; - let result = self.deconstruction_import(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Semicolon, + TokenKind::CloseParen, ))?; seq.finish() }) - .with_kind(RuleKind::ImportDirective) + .with_kind(RuleKind::ParametersDeclaration) } #[allow(unused_assignments, unused_parens)] - fn inheritance_specifier(&self, input: &mut ParserContext) -> ParserResult { + fn path_import_symbol(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::IsKeyword, + TokenKind::AsciiStringLiteral, ))?; - seq.elem(self.inheritance_types_list(input))?; - seq.finish() - }) - .with_kind(RuleKind::InheritanceSpecifier) - } - - #[allow(unused_assignments, unused_parens)] - fn inheritance_type(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.identifier_path(input))?; - seq.elem(OptionalHelper::transform(self.arguments_declaration(input)))?; + seq.elem(OptionalHelper::transform(self.import_alias(input)))?; seq.finish() }) - .with_kind(RuleKind::InheritanceType) + .with_kind(RuleKind::PathImportSymbol) } #[allow(unused_assignments, unused_parens)] - fn inheritance_types_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( + fn positional_arguments(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( input, self, - |input| self.inheritance_type(input), + |input| self.expression(input), TokenKind::Comma, - ) - .with_kind(RuleKind::InheritanceTypesList) + )) + .with_kind(RuleKind::PositionalArguments) } #[allow(unused_assignments, unused_parens)] - fn interface_definition(&self, input: &mut ParserContext) -> ParserResult { + fn positional_arguments_declaration(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); seq.elem(self.parse_token_with_trivia::( input, - TokenKind::InterfaceKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, + TokenKind::OpenParen, ))?; - seq.elem(OptionalHelper::transform(self.inheritance_specifier(input)))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; - seq.elem( - OptionalHelper::transform(self.interface_members_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + seq.elem( + self.positional_arguments(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, - TokenKind::CloseBrace, + TokenKind::CloseParen, RecoverFromNoMatch::Yes, ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseBrace, - ))?; - seq.finish() - }))?; + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; seq.finish() }) - .with_kind(RuleKind::InterfaceDefinition) + .with_kind(RuleKind::PositionalArgumentsDeclaration) } #[allow(unused_assignments, unused_parens)] - fn interface_members_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive(input); - choice.consider(input, result)?; - let result = self.function_definition(input); - choice.consider(input, result)?; - let result = self.modifier_definition(input); - choice.consider(input, result)?; - let result = self.struct_definition(input); - choice.consider(input, result)?; - let result = self.enum_definition(input); - choice.consider(input, result)?; - let result = self.event_definition(input); - choice.consider(input, result)?; - let result = self.state_variable_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_4_22 { - let result = self.constructor_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.fallback_function_definition(input); - choice.consider(input, result)?; - let result = self.receive_function_definition(input); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_6_0 { - let result = self.unnamed_function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) + fn postfix_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self + .parse_token_with_trivia::(input, TokenKind::PlusPlus); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinusMinus, + ); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::InterfaceMembersList) + .with_kind(RuleKind::PostfixExpression) } #[allow(unused_assignments, unused_parens)] - fn leading_trivia(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = - self.parse_token::(input, TokenKind::Whitespace); - choice.consider(input, result)?; - let result = - self.parse_token::(input, TokenKind::EndOfLine); - choice.consider(input, result)?; - let result = self - .parse_token::(input, TokenKind::MultilineComment); - choice.consider(input, result)?; - let result = self.parse_token::( - input, - TokenKind::SingleLineComment, - ); - choice.consider(input, result)?; - choice.finish(input) - }) + fn pragma(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.abi_coder_pragma(input); + choice.consider(input, result)?; + let result = self.experimental_pragma(input); + choice.consider(input, result)?; + let result = self.version_pragma(input); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::LeadingTrivia) + .with_kind(RuleKind::Pragma) } #[allow(unused_assignments, unused_parens)] - fn library_definition(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + fn pragma_all_keywords(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( input, - TokenKind::LibraryKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::AbicoderKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Identifier, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; - seq.elem( - OptionalHelper::transform(self.library_members_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + TokenKind::ExperimentalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SolidityKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::PragmaAllKeywords) + } + + #[allow(unused_assignments, unused_parens)] + fn pragma_directive(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( input, - self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::PragmaKeyword, + ))?; + seq.elem(self.pragma(input))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Pragma>( input, - TokenKind::CloseBrace, - ))?; - seq.finish() - }))?; + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; seq.finish() }) - .with_kind(RuleKind::LibraryDefinition) + .with_kind(RuleKind::PragmaDirective) } #[allow(unused_assignments, unused_parens)] - fn library_members_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive(input); - choice.consider(input, result)?; - let result = self.function_definition(input); - choice.consider(input, result)?; - let result = self.modifier_definition(input); - choice.consider(input, result)?; - let result = self.struct_definition(input); - choice.consider(input, result)?; - let result = self.enum_definition(input); - choice.consider(input, result)?; - let result = self.event_definition(input); - choice.consider(input, result)?; - let result = self.state_variable_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_4_22 { - let result = self.constructor_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.fallback_function_definition(input); - choice.consider(input, result)?; - let result = self.receive_function_definition(input); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_6_0 { - let result = self.unnamed_function_definition(input); + fn prefix_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_5_0 { + let result = ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::PlusPlus, + ); choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinusMinus, + ); choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); choice.consider(input, result)?; - } - choice.finish(input) - }) - }) - .with_kind(RuleKind::LibraryMembersList) - } - - #[allow(unused_assignments, unused_parens)] - fn mapping_key_type(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = ChoiceHelper::run(input, |mut choice, input| { let result = self.parse_token_with_trivia::( input, - TokenKind::BoolKeyword, + TokenKind::Bang, ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::StringKeyword, + TokenKind::Minus, ); choice.consider(input, result)?; - let result = self.address_type(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::Plus, + ); choice.consider(input, result)?; + choice.finish(input) + }); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_5_0 { + let result = ChoiceHelper::run(input, |mut choice, input| { let result = self.parse_token_with_trivia::( input, - TokenKind::FixedBytesType, + TokenKind::PlusPlus, ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::SignedIntegerType, + TokenKind::MinusMinus, ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::UnsignedIntegerType, + TokenKind::Tilde, ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::SignedFixedType, + TokenKind::Bang, ); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, - TokenKind::UnsignedFixedType, + TokenKind::Minus, ); choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } choice.finish(input) }); choice.consider(input, result)?; - let result = self.identifier_path(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - if self.version_is_at_least_0_8_18 { - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ), - ))?; - } - seq.finish() - }) - .with_kind(RuleKind::MappingKeyType) - } - - #[allow(unused_assignments, unused_parens)] - fn mapping_type(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::MappingKeyword, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.mapping_key_type(input))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::EqualGreaterThan, - ))?; - seq.elem(self.mapping_value_type(input))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; - seq.finish() - }) - .with_kind(RuleKind::MappingType) - } - - #[allow(unused_assignments, unused_parens)] - fn mapping_value_type(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - if self.version_is_at_least_0_8_18 { - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ), - ))?; } - seq.finish() + choice.finish(input) }) - .with_kind(RuleKind::MappingValueType) + .with_kind(RuleKind::PrefixExpression) } #[allow(unused_assignments, unused_parens)] - fn modifier_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { + fn receive_function_attribute(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_0 { ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; let result = self.override_specifier(input); choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }) - }) - .with_kind(RuleKind::ModifierAttributesList) - } - - #[allow(unused_assignments, unused_parens)] - fn modifier_definition(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::ModifierKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.elem(OptionalHelper::transform( - self.parameters_declaration(input), - ))?; - seq.elem(OptionalHelper::transform( - self.modifier_attributes_list(input), - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { let result = self.parse_token_with_trivia::( input, - TokenKind::Semicolon, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, ); choice.consider(input, result)?; - let result = self.block(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); choice.consider(input, result)?; choice.finish(input) - }))?; - seq.finish() - }) - .with_kind(RuleKind::ModifierDefinition) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ReceiveFunctionAttribute) } #[allow(unused_assignments, unused_parens)] - fn modifier_invocation(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.identifier_path(input))?; - seq.elem(OptionalHelper::transform(self.arguments_declaration(input)))?; - seq.finish() - }) - .with_kind(RuleKind::ModifierInvocation) + fn receive_function_attributes(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_0 { + ZeroOrMoreHelper::run(input, |input| self.receive_function_attribute(input)) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ReceiveFunctionAttributes) } #[allow(unused_assignments, unused_parens)] - fn named_argument(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.elem( - self.parse_token_with_trivia::( + fn receive_function_definition(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_6_0 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Colon, - ), - )?; - seq.elem(self.expression(input))?; - seq.finish() - }) - .with_kind(RuleKind::NamedArgument) + TokenKind::ReceiveKeyword, + ))?; + seq.elem(self.parameters_declaration(input))?; + seq.elem(self.receive_function_attributes(input))?; + seq.elem(self.function_body(input))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::ReceiveFunctionDefinition) } #[allow(unused_assignments, unused_parens)] - fn named_arguments_declaration(&self, input: &mut ParserContext) -> ParserResult { + fn return_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; seq.elem( - OptionalHelper::transform(self.named_arguments_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ReturnKeyword, + ))?; + seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, + TokenKind::Semicolon, + RecoverFromNoMatch::No, ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::CloseBrace, - ))?; - seq.finish() - }) - .with_kind(RuleKind::NamedArgumentsDeclaration) - } - - #[allow(unused_assignments, unused_parens)] - fn named_arguments_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.named_argument(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::NamedArgumentsList) - } - - #[allow(unused_assignments, unused_parens)] - fn named_import(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Asterisk, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::AsKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::FromKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, + TokenKind::Semicolon, ))?; seq.finish() }) - .with_kind(RuleKind::NamedImport) + .with_kind(RuleKind::ReturnStatement) } #[allow(unused_assignments, unused_parens)] - fn new_expression(&self, input: &mut ParserContext) -> ParserResult { + fn returns_declaration(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::NewKeyword, + TokenKind::ReturnsKeyword, ))?; - seq.elem(self.type_name(input))?; + seq.elem(self.parameters_declaration(input))?; seq.finish() }) - .with_kind(RuleKind::NewExpression) + .with_kind(RuleKind::ReturnsDeclaration) } #[allow(unused_assignments, unused_parens)] - fn numeric_expression(&self, input: &mut ParserContext) -> ParserResult { - ChoiceHelper::run(input, |mut choice, input| { - let result = SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::HexLiteral, - ))?; - if !self.version_is_at_least_0_5_0 { - seq.elem(OptionalHelper::transform(ChoiceHelper::run( + fn revert_statement(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_4 { + SequenceHelper::run(|mut seq| { + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::RevertKeyword, + ))?; + seq.elem(OptionalHelper::transform(self.identifier_path(input)))?; + seq.elem(self.arguments_declaration(input))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - |mut choice, input| { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::DaysKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::EtherKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::HoursKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::MinutesKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::SecondsKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::WeeksKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::WeiKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::YearsKeyword, - ); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_11 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::GweiKeyword, - ); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_7_0 { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::FinneyKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::SzaboKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - } - seq.finish() - }); - choice.consider(input, result)?; - let result = SequenceHelper::run(|mut seq| { + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::DecimalLiteral, + TokenKind::Semicolon, ))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::DaysKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::EtherKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HoursKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::MinutesKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::SecondsKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::WeeksKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::WeiKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::YearsKeyword, - ); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_11 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::GweiKeyword, - ); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_7_0 { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::FinneyKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::SzaboKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; seq.finish() - }); + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::RevertStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn shift_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanLessThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanGreaterThanGreaterThan, + ); choice.consider(input, result)?; choice.finish(input) }) - .with_kind(RuleKind::NumericExpression) + .with_kind(RuleKind::ShiftExpression) } #[allow(unused_assignments, unused_parens)] - fn override_specifier(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + fn source_unit(&self, input: &mut ParserContext) -> ParserResult { + self.source_unit_members(input) + .with_kind(RuleKind::SourceUnit) + } + + #[allow(unused_assignments, unused_parens)] + fn source_unit_member(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.pragma_directive(input); + choice.consider(input, result)?; + let result = self.import_directive(input); + choice.consider(input, result)?; + let result = self.contract_definition(input); + choice.consider(input, result)?; + let result = self.interface_definition(input); + choice.consider(input, result)?; + let result = self.library_definition(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { + let result = self.struct_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.enum_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_7_1 { + let result = self.function_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_7_4 { + let result = self.constant_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_4 { + let result = self.error_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_8 { + let result = self.user_defined_value_type_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_13 { + let result = self.using_directive(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_22 { + let result = self.event_definition(input); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::SourceUnitMember) + } + + #[allow(unused_assignments, unused_parens)] + fn source_unit_members(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.source_unit_member(input)) + .with_kind(RuleKind::SourceUnitMembers) + } + + #[allow(unused_assignments, unused_parens)] + fn state_variable_attribute(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::OverrideKeyword, - ))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - OptionalHelper::transform(self.identifier_paths_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::ConstantKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_5 { + let result = self.parse_token_with_trivia::( input, - TokenKind::CloseParen, - ))?; - seq.finish() - })))?; - seq.finish() + TokenKind::ImmutableKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) }) - .with_kind(RuleKind::OverrideSpecifier) + .with_kind(RuleKind::StateVariableAttribute) } #[allow(unused_assignments, unused_parens)] - fn parameter(&self, input: &mut ParserContext) -> ParserResult { + fn state_variable_attributes(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.state_variable_attribute(input)) + .with_kind(RuleKind::StateVariableAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn state_variable_definition(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::MemoryKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + seq.elem( + SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; + seq.elem(self.state_variable_attributes(input))?; + seq.elem(self.parse_token_with_trivia::( input, - TokenKind::StorageKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::CalldataKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( + TokenKind::Identifier, + ))?; + seq.elem(OptionalHelper::transform( + self.state_variable_definition_value(input), + ))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::Identifier, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, ))?; seq.finish() }) - .with_kind(RuleKind::Parameter) + .with_kind(RuleKind::StateVariableDefinition) } #[allow(unused_assignments, unused_parens)] - fn parameters_declaration(&self, input: &mut ParserContext) -> ParserResult { + fn state_variable_definition_value(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; seq.elem( - OptionalHelper::transform(self.parameters_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), + self.parse_token_with_trivia::( + input, + TokenKind::Equal, + ), )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; + seq.elem(self.expression(input))?; seq.finish() }) - .with_kind(RuleKind::ParametersDeclaration) + .with_kind(RuleKind::StateVariableDefinitionValue) } #[allow(unused_assignments, unused_parens)] - fn parameters_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.parameter(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::ParametersList) + fn statement(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.tuple_deconstruction_statement(input); + choice.consider(input, result)?; + let result = self.variable_declaration_statement(input); + choice.consider(input, result)?; + let result = self.if_statement(input); + choice.consider(input, result)?; + let result = self.for_statement(input); + choice.consider(input, result)?; + let result = self.while_statement(input); + choice.consider(input, result)?; + let result = self.do_while_statement(input); + choice.consider(input, result)?; + let result = self.continue_statement(input); + choice.consider(input, result)?; + let result = self.break_statement(input); + choice.consider(input, result)?; + let result = self.delete_statement(input); + choice.consider(input, result)?; + let result = self.return_statement(input); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { + let result = self.throw_statement(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_4_21 { + let result = self.emit_statement(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.try_statement(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_4 { + let result = self.revert_statement(input); + choice.consider(input, result)?; + } + let result = self.assembly_statement(input); + choice.consider(input, result)?; + let result = self.block(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_8_0 { + let result = self.unchecked_block(input); + choice.consider(input, result)?; + } + let result = self.expression_statement(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::Statement) + } + + #[allow(unused_assignments, unused_parens)] + fn statements(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.statement(input)).with_kind(RuleKind::Statements) + } + + #[allow(unused_assignments, unused_parens)] + fn storage_location(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::MemoryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StorageKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::CallDataKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::StorageLocation) + } + + #[allow(unused_assignments, unused_parens)] + fn string_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.hex_string_literals(input); + choice.consider(input, result)?; + let result = self.ascii_string_literals(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_7_0 { + let result = self.unicode_string_literals(input); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::StringExpression) } #[allow(unused_assignments, unused_parens)] - fn path_import(&self, input: &mut ParserContext) -> ParserResult { + fn struct_definition(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::AsciiStringLiteral, + TokenKind::StructKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, ))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); seq.elem(self.parse_token_with_trivia::( input, - TokenKind::AsKeyword, + TokenKind::OpenBrace, ))?; + seq.elem( + self.struct_members(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), + )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Identifier, + TokenKind::CloseBrace, ))?; seq.finish() - })))?; + }))?; seq.finish() }) - .with_kind(RuleKind::PathImport) - } - - #[allow(unused_assignments, unused_parens)] - fn positional_arguments_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.expression(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::PositionalArgumentsList) + .with_kind(RuleKind::StructDefinition) } #[allow(unused_assignments, unused_parens)] - fn pragma_directive(&self, input: &mut ParserContext) -> ParserResult { + fn struct_member(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem( SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::PragmaKeyword, + TokenKind::Identifier, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.abi_coder_pragma(input); - choice.consider(input, result)?; - let result = self.experimental_pragma(input); - choice.consider(input, result)?; - let result = self.version_pragma(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -3056,86 +4564,113 @@ impl Language { ))?; seq.finish() }) - .with_kind(RuleKind::PragmaDirective) + .with_kind(RuleKind::StructMember) } #[allow(unused_assignments, unused_parens)] - fn receive_function_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_6_0 { - OneOrMoreHelper::run(input, |input| { - if self.version_is_at_least_0_6_0 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } + fn struct_members(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.struct_member(input)) + .with_kind(RuleKind::StructMembers) + } + + #[allow(unused_assignments, unused_parens)] + fn throw_statement(&self, input: &mut ParserContext) -> ParserResult { + if !self.version_is_at_least_0_5_0 { + SequenceHelper::run(|mut seq| { + seq.elem( + self.parse_token_with_trivia::( + input, + TokenKind::ThrowKeyword, + ) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::Semicolon, + RecoverFromNoMatch::No, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ))?; + seq.finish() }) } else { ParserResult::disabled() } - .with_kind(RuleKind::ReceiveFunctionAttributesList) + .with_kind(RuleKind::ThrowStatement) } #[allow(unused_assignments, unused_parens)] - fn receive_function_definition(&self, input: &mut ParserContext) -> ParserResult { + fn trailing_trivia(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(OptionalHelper::transform( + self.parse_token::(input, TokenKind::Whitespace), + ))?; + seq.elem(OptionalHelper::transform( + self.parse_token::( + input, + TokenKind::SingleLineComment, + ), + ))?; + seq.elem(self.parse_token::(input, TokenKind::EndOfLine))?; + seq.finish() + }) + .with_kind(RuleKind::TrailingTrivia) + } + + #[allow(unused_assignments, unused_parens)] + fn try_statement(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_6_0 { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::ReceiveKeyword, - ))?; - seq.elem(self.parameters_declaration(input))?; - seq.elem(OptionalHelper::transform( - self.receive_function_attributes_list(input), + TokenKind::TryKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.expression(input))?; + seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; + seq.elem(self.block(input))?; + seq.elem(self.catch_clauses(input))?; seq.finish() }) } else { ParserResult::disabled() } - .with_kind(RuleKind::ReceiveFunctionDefinition) + .with_kind(RuleKind::TryStatement) } #[allow(unused_assignments, unused_parens)] - fn return_statement(&self, input: &mut ParserContext) -> ParserResult { + fn tuple_deconstruction_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem( SequenceHelper::run(|mut seq| { + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + self.tuple_members_deconstruction(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }))?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::ReturnKeyword, + TokenKind::Equal, ))?; - seq.elem(OptionalHelper::transform(self.expression(input)))?; + seq.elem(self.expression(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -3151,311 +4686,497 @@ impl Language { ))?; seq.finish() }) - .with_kind(RuleKind::ReturnStatement) + .with_kind(RuleKind::TupleDeconstructionStatement) } #[allow(unused_assignments, unused_parens)] - fn returns_declaration(&self, input: &mut ParserContext) -> ParserResult { + fn tuple_expression(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); seq.elem(self.parse_token_with_trivia::( input, - TokenKind::ReturnsKeyword, + TokenKind::OpenParen, ))?; - seq.elem(self.parameters_declaration(input))?; - seq.finish() - }) - .with_kind(RuleKind::ReturnsDeclaration) - } - - #[allow(unused_assignments, unused_parens)] - fn revert_statement(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + self.tuple_values(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::RevertKeyword, - ))?; - seq.elem(OptionalHelper::transform(self.identifier_path(input)))?; - seq.elem(self.arguments_declaration(input))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Semicolon, + TokenKind::CloseParen, ))?; seq.finish() }) - .with_kind(RuleKind::RevertStatement) + .with_kind(RuleKind::TupleExpression) } #[allow(unused_assignments, unused_parens)] - fn source_unit(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(OptionalHelper::transform( - self.source_unit_members_list(input), - ))?; - seq.elem(OptionalHelper::transform(self.end_of_file_trivia(input)))?; - seq.finish() + fn tuple_member(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.typed_tuple_member(input); + choice.consider(input, result)?; + let result = self.untyped_tuple_member(input); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::SourceUnit) + .with_kind(RuleKind::TupleMember) } #[allow(unused_assignments, unused_parens)] - fn source_unit_members_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.pragma_directive(input); - choice.consider(input, result)?; - let result = self.import_directive(input); - choice.consider(input, result)?; - let result = self.contract_definition(input); - choice.consider(input, result)?; - let result = self.interface_definition(input); - choice.consider(input, result)?; - let result = self.library_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.struct_definition(input); - choice.consider(input, result)?; - let result = self.enum_definition(input); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_7_1 { - let result = self.function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_7_4 { - let result = self.constant_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_13 { - let result = self.using_directive(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_22 { - let result = self.event_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) + fn tuple_member_deconstruction(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(self.tuple_member(input)) + .with_kind(RuleKind::TupleMemberDeconstruction) + } + + #[allow(unused_assignments, unused_parens)] + fn tuple_members_deconstruction(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.tuple_member_deconstruction(input), + TokenKind::Comma, + )) + .with_kind(RuleKind::TupleMembersDeconstruction) + } + + #[allow(unused_assignments, unused_parens)] + fn tuple_value(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(self.expression(input)).with_kind(RuleKind::TupleValue) + } + + #[allow(unused_assignments, unused_parens)] + fn tuple_values(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.tuple_value(input), + TokenKind::Comma, + ) + .with_kind(RuleKind::TupleValues) + } + + #[allow(unused_assignments, unused_parens)] + fn type_expression(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_5_3 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::TypeKeyword, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + self.type_name(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() + }))?; + seq.finish() }) - }) - .with_kind(RuleKind::SourceUnitMembersList) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::TypeExpression) } #[allow(unused_assignments, unused_parens)] - fn state_variable_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| { + fn type_name(&self, input: &mut ParserContext) -> ParserResult { + let parse_array_type_name = |input: &mut ParserContext| { + PrecedenceHelper::to_postfix_operator( + RuleKind::ArrayTypeName, + 1u8, + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBracket); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBracket, + ))?; + seq.elem( + OptionalHelper::transform(self.expression(input)) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBracket, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseBracket, + ))?; + seq.finish() + }), + ) + }; + let primary_expression_parser = |input: &mut ParserContext| { ChoiceHelper::run(input, |mut choice, input| { - let result = self.override_specifier(input); + let result = self.function_type(input); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ConstantKeyword, - ); + let result = self.mapping_type(input); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); + let result = self.elementary_type(input); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PrivateKeyword, - ); + let result = self.identifier_path(input); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PublicKeyword, - ); + choice.finish(input) + }) + }; + let postfix_operator_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + let result = parse_array_type_name(input); choice.consider(input, result)?; - if self.version_is_at_least_0_6_5 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ImmutableKeyword, - ); - choice.consider(input, result)?; - } choice.finish(input) }) - }) - .with_kind(RuleKind::StateVariableAttributesList) + }; + let linear_expression_parser = |input: &mut ParserContext| { + SequenceHelper::run(|mut seq| { + seq.elem(primary_expression_parser(input))?; + seq.elem(ZeroOrMoreHelper::run(input, |input| { + postfix_operator_parser(input) + }))?; + seq.finish() + }) + }; + PrecedenceHelper::reduce_precedence_result( + Some(RuleKind::TypeName), + linear_expression_parser(input), + ) + .with_kind(RuleKind::TypeName) } #[allow(unused_assignments, unused_parens)] - fn state_variable_definition(&self, input: &mut ParserContext) -> ParserResult { + fn typed_tuple_member(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - seq.elem(OptionalHelper::transform( - self.state_variable_attributes_list(input), - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Equal, - ))?; - seq.elem(self.expression(input))?; - seq.finish() - })))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + seq.elem(self.type_name(input))?; + seq.elem(OptionalHelper::transform(self.storage_location(input)))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.finish() + }) + .with_kind(RuleKind::TypedTupleMember) + } + + #[allow(unused_assignments, unused_parens)] + fn unchecked_block(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_0 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::UncheckedKeyword, + ))?; + seq.elem(self.block(input))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UncheckedBlock) + } + + #[allow(unused_assignments, unused_parens)] + fn unicode_string_literals(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_7_0 { + OneOrMoreHelper::run(input, |input| { + self.parse_token_with_trivia::( input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - .with_kind(RuleKind::StateVariableDefinition) + TokenKind::UnicodeStringLiteral, + ) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UnicodeStringLiterals) } #[allow(unused_assignments, unused_parens)] - fn statement(&self, input: &mut ParserContext) -> ParserResult { - ChoiceHelper::run(input, |mut choice, input| { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); + fn unnamed_function_attribute(&self, input: &mut ParserContext) -> ParserResult { + if !self.version_is_at_least_0_6_0 { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); choice.consider(input, result)?; - let result = self.do_while_statement(input); + let result = self.override_specifier(input); choice.consider(input, result)?; - let result = self.continue_statement(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); choice.consider(input, result)?; - let result = self.break_statement(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); choice.consider(input, result)?; - let result = self.delete_statement(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); choice.consider(input, result)?; - let result = self.return_statement(input); + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); choice.consider(input, result)?; - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } choice.finish(input) - }); - choice.consider(input, result)?; - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) - .with_kind(RuleKind::Statement) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UnnamedFunctionAttribute) } #[allow(unused_assignments, unused_parens)] - fn statements_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| self.statement(input)) - .with_kind(RuleKind::StatementsList) + fn unnamed_function_attributes(&self, input: &mut ParserContext) -> ParserResult { + if !self.version_is_at_least_0_6_0 { + ZeroOrMoreHelper::run(input, |input| self.unnamed_function_attribute(input)) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UnnamedFunctionAttributes) } #[allow(unused_assignments, unused_parens)] - fn struct_definition(&self, input: &mut ParserContext) -> ParserResult { + fn unnamed_function_definition(&self, input: &mut ParserContext) -> ParserResult { + if !self.version_is_at_least_0_6_0 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FunctionKeyword, + ))?; + seq.elem(self.parameters_declaration(input))?; + seq.elem(self.unnamed_function_attributes(input))?; + seq.elem(self.function_body(input))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UnnamedFunctionDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn untyped_tuple_member(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::StructKeyword, - ))?; + seq.elem(OptionalHelper::transform(self.storage_location(input)))?; seq.elem(self.parse_token_with_trivia::( input, TokenKind::Identifier, ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; + seq.finish() + }) + .with_kind(RuleKind::UntypedTupleMember) + } + + #[allow(unused_assignments, unused_parens)] + fn user_defined_value_type_definition(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_8 { + SequenceHelper::run(|mut seq| { seq.elem( - OptionalHelper::transform(self.struct_members_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::TypeKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::IsKeyword, + ))?; + seq.elem(self.elementary_type(input))?; + seq.finish() + }) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, + TokenKind::Semicolon, + RecoverFromNoMatch::No, ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::CloseBrace, + TokenKind::Semicolon, ))?; seq.finish() - }))?; - seq.finish() - }) - .with_kind(RuleKind::StructDefinition) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UserDefinedValueTypeDefinition) + } + + #[allow(unused_assignments, unused_parens)] + fn using_alias(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_19 { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::AsKeyword, + ))?; + seq.elem(ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Ampersand, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Asterisk, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BangEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Bar, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Caret, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::EqualEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Percent, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Plus, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Slash, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); + choice.consider(input, result)?; + choice.finish(input) + }))?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UsingAlias) + } + + #[allow(unused_assignments, unused_parens)] + fn using_deconstruction_field(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_13 { + SequenceHelper::run(|mut seq| { + seq.elem(self.identifier_path(input))?; + if self.version_is_at_least_0_8_19 { + seq.elem(OptionalHelper::transform(self.using_alias(input)))?; + } + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UsingDeconstructionField) + } + + #[allow(unused_assignments, unused_parens)] + fn using_deconstruction_fields(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_13 { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.using_deconstruction_field(input), + TokenKind::Comma, + )) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UsingDeconstructionFields) } #[allow(unused_assignments, unused_parens)] - fn struct_member(&self, input: &mut ParserContext) -> ParserResult { + fn using_directive(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem( SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Identifier, + TokenKind::UsingKeyword, + ))?; + seq.elem(self.using_symbol(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::ForKeyword, ))?; + seq.elem(self.using_target(input))?; + if self.version_is_at_least_0_8_13 { + seq.elem(OptionalHelper::transform( + self.parse_token_with_trivia::( + input, + TokenKind::GlobalKeyword, + ), + ))?; + } seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -3471,113 +5192,81 @@ impl Language { ))?; seq.finish() }) - .with_kind(RuleKind::StructMember) + .with_kind(RuleKind::UsingDirective) } #[allow(unused_assignments, unused_parens)] - fn struct_members_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| self.struct_member(input)) - .with_kind(RuleKind::StructMembersList) + fn using_symbol(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.identifier_path(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_8_13 { + let result = self.using_symbol_deconstruction(input); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::UsingSymbol) } #[allow(unused_assignments, unused_parens)] - fn throw_statement(&self, input: &mut ParserContext) -> ParserResult { - if !self.version_is_at_least_0_5_0 { + fn using_symbol_deconstruction(&self, input: &mut ParserContext) -> ParserResult { + if self.version_is_at_least_0_8_13 { SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseBrace); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenBrace, + ))?; seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::ThrowKeyword, - ) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), + self.using_deconstruction_fields(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Semicolon, + TokenKind::CloseBrace, ))?; seq.finish() }) } else { ParserResult::disabled() } - .with_kind(RuleKind::ThrowStatement) + .with_kind(RuleKind::UsingSymbolDeconstruction) } #[allow(unused_assignments, unused_parens)] - fn trailing_trivia(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(OptionalHelper::transform( - self.parse_token::(input, TokenKind::Whitespace), - ))?; - seq.elem(OptionalHelper::transform( - self.parse_token::( - input, - TokenKind::SingleLineComment, - ), - ))?; - seq.elem(self.parse_token::(input, TokenKind::EndOfLine))?; - seq.finish() + fn using_target(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.type_name(input); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::Asterisk); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::TrailingTrivia) - } - - #[allow(unused_assignments, unused_parens)] - fn try_statement(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_6_0 { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::TryKeyword, - ))?; - seq.elem(self.expression(input))?; - seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; - seq.elem(self.block(input))?; - seq.elem(self.catch_clauses_list(input))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::TryStatement) + .with_kind(RuleKind::UsingTarget) } #[allow(unused_assignments, unused_parens)] - fn tuple_deconstruction_statement(&self, input: &mut ParserContext) -> ParserResult { + fn variable_declaration_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem( SequenceHelper::run(|mut seq| { - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - OptionalHelper::transform(self.tuple_members_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; + seq.elem(self.variable_declaration_type(input))?; + seq.elem(OptionalHelper::transform(self.storage_location(input)))?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Equal, + TokenKind::Identifier, + ))?; + seq.elem(OptionalHelper::transform( + self.variable_declaration_value(input), ))?; - seq.elem(self.expression(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -3593,970 +5282,823 @@ impl Language { ))?; seq.finish() }) - .with_kind(RuleKind::TupleDeconstructionStatement) - } - - #[allow(unused_assignments, unused_parens)] - fn tuple_expression(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - self.tuple_values_list(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }) - .with_kind(RuleKind::TupleExpression) + .with_kind(RuleKind::VariableDeclarationStatement) } #[allow(unused_assignments, unused_parens)] - fn tuple_member(&self, input: &mut ParserContext) -> ParserResult { - OptionalHelper::transform(ChoiceHelper::run(input, |mut choice, input| { - let result = SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::MemoryKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::StorageKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::CalldataKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.finish() - }); + fn variable_declaration_type(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.type_name(input); choice.consider(input, result)?; - let result = SequenceHelper::run(|mut seq| { - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::MemoryKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::StorageKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::CalldataKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - seq.elem(self.parse_token_with_trivia::( + if !self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( input, - TokenKind::Identifier, - ))?; - seq.finish() - }); - choice.consider(input, result)?; + TokenKind::VarKeyword, + ); + choice.consider(input, result)?; + } choice.finish(input) - })) - .with_kind(RuleKind::TupleMember) - } - - #[allow(unused_assignments, unused_parens)] - fn tuple_members_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.tuple_member(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::TupleMembersList) - } - - #[allow(unused_assignments, unused_parens)] - fn tuple_values_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| OptionalHelper::transform(self.expression(input)), - TokenKind::Comma, - ) - .with_kind(RuleKind::TupleValuesList) + }) + .with_kind(RuleKind::VariableDeclarationType) } #[allow(unused_assignments, unused_parens)] - fn type_expression(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_5_3 { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::TypeKeyword, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - self.type_name(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::TypeExpression) + fn variable_declaration_value(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem( + self.parse_token_with_trivia::( + input, + TokenKind::Equal, + ), + )?; + seq.elem(self.expression(input))?; + seq.finish() + }) + .with_kind(RuleKind::VariableDeclarationValue) } #[allow(unused_assignments, unused_parens)] - fn type_name(&self, input: &mut ParserContext) -> ParserResult { - let parse_array_type_name_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_postfix_operator( - RuleKind::ArrayTypeName, + fn version_pragma(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::SolidityKeyword, + ))?; + seq.elem(self.version_pragma_expressions(input))?; + seq.finish() + }) + .with_kind(RuleKind::VersionPragma) + } + + #[allow(unused_assignments, unused_parens)] + fn version_pragma_expression(&self, input: &mut ParserContext) -> ParserResult { + let parse_version_pragma_or_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::VersionPragmaBinaryExpression, 1u8, - SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBracket); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBracket, - ))?; - seq.elem( - OptionalHelper::transform(self.expression(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseBracket, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseBracket, - ))?; - seq.finish() - }), + 1u8 + 1, + self.parse_token_with_trivia::( + input, + TokenKind::BarBar, + ), ) }; - let primary_expression_parser = |input: &mut ParserContext| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.function_type(input); - choice.consider(input, result)?; - let result = self.mapping_type(input); - choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( + let parse_version_pragma_range_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_binary_operator( + RuleKind::VersionPragmaBinaryExpression, + 3u8, + 3u8 + 1, + self.parse_token_with_trivia::(input, TokenKind::Minus), + ) + }; + let parse_version_pragma_prefix_expression = |input: &mut ParserContext| { + PrecedenceHelper::to_prefix_operator( + RuleKind::VersionPragmaUnaryExpression, + 5u8, + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( input, - TokenKind::BoolKeyword, + TokenKind::Caret, ); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let result = self.parse_token_with_trivia::( input, - TokenKind::StringKeyword, + TokenKind::Tilde, ); choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let result = self.parse_token_with_trivia::( input, - TokenKind::FixedBytesType, + TokenKind::Equal, ); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let result = self.parse_token_with_trivia::( input, - TokenKind::SignedIntegerType, + TokenKind::LessThan, ); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let result = self.parse_token_with_trivia::( input, - TokenKind::UnsignedIntegerType, + TokenKind::GreaterThan, ); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let result = self.parse_token_with_trivia::( input, - TokenKind::SignedFixedType, + TokenKind::LessThanEqual, ); choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( + let result = self.parse_token_with_trivia::( input, - TokenKind::UnsignedFixedType, + TokenKind::GreaterThanEqual, ); choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } choice.finish(input) - }); + }), + ) + }; + let prefix_operator_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + let result = parse_version_pragma_prefix_expression(input); choice.consider(input, result)?; - let result = self.identifier_path(input); + choice.finish(input) + }) + }; + let primary_expression_parser = |input: &mut ParserContext| { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.version_pragma_specifier(input); choice.consider(input, result)?; choice.finish(input) }) }; - let postfix_operator_parser = |input: &mut ParserContext| { + let binary_operand_parser = |input: &mut ParserContext| { + SequenceHelper::run(|mut seq| { + seq.elem(ZeroOrMoreHelper::run(input, |input| { + prefix_operator_parser(input) + }))?; + seq.elem(primary_expression_parser(input))?; + seq.finish() + }) + }; + let binary_operator_parser = |input: &mut ParserContext| { ChoiceHelper::run(input, |mut choice, input| { - let result = parse_array_type_name_operator(input); + let result = parse_version_pragma_or_expression(input); + choice.consider(input, result)?; + let result = parse_version_pragma_range_expression(input); choice.consider(input, result)?; choice.finish(input) }) }; let linear_expression_parser = |input: &mut ParserContext| { SequenceHelper::run(|mut seq| { - seq.elem(primary_expression_parser(input))?; + seq.elem(binary_operand_parser(input))?; seq.elem(ZeroOrMoreHelper::run(input, |input| { - postfix_operator_parser(input) + SequenceHelper::run(|mut seq| { + seq.elem(binary_operator_parser(input))?; + seq.elem(binary_operand_parser(input))?; + seq.finish() + }) }))?; seq.finish() }) }; PrecedenceHelper::reduce_precedence_result( - Some(RuleKind::TypeName), + Some(RuleKind::VersionPragmaExpression), linear_expression_parser(input), ) - .with_kind(RuleKind::TypeName) + .with_kind(RuleKind::VersionPragmaExpression) } #[allow(unused_assignments, unused_parens)] - fn unchecked_block(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_8_0 { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::UncheckedKeyword, - ))?; - seq.elem(self.block(input))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::UncheckedBlock) + fn version_pragma_expressions(&self, input: &mut ParserContext) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.version_pragma_expression(input)) + .with_kind(RuleKind::VersionPragmaExpressions) } #[allow(unused_assignments, unused_parens)] - fn unicode_string_literals_list(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_7_0 { - OneOrMoreHelper::run(input, |input| { - self.parse_token_with_trivia::( - input, - TokenKind::UnicodeStringLiteral, - ) - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::UnicodeStringLiteralsList) + fn version_pragma_or_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::(input, TokenKind::BarBar) + .with_kind(RuleKind::VersionPragmaOrExpression) } #[allow(unused_assignments, unused_parens)] - fn unnamed_function_attributes_list(&self, input: &mut ParserContext) -> ParserResult { - if !self.version_is_at_least_0_6_0 { - OneOrMoreHelper::run(input, |input| { - if !self.version_is_at_least_0_6_0 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PureKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ViewKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::UnnamedFunctionAttributesList) + fn version_pragma_prefix_expression(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = + self.parse_token_with_trivia::(input, TokenKind::Caret); + choice.consider(input, result)?; + let result = + self.parse_token_with_trivia::(input, TokenKind::Tilde); + choice.consider(input, result)?; + let result = + self.parse_token_with_trivia::(input, TokenKind::Equal); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::LessThan); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanEqual, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::VersionPragmaPrefixExpression) } #[allow(unused_assignments, unused_parens)] - fn unnamed_function_definition(&self, input: &mut ParserContext) -> ParserResult { - if !self.version_is_at_least_0_6_0 { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + fn version_pragma_range_expression(&self, input: &mut ParserContext) -> ParserResult { + self.parse_token_with_trivia::(input, TokenKind::Minus) + .with_kind(RuleKind::VersionPragmaRangeExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn version_pragma_specifier(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Pragma>( + input, + self, + |input| { + self.parse_token_with_trivia::( input, - TokenKind::FunctionKeyword, - ))?; - seq.elem(self.parameters_declaration(input))?; - seq.elem(OptionalHelper::transform( - self.unnamed_function_attributes_list(input), - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::UnnamedFunctionDefinition) + TokenKind::VersionPragmaValue, + ) + }, + TokenKind::Period, + ) + .with_kind(RuleKind::VersionPragmaSpecifier) } #[allow(unused_assignments, unused_parens)] - fn user_defined_value_type_definition(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_8_8 { - SequenceHelper::run(|mut seq| { + fn while_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::WhileKeyword, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::TypeKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.elem(self.parse_token_with_trivia::( + self.expression(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, - TokenKind::IsKeyword, - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::BoolKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::StringKeyword, - ); - choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::FixedBytesType, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::SignedIntegerType, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::UnsignedIntegerType, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::SignedFixedType, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::UnsignedFixedType, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Semicolon, + TokenKind::CloseParen, ))?; seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::UserDefinedValueTypeDefinition) + }))?; + seq.elem(self.statement(input))?; + seq.finish() + }) + .with_kind(RuleKind::WhileStatement) } #[allow(unused_assignments, unused_parens)] - fn using_directive(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::UsingKeyword, - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive_path(input); - choice.consider(input, result)?; - let result = self.using_directive_deconstruction(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::ForKeyword, - ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Asterisk, - ); - choice.consider(input, result)?; - let result = self.type_name(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - if self.version_is_at_least_0_8_13 { - seq.elem(OptionalHelper::transform( - self.parse_token_with_trivia::( - input, - TokenKind::GlobalKeyword, - ), - ))?; - } - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + fn yul_all_keywords(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAbstractKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAddressKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAfterKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAliasKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAnonymousKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulApplyKeyword, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::YulAsKeyword); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAssemblyKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulAutoKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulBoolKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulBreakKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulByteKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulBytesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulCallDataKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulCaseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulCatchKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulConstantKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulConstructorKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulContinueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulContractKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulCopyOfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulDaysKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulDefaultKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulDefineKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulDeleteKeyword, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::YulDoKeyword); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulElseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulEmitKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulEnumKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulEtherKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulEventKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFallbackKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFalseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFinalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFinneyKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFixedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulForKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFunctionKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulGweiKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulHexKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulHoursKeyword, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::YulIfKeyword); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulImmutableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulImplementsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulImportKeyword, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::YulInKeyword); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulIndexedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulInlineKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulIntKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulInterfaceKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulInternalKeyword, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::YulIsKeyword); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - .with_kind(RuleKind::UsingDirective) - } - - #[allow(unused_assignments, unused_parens)] - fn using_directive_deconstruction(&self, input: &mut ParserContext) -> ParserResult { - if self.version_is_at_least_0_8_13 { - SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseBrace); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenBrace, - ))?; - seq.elem( - self.using_directive_symbols_list(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseBrace, - ))?; - seq.finish() - }) - } else { - ParserResult::disabled() - } - .with_kind(RuleKind::UsingDirectiveDeconstruction) - } - - #[allow(unused_assignments, unused_parens)] - fn using_directive_path(&self, input: &mut ParserContext) -> ParserResult { - self.identifier_path(input) - .with_kind(RuleKind::UsingDirectivePath) - } - - #[allow(unused_assignments, unused_parens)] - fn using_directive_symbol(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.identifier_path(input))?; - if self.version_is_at_least_0_8_19 { - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::AsKeyword, - ))?; - seq.elem(if self.version_is_at_least_0_8_19 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Ampersand, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Asterisk, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::BangEqual, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Bar, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Caret, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::EqualEqual, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::GreaterThan, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::GreaterThanEqual, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::LessThan, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::LessThanEqual, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Minus, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Percent, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Plus, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Slash, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Tilde, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - })?; - seq.finish() - })))?; - } - seq.finish() - }) - .with_kind(RuleKind::UsingDirectiveSymbol) - } - - #[allow(unused_assignments, unused_parens)] - fn using_directive_symbols_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.using_directive_symbol(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::UsingDirectiveSymbolsList) - } - - #[allow(unused_assignments, unused_parens)] - fn variable_declaration(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - if !self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::VarKeyword, - ); - choice.consider(input, result)?; - } - let result = self.type_name(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( + TokenKind::YulLeaveKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulLetKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulLibraryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulMacroKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulMappingKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulMatchKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulMemoryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulMinutesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulModifierKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulMutableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulNewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulNullKeyword, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::YulOfKeyword); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulOverrideKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPartialKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPragmaKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPromiseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPublicKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulPureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulReceiveKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulReferenceKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulRelocatableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulReturnKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulReturnsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulRevertKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulSealedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulSecondsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulSizeOfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulStaticKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulStorageKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulStringKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulStructKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulSupportsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulSwitchKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::MemoryKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::StorageKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::CalldataKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::YulSzaboKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Identifier, - ))?; - seq.finish() - }) - .with_kind(RuleKind::VariableDeclaration) - } - - #[allow(unused_assignments, unused_parens)] - fn variable_declaration_statement(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem( - SequenceHelper::run(|mut seq| { - seq.elem(self.variable_declaration(input))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Equal, - ))?; - seq.elem(self.expression(input))?; - seq.finish() - })))?; - seq.finish() - }) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::Semicolon, - RecoverFromNoMatch::No, - ), - )?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::YulThrowKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::Semicolon, - ))?; - seq.finish() - }) - .with_kind(RuleKind::VariableDeclarationStatement) - } - - #[allow(unused_assignments, unused_parens)] - fn version_pragma(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::SolidityKeyword, - ), - )?; - seq.elem(self.version_pragma_expressions_list(input))?; - seq.finish() - }) - .with_kind(RuleKind::VersionPragma) - } - - #[allow(unused_assignments, unused_parens)] - fn version_pragma_expression(&self, input: &mut ParserContext) -> ParserResult { - let parse_version_pragma_or_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::VersionPragmaBinaryExpression, - 1u8, - 1u8 + 1, - self.parse_token_with_trivia::( - input, - TokenKind::BarBar, - ), - ) - }; - let parse_version_pragma_range_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_binary_operator( - RuleKind::VersionPragmaBinaryExpression, - 3u8, - 3u8 + 1, - self.parse_token_with_trivia::( - input, - TokenKind::Minus, - ), - ) - }; - let parse_version_pragma_unary_operator = |input: &mut ParserContext| { - PrecedenceHelper::to_prefix_operator( - RuleKind::VersionPragmaUnaryExpression, - 5u8, - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Caret, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Tilde, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Equal, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThanEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThanEqual, - ); - choice.consider(input, result)?; - choice.finish(input) - }), - ) - }; - let prefix_operator_parser = |input: &mut ParserContext| { - ChoiceHelper::run(input, |mut choice, input| { - let result = parse_version_pragma_unary_operator(input); - choice.consider(input, result)?; - choice.finish(input) - }) - }; - let primary_expression_parser = - |input: &mut ParserContext| self.version_pragma_specifier(input); - let binary_operand_parser = |input: &mut ParserContext| { - SequenceHelper::run(|mut seq| { - seq.elem(ZeroOrMoreHelper::run(input, |input| { - prefix_operator_parser(input) - }))?; - seq.elem(primary_expression_parser(input))?; - seq.finish() - }) - }; - let binary_operator_parser = |input: &mut ParserContext| { - ChoiceHelper::run(input, |mut choice, input| { - let result = parse_version_pragma_or_operator(input); - choice.consider(input, result)?; - let result = parse_version_pragma_range_operator(input); - choice.consider(input, result)?; - choice.finish(input) - }) - }; - let linear_expression_parser = |input: &mut ParserContext| { - SequenceHelper::run(|mut seq| { - seq.elem(binary_operand_parser(input))?; - seq.elem(ZeroOrMoreHelper::run(input, |input| { - SequenceHelper::run(|mut seq| { - seq.elem(binary_operator_parser(input))?; - seq.elem(binary_operand_parser(input))?; - seq.finish() - }) - }))?; - seq.finish() - }) - }; - PrecedenceHelper::reduce_precedence_result( - Some(RuleKind::VersionPragmaExpression), - linear_expression_parser(input), - ) - .with_kind(RuleKind::VersionPragmaExpression) - } - - #[allow(unused_assignments, unused_parens)] - fn version_pragma_expressions_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| self.version_pragma_expression(input)) - .with_kind(RuleKind::VersionPragmaExpressionsList) - } - - #[allow(unused_assignments, unused_parens)] - fn version_pragma_specifier(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::VersionPragma>( - input, - self, - |input| { - self.parse_token_with_trivia::( - input, - TokenKind::VersionPragmaValue, - ) - }, - TokenKind::Period, - ) - .with_kind(RuleKind::VersionPragmaSpecifier) - } - - #[allow(unused_assignments, unused_parens)] - fn while_statement(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + TokenKind::YulTrueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::WhileKeyword, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - self.expression(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; - seq.elem(self.statement(input))?; - seq.finish() + TokenKind::YulTryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulTypeDefKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulTypeKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulTypeOfKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulUfixedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulUintKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulUncheckedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulUsingKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulVarKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulViewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulVirtualKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulWeeksKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulWeiKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulWhileKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulYearsKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::WhileStatement) + .with_kind(RuleKind::YulAllKeywords) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_arguments(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Yul>( + input, + self, + |input| self.yul_expression(input), + TokenKind::Comma, + )) + .with_kind(RuleKind::YulArguments) } #[allow(unused_assignments, unused_parens)] fn yul_assignment_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem(self.yul_identifier_paths_list(input))?; + seq.elem(self.yul_identifier_paths(input))?; seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::ColonEqual, ), @@ -4573,22 +6115,22 @@ impl Language { let mut delim_guard = input.open_delim(TokenKind::CloseBrace); let input = delim_guard.ctx(); seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::OpenBrace, ), )?; seq.elem( - OptionalHelper::transform(self.yul_statements_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::YulBlock>( - input, - self, - TokenKind::CloseBrace, - RecoverFromNoMatch::Yes, - ), + self.yul_statements(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Yul>( + input, + self, + TokenKind::CloseBrace, + RecoverFromNoMatch::Yes, + ), )?; seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::CloseBrace, ), @@ -4600,113 +6142,65 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn yul_break_statement(&self, input: &mut ParserContext) -> ParserResult { - self.parse_token_with_trivia::(input, TokenKind::BreakKeyword) + self.parse_token_with_trivia::(input, TokenKind::YulBreakKeyword) .with_kind(RuleKind::YulBreakStatement) } #[allow(unused_assignments, unused_parens)] fn yul_continue_statement(&self, input: &mut ParserContext) -> ParserResult { - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, - TokenKind::ContinueKeyword, + TokenKind::YulContinueKeyword, ) .with_kind(RuleKind::YulContinueStatement) } #[allow(unused_assignments, unused_parens)] - fn yul_declaration_statement(&self, input: &mut ParserContext) -> ParserResult { + fn yul_default_case(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::LetKeyword, - ), - )?; - seq.elem(self.yul_identifier_paths_list(input))?; - seq.elem(OptionalHelper::transform(SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::ColonEqual, - ), - )?; - seq.elem(self.yul_expression(input))?; - seq.finish() - })))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulDefaultKeyword, + ))?; + seq.elem(self.yul_block(input))?; seq.finish() }) - .with_kind(RuleKind::YulDeclarationStatement) + .with_kind(RuleKind::YulDefaultCase) } #[allow(unused_assignments, unused_parens)] fn yul_expression(&self, input: &mut ParserContext) -> ParserResult { - let parse_yul_function_call_operator = |input: &mut ParserContext| { + let parse_yul_function_call_expression = |input: &mut ParserContext| { PrecedenceHelper::to_postfix_operator( RuleKind::YulFunctionCallExpression, 1u8, SequenceHelper::run(|mut seq| { let mut delim_guard = input.open_delim(TokenKind::CloseParen); let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ), - )?; - seq.elem( - OptionalHelper::transform(self.yul_expressions_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::YulBlock>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ), + self.yul_arguments(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Yul>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; seq.finish() }), ) }; let primary_expression_parser = |input: &mut ParserContext| { ChoiceHelper::run(input, |mut choice, input| { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::TrueKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FalseKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulHexLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulDecimalLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HexStringLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ); - choice.consider(input, result)?; - choice.finish(input) - }); + let result = self.yul_literal(input); choice.consider(input, result)?; let result = self.yul_identifier_path(input); choice.consider(input, result)?; @@ -4715,7 +6209,7 @@ impl Language { }; let postfix_operator_parser = |input: &mut ParserContext| { ChoiceHelper::run(input, |mut choice, input| { - let result = parse_yul_function_call_operator(input); + let result = parse_yul_function_call_expression(input); choice.consider(input, result)?; choice.finish(input) }) @@ -4736,26 +6230,13 @@ impl Language { .with_kind(RuleKind::YulExpression) } - #[allow(unused_assignments, unused_parens)] - fn yul_expressions_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::YulBlock>( - input, - self, - |input| self.yul_expression(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::YulExpressionsList) - } - #[allow(unused_assignments, unused_parens)] fn yul_for_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::ForKeyword, - ), - )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulForKeyword, + ))?; seq.elem(self.yul_block(input))?; seq.elem(self.yul_expression(input))?; seq.elem(self.yul_block(input))?; @@ -4766,20 +6247,47 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn yul_function_definition(&self, input: &mut ParserContext) -> ParserResult { + fn yul_function_call_expression(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, - TokenKind::FunctionKeyword, + TokenKind::OpenParen, ), )?; seq.elem( - self.parse_token_with_trivia::( + self.yul_arguments(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Yul>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem( + self.parse_token_with_trivia::( input, - TokenKind::YulIdentifier, + TokenKind::CloseParen, ), )?; + seq.finish() + }) + .with_kind(RuleKind::YulFunctionCallExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_function_definition(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulFunctionKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulIdentifier, + ))?; seq.elem(self.yul_parameters_declaration(input))?; seq.elem(OptionalHelper::transform( self.yul_returns_declaration(input), @@ -4792,11 +6300,11 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn yul_identifier_path(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::YulBlock>( + SeparatedHelper::run::<_, LexicalContextType::Yul>( input, self, |input| { - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::YulIdentifier, ) @@ -4807,41 +6315,23 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn yul_identifier_paths_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::YulBlock>( + fn yul_identifier_paths(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Yul>( input, self, |input| self.yul_identifier_path(input), TokenKind::Comma, ) - .with_kind(RuleKind::YulIdentifierPathsList) - } - - #[allow(unused_assignments, unused_parens)] - fn yul_identifiers_list(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::YulBlock>( - input, - self, - |input| { - self.parse_token_with_trivia::( - input, - TokenKind::YulIdentifier, - ) - }, - TokenKind::Comma, - ) - .with_kind(RuleKind::YulIdentifiersList) + .with_kind(RuleKind::YulIdentifierPaths) } #[allow(unused_assignments, unused_parens)] fn yul_if_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::IfKeyword, - ), - )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulIfKeyword, + ))?; seq.elem(self.yul_expression(input))?; seq.elem(self.yul_block(input))?; seq.finish() @@ -4852,9 +6342,9 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn yul_leave_statement(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_6_0 { - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, - TokenKind::LeaveKeyword, + TokenKind::YulLeaveKeyword, ) } else { ParserResult::disabled() @@ -4862,28 +6352,82 @@ impl Language { .with_kind(RuleKind::YulLeaveStatement) } + #[allow(unused_assignments, unused_parens)] + fn yul_literal(&self, input: &mut ParserContext) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulTrueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFalseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulDecimalLiteral, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulHexLiteral, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::HexStringLiteral, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::YulLiteral) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_parameters(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(SeparatedHelper::run::<_, LexicalContextType::Yul>( + input, + self, + |input| { + self.parse_token_with_trivia::( + input, + TokenKind::YulIdentifier, + ) + }, + TokenKind::Comma, + )) + .with_kind(RuleKind::YulParameters) + } + #[allow(unused_assignments, unused_parens)] fn yul_parameters_declaration(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { let mut delim_guard = input.open_delim(TokenKind::CloseParen); let input = delim_guard.ctx(); seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::OpenParen, ), )?; seq.elem( - OptionalHelper::transform(self.yul_identifiers_list(input)) - .recover_until_with_nested_delims::<_, LexicalContextType::YulBlock>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), + self.yul_parameters(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Yul>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), )?; seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, TokenKind::CloseParen, ), @@ -4893,16 +6437,30 @@ impl Language { .with_kind(RuleKind::YulParametersDeclaration) } + #[allow(unused_assignments, unused_parens)] + fn yul_return_variables(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Yul>( + input, + self, + |input| { + self.parse_token_with_trivia::( + input, + TokenKind::YulIdentifier, + ) + }, + TokenKind::Comma, + ) + .with_kind(RuleKind::YulReturnVariables) + } + #[allow(unused_assignments, unused_parens)] fn yul_returns_declaration(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::MinusGreaterThan, - ), - )?; - seq.elem(self.yul_identifiers_list(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::MinusGreaterThan, + ))?; + seq.elem(self.yul_return_variables(input))?; seq.finish() }) .with_kind(RuleKind::YulReturnsDeclaration) @@ -4915,7 +6473,7 @@ impl Language { choice.consider(input, result)?; let result = self.yul_function_definition(input); choice.consider(input, result)?; - let result = self.yul_declaration_statement(input); + let result = self.yul_variable_declaration_statement(input); choice.consider(input, result)?; let result = self.yul_assignment_statement(input); choice.consider(input, result)?; @@ -4925,107 +6483,102 @@ impl Language { choice.consider(input, result)?; let result = self.yul_switch_statement(input); choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { + let result = self.yul_leave_statement(input); + choice.consider(input, result)?; + } let result = self.yul_break_statement(input); choice.consider(input, result)?; let result = self.yul_continue_statement(input); choice.consider(input, result)?; let result = self.yul_expression(input); choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = self.yul_leave_statement(input); - choice.consider(input, result)?; - } choice.finish(input) }) .with_kind(RuleKind::YulStatement) } #[allow(unused_assignments, unused_parens)] - fn yul_statements_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| self.yul_statement(input)) - .with_kind(RuleKind::YulStatementsList) + fn yul_statements(&self, input: &mut ParserContext) -> ParserResult { + ZeroOrMoreHelper::run(input, |input| self.yul_statement(input)) + .with_kind(RuleKind::YulStatements) } #[allow(unused_assignments, unused_parens)] fn yul_switch_case(&self, input: &mut ParserContext) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::DefaultKeyword, - ); - choice.consider(input, result)?; - let result = SequenceHelper::run(|mut seq| { - seq.elem( - self.parse_token_with_trivia::( - input, - TokenKind::CaseKeyword, - ), - )?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::TrueKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FalseKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulHexLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulDecimalLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HexStringLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.finish() - }); - choice.consider(input, result)?; - choice.finish(input) - }))?; + ChoiceHelper::run(input, |mut choice, input| { + let result = self.yul_default_case(input); + choice.consider(input, result)?; + let result = self.yul_value_case(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::YulSwitchCase) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_switch_cases(&self, input: &mut ParserContext) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.yul_switch_case(input)) + .with_kind(RuleKind::YulSwitchCases) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_switch_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulSwitchKeyword, + ))?; + seq.elem(self.yul_expression(input))?; + seq.elem(self.yul_switch_cases(input))?; + seq.finish() + }) + .with_kind(RuleKind::YulSwitchStatement) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_value_case(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulCaseKeyword, + ))?; + seq.elem(self.yul_literal(input))?; seq.elem(self.yul_block(input))?; seq.finish() }) - .with_kind(RuleKind::YulSwitchCase) + .with_kind(RuleKind::YulValueCase) } #[allow(unused_assignments, unused_parens)] - fn yul_switch_cases_list(&self, input: &mut ParserContext) -> ParserResult { - OneOrMoreHelper::run(input, |input| self.yul_switch_case(input)) - .with_kind(RuleKind::YulSwitchCasesList) + fn yul_variable_declaration_statement(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::YulLetKeyword, + ))?; + seq.elem(self.yul_identifier_paths(input))?; + seq.elem(OptionalHelper::transform( + self.yul_variable_declaration_value(input), + ))?; + seq.finish() + }) + .with_kind(RuleKind::YulVariableDeclarationStatement) } #[allow(unused_assignments, unused_parens)] - fn yul_switch_statement(&self, input: &mut ParserContext) -> ParserResult { + fn yul_variable_declaration_value(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem( - self.parse_token_with_trivia::( + self.parse_token_with_trivia::( input, - TokenKind::SwitchKeyword, + TokenKind::ColonEqual, ), )?; seq.elem(self.yul_expression(input))?; - seq.elem(self.yul_switch_cases_list(input))?; seq.finish() }) - .with_kind(RuleKind::YulSwitchStatement) + .with_kind(RuleKind::YulVariableDeclarationValue) } /******************************************** @@ -5033,22 +6586,11 @@ impl Language { ********************************************/ #[allow(unused_assignments, unused_parens)] - fn ascii_character_without_double_quote_or_backslash(&self, input: &mut ParserContext) -> bool { - scan_choice!( - input, - scan_char_range!(input, ' ', '!'), - scan_char_range!(input, '#', '['), - scan_char_range!(input, ']', '~') - ) - } - - #[allow(unused_assignments, unused_parens)] - fn ascii_character_without_single_quote_or_backslash(&self, input: &mut ParserContext) -> bool { - scan_choice!( + fn ampersand(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( input, - scan_char_range!(input, ' ', '&'), - scan_char_range!(input, '(', '['), - scan_char_range!(input, ']', '~') + scan_chars!(input, '&'), + scan_choice!(input, scan_chars!(input, '='), scan_chars!(input, '&')) ) } @@ -5077,19 +6619,89 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn decimal_digit(&self, input: &mut ParserContext) -> bool { - scan_char_range!(input, '0', '9') + fn asterisk(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '*'), + scan_choice!(input, scan_chars!(input, '='), scan_chars!(input, '*')) + ) + } + + #[allow(unused_assignments, unused_parens)] + fn bang(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!(input, scan_chars!(input, '!'), scan_chars!(input, '=')) + } + + #[allow(unused_assignments, unused_parens)] + fn bar(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '|'), + scan_choice!(input, scan_chars!(input, '|'), scan_chars!(input, '=')) + ) + } + + #[allow(unused_assignments, unused_parens)] + fn bytes_keyword(&self, input: &mut ParserContext) -> bool { + scan_sequence!( + scan_chars!(input, 'b', 'y', 't', 'e', 's'), + scan_choice!( + input, + scan_chars!(input, '9'), + scan_chars!(input, '8'), + scan_chars!(input, '7'), + scan_chars!(input, '6'), + scan_chars!(input, '5'), + scan_chars!(input, '4'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '3', '1'), + scan_chars!(input, '3', '0'), + scan_chars!(input, '3'), + scan_chars!(input, '2', '9'), + scan_chars!(input, '2', '8'), + scan_chars!(input, '2', '7'), + scan_chars!(input, '2', '6'), + scan_chars!(input, '2', '5'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3'), + scan_chars!(input, '2', '2'), + scan_chars!(input, '2', '1'), + scan_chars!(input, '2', '0'), + scan_chars!(input, '2'), + scan_chars!(input, '1', '9'), + scan_chars!(input, '1', '8'), + scan_chars!(input, '1', '7'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5'), + scan_chars!(input, '1', '4'), + scan_chars!(input, '1', '3'), + scan_chars!(input, '1', '2'), + scan_chars!(input, '1', '1'), + scan_chars!(input, '1', '0'), + scan_chars!(input, '1') + ) + ) + } + + #[allow(unused_assignments, unused_parens)] + fn caret(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!(input, scan_chars!(input, '^'), scan_chars!(input, '=')) + } + + #[allow(unused_assignments, unused_parens)] + fn colon(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!(input, scan_chars!(input, ':'), scan_chars!(input, '=')) } #[allow(unused_assignments, unused_parens)] fn decimal_digits(&self, input: &mut ParserContext) -> bool { scan_sequence!( - scan_one_or_more!(input, self.decimal_digit(input)), + scan_one_or_more!(input, scan_char_range!(input, '0', '9')), scan_zero_or_more!( input, scan_sequence!( scan_chars!(input, '_'), - scan_one_or_more!(input, self.decimal_digit(input)) + scan_one_or_more!(input, scan_char_range!(input, '0', '9')) ) ) ) @@ -5106,35 +6718,55 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn decimal_literal(&self, input: &mut ParserContext) -> bool { - scan_not_followed_by!( + scan_choice!( input, - scan_sequence!( - scan_choice!( - input, + scan_not_followed_by!( + input, + scan_sequence!( scan_not_followed_by!( input, self.decimal_digits(input), scan_chars!(input, '.') ), - if !self.version_is_at_least_0_5_0 { + scan_optional!(input, self.decimal_exponent(input)) + ), + self.identifier_start(input) + ), + if !self.version_is_at_least_0_5_0 { + scan_not_followed_by!( + input, + scan_sequence!( scan_not_followed_by!( input, scan_sequence!(self.decimal_digits(input), scan_chars!(input, '.')), self.decimal_digits(input) - ) - } else { - false - }, - scan_sequence!(scan_chars!(input, '.'), self.decimal_digits(input)), - scan_sequence!( - self.decimal_digits(input), - scan_chars!(input, '.'), - self.decimal_digits(input) - ) + ), + scan_optional!(input, self.decimal_exponent(input)) + ), + self.identifier_start(input) + ) + } else { + false + }, + scan_not_followed_by!( + input, + scan_sequence!( + scan_chars!(input, '.'), + self.decimal_digits(input), + scan_optional!(input, self.decimal_exponent(input)) ), - scan_optional!(input, self.decimal_exponent(input)) + self.identifier_start(input) ), - self.identifier_start(input) + scan_not_followed_by!( + input, + scan_sequence!( + self.decimal_digits(input), + scan_chars!(input, '.'), + self.decimal_digits(input), + scan_optional!(input, self.decimal_exponent(input)) + ), + self.identifier_start(input) + ) ) } @@ -5147,7 +6779,9 @@ impl Language { scan_choice!( input, self.escape_sequence(input), - self.ascii_character_without_double_quote_or_backslash(input) + scan_char_range!(input, ' ', '!'), + scan_char_range!(input, '#', '['), + scan_char_range!(input, ']', '~') ) ), scan_chars!(input, '"') @@ -5173,7 +6807,7 @@ impl Language { scan_choice!( input, self.escape_sequence(input), - scan_none_of!(input, '\n', '\r', '"', '\\') + scan_none_of!(input, '"', '\\', '\r', '\n') ) ), scan_chars!(input, '"') @@ -5191,6 +6825,15 @@ impl Language { ) } + #[allow(unused_assignments, unused_parens)] + fn equal(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '='), + scan_choice!(input, scan_chars!(input, '>'), scan_chars!(input, '=')) + ) + } + #[allow(unused_assignments, unused_parens)] fn escape_sequence(&self, input: &mut ParserContext) -> bool { scan_sequence!( @@ -5205,58 +6848,312 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn fixed_bytes_type(&self, input: &mut ParserContext) -> bool { - scan_sequence!( - scan_chars!(input, 'b', 'y', 't', 'e', 's'), - self.fixed_bytes_type_size(input) + fn fixed_keyword(&self, input: &mut ParserContext) -> bool { + scan_choice!( + input, + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '6') + ) + ), + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '4', '8', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '1', '6'), + scan_chars!(input, '2', '3', '2', 'x', '8'), + scan_chars!(input, '2', '3', '2', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '1', '6'), + scan_chars!(input, '2', '2', '4', 'x', '8'), + scan_chars!(input, '2', '2', '4', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '2', '4'), + scan_chars!(input, '2', '2', '4', 'x', '1', '6'), + scan_chars!(input, '2', '1', '6', 'x', '8'), + scan_chars!(input, '2', '1', '6', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '3', '2'), + scan_chars!(input, '2', '1', '6', 'x', '2', '4'), + scan_chars!(input, '2', '1', '6', 'x', '1', '6'), + scan_chars!(input, '2', '0', '8', 'x', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '0'), + scan_chars!(input, '2', '0', '8', 'x', '3', '2'), + scan_chars!(input, '2', '0', '8', 'x', '2', '4'), + scan_chars!(input, '2', '0', '8', 'x', '1', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8'), + scan_chars!(input, '2', '0', '0', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '4', '8'), + scan_chars!(input, '2', '0', '0', 'x', '4', '0'), + scan_chars!(input, '2', '0', '0', 'x', '3', '2'), + scan_chars!(input, '2', '0', '0', 'x', '2', '4'), + scan_chars!(input, '2', '0', '0', 'x', '1', '6'), + scan_chars!(input, '1', '9', '2', 'x', '8'), + scan_chars!(input, '1', '9', '2', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '5', '6'), + scan_chars!(input, '1', '9', '2', 'x', '4', '8'), + scan_chars!(input, '1', '9', '2', 'x', '4', '0'), + scan_chars!(input, '1', '9', '2', 'x', '3', '2'), + scan_chars!(input, '1', '9', '2', 'x', '2', '4'), + scan_chars!(input, '1', '9', '2', 'x', '1', '6'), + scan_chars!(input, '1', '8', '4', 'x', '8'), + scan_chars!(input, '1', '8', '4', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '6', '4'), + scan_chars!(input, '1', '8', '4', 'x', '5', '6'), + scan_chars!(input, '1', '8', '4', 'x', '4', '8'), + scan_chars!(input, '1', '8', '4', 'x', '4', '0'), + scan_chars!(input, '1', '8', '4', 'x', '3', '2'), + scan_chars!(input, '1', '8', '4', 'x', '2', '4'), + scan_chars!(input, '1', '8', '4', 'x', '1', '6') + ) + ), + if self.version_is_at_least_0_4_14 { + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '5', '6', 'x', '8', '0'), + scan_chars!(input, '2', '5', '6', 'x', '8'), + scan_chars!(input, '2', '5', '6', 'x', '7', '2'), + scan_chars!(input, '2', '5', '6', 'x', '6', '4'), + scan_chars!(input, '2', '5', '6', 'x', '5', '6'), + scan_chars!(input, '2', '5', '6', 'x', '4', '8'), + scan_chars!(input, '2', '5', '6', 'x', '4', '0'), + scan_chars!(input, '2', '5', '6', 'x', '3', '2'), + scan_chars!(input, '2', '5', '6', 'x', '2', '4'), + scan_chars!(input, '2', '5', '6', 'x', '1', '6'), + scan_chars!(input, '2', '4', '8', 'x', '8', '0'), + scan_chars!(input, '2', '4', '8', 'x', '7', '2'), + scan_chars!(input, '2', '4', '8', 'x', '6', '4'), + scan_chars!(input, '2', '4', '8', 'x', '5', '6'), + scan_chars!(input, '2', '4', '8', 'x', '4', '8'), + scan_chars!(input, '2', '4', '8', 'x', '4', '0'), + scan_chars!(input, '2', '4', '8', 'x', '3', '2'), + scan_chars!(input, '2', '4', '8', 'x', '2', '4'), + scan_chars!(input, '2', '4', '8', 'x', '1', '6'), + scan_chars!(input, '2', '4', '0', 'x', '8', '0'), + scan_chars!(input, '2', '4', '0', 'x', '7', '2'), + scan_chars!(input, '2', '4', '0', 'x', '6', '4'), + scan_chars!(input, '2', '4', '0', 'x', '5', '6'), + scan_chars!(input, '2', '4', '0', 'x', '4', '8'), + scan_chars!(input, '2', '4', '0', 'x', '4', '0'), + scan_chars!(input, '2', '4', '0', 'x', '3', '2'), + scan_chars!(input, '2', '4', '0', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '8', '0'), + scan_chars!(input, '2', '3', '2', 'x', '7', '2'), + scan_chars!(input, '2', '3', '2', 'x', '6', '4'), + scan_chars!(input, '2', '3', '2', 'x', '5', '6'), + scan_chars!(input, '2', '3', '2', 'x', '4', '8'), + scan_chars!(input, '2', '3', '2', 'x', '4', '0'), + scan_chars!(input, '2', '3', '2', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '8', '0'), + scan_chars!(input, '2', '2', '4', 'x', '7', '2'), + scan_chars!(input, '2', '2', '4', 'x', '6', '4'), + scan_chars!(input, '2', '2', '4', 'x', '5', '6'), + scan_chars!(input, '2', '2', '4', 'x', '4', '8'), + scan_chars!(input, '2', '2', '4', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '8', '0'), + scan_chars!(input, '2', '1', '6', 'x', '7', '2'), + scan_chars!(input, '2', '1', '6', 'x', '6', '4'), + scan_chars!(input, '2', '1', '6', 'x', '5', '6'), + scan_chars!(input, '2', '1', '6', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '8', '0'), + scan_chars!(input, '2', '0', '8', 'x', '7', '2'), + scan_chars!(input, '2', '0', '8', 'x', '6', '4'), + scan_chars!(input, '2', '0', '8', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8', '0'), + scan_chars!(input, '2', '0', '0', 'x', '7', '2'), + scan_chars!(input, '2', '0', '0', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '8', '0'), + scan_chars!(input, '1', '9', '2', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '8', '0') + ) + ) + } else { + false + }, + if self.version_is_at_least_0_4_14 { + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '9'), + scan_chars!(input, '7', '9'), + scan_chars!(input, '7', '8'), + scan_chars!(input, '7', '7'), + scan_chars!(input, '7', '6'), + scan_chars!(input, '7', '5'), + scan_chars!(input, '7', '4'), + scan_chars!(input, '7', '3'), + scan_chars!(input, '7', '1'), + scan_chars!(input, '7', '0'), + scan_chars!(input, '7'), + scan_chars!(input, '6', '9'), + scan_chars!(input, '6', '8'), + scan_chars!(input, '6', '7'), + scan_chars!(input, '6', '6'), + scan_chars!(input, '6', '5'), + scan_chars!(input, '6', '3'), + scan_chars!(input, '6', '2'), + scan_chars!(input, '6', '1'), + scan_chars!(input, '6', '0'), + scan_chars!(input, '6'), + scan_chars!(input, '5', '9'), + scan_chars!(input, '5', '8'), + scan_chars!(input, '5', '7'), + scan_chars!(input, '5', '5'), + scan_chars!(input, '5', '4'), + scan_chars!(input, '5', '3'), + scan_chars!(input, '5', '2'), + scan_chars!(input, '5', '1'), + scan_chars!(input, '5', '0'), + scan_chars!(input, '5'), + scan_chars!(input, '4', '9'), + scan_chars!(input, '4', '7'), + scan_chars!(input, '4', '6'), + scan_chars!(input, '4', '5'), + scan_chars!(input, '4', '4'), + scan_chars!(input, '4', '3'), + scan_chars!(input, '4', '2'), + scan_chars!(input, '4', '1'), + scan_chars!(input, '4'), + scan_chars!(input, '3', '9'), + scan_chars!(input, '3', '8'), + scan_chars!(input, '3', '7'), + scan_chars!(input, '3', '6'), + scan_chars!(input, '3', '5'), + scan_chars!(input, '3', '4'), + scan_chars!(input, '3', '3'), + scan_chars!(input, '3', '1'), + scan_chars!(input, '3', '0'), + scan_chars!(input, '3'), + scan_chars!(input, '2', '9'), + scan_chars!(input, '2', '8'), + scan_chars!(input, '2', '7'), + scan_chars!(input, '2', '6'), + scan_chars!(input, '2', '5'), + scan_chars!(input, '2', '3'), + scan_chars!(input, '2', '2'), + scan_chars!(input, '2', '1'), + scan_chars!(input, '2', '0'), + scan_chars!(input, '2'), + scan_chars!(input, '1', '9'), + scan_chars!(input, '1', '8'), + scan_chars!(input, '1', '7'), + scan_chars!(input, '1', '5'), + scan_chars!(input, '1', '4'), + scan_chars!(input, '1', '3'), + scan_chars!(input, '1', '2'), + scan_chars!(input, '1', '1'), + scan_chars!(input, '1', '0'), + scan_chars!(input, '1'), + scan_chars!(input, '0') + ) + ) + } else { + false + } ) } #[allow(unused_assignments, unused_parens)] - fn fixed_bytes_type_size(&self, input: &mut ParserContext) -> bool { - scan_choice!( + fn greater_than(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( input, - scan_chars!(input, '9'), - scan_chars!(input, '8'), - scan_chars!(input, '7'), - scan_chars!(input, '6'), - scan_chars!(input, '5'), - scan_chars!(input, '4'), - scan_chars!(input, '3', '2'), - scan_chars!(input, '3', '1'), - scan_chars!(input, '3', '0'), - scan_chars!(input, '3'), - scan_chars!(input, '2', '9'), - scan_chars!(input, '2', '8'), - scan_chars!(input, '2', '7'), - scan_chars!(input, '2', '6'), - scan_chars!(input, '2', '5'), - scan_chars!(input, '2', '4'), - scan_chars!(input, '2', '3'), - scan_chars!(input, '2', '2'), - scan_chars!(input, '2', '1'), - scan_chars!(input, '2', '0'), - scan_chars!(input, '2'), - scan_chars!(input, '1', '9'), - scan_chars!(input, '1', '8'), - scan_chars!(input, '1', '7'), - scan_chars!(input, '1', '6'), - scan_chars!(input, '1', '5'), - scan_chars!(input, '1', '4'), - scan_chars!(input, '1', '3'), - scan_chars!(input, '1', '2'), - scan_chars!(input, '1', '1'), - scan_chars!(input, '1', '0'), - scan_chars!(input, '1') + scan_chars!(input, '>'), + scan_choice!(input, scan_chars!(input, '>'), scan_chars!(input, '=')) ) } #[allow(unused_assignments, unused_parens)] - fn fixed_type_size(&self, input: &mut ParserContext) -> bool { - scan_sequence!( - scan_one_or_more!(input, scan_char_range!(input, '0', '9')), - scan_chars!(input, 'x'), - scan_one_or_more!(input, scan_char_range!(input, '0', '9')) + fn greater_than_greater_than(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '>', '>'), + scan_choice!(input, scan_chars!(input, '>'), scan_chars!(input, '=')) + ) + } + + #[allow(unused_assignments, unused_parens)] + fn greater_than_greater_than_greater_than(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '>', '>', '>'), + scan_chars!(input, '=') ) } @@ -5273,36 +7170,50 @@ impl Language { fn hex_character(&self, input: &mut ParserContext) -> bool { scan_choice!( input, - self.decimal_digit(input), - scan_char_range!(input, 'A', 'F'), - scan_char_range!(input, 'a', 'f') + scan_char_range!(input, '0', '9'), + scan_char_range!(input, 'a', 'f'), + scan_char_range!(input, 'A', 'F') ) } #[allow(unused_assignments, unused_parens)] fn hex_literal(&self, input: &mut ParserContext) -> bool { - scan_not_followed_by!( + scan_choice!( input, - scan_sequence!( - scan_choice!( - input, + scan_not_followed_by!( + input, + scan_sequence!( scan_chars!(input, '0', 'x'), - if !self.version_is_at_least_0_5_0 { - scan_chars!(input, '0', 'X') - } else { - false - } + scan_one_or_more!(input, self.hex_character(input)), + scan_zero_or_more!( + input, + scan_sequence!( + scan_chars!(input, '_'), + scan_one_or_more!(input, self.hex_character(input)) + ) + ) ), - scan_one_or_more!(input, self.hex_character(input)), - scan_zero_or_more!( + self.identifier_start(input) + ), + if !self.version_is_at_least_0_5_0 { + scan_not_followed_by!( input, scan_sequence!( - scan_chars!(input, '_'), - scan_one_or_more!(input, self.hex_character(input)) - ) + scan_chars!(input, '0', 'X'), + scan_one_or_more!(input, self.hex_character(input)), + scan_zero_or_more!( + input, + scan_sequence!( + scan_chars!(input, '_'), + scan_one_or_more!(input, self.hex_character(input)) + ) + ) + ), + self.identifier_start(input) ) - ), - self.identifier_start(input) + } else { + false + } ) } @@ -5351,47 +7262,81 @@ impl Language { input, scan_chars!(input, '_'), scan_chars!(input, '$'), - scan_char_range!(input, 'A', 'Z'), - scan_char_range!(input, 'a', 'z') + scan_char_range!(input, 'a', 'z'), + scan_char_range!(input, 'A', 'Z') ) } #[allow(unused_assignments, unused_parens)] - fn integer_type_size(&self, input: &mut ParserContext) -> bool { - scan_choice!( + fn int_keyword(&self, input: &mut ParserContext) -> bool { + scan_sequence!( + scan_chars!(input, 'i', 'n', 't'), + scan_optional!( + input, + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ) + ) + ) + } + + #[allow(unused_assignments, unused_parens)] + fn less_than(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '<'), + scan_choice!(input, scan_chars!(input, '='), scan_chars!(input, '<')) + ) + } + + #[allow(unused_assignments, unused_parens)] + fn less_than_less_than(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!(input, scan_chars!(input, '<', '<'), scan_chars!(input, '=')) + } + + #[allow(unused_assignments, unused_parens)] + fn minus(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( input, - scan_chars!(input, '9', '6'), - scan_chars!(input, '8', '8'), - scan_chars!(input, '8', '0'), - scan_chars!(input, '8'), - scan_chars!(input, '7', '2'), - scan_chars!(input, '6', '4'), - scan_chars!(input, '5', '6'), - scan_chars!(input, '4', '8'), - scan_chars!(input, '4', '0'), - scan_chars!(input, '3', '2'), - scan_chars!(input, '2', '5', '6'), - scan_chars!(input, '2', '4', '8'), - scan_chars!(input, '2', '4', '0'), - scan_chars!(input, '2', '4'), - scan_chars!(input, '2', '3', '2'), - scan_chars!(input, '2', '2', '4'), - scan_chars!(input, '2', '1', '6'), - scan_chars!(input, '2', '0', '8'), - scan_chars!(input, '2', '0', '0'), - scan_chars!(input, '1', '9', '2'), - scan_chars!(input, '1', '8', '4'), - scan_chars!(input, '1', '7', '6'), - scan_chars!(input, '1', '6', '8'), - scan_chars!(input, '1', '6', '0'), - scan_chars!(input, '1', '6'), - scan_chars!(input, '1', '5', '2'), - scan_chars!(input, '1', '4', '4'), - scan_chars!(input, '1', '3', '6'), - scan_chars!(input, '1', '2', '8'), - scan_chars!(input, '1', '2', '0'), - scan_chars!(input, '1', '1', '2'), - scan_chars!(input, '1', '0', '4') + scan_chars!(input, '-'), + scan_choice!( + input, + scan_chars!(input, '>'), + scan_chars!(input, '='), + scan_chars!(input, '-') + ) ) } @@ -5414,26 +7359,24 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn raw_identifier(&self, input: &mut ParserContext) -> bool { - scan_sequence!( - self.identifier_start(input), - scan_zero_or_more!(input, self.identifier_part(input)) - ) + fn percent(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!(input, scan_chars!(input, '%'), scan_chars!(input, '=')) } #[allow(unused_assignments, unused_parens)] - fn signed_fixed_type(&self, input: &mut ParserContext) -> bool { - scan_sequence!( - scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), - scan_optional!(input, self.fixed_type_size(input)) + fn plus(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!( + input, + scan_chars!(input, '+'), + scan_choice!(input, scan_chars!(input, '='), scan_chars!(input, '+')) ) } #[allow(unused_assignments, unused_parens)] - fn signed_integer_type(&self, input: &mut ParserContext) -> bool { + fn raw_identifier(&self, input: &mut ParserContext) -> bool { scan_sequence!( - scan_chars!(input, 'i', 'n', 't'), - scan_optional!(input, self.integer_type_size(input)) + self.identifier_start(input), + scan_zero_or_more!(input, self.identifier_part(input)) ) } @@ -5454,7 +7397,9 @@ impl Language { scan_choice!( input, self.escape_sequence(input), - self.ascii_character_without_single_quote_or_backslash(input) + scan_char_range!(input, ' ', '&'), + scan_char_range!(input, '(', '['), + scan_char_range!(input, ']', '~') ) ), scan_chars!(input, '\'') @@ -5480,7 +7425,7 @@ impl Language { scan_choice!( input, self.escape_sequence(input), - scan_none_of!(input, '\n', '\r', '\'', '\\') + scan_none_of!(input, '\'', '\\', '\r', '\n') ) ), scan_chars!(input, '\'') @@ -5491,42 +7436,363 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn unicode_escape(&self, input: &mut ParserContext) -> bool { - scan_sequence!( - scan_chars!(input, 'u'), - self.hex_character(input), - self.hex_character(input), - self.hex_character(input), - self.hex_character(input) + fn slash(&self, input: &mut ParserContext) -> bool { + scan_not_followed_by!(input, scan_chars!(input, '/'), scan_chars!(input, '=')) + } + + #[allow(unused_assignments, unused_parens)] + fn ufixed_keyword(&self, input: &mut ParserContext) -> bool { + scan_choice!( + input, + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '6') + ) + ), + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '4', '8', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '1', '6'), + scan_chars!(input, '2', '3', '2', 'x', '8'), + scan_chars!(input, '2', '3', '2', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '1', '6'), + scan_chars!(input, '2', '2', '4', 'x', '8'), + scan_chars!(input, '2', '2', '4', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '2', '4'), + scan_chars!(input, '2', '2', '4', 'x', '1', '6'), + scan_chars!(input, '2', '1', '6', 'x', '8'), + scan_chars!(input, '2', '1', '6', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '3', '2'), + scan_chars!(input, '2', '1', '6', 'x', '2', '4'), + scan_chars!(input, '2', '1', '6', 'x', '1', '6'), + scan_chars!(input, '2', '0', '8', 'x', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '0'), + scan_chars!(input, '2', '0', '8', 'x', '3', '2'), + scan_chars!(input, '2', '0', '8', 'x', '2', '4'), + scan_chars!(input, '2', '0', '8', 'x', '1', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8'), + scan_chars!(input, '2', '0', '0', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '4', '8'), + scan_chars!(input, '2', '0', '0', 'x', '4', '0'), + scan_chars!(input, '2', '0', '0', 'x', '3', '2'), + scan_chars!(input, '2', '0', '0', 'x', '2', '4'), + scan_chars!(input, '2', '0', '0', 'x', '1', '6'), + scan_chars!(input, '1', '9', '2', 'x', '8'), + scan_chars!(input, '1', '9', '2', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '5', '6'), + scan_chars!(input, '1', '9', '2', 'x', '4', '8'), + scan_chars!(input, '1', '9', '2', 'x', '4', '0'), + scan_chars!(input, '1', '9', '2', 'x', '3', '2'), + scan_chars!(input, '1', '9', '2', 'x', '2', '4'), + scan_chars!(input, '1', '9', '2', 'x', '1', '6'), + scan_chars!(input, '1', '8', '4', 'x', '8'), + scan_chars!(input, '1', '8', '4', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '6', '4'), + scan_chars!(input, '1', '8', '4', 'x', '5', '6'), + scan_chars!(input, '1', '8', '4', 'x', '4', '8'), + scan_chars!(input, '1', '8', '4', 'x', '4', '0'), + scan_chars!(input, '1', '8', '4', 'x', '3', '2'), + scan_chars!(input, '1', '8', '4', 'x', '2', '4'), + scan_chars!(input, '1', '8', '4', 'x', '1', '6') + ) + ), + if self.version_is_at_least_0_4_14 { + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '5', '6', 'x', '8', '0'), + scan_chars!(input, '2', '5', '6', 'x', '8'), + scan_chars!(input, '2', '5', '6', 'x', '7', '2'), + scan_chars!(input, '2', '5', '6', 'x', '6', '4'), + scan_chars!(input, '2', '5', '6', 'x', '5', '6'), + scan_chars!(input, '2', '5', '6', 'x', '4', '8'), + scan_chars!(input, '2', '5', '6', 'x', '4', '0'), + scan_chars!(input, '2', '5', '6', 'x', '3', '2'), + scan_chars!(input, '2', '5', '6', 'x', '2', '4'), + scan_chars!(input, '2', '5', '6', 'x', '1', '6'), + scan_chars!(input, '2', '4', '8', 'x', '8', '0'), + scan_chars!(input, '2', '4', '8', 'x', '7', '2'), + scan_chars!(input, '2', '4', '8', 'x', '6', '4'), + scan_chars!(input, '2', '4', '8', 'x', '5', '6'), + scan_chars!(input, '2', '4', '8', 'x', '4', '8'), + scan_chars!(input, '2', '4', '8', 'x', '4', '0'), + scan_chars!(input, '2', '4', '8', 'x', '3', '2'), + scan_chars!(input, '2', '4', '8', 'x', '2', '4'), + scan_chars!(input, '2', '4', '8', 'x', '1', '6'), + scan_chars!(input, '2', '4', '0', 'x', '8', '0'), + scan_chars!(input, '2', '4', '0', 'x', '7', '2'), + scan_chars!(input, '2', '4', '0', 'x', '6', '4'), + scan_chars!(input, '2', '4', '0', 'x', '5', '6'), + scan_chars!(input, '2', '4', '0', 'x', '4', '8'), + scan_chars!(input, '2', '4', '0', 'x', '4', '0'), + scan_chars!(input, '2', '4', '0', 'x', '3', '2'), + scan_chars!(input, '2', '4', '0', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '8', '0'), + scan_chars!(input, '2', '3', '2', 'x', '7', '2'), + scan_chars!(input, '2', '3', '2', 'x', '6', '4'), + scan_chars!(input, '2', '3', '2', 'x', '5', '6'), + scan_chars!(input, '2', '3', '2', 'x', '4', '8'), + scan_chars!(input, '2', '3', '2', 'x', '4', '0'), + scan_chars!(input, '2', '3', '2', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '8', '0'), + scan_chars!(input, '2', '2', '4', 'x', '7', '2'), + scan_chars!(input, '2', '2', '4', 'x', '6', '4'), + scan_chars!(input, '2', '2', '4', 'x', '5', '6'), + scan_chars!(input, '2', '2', '4', 'x', '4', '8'), + scan_chars!(input, '2', '2', '4', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '8', '0'), + scan_chars!(input, '2', '1', '6', 'x', '7', '2'), + scan_chars!(input, '2', '1', '6', 'x', '6', '4'), + scan_chars!(input, '2', '1', '6', 'x', '5', '6'), + scan_chars!(input, '2', '1', '6', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '8', '0'), + scan_chars!(input, '2', '0', '8', 'x', '7', '2'), + scan_chars!(input, '2', '0', '8', 'x', '6', '4'), + scan_chars!(input, '2', '0', '8', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8', '0'), + scan_chars!(input, '2', '0', '0', 'x', '7', '2'), + scan_chars!(input, '2', '0', '0', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '8', '0'), + scan_chars!(input, '1', '9', '2', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '8', '0') + ) + ) + } else { + false + }, + if self.version_is_at_least_0_4_14 { + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '9'), + scan_chars!(input, '7', '9'), + scan_chars!(input, '7', '8'), + scan_chars!(input, '7', '7'), + scan_chars!(input, '7', '6'), + scan_chars!(input, '7', '5'), + scan_chars!(input, '7', '4'), + scan_chars!(input, '7', '3'), + scan_chars!(input, '7', '1'), + scan_chars!(input, '7', '0'), + scan_chars!(input, '7'), + scan_chars!(input, '6', '9'), + scan_chars!(input, '6', '8'), + scan_chars!(input, '6', '7'), + scan_chars!(input, '6', '6'), + scan_chars!(input, '6', '5'), + scan_chars!(input, '6', '3'), + scan_chars!(input, '6', '2'), + scan_chars!(input, '6', '1'), + scan_chars!(input, '6', '0'), + scan_chars!(input, '6'), + scan_chars!(input, '5', '9'), + scan_chars!(input, '5', '8'), + scan_chars!(input, '5', '7'), + scan_chars!(input, '5', '5'), + scan_chars!(input, '5', '4'), + scan_chars!(input, '5', '3'), + scan_chars!(input, '5', '2'), + scan_chars!(input, '5', '1'), + scan_chars!(input, '5', '0'), + scan_chars!(input, '5'), + scan_chars!(input, '4', '9'), + scan_chars!(input, '4', '7'), + scan_chars!(input, '4', '6'), + scan_chars!(input, '4', '5'), + scan_chars!(input, '4', '4'), + scan_chars!(input, '4', '3'), + scan_chars!(input, '4', '2'), + scan_chars!(input, '4', '1'), + scan_chars!(input, '4'), + scan_chars!(input, '3', '9'), + scan_chars!(input, '3', '8'), + scan_chars!(input, '3', '7'), + scan_chars!(input, '3', '6'), + scan_chars!(input, '3', '5'), + scan_chars!(input, '3', '4'), + scan_chars!(input, '3', '3'), + scan_chars!(input, '3', '1'), + scan_chars!(input, '3', '0'), + scan_chars!(input, '3'), + scan_chars!(input, '2', '9'), + scan_chars!(input, '2', '8'), + scan_chars!(input, '2', '7'), + scan_chars!(input, '2', '6'), + scan_chars!(input, '2', '5'), + scan_chars!(input, '2', '3'), + scan_chars!(input, '2', '2'), + scan_chars!(input, '2', '1'), + scan_chars!(input, '2', '0'), + scan_chars!(input, '2'), + scan_chars!(input, '1', '9'), + scan_chars!(input, '1', '8'), + scan_chars!(input, '1', '7'), + scan_chars!(input, '1', '5'), + scan_chars!(input, '1', '4'), + scan_chars!(input, '1', '3'), + scan_chars!(input, '1', '2'), + scan_chars!(input, '1', '1'), + scan_chars!(input, '1', '0'), + scan_chars!(input, '1'), + scan_chars!(input, '0') + ) + ) + } else { + false + } ) } #[allow(unused_assignments, unused_parens)] - fn unicode_string_literal(&self, input: &mut ParserContext) -> bool { - if self.version_is_at_least_0_7_0 { - scan_choice!( + fn uint_keyword(&self, input: &mut ParserContext) -> bool { + scan_sequence!( + scan_chars!(input, 'u', 'i', 'n', 't'), + scan_optional!( input, - self.single_quoted_unicode_string_literal(input), - self.double_quoted_unicode_string_literal(input) + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ) ) - } else { - false - } + ) } #[allow(unused_assignments, unused_parens)] - fn unsigned_fixed_type(&self, input: &mut ParserContext) -> bool { + fn unicode_escape(&self, input: &mut ParserContext) -> bool { scan_sequence!( - scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), - scan_optional!(input, self.fixed_type_size(input)) + scan_chars!(input, 'u'), + self.hex_character(input), + self.hex_character(input), + self.hex_character(input), + self.hex_character(input) ) } #[allow(unused_assignments, unused_parens)] - fn unsigned_integer_type(&self, input: &mut ParserContext) -> bool { - scan_sequence!( - scan_chars!(input, 'u', 'i', 'n', 't'), - scan_optional!(input, self.integer_type_size(input)) + fn unicode_string_literal(&self, input: &mut ParserContext) -> bool { + scan_choice!( + input, + if self.version_is_at_least_0_7_0 { + self.single_quoted_unicode_string_literal(input) + } else { + false + }, + if self.version_is_at_least_0_7_0 { + self.double_quoted_unicode_string_literal(input) + } else { + false + } ) } @@ -5552,6 +7818,52 @@ impl Language { ) } + #[allow(unused_assignments, unused_parens)] + fn yul_bytes_keyword(&self, input: &mut ParserContext) -> bool { + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'b', 'y', 't', 'e', 's'), + scan_choice!( + input, + scan_chars!(input, '9'), + scan_chars!(input, '8'), + scan_chars!(input, '7'), + scan_chars!(input, '6'), + scan_chars!(input, '5'), + scan_chars!(input, '4'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '3', '1'), + scan_chars!(input, '3', '0'), + scan_chars!(input, '3'), + scan_chars!(input, '2', '9'), + scan_chars!(input, '2', '8'), + scan_chars!(input, '2', '7'), + scan_chars!(input, '2', '6'), + scan_chars!(input, '2', '5'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3'), + scan_chars!(input, '2', '2'), + scan_chars!(input, '2', '1'), + scan_chars!(input, '2', '0'), + scan_chars!(input, '2'), + scan_chars!(input, '1', '9'), + scan_chars!(input, '1', '8'), + scan_chars!(input, '1', '7'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5'), + scan_chars!(input, '1', '4'), + scan_chars!(input, '1', '3'), + scan_chars!(input, '1', '2'), + scan_chars!(input, '1', '1'), + scan_chars!(input, '1', '0'), + scan_chars!(input, '1') + ) + ) + } else { + false + } + } + #[allow(unused_assignments, unused_parens)] fn yul_decimal_literal(&self, input: &mut ParserContext) -> bool { scan_not_followed_by!( @@ -5561,13 +7873,308 @@ impl Language { scan_chars!(input, '0'), scan_sequence!( scan_char_range!(input, '1', '9'), - scan_zero_or_more!(input, self.decimal_digit(input)) + scan_zero_or_more!(input, scan_char_range!(input, '0', '9')) ) ), self.identifier_start(input) ) } + #[allow(unused_assignments, unused_parens)] + fn yul_fixed_keyword(&self, input: &mut ParserContext) -> bool { + scan_choice!( + input, + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'f', 'i', 'x', 'e', 'd') + } else { + false + }, + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '6') + ) + ) + } else { + false + }, + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '4', '8', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '1', '6'), + scan_chars!(input, '2', '3', '2', 'x', '8'), + scan_chars!(input, '2', '3', '2', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '1', '6'), + scan_chars!(input, '2', '2', '4', 'x', '8'), + scan_chars!(input, '2', '2', '4', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '2', '4'), + scan_chars!(input, '2', '2', '4', 'x', '1', '6'), + scan_chars!(input, '2', '1', '6', 'x', '8'), + scan_chars!(input, '2', '1', '6', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '3', '2'), + scan_chars!(input, '2', '1', '6', 'x', '2', '4'), + scan_chars!(input, '2', '1', '6', 'x', '1', '6'), + scan_chars!(input, '2', '0', '8', 'x', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '0'), + scan_chars!(input, '2', '0', '8', 'x', '3', '2'), + scan_chars!(input, '2', '0', '8', 'x', '2', '4'), + scan_chars!(input, '2', '0', '8', 'x', '1', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8'), + scan_chars!(input, '2', '0', '0', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '4', '8'), + scan_chars!(input, '2', '0', '0', 'x', '4', '0'), + scan_chars!(input, '2', '0', '0', 'x', '3', '2'), + scan_chars!(input, '2', '0', '0', 'x', '2', '4'), + scan_chars!(input, '2', '0', '0', 'x', '1', '6'), + scan_chars!(input, '1', '9', '2', 'x', '8'), + scan_chars!(input, '1', '9', '2', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '5', '6'), + scan_chars!(input, '1', '9', '2', 'x', '4', '8'), + scan_chars!(input, '1', '9', '2', 'x', '4', '0'), + scan_chars!(input, '1', '9', '2', 'x', '3', '2'), + scan_chars!(input, '1', '9', '2', 'x', '2', '4'), + scan_chars!(input, '1', '9', '2', 'x', '1', '6'), + scan_chars!(input, '1', '8', '4', 'x', '8'), + scan_chars!(input, '1', '8', '4', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '6', '4'), + scan_chars!(input, '1', '8', '4', 'x', '5', '6'), + scan_chars!(input, '1', '8', '4', 'x', '4', '8'), + scan_chars!(input, '1', '8', '4', 'x', '4', '0'), + scan_chars!(input, '1', '8', '4', 'x', '3', '2'), + scan_chars!(input, '1', '8', '4', 'x', '2', '4'), + scan_chars!(input, '1', '8', '4', 'x', '1', '6') + ) + ) + } else { + false + }, + if self.version_is_at_least_0_4_14 && !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '5', '6', 'x', '8', '0'), + scan_chars!(input, '2', '5', '6', 'x', '8'), + scan_chars!(input, '2', '5', '6', 'x', '7', '2'), + scan_chars!(input, '2', '5', '6', 'x', '6', '4'), + scan_chars!(input, '2', '5', '6', 'x', '5', '6'), + scan_chars!(input, '2', '5', '6', 'x', '4', '8'), + scan_chars!(input, '2', '5', '6', 'x', '4', '0'), + scan_chars!(input, '2', '5', '6', 'x', '3', '2'), + scan_chars!(input, '2', '5', '6', 'x', '2', '4'), + scan_chars!(input, '2', '5', '6', 'x', '1', '6'), + scan_chars!(input, '2', '4', '8', 'x', '8', '0'), + scan_chars!(input, '2', '4', '8', 'x', '7', '2'), + scan_chars!(input, '2', '4', '8', 'x', '6', '4'), + scan_chars!(input, '2', '4', '8', 'x', '5', '6'), + scan_chars!(input, '2', '4', '8', 'x', '4', '8'), + scan_chars!(input, '2', '4', '8', 'x', '4', '0'), + scan_chars!(input, '2', '4', '8', 'x', '3', '2'), + scan_chars!(input, '2', '4', '8', 'x', '2', '4'), + scan_chars!(input, '2', '4', '8', 'x', '1', '6'), + scan_chars!(input, '2', '4', '0', 'x', '8', '0'), + scan_chars!(input, '2', '4', '0', 'x', '7', '2'), + scan_chars!(input, '2', '4', '0', 'x', '6', '4'), + scan_chars!(input, '2', '4', '0', 'x', '5', '6'), + scan_chars!(input, '2', '4', '0', 'x', '4', '8'), + scan_chars!(input, '2', '4', '0', 'x', '4', '0'), + scan_chars!(input, '2', '4', '0', 'x', '3', '2'), + scan_chars!(input, '2', '4', '0', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '8', '0'), + scan_chars!(input, '2', '3', '2', 'x', '7', '2'), + scan_chars!(input, '2', '3', '2', 'x', '6', '4'), + scan_chars!(input, '2', '3', '2', 'x', '5', '6'), + scan_chars!(input, '2', '3', '2', 'x', '4', '8'), + scan_chars!(input, '2', '3', '2', 'x', '4', '0'), + scan_chars!(input, '2', '3', '2', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '8', '0'), + scan_chars!(input, '2', '2', '4', 'x', '7', '2'), + scan_chars!(input, '2', '2', '4', 'x', '6', '4'), + scan_chars!(input, '2', '2', '4', 'x', '5', '6'), + scan_chars!(input, '2', '2', '4', 'x', '4', '8'), + scan_chars!(input, '2', '2', '4', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '8', '0'), + scan_chars!(input, '2', '1', '6', 'x', '7', '2'), + scan_chars!(input, '2', '1', '6', 'x', '6', '4'), + scan_chars!(input, '2', '1', '6', 'x', '5', '6'), + scan_chars!(input, '2', '1', '6', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '8', '0'), + scan_chars!(input, '2', '0', '8', 'x', '7', '2'), + scan_chars!(input, '2', '0', '8', 'x', '6', '4'), + scan_chars!(input, '2', '0', '8', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8', '0'), + scan_chars!(input, '2', '0', '0', 'x', '7', '2'), + scan_chars!(input, '2', '0', '0', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '8', '0'), + scan_chars!(input, '1', '9', '2', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '8', '0') + ) + ) + } else { + false + }, + if self.version_is_at_least_0_4_14 && !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '9'), + scan_chars!(input, '7', '9'), + scan_chars!(input, '7', '8'), + scan_chars!(input, '7', '7'), + scan_chars!(input, '7', '6'), + scan_chars!(input, '7', '5'), + scan_chars!(input, '7', '4'), + scan_chars!(input, '7', '3'), + scan_chars!(input, '7', '1'), + scan_chars!(input, '7', '0'), + scan_chars!(input, '7'), + scan_chars!(input, '6', '9'), + scan_chars!(input, '6', '8'), + scan_chars!(input, '6', '7'), + scan_chars!(input, '6', '6'), + scan_chars!(input, '6', '5'), + scan_chars!(input, '6', '3'), + scan_chars!(input, '6', '2'), + scan_chars!(input, '6', '1'), + scan_chars!(input, '6', '0'), + scan_chars!(input, '6'), + scan_chars!(input, '5', '9'), + scan_chars!(input, '5', '8'), + scan_chars!(input, '5', '7'), + scan_chars!(input, '5', '5'), + scan_chars!(input, '5', '4'), + scan_chars!(input, '5', '3'), + scan_chars!(input, '5', '2'), + scan_chars!(input, '5', '1'), + scan_chars!(input, '5', '0'), + scan_chars!(input, '5'), + scan_chars!(input, '4', '9'), + scan_chars!(input, '4', '7'), + scan_chars!(input, '4', '6'), + scan_chars!(input, '4', '5'), + scan_chars!(input, '4', '4'), + scan_chars!(input, '4', '3'), + scan_chars!(input, '4', '2'), + scan_chars!(input, '4', '1'), + scan_chars!(input, '4'), + scan_chars!(input, '3', '9'), + scan_chars!(input, '3', '8'), + scan_chars!(input, '3', '7'), + scan_chars!(input, '3', '6'), + scan_chars!(input, '3', '5'), + scan_chars!(input, '3', '4'), + scan_chars!(input, '3', '3'), + scan_chars!(input, '3', '1'), + scan_chars!(input, '3', '0'), + scan_chars!(input, '3'), + scan_chars!(input, '2', '9'), + scan_chars!(input, '2', '8'), + scan_chars!(input, '2', '7'), + scan_chars!(input, '2', '6'), + scan_chars!(input, '2', '5'), + scan_chars!(input, '2', '3'), + scan_chars!(input, '2', '2'), + scan_chars!(input, '2', '1'), + scan_chars!(input, '2', '0'), + scan_chars!(input, '2'), + scan_chars!(input, '1', '9'), + scan_chars!(input, '1', '8'), + scan_chars!(input, '1', '7'), + scan_chars!(input, '1', '5'), + scan_chars!(input, '1', '4'), + scan_chars!(input, '1', '3'), + scan_chars!(input, '1', '2'), + scan_chars!(input, '1', '1'), + scan_chars!(input, '1', '0'), + scan_chars!(input, '1'), + scan_chars!(input, '0') + ) + ) + } else { + false + } + ) + } + #[allow(unused_assignments, unused_parens)] fn yul_hex_literal(&self, input: &mut ParserContext) -> bool { scan_not_followed_by!( @@ -5585,130 +8192,590 @@ impl Language { self.raw_identifier(input) } + #[allow(unused_assignments, unused_parens)] + fn yul_int_keyword(&self, input: &mut ParserContext) -> bool { + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'i', 'n', 't'), + scan_optional!( + input, + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ) + ) + ) + } else { + false + } + } + + #[allow(unused_assignments, unused_parens)] + fn yul_ufixed_keyword(&self, input: &mut ParserContext) -> bool { + scan_choice!( + input, + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd') + } else { + false + }, + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '1', '6') + ) + ) + } else { + false + }, + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '4', '8', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '8'), + scan_chars!(input, '2', '4', '0', 'x', '1', '6'), + scan_chars!(input, '2', '3', '2', 'x', '8'), + scan_chars!(input, '2', '3', '2', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '1', '6'), + scan_chars!(input, '2', '2', '4', 'x', '8'), + scan_chars!(input, '2', '2', '4', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '2', '4'), + scan_chars!(input, '2', '2', '4', 'x', '1', '6'), + scan_chars!(input, '2', '1', '6', 'x', '8'), + scan_chars!(input, '2', '1', '6', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '3', '2'), + scan_chars!(input, '2', '1', '6', 'x', '2', '4'), + scan_chars!(input, '2', '1', '6', 'x', '1', '6'), + scan_chars!(input, '2', '0', '8', 'x', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '4', '0'), + scan_chars!(input, '2', '0', '8', 'x', '3', '2'), + scan_chars!(input, '2', '0', '8', 'x', '2', '4'), + scan_chars!(input, '2', '0', '8', 'x', '1', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8'), + scan_chars!(input, '2', '0', '0', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '4', '8'), + scan_chars!(input, '2', '0', '0', 'x', '4', '0'), + scan_chars!(input, '2', '0', '0', 'x', '3', '2'), + scan_chars!(input, '2', '0', '0', 'x', '2', '4'), + scan_chars!(input, '2', '0', '0', 'x', '1', '6'), + scan_chars!(input, '1', '9', '2', 'x', '8'), + scan_chars!(input, '1', '9', '2', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '5', '6'), + scan_chars!(input, '1', '9', '2', 'x', '4', '8'), + scan_chars!(input, '1', '9', '2', 'x', '4', '0'), + scan_chars!(input, '1', '9', '2', 'x', '3', '2'), + scan_chars!(input, '1', '9', '2', 'x', '2', '4'), + scan_chars!(input, '1', '9', '2', 'x', '1', '6'), + scan_chars!(input, '1', '8', '4', 'x', '8'), + scan_chars!(input, '1', '8', '4', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '6', '4'), + scan_chars!(input, '1', '8', '4', 'x', '5', '6'), + scan_chars!(input, '1', '8', '4', 'x', '4', '8'), + scan_chars!(input, '1', '8', '4', 'x', '4', '0'), + scan_chars!(input, '1', '8', '4', 'x', '3', '2'), + scan_chars!(input, '1', '8', '4', 'x', '2', '4'), + scan_chars!(input, '1', '8', '4', 'x', '1', '6') + ) + ) + } else { + false + }, + if self.version_is_at_least_0_4_14 && !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '2', '5', '6', 'x', '8', '0'), + scan_chars!(input, '2', '5', '6', 'x', '8'), + scan_chars!(input, '2', '5', '6', 'x', '7', '2'), + scan_chars!(input, '2', '5', '6', 'x', '6', '4'), + scan_chars!(input, '2', '5', '6', 'x', '5', '6'), + scan_chars!(input, '2', '5', '6', 'x', '4', '8'), + scan_chars!(input, '2', '5', '6', 'x', '4', '0'), + scan_chars!(input, '2', '5', '6', 'x', '3', '2'), + scan_chars!(input, '2', '5', '6', 'x', '2', '4'), + scan_chars!(input, '2', '5', '6', 'x', '1', '6'), + scan_chars!(input, '2', '4', '8', 'x', '8', '0'), + scan_chars!(input, '2', '4', '8', 'x', '7', '2'), + scan_chars!(input, '2', '4', '8', 'x', '6', '4'), + scan_chars!(input, '2', '4', '8', 'x', '5', '6'), + scan_chars!(input, '2', '4', '8', 'x', '4', '8'), + scan_chars!(input, '2', '4', '8', 'x', '4', '0'), + scan_chars!(input, '2', '4', '8', 'x', '3', '2'), + scan_chars!(input, '2', '4', '8', 'x', '2', '4'), + scan_chars!(input, '2', '4', '8', 'x', '1', '6'), + scan_chars!(input, '2', '4', '0', 'x', '8', '0'), + scan_chars!(input, '2', '4', '0', 'x', '7', '2'), + scan_chars!(input, '2', '4', '0', 'x', '6', '4'), + scan_chars!(input, '2', '4', '0', 'x', '5', '6'), + scan_chars!(input, '2', '4', '0', 'x', '4', '8'), + scan_chars!(input, '2', '4', '0', 'x', '4', '0'), + scan_chars!(input, '2', '4', '0', 'x', '3', '2'), + scan_chars!(input, '2', '4', '0', 'x', '2', '4'), + scan_chars!(input, '2', '3', '2', 'x', '8', '0'), + scan_chars!(input, '2', '3', '2', 'x', '7', '2'), + scan_chars!(input, '2', '3', '2', 'x', '6', '4'), + scan_chars!(input, '2', '3', '2', 'x', '5', '6'), + scan_chars!(input, '2', '3', '2', 'x', '4', '8'), + scan_chars!(input, '2', '3', '2', 'x', '4', '0'), + scan_chars!(input, '2', '3', '2', 'x', '3', '2'), + scan_chars!(input, '2', '2', '4', 'x', '8', '0'), + scan_chars!(input, '2', '2', '4', 'x', '7', '2'), + scan_chars!(input, '2', '2', '4', 'x', '6', '4'), + scan_chars!(input, '2', '2', '4', 'x', '5', '6'), + scan_chars!(input, '2', '2', '4', 'x', '4', '8'), + scan_chars!(input, '2', '2', '4', 'x', '4', '0'), + scan_chars!(input, '2', '1', '6', 'x', '8', '0'), + scan_chars!(input, '2', '1', '6', 'x', '7', '2'), + scan_chars!(input, '2', '1', '6', 'x', '6', '4'), + scan_chars!(input, '2', '1', '6', 'x', '5', '6'), + scan_chars!(input, '2', '1', '6', 'x', '4', '8'), + scan_chars!(input, '2', '0', '8', 'x', '8', '0'), + scan_chars!(input, '2', '0', '8', 'x', '7', '2'), + scan_chars!(input, '2', '0', '8', 'x', '6', '4'), + scan_chars!(input, '2', '0', '8', 'x', '5', '6'), + scan_chars!(input, '2', '0', '0', 'x', '8', '0'), + scan_chars!(input, '2', '0', '0', 'x', '7', '2'), + scan_chars!(input, '2', '0', '0', 'x', '6', '4'), + scan_chars!(input, '1', '9', '2', 'x', '8', '0'), + scan_chars!(input, '1', '9', '2', 'x', '7', '2'), + scan_chars!(input, '1', '8', '4', 'x', '8', '0') + ) + ) + } else { + false + }, + if self.version_is_at_least_0_4_14 && !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'u', 'f', 'i', 'x', 'e', 'd'), + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ), + scan_chars!(input, 'x'), + scan_choice!( + input, + scan_chars!(input, '9'), + scan_chars!(input, '7', '9'), + scan_chars!(input, '7', '8'), + scan_chars!(input, '7', '7'), + scan_chars!(input, '7', '6'), + scan_chars!(input, '7', '5'), + scan_chars!(input, '7', '4'), + scan_chars!(input, '7', '3'), + scan_chars!(input, '7', '1'), + scan_chars!(input, '7', '0'), + scan_chars!(input, '7'), + scan_chars!(input, '6', '9'), + scan_chars!(input, '6', '8'), + scan_chars!(input, '6', '7'), + scan_chars!(input, '6', '6'), + scan_chars!(input, '6', '5'), + scan_chars!(input, '6', '3'), + scan_chars!(input, '6', '2'), + scan_chars!(input, '6', '1'), + scan_chars!(input, '6', '0'), + scan_chars!(input, '6'), + scan_chars!(input, '5', '9'), + scan_chars!(input, '5', '8'), + scan_chars!(input, '5', '7'), + scan_chars!(input, '5', '5'), + scan_chars!(input, '5', '4'), + scan_chars!(input, '5', '3'), + scan_chars!(input, '5', '2'), + scan_chars!(input, '5', '1'), + scan_chars!(input, '5', '0'), + scan_chars!(input, '5'), + scan_chars!(input, '4', '9'), + scan_chars!(input, '4', '7'), + scan_chars!(input, '4', '6'), + scan_chars!(input, '4', '5'), + scan_chars!(input, '4', '4'), + scan_chars!(input, '4', '3'), + scan_chars!(input, '4', '2'), + scan_chars!(input, '4', '1'), + scan_chars!(input, '4'), + scan_chars!(input, '3', '9'), + scan_chars!(input, '3', '8'), + scan_chars!(input, '3', '7'), + scan_chars!(input, '3', '6'), + scan_chars!(input, '3', '5'), + scan_chars!(input, '3', '4'), + scan_chars!(input, '3', '3'), + scan_chars!(input, '3', '1'), + scan_chars!(input, '3', '0'), + scan_chars!(input, '3'), + scan_chars!(input, '2', '9'), + scan_chars!(input, '2', '8'), + scan_chars!(input, '2', '7'), + scan_chars!(input, '2', '6'), + scan_chars!(input, '2', '5'), + scan_chars!(input, '2', '3'), + scan_chars!(input, '2', '2'), + scan_chars!(input, '2', '1'), + scan_chars!(input, '2', '0'), + scan_chars!(input, '2'), + scan_chars!(input, '1', '9'), + scan_chars!(input, '1', '8'), + scan_chars!(input, '1', '7'), + scan_chars!(input, '1', '5'), + scan_chars!(input, '1', '4'), + scan_chars!(input, '1', '3'), + scan_chars!(input, '1', '2'), + scan_chars!(input, '1', '1'), + scan_chars!(input, '1', '0'), + scan_chars!(input, '1'), + scan_chars!(input, '0') + ) + ) + } else { + false + } + ) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_uint_keyword(&self, input: &mut ParserContext) -> bool { + if !self.version_is_at_least_0_7_1 { + scan_sequence!( + scan_chars!(input, 'u', 'i', 'n', 't'), + scan_optional!( + input, + scan_choice!( + input, + scan_chars!(input, '9', '6'), + scan_chars!(input, '8', '8'), + scan_chars!(input, '8', '0'), + scan_chars!(input, '8'), + scan_chars!(input, '7', '2'), + scan_chars!(input, '6', '4'), + scan_chars!(input, '5', '6'), + scan_chars!(input, '4', '8'), + scan_chars!(input, '4', '0'), + scan_chars!(input, '3', '2'), + scan_chars!(input, '2', '5', '6'), + scan_chars!(input, '2', '4', '8'), + scan_chars!(input, '2', '4', '0'), + scan_chars!(input, '2', '4'), + scan_chars!(input, '2', '3', '2'), + scan_chars!(input, '2', '2', '4'), + scan_chars!(input, '2', '1', '6'), + scan_chars!(input, '2', '0', '8'), + scan_chars!(input, '2', '0', '0'), + scan_chars!(input, '1', '9', '2'), + scan_chars!(input, '1', '8', '4'), + scan_chars!(input, '1', '7', '6'), + scan_chars!(input, '1', '6', '8'), + scan_chars!(input, '1', '6', '0'), + scan_chars!(input, '1', '6'), + scan_chars!(input, '1', '5', '2'), + scan_chars!(input, '1', '4', '4'), + scan_chars!(input, '1', '3', '6'), + scan_chars!(input, '1', '2', '8'), + scan_chars!(input, '1', '2', '0'), + scan_chars!(input, '1', '1', '2'), + scan_chars!(input, '1', '0', '4') + ) + ) + ) + } else { + false + } + } + pub fn scan(&self, lexical_context: LexicalContext, input: &str) -> Option { let mut input = ParserContext::new(input); match lexical_context { LexicalContext::Default => { Lexer::next_token::(self, &mut input) } - LexicalContext::VersionPragma => { - Lexer::next_token::(self, &mut input) - } - LexicalContext::YulBlock => { - Lexer::next_token::(self, &mut input) + LexicalContext::Pragma => { + Lexer::next_token::(self, &mut input) } + LexicalContext::Yul => Lexer::next_token::(self, &mut input), } } pub fn parse(&self, production_kind: ProductionKind, input: &str) -> ParseOutput { match production_kind { ProductionKind::ABICoderPragma => Self::abi_coder_pragma.parse(self, input), + ProductionKind::AdditiveExpression => Self::additive_expression.parse(self, input), ProductionKind::AddressType => Self::address_type.parse(self, input), + ProductionKind::AndExpression => Self::and_expression.parse(self, input), ProductionKind::ArgumentsDeclaration => Self::arguments_declaration.parse(self, input), ProductionKind::ArrayExpression => Self::array_expression.parse(self, input), - ProductionKind::ArrayValuesList => Self::array_values_list.parse(self, input), - ProductionKind::AsciiStringLiteralsList => { - Self::ascii_string_literals_list.parse(self, input) + ProductionKind::ArrayTypeName => Self::array_type_name.parse(self, input), + ProductionKind::ArrayValues => Self::array_values.parse(self, input), + ProductionKind::AsciiStringLiterals => Self::ascii_string_literals.parse(self, input), + ProductionKind::AssemblyFlags => Self::assembly_flags.parse(self, input), + ProductionKind::AssemblyFlagsDeclaration => { + Self::assembly_flags_declaration.parse(self, input) } - ProductionKind::AssemblyFlagsList => Self::assembly_flags_list.parse(self, input), ProductionKind::AssemblyStatement => Self::assembly_statement.parse(self, input), + ProductionKind::AssignmentExpression => Self::assignment_expression.parse(self, input), + ProductionKind::BitwiseAndExpression => Self::bitwise_and_expression.parse(self, input), + ProductionKind::BitwiseOrExpression => Self::bitwise_or_expression.parse(self, input), + ProductionKind::BitwiseXorExpression => Self::bitwise_xor_expression.parse(self, input), ProductionKind::Block => Self::block.parse(self, input), ProductionKind::BreakStatement => Self::break_statement.parse(self, input), ProductionKind::CatchClause => Self::catch_clause.parse(self, input), ProductionKind::CatchClauseError => Self::catch_clause_error.parse(self, input), - ProductionKind::CatchClausesList => Self::catch_clauses_list.parse(self, input), + ProductionKind::CatchClauses => Self::catch_clauses.parse(self, input), + ProductionKind::ComparisonExpression => Self::comparison_expression.parse(self, input), + ProductionKind::ConditionalExpression => { + Self::conditional_expression.parse(self, input) + } ProductionKind::ConstantDefinition => Self::constant_definition.parse(self, input), - ProductionKind::ConstructorAttributesList => { - Self::constructor_attributes_list.parse(self, input) + ProductionKind::ConstructorAttribute => Self::constructor_attribute.parse(self, input), + ProductionKind::ConstructorAttributes => { + Self::constructor_attributes.parse(self, input) } ProductionKind::ConstructorDefinition => { Self::constructor_definition.parse(self, input) } ProductionKind::ContinueStatement => Self::continue_statement.parse(self, input), ProductionKind::ContractDefinition => Self::contract_definition.parse(self, input), - ProductionKind::ContractMembersList => Self::contract_members_list.parse(self, input), - ProductionKind::DeconstructionImport => Self::deconstruction_import.parse(self, input), - ProductionKind::DeconstructionImportSymbol => { - Self::deconstruction_import_symbol.parse(self, input) - } - ProductionKind::DeconstructionImportSymbolsList => { - Self::deconstruction_import_symbols_list.parse(self, input) + ProductionKind::ContractMember => Self::contract_member.parse(self, input), + ProductionKind::ContractMembers => Self::contract_members.parse(self, input), + ProductionKind::DecimalNumberExpression => { + Self::decimal_number_expression.parse(self, input) } + ProductionKind::DefaultAllKeywords => Self::default_all_keywords.parse(self, input), ProductionKind::DeleteStatement => Self::delete_statement.parse(self, input), ProductionKind::DoWhileStatement => Self::do_while_statement.parse(self, input), + ProductionKind::ElementaryType => Self::elementary_type.parse(self, input), + ProductionKind::ElseBranch => Self::else_branch.parse(self, input), ProductionKind::EmitStatement => Self::emit_statement.parse(self, input), - ProductionKind::EndOfFileTrivia => Self::end_of_file_trivia.parse(self, input), ProductionKind::EnumDefinition => Self::enum_definition.parse(self, input), + ProductionKind::EnumMembers => Self::enum_members.parse(self, input), + ProductionKind::EqualityExpression => Self::equality_expression.parse(self, input), ProductionKind::ErrorDefinition => Self::error_definition.parse(self, input), ProductionKind::ErrorParameter => Self::error_parameter.parse(self, input), - ProductionKind::ErrorParametersList => Self::error_parameters_list.parse(self, input), + ProductionKind::ErrorParameters => Self::error_parameters.parse(self, input), + ProductionKind::ErrorParametersDeclaration => { + Self::error_parameters_declaration.parse(self, input) + } ProductionKind::EventDefinition => Self::event_definition.parse(self, input), ProductionKind::EventParameter => Self::event_parameter.parse(self, input), - ProductionKind::EventParametersList => Self::event_parameters_list.parse(self, input), + ProductionKind::EventParameters => Self::event_parameters.parse(self, input), + ProductionKind::EventParametersDeclaration => { + Self::event_parameters_declaration.parse(self, input) + } + ProductionKind::ExperimentalFeature => Self::experimental_feature.parse(self, input), ProductionKind::ExperimentalPragma => Self::experimental_pragma.parse(self, input), + ProductionKind::ExponentiationExpression => { + Self::exponentiation_expression.parse(self, input) + } ProductionKind::Expression => Self::expression.parse(self, input), ProductionKind::ExpressionStatement => Self::expression_statement.parse(self, input), - ProductionKind::FallbackFunctionAttributesList => { - Self::fallback_function_attributes_list.parse(self, input) + ProductionKind::FallbackFunctionAttribute => { + Self::fallback_function_attribute.parse(self, input) + } + ProductionKind::FallbackFunctionAttributes => { + Self::fallback_function_attributes.parse(self, input) } ProductionKind::FallbackFunctionDefinition => { Self::fallback_function_definition.parse(self, input) } ProductionKind::ForStatement => Self::for_statement.parse(self, input), - ProductionKind::FunctionAttributesList => { - Self::function_attributes_list.parse(self, input) + ProductionKind::ForStatementCondition => { + Self::for_statement_condition.parse(self, input) + } + ProductionKind::ForStatementInitialization => { + Self::for_statement_initialization.parse(self, input) + } + ProductionKind::FunctionAttribute => Self::function_attribute.parse(self, input), + ProductionKind::FunctionAttributes => Self::function_attributes.parse(self, input), + ProductionKind::FunctionBody => Self::function_body.parse(self, input), + ProductionKind::FunctionCallExpression => { + Self::function_call_expression.parse(self, input) } ProductionKind::FunctionCallOptions => Self::function_call_options.parse(self, input), ProductionKind::FunctionDefinition => Self::function_definition.parse(self, input), ProductionKind::FunctionType => Self::function_type.parse(self, input), - ProductionKind::FunctionTypeAttributesList => { - Self::function_type_attributes_list.parse(self, input) + ProductionKind::FunctionTypeAttribute => { + Self::function_type_attribute.parse(self, input) } - ProductionKind::HexStringLiteralsList => { - Self::hex_string_literals_list.parse(self, input) + ProductionKind::FunctionTypeAttributes => { + Self::function_type_attributes.parse(self, input) } + ProductionKind::HexNumberExpression => Self::hex_number_expression.parse(self, input), + ProductionKind::HexStringLiterals => Self::hex_string_literals.parse(self, input), ProductionKind::IdentifierPath => Self::identifier_path.parse(self, input), - ProductionKind::IdentifierPathsList => Self::identifier_paths_list.parse(self, input), - ProductionKind::IdentifiersList => Self::identifiers_list.parse(self, input), ProductionKind::IfStatement => Self::if_statement.parse(self, input), + ProductionKind::ImportAlias => Self::import_alias.parse(self, input), + ProductionKind::ImportDeconstructionField => { + Self::import_deconstruction_field.parse(self, input) + } + ProductionKind::ImportDeconstructionFields => { + Self::import_deconstruction_fields.parse(self, input) + } ProductionKind::ImportDirective => Self::import_directive.parse(self, input), + ProductionKind::ImportSymbol => Self::import_symbol.parse(self, input), + ProductionKind::ImportSymbolDeconstruction => { + Self::import_symbol_deconstruction.parse(self, input) + } + ProductionKind::IndexAccessEnd => Self::index_access_end.parse(self, input), + ProductionKind::IndexAccessExpression => { + Self::index_access_expression.parse(self, input) + } ProductionKind::InheritanceSpecifier => Self::inheritance_specifier.parse(self, input), ProductionKind::InheritanceType => Self::inheritance_type.parse(self, input), - ProductionKind::InheritanceTypesList => Self::inheritance_types_list.parse(self, input), + ProductionKind::InheritanceTypes => Self::inheritance_types.parse(self, input), ProductionKind::InterfaceDefinition => Self::interface_definition.parse(self, input), - ProductionKind::InterfaceMembersList => Self::interface_members_list.parse(self, input), + ProductionKind::InterfaceMembers => Self::interface_members.parse(self, input), ProductionKind::LeadingTrivia => Self::leading_trivia.parse(self, input), ProductionKind::LibraryDefinition => Self::library_definition.parse(self, input), - ProductionKind::LibraryMembersList => Self::library_members_list.parse(self, input), + ProductionKind::LibraryMembers => Self::library_members.parse(self, input), + ProductionKind::MappingKey => Self::mapping_key.parse(self, input), ProductionKind::MappingKeyType => Self::mapping_key_type.parse(self, input), ProductionKind::MappingType => Self::mapping_type.parse(self, input), - ProductionKind::MappingValueType => Self::mapping_value_type.parse(self, input), - ProductionKind::ModifierAttributesList => { - Self::modifier_attributes_list.parse(self, input) + ProductionKind::MappingValue => Self::mapping_value.parse(self, input), + ProductionKind::MemberAccessExpression => { + Self::member_access_expression.parse(self, input) } + ProductionKind::ModifierAttribute => Self::modifier_attribute.parse(self, input), + ProductionKind::ModifierAttributes => Self::modifier_attributes.parse(self, input), ProductionKind::ModifierDefinition => Self::modifier_definition.parse(self, input), ProductionKind::ModifierInvocation => Self::modifier_invocation.parse(self, input), + ProductionKind::MultiplicativeExpression => { + Self::multiplicative_expression.parse(self, input) + } ProductionKind::NamedArgument => Self::named_argument.parse(self, input), + ProductionKind::NamedArgumentGroup => Self::named_argument_group.parse(self, input), + ProductionKind::NamedArgumentGroups => Self::named_argument_groups.parse(self, input), + ProductionKind::NamedArguments => Self::named_arguments.parse(self, input), ProductionKind::NamedArgumentsDeclaration => { Self::named_arguments_declaration.parse(self, input) } - ProductionKind::NamedArgumentsList => Self::named_arguments_list.parse(self, input), - ProductionKind::NamedImport => Self::named_import.parse(self, input), + ProductionKind::NamedImportSymbol => Self::named_import_symbol.parse(self, input), ProductionKind::NewExpression => Self::new_expression.parse(self, input), - ProductionKind::NumericExpression => Self::numeric_expression.parse(self, input), + ProductionKind::NumberUnit => Self::number_unit.parse(self, input), + ProductionKind::OrExpression => Self::or_expression.parse(self, input), + ProductionKind::OverridePaths => Self::override_paths.parse(self, input), ProductionKind::OverrideSpecifier => Self::override_specifier.parse(self, input), ProductionKind::Parameter => Self::parameter.parse(self, input), + ProductionKind::Parameters => Self::parameters.parse(self, input), ProductionKind::ParametersDeclaration => { Self::parameters_declaration.parse(self, input) } - ProductionKind::ParametersList => Self::parameters_list.parse(self, input), - ProductionKind::PathImport => Self::path_import.parse(self, input), - ProductionKind::PositionalArgumentsList => { - Self::positional_arguments_list.parse(self, input) + ProductionKind::PathImportSymbol => Self::path_import_symbol.parse(self, input), + ProductionKind::PositionalArguments => Self::positional_arguments.parse(self, input), + ProductionKind::PositionalArgumentsDeclaration => { + Self::positional_arguments_declaration.parse(self, input) } + ProductionKind::PostfixExpression => Self::postfix_expression.parse(self, input), + ProductionKind::Pragma => Self::pragma.parse(self, input), + ProductionKind::PragmaAllKeywords => Self::pragma_all_keywords.parse(self, input), ProductionKind::PragmaDirective => Self::pragma_directive.parse(self, input), - ProductionKind::ReceiveFunctionAttributesList => { - Self::receive_function_attributes_list.parse(self, input) + ProductionKind::PrefixExpression => Self::prefix_expression.parse(self, input), + ProductionKind::ReceiveFunctionAttribute => { + Self::receive_function_attribute.parse(self, input) + } + ProductionKind::ReceiveFunctionAttributes => { + Self::receive_function_attributes.parse(self, input) } ProductionKind::ReceiveFunctionDefinition => { Self::receive_function_definition.parse(self, input) @@ -5716,21 +8783,29 @@ impl Language { ProductionKind::ReturnStatement => Self::return_statement.parse(self, input), ProductionKind::ReturnsDeclaration => Self::returns_declaration.parse(self, input), ProductionKind::RevertStatement => Self::revert_statement.parse(self, input), + ProductionKind::ShiftExpression => Self::shift_expression.parse(self, input), ProductionKind::SourceUnit => Self::source_unit.parse(self, input), - ProductionKind::SourceUnitMembersList => { - Self::source_unit_members_list.parse(self, input) + ProductionKind::SourceUnitMember => Self::source_unit_member.parse(self, input), + ProductionKind::SourceUnitMembers => Self::source_unit_members.parse(self, input), + ProductionKind::StateVariableAttribute => { + Self::state_variable_attribute.parse(self, input) } - ProductionKind::StateVariableAttributesList => { - Self::state_variable_attributes_list.parse(self, input) + ProductionKind::StateVariableAttributes => { + Self::state_variable_attributes.parse(self, input) } ProductionKind::StateVariableDefinition => { Self::state_variable_definition.parse(self, input) } + ProductionKind::StateVariableDefinitionValue => { + Self::state_variable_definition_value.parse(self, input) + } ProductionKind::Statement => Self::statement.parse(self, input), - ProductionKind::StatementsList => Self::statements_list.parse(self, input), + ProductionKind::Statements => Self::statements.parse(self, input), + ProductionKind::StorageLocation => Self::storage_location.parse(self, input), + ProductionKind::StringExpression => Self::string_expression.parse(self, input), ProductionKind::StructDefinition => Self::struct_definition.parse(self, input), ProductionKind::StructMember => Self::struct_member.parse(self, input), - ProductionKind::StructMembersList => Self::struct_members_list.parse(self, input), + ProductionKind::StructMembers => Self::struct_members.parse(self, input), ProductionKind::ThrowStatement => Self::throw_statement.parse(self, input), ProductionKind::TrailingTrivia => Self::trailing_trivia.parse(self, input), ProductionKind::TryStatement => Self::try_statement.parse(self, input), @@ -5739,115 +8814,1125 @@ impl Language { } ProductionKind::TupleExpression => Self::tuple_expression.parse(self, input), ProductionKind::TupleMember => Self::tuple_member.parse(self, input), - ProductionKind::TupleMembersList => Self::tuple_members_list.parse(self, input), - ProductionKind::TupleValuesList => Self::tuple_values_list.parse(self, input), + ProductionKind::TupleMemberDeconstruction => { + Self::tuple_member_deconstruction.parse(self, input) + } + ProductionKind::TupleMembersDeconstruction => { + Self::tuple_members_deconstruction.parse(self, input) + } + ProductionKind::TupleValue => Self::tuple_value.parse(self, input), + ProductionKind::TupleValues => Self::tuple_values.parse(self, input), ProductionKind::TypeExpression => Self::type_expression.parse(self, input), ProductionKind::TypeName => Self::type_name.parse(self, input), + ProductionKind::TypedTupleMember => Self::typed_tuple_member.parse(self, input), ProductionKind::UncheckedBlock => Self::unchecked_block.parse(self, input), - ProductionKind::UnicodeStringLiteralsList => { - Self::unicode_string_literals_list.parse(self, input) + ProductionKind::UnicodeStringLiterals => { + Self::unicode_string_literals.parse(self, input) } - ProductionKind::UnnamedFunctionAttributesList => { - Self::unnamed_function_attributes_list.parse(self, input) + ProductionKind::UnnamedFunctionAttribute => { + Self::unnamed_function_attribute.parse(self, input) + } + ProductionKind::UnnamedFunctionAttributes => { + Self::unnamed_function_attributes.parse(self, input) } ProductionKind::UnnamedFunctionDefinition => { Self::unnamed_function_definition.parse(self, input) } + ProductionKind::UntypedTupleMember => Self::untyped_tuple_member.parse(self, input), ProductionKind::UserDefinedValueTypeDefinition => { Self::user_defined_value_type_definition.parse(self, input) } - ProductionKind::UsingDirective => Self::using_directive.parse(self, input), - ProductionKind::UsingDirectiveDeconstruction => { - Self::using_directive_deconstruction.parse(self, input) + ProductionKind::UsingAlias => Self::using_alias.parse(self, input), + ProductionKind::UsingDeconstructionField => { + Self::using_deconstruction_field.parse(self, input) } - ProductionKind::UsingDirectivePath => Self::using_directive_path.parse(self, input), - ProductionKind::UsingDirectiveSymbol => Self::using_directive_symbol.parse(self, input), - ProductionKind::UsingDirectiveSymbolsList => { - Self::using_directive_symbols_list.parse(self, input) + ProductionKind::UsingDeconstructionFields => { + Self::using_deconstruction_fields.parse(self, input) + } + ProductionKind::UsingDirective => Self::using_directive.parse(self, input), + ProductionKind::UsingSymbol => Self::using_symbol.parse(self, input), + ProductionKind::UsingSymbolDeconstruction => { + Self::using_symbol_deconstruction.parse(self, input) } - ProductionKind::VariableDeclaration => Self::variable_declaration.parse(self, input), + ProductionKind::UsingTarget => Self::using_target.parse(self, input), ProductionKind::VariableDeclarationStatement => { Self::variable_declaration_statement.parse(self, input) } + ProductionKind::VariableDeclarationType => { + Self::variable_declaration_type.parse(self, input) + } + ProductionKind::VariableDeclarationValue => { + Self::variable_declaration_value.parse(self, input) + } ProductionKind::VersionPragma => Self::version_pragma.parse(self, input), ProductionKind::VersionPragmaExpression => { Self::version_pragma_expression.parse(self, input) } - ProductionKind::VersionPragmaExpressionsList => { - Self::version_pragma_expressions_list.parse(self, input) + ProductionKind::VersionPragmaExpressions => { + Self::version_pragma_expressions.parse(self, input) + } + ProductionKind::VersionPragmaOrExpression => { + Self::version_pragma_or_expression.parse(self, input) + } + ProductionKind::VersionPragmaPrefixExpression => { + Self::version_pragma_prefix_expression.parse(self, input) + } + ProductionKind::VersionPragmaRangeExpression => { + Self::version_pragma_range_expression.parse(self, input) } ProductionKind::VersionPragmaSpecifier => { Self::version_pragma_specifier.parse(self, input) } ProductionKind::WhileStatement => Self::while_statement.parse(self, input), + ProductionKind::YulAllKeywords => Self::yul_all_keywords.parse(self, input), + ProductionKind::YulArguments => Self::yul_arguments.parse(self, input), ProductionKind::YulAssignmentStatement => { Self::yul_assignment_statement.parse(self, input) } ProductionKind::YulBlock => Self::yul_block.parse(self, input), ProductionKind::YulBreakStatement => Self::yul_break_statement.parse(self, input), ProductionKind::YulContinueStatement => Self::yul_continue_statement.parse(self, input), - ProductionKind::YulDeclarationStatement => { - Self::yul_declaration_statement.parse(self, input) - } + ProductionKind::YulDefaultCase => Self::yul_default_case.parse(self, input), ProductionKind::YulExpression => Self::yul_expression.parse(self, input), - ProductionKind::YulExpressionsList => Self::yul_expressions_list.parse(self, input), ProductionKind::YulForStatement => Self::yul_for_statement.parse(self, input), + ProductionKind::YulFunctionCallExpression => { + Self::yul_function_call_expression.parse(self, input) + } ProductionKind::YulFunctionDefinition => { Self::yul_function_definition.parse(self, input) } ProductionKind::YulIdentifierPath => Self::yul_identifier_path.parse(self, input), - ProductionKind::YulIdentifierPathsList => { - Self::yul_identifier_paths_list.parse(self, input) - } - ProductionKind::YulIdentifiersList => Self::yul_identifiers_list.parse(self, input), + ProductionKind::YulIdentifierPaths => Self::yul_identifier_paths.parse(self, input), ProductionKind::YulIfStatement => Self::yul_if_statement.parse(self, input), ProductionKind::YulLeaveStatement => Self::yul_leave_statement.parse(self, input), + ProductionKind::YulLiteral => Self::yul_literal.parse(self, input), + ProductionKind::YulParameters => Self::yul_parameters.parse(self, input), ProductionKind::YulParametersDeclaration => { Self::yul_parameters_declaration.parse(self, input) } + ProductionKind::YulReturnVariables => Self::yul_return_variables.parse(self, input), ProductionKind::YulReturnsDeclaration => { Self::yul_returns_declaration.parse(self, input) } ProductionKind::YulStatement => Self::yul_statement.parse(self, input), - ProductionKind::YulStatementsList => Self::yul_statements_list.parse(self, input), + ProductionKind::YulStatements => Self::yul_statements.parse(self, input), ProductionKind::YulSwitchCase => Self::yul_switch_case.parse(self, input), - ProductionKind::YulSwitchCasesList => Self::yul_switch_cases_list.parse(self, input), + ProductionKind::YulSwitchCases => Self::yul_switch_cases.parse(self, input), ProductionKind::YulSwitchStatement => Self::yul_switch_statement.parse(self, input), + ProductionKind::YulValueCase => Self::yul_value_case.parse(self, input), + ProductionKind::YulVariableDeclarationStatement => { + Self::yul_variable_declaration_statement.parse(self, input) + } + ProductionKind::YulVariableDeclarationValue => { + Self::yul_variable_declaration_value.parse(self, input) + } } } } -impl Lexer for Language { - fn leading_trivia(&self, input: &mut ParserContext) -> ParserResult { - Language::leading_trivia(self, input) - } +impl Lexer for Language { + fn leading_trivia(&self, input: &mut ParserContext) -> ParserResult { + Language::leading_trivia(self, input) + } + + fn trailing_trivia(&self, input: &mut ParserContext) -> ParserResult { + Language::trailing_trivia(self, input) + } + + fn delimiters() -> &'static [(TokenKind, TokenKind)] { + match LexCtx::value() { + LexicalContext::Default => &[ + (TokenKind::OpenBrace, TokenKind::CloseBrace), + (TokenKind::OpenBracket, TokenKind::CloseBracket), + (TokenKind::OpenParen, TokenKind::CloseParen), + ], + LexicalContext::Pragma => &[], + LexicalContext::Yul => &[ + (TokenKind::OpenBrace, TokenKind::CloseBrace), + (TokenKind::OpenParen, TokenKind::CloseParen), + ], + } + } + + fn next_token(&self, input: &mut ParserContext) -> Option { + let save = input.position(); + let mut furthest_position = input.position(); + let mut longest_token = None; + + match LexCtx::value() { + LexicalContext::Default => { + macro_rules! longest_match { + ($( { $kind:ident = $function:ident } )*) => { + $( + if self.$function(input) && input.position() > furthest_position { + furthest_position = input.position(); + longest_token = Some(TokenKind::$kind); + } + input.set_position(save); + )* + }; + } + + if let Some(kind) = match input.next() { + Some('a') => match input.next() { + Some('b') => scan_chars!(input, 's', 't', 'r', 'a', 'c', 't') + .then_some(TokenKind::AbstractKeyword), + Some('d') => scan_chars!(input, 'd', 'r', 'e', 's', 's') + .then_some(TokenKind::AddressKeyword), + Some('f') => { + scan_chars!(input, 't', 'e', 'r').then_some(TokenKind::AfterKeyword) + } + Some('l') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'i', 'a', 's').then_some(TokenKind::AliasKeyword) + } else { + None + } + } + Some('n') => scan_chars!(input, 'o', 'n', 'y', 'm', 'o', 'u', 's') + .then_some(TokenKind::AnonymousKeyword), + Some('p') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'p', 'l', 'y').then_some(TokenKind::ApplyKeyword) + } else { + None + } + } + Some('s') => match input.next() { + Some('s') => scan_chars!(input, 'e', 'm', 'b', 'l', 'y') + .then_some(TokenKind::AssemblyKeyword), + Some(_) => { + input.undo(); + Some(TokenKind::AsKeyword) + } + None => Some(TokenKind::AsKeyword), + }, + Some('u') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 't', 'o').then_some(TokenKind::AutoKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('b') => match input.next() { + Some('o') => scan_chars!(input, 'o', 'l').then_some(TokenKind::BoolKeyword), + Some('r') => { + scan_chars!(input, 'e', 'a', 'k').then_some(TokenKind::BreakKeyword) + } + Some('y') => scan_chars!(input, 't', 'e').then_some(TokenKind::ByteKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('c') => match input.next() { + Some('a') => match input.next() { + Some('l') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'l', 'd', 'a', 't', 'a') + .then_some(TokenKind::CallDataKeyword) + } else { + None + } + } + Some('s') => scan_chars!(input, 'e').then_some(TokenKind::CaseKeyword), + Some('t') => { + scan_chars!(input, 'c', 'h').then_some(TokenKind::CatchKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('o') => match input.next() { + Some('n') => match input.next() { + Some('s') => { + if scan_chars!(input, 't') { + match input.next() { + Some('a') => scan_chars!(input, 'n', 't') + .then_some(TokenKind::ConstantKeyword), + Some('r') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'u', 'c', 't', 'o', 'r') + .then_some(TokenKind::ConstructorKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + } + } else { + None + } + } + Some('t') => match input.next() { + Some('i') => scan_chars!(input, 'n', 'u', 'e') + .then_some(TokenKind::ContinueKeyword), + Some('r') => scan_chars!(input, 'a', 'c', 't') + .then_some(TokenKind::ContractKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('p') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'y', 'o', 'f') + .then_some(TokenKind::CopyOfKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('d') => match input.next() { + Some('a') => scan_chars!(input, 'y', 's').then_some(TokenKind::DaysKeyword), + Some('e') => match input.next() { + Some('f') => match input.next() { + Some('a') => scan_chars!(input, 'u', 'l', 't') + .then_some(TokenKind::DefaultKeyword), + Some('i') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'n', 'e') + .then_some(TokenKind::DefineKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('l') => scan_chars!(input, 'e', 't', 'e') + .then_some(TokenKind::DeleteKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('o') => Some(TokenKind::DoKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('e') => match input.next() { + Some('l') => scan_chars!(input, 's', 'e').then_some(TokenKind::ElseKeyword), + Some('m') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'i', 't').then_some(TokenKind::EmitKeyword) + } else { + None + } + } + Some('n') => scan_chars!(input, 'u', 'm').then_some(TokenKind::EnumKeyword), + Some('r') => { + if self.version_is_at_least_0_8_4 { + scan_chars!(input, 'r', 'o', 'r').then_some(TokenKind::ErrorKeyword) + } else { + None + } + } + Some('t') => { + scan_chars!(input, 'h', 'e', 'r').then_some(TokenKind::EtherKeyword) + } + Some('v') => { + scan_chars!(input, 'e', 'n', 't').then_some(TokenKind::EventKeyword) + } + Some('x') => scan_chars!(input, 't', 'e', 'r', 'n', 'a', 'l') + .then_some(TokenKind::ExternalKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('f') => match input.next() { + Some('a') => { + if scan_chars!(input, 'l') { + match input.next() { + Some('l') => { + if self.version_is_at_least_0_6_0 { + scan_chars!(input, 'b', 'a', 'c', 'k') + .then_some(TokenKind::FallbackKeyword) + } else { + None + } + } + Some('s') => { + scan_chars!(input, 'e').then_some(TokenKind::FalseKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + } + } else { + None + } + } + Some('i') => { + if scan_chars!(input, 'n') { + match input.next() { + Some('a') => { + scan_chars!(input, 'l').then_some(TokenKind::FinalKeyword) + } + Some('n') => { + if !self.version_is_at_least_0_7_0 { + scan_chars!(input, 'e', 'y') + .then_some(TokenKind::FinneyKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + } + } else { + None + } + } + Some('o') => scan_chars!(input, 'r').then_some(TokenKind::ForKeyword), + Some('r') => scan_chars!(input, 'o', 'm').then_some(TokenKind::FromKeyword), + Some('u') => scan_chars!(input, 'n', 'c', 't', 'i', 'o', 'n') + .then_some(TokenKind::FunctionKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('g') => match input.next() { + Some('l') => { + if self.version_is_at_least_0_8_13 { + scan_chars!(input, 'o', 'b', 'a', 'l') + .then_some(TokenKind::GlobalKeyword) + } else { + None + } + } + Some('w') => { + if self.version_is_at_least_0_7_0 { + scan_chars!(input, 'e', 'i').then_some(TokenKind::GweiKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('h') => match input.next() { + Some('e') => scan_chars!(input, 'x').then_some(TokenKind::HexKeyword), + Some('o') => { + scan_chars!(input, 'u', 'r', 's').then_some(TokenKind::HoursKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('i') => match input.next() { + Some('f') => Some(TokenKind::IfKeyword), + Some('m') => match input.next() { + Some('m') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'u', 't', 'a', 'b', 'l', 'e') + .then_some(TokenKind::ImmutableKeyword) + } else { + None + } + } + Some('p') => match input.next() { + Some('l') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'e', 'm', 'e', 'n', 't', 's') + .then_some(TokenKind::ImplementsKeyword) + } else { + None + } + } + Some('o') => { + scan_chars!(input, 'r', 't').then_some(TokenKind::ImportKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('n') => match input.next() { + Some('d') => scan_chars!(input, 'e', 'x', 'e', 'd') + .then_some(TokenKind::IndexedKeyword), + Some('l') => scan_chars!(input, 'i', 'n', 'e') + .then_some(TokenKind::InlineKeyword), + Some('t') => { + if scan_chars!(input, 'e', 'r') { + match input.next() { + Some('f') => scan_chars!(input, 'a', 'c', 'e') + .then_some(TokenKind::InterfaceKeyword), + Some('n') => scan_chars!(input, 'a', 'l') + .then_some(TokenKind::InternalKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + } + } else { + None + } + } + Some(_) => { + input.undo(); + Some(TokenKind::InKeyword) + } + None => Some(TokenKind::InKeyword), + }, + Some('s') => Some(TokenKind::IsKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('l') => match input.next() { + Some('e') => scan_chars!(input, 't').then_some(TokenKind::LetKeyword), + Some('i') => scan_chars!(input, 'b', 'r', 'a', 'r', 'y') + .then_some(TokenKind::LibraryKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('m') => match input.next() { + Some('a') => match input.next() { + Some('c') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'r', 'o').then_some(TokenKind::MacroKeyword) + } else { + None + } + } + Some('p') => scan_chars!(input, 'p', 'i', 'n', 'g') + .then_some(TokenKind::MappingKeyword), + Some('t') => { + scan_chars!(input, 'c', 'h').then_some(TokenKind::MatchKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('e') => scan_chars!(input, 'm', 'o', 'r', 'y') + .then_some(TokenKind::MemoryKeyword), + Some('i') => scan_chars!(input, 'n', 'u', 't', 'e', 's') + .then_some(TokenKind::MinutesKeyword), + Some('o') => scan_chars!(input, 'd', 'i', 'f', 'i', 'e', 'r') + .then_some(TokenKind::ModifierKeyword), + Some('u') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 't', 'a', 'b', 'l', 'e') + .then_some(TokenKind::MutableKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('n') => match input.next() { + Some('e') => scan_chars!(input, 'w').then_some(TokenKind::NewKeyword), + Some('u') => scan_chars!(input, 'l', 'l').then_some(TokenKind::NullKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('o') => match input.next() { + Some('f') => Some(TokenKind::OfKeyword), + Some('v') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'e', 'r', 'r', 'i', 'd', 'e') + .then_some(TokenKind::OverrideKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('p') => match input.next() { + Some('a') => match input.next() { + Some('r') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 't', 'i', 'a', 'l') + .then_some(TokenKind::PartialKeyword) + } else { + None + } + } + Some('y') => scan_chars!(input, 'a', 'b', 'l', 'e') + .then_some(TokenKind::PayableKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('r') => match input.next() { + Some('a') => scan_chars!(input, 'g', 'm', 'a') + .then_some(TokenKind::PragmaKeyword), + Some('i') => scan_chars!(input, 'v', 'a', 't', 'e') + .then_some(TokenKind::PrivateKeyword), + Some('o') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'm', 'i', 's', 'e') + .then_some(TokenKind::PromiseKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('u') => match input.next() { + Some('b') => scan_chars!(input, 'l', 'i', 'c') + .then_some(TokenKind::PublicKeyword), + Some('r') => scan_chars!(input, 'e').then_some(TokenKind::PureKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('r') => { + if scan_chars!(input, 'e') { + match input.next() { + Some('c') => { + if self.version_is_at_least_0_6_0 { + scan_chars!(input, 'e', 'i', 'v', 'e') + .then_some(TokenKind::ReceiveKeyword) + } else { + None + } + } + Some('f') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'e', 'r', 'e', 'n', 'c', 'e') + .then_some(TokenKind::ReferenceKeyword) + } else { + None + } + } + Some('l') => { + scan_chars!(input, 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e') + .then_some(TokenKind::RelocatableKeyword) + } + Some('t') => { + if scan_chars!(input, 'u', 'r', 'n') { + match input.next() { + Some('s') => Some(TokenKind::ReturnsKeyword), + Some(_) => { + input.undo(); + Some(TokenKind::ReturnKeyword) + } + None => Some(TokenKind::ReturnKeyword), + } + } else { + None + } + } + Some('v') => { + if self.version_is_at_least_0_8_4 { + scan_chars!(input, 'e', 'r', 't') + .then_some(TokenKind::RevertKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + } + } else { + None + } + } + Some('s') => match input.next() { + Some('e') => match input.next() { + Some('a') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'l', 'e', 'd') + .then_some(TokenKind::SealedKeyword) + } else { + None + } + } + Some('c') => scan_chars!(input, 'o', 'n', 'd', 's') + .then_some(TokenKind::SecondsKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('i') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'z', 'e', 'o', 'f') + .then_some(TokenKind::SizeOfKeyword) + } else { + None + } + } + Some('t') => { + match input.next() { + Some('a') => scan_chars!(input, 't', 'i', 'c') + .then_some(TokenKind::StaticKeyword), + Some('o') => scan_chars!(input, 'r', 'a', 'g', 'e') + .then_some(TokenKind::StorageKeyword), + Some('r') => match input.next() { + Some('i') => scan_chars!(input, 'n', 'g') + .then_some(TokenKind::StringKeyword), + Some('u') => scan_chars!(input, 'c', 't') + .then_some(TokenKind::StructKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + } + } + Some('u') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'p', 'p', 'o', 'r', 't', 's') + .then_some(TokenKind::SupportsKeyword) + } else { + None + } + } + Some('w') => scan_chars!(input, 'i', 't', 'c', 'h') + .then_some(TokenKind::SwitchKeyword), + Some('z') => { + if !self.version_is_at_least_0_7_0 { + scan_chars!(input, 'a', 'b', 'o').then_some(TokenKind::SzaboKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('t') => match input.next() { + Some('h') => { + scan_chars!(input, 'r', 'o', 'w').then_some(TokenKind::ThrowKeyword) + } + Some('r') => match input.next() { + Some('u') => scan_chars!(input, 'e').then_some(TokenKind::TrueKeyword), + Some('y') => Some(TokenKind::TryKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('y') => { + if scan_chars!(input, 'p', 'e') { + match input.next() { + Some('d') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'e', 'f') + .then_some(TokenKind::TypeDefKeyword) + } else { + None + } + } + Some('o') => { + scan_chars!(input, 'f').then_some(TokenKind::TypeOfKeyword) + } + Some(_) => { + input.undo(); + Some(TokenKind::TypeKeyword) + } + None => Some(TokenKind::TypeKeyword), + } + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('u') => match input.next() { + Some('n') => { + if self.version_is_at_least_0_5_0 { + scan_chars!(input, 'c', 'h', 'e', 'c', 'k', 'e', 'd') + .then_some(TokenKind::UncheckedKeyword) + } else { + None + } + } + Some('s') => { + scan_chars!(input, 'i', 'n', 'g').then_some(TokenKind::UsingKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('v') => match input.next() { + Some('a') => scan_chars!(input, 'r').then_some(TokenKind::VarKeyword), + Some('i') => match input.next() { + Some('e') => scan_chars!(input, 'w').then_some(TokenKind::ViewKeyword), + Some('r') => { + if self.version_is_at_least_0_6_0 { + scan_chars!(input, 't', 'u', 'a', 'l') + .then_some(TokenKind::VirtualKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('w') => match input.next() { + Some('e') => match input.next() { + Some('e') => { + scan_chars!(input, 'k', 's').then_some(TokenKind::WeeksKeyword) + } + Some('i') => Some(TokenKind::WeiKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('h') => { + scan_chars!(input, 'i', 'l', 'e').then_some(TokenKind::WhileKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('y') => { + scan_chars!(input, 'e', 'a', 'r', 's').then_some(TokenKind::YearsKeyword) + } + Some(_) => { + input.undo(); + None + } + None => None, + } { + // Make sure that this is not the start of an identifier + if !self.identifier_part(input) { + furthest_position = input.position(); + longest_token = Some(kind); + } + } + input.set_position(save); + + if let Some(kind) = match input.next() { + Some('!') => scan_chars!(input, '=').then_some(TokenKind::BangEqual), + Some('%') => scan_chars!(input, '=').then_some(TokenKind::PercentEqual), + Some('&') => match input.next() { + Some('&') => Some(TokenKind::AmpersandAmpersand), + Some('=') => Some(TokenKind::AmpersandEqual), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('(') => Some(TokenKind::OpenParen), + Some(')') => Some(TokenKind::CloseParen), + Some('*') => match input.next() { + Some('*') => Some(TokenKind::AsteriskAsterisk), + Some('=') => Some(TokenKind::AsteriskEqual), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('+') => match input.next() { + Some('+') => Some(TokenKind::PlusPlus), + Some('=') => Some(TokenKind::PlusEqual), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(',') => Some(TokenKind::Comma), + Some('-') => match input.next() { + Some('-') => Some(TokenKind::MinusMinus), + Some('=') => Some(TokenKind::MinusEqual), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('.') => Some(TokenKind::Period), + Some('/') => scan_chars!(input, '=').then_some(TokenKind::SlashEqual), + Some(';') => Some(TokenKind::Semicolon), + Some('<') => match input.next() { + Some('<') => { + scan_chars!(input, '=').then_some(TokenKind::LessThanLessThanEqual) + } + Some('=') => Some(TokenKind::LessThanEqual), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('=') => match input.next() { + Some('=') => Some(TokenKind::EqualEqual), + Some('>') => Some(TokenKind::EqualGreaterThan), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('>') => match input.next() { + Some('=') => Some(TokenKind::GreaterThanEqual), + Some('>') => match input.next() { + Some('=') => Some(TokenKind::GreaterThanGreaterThanEqual), + Some('>') => scan_chars!(input, '=') + .then_some(TokenKind::GreaterThanGreaterThanGreaterThanEqual), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('?') => Some(TokenKind::QuestionMark), + Some('[') => Some(TokenKind::OpenBracket), + Some(']') => Some(TokenKind::CloseBracket), + Some('^') => scan_chars!(input, '=').then_some(TokenKind::CaretEqual), + Some('{') => Some(TokenKind::OpenBrace), + Some('|') => match input.next() { + Some('=') => Some(TokenKind::BarEqual), + Some('|') => Some(TokenKind::BarBar), + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('}') => Some(TokenKind::CloseBrace), + Some('~') => Some(TokenKind::Tilde), + Some(_) => { + input.undo(); + None + } + None => None, + } { + furthest_position = input.position(); + longest_token = Some(kind); + } + input.set_position(save); - fn trailing_trivia(&self, input: &mut ParserContext) -> ParserResult { - Language::trailing_trivia(self, input) - } + longest_match! { + { Ampersand = ampersand } + { AsciiStringLiteral = ascii_string_literal } + { Asterisk = asterisk } + { Bang = bang } + { Bar = bar } + { BytesKeyword = bytes_keyword } + { Caret = caret } + { Colon = colon } + { DecimalLiteral = decimal_literal } + { EndOfLine = end_of_line } + { Equal = equal } + { FixedKeyword = fixed_keyword } + { GreaterThan = greater_than } + { GreaterThanGreaterThan = greater_than_greater_than } + { GreaterThanGreaterThanGreaterThan = greater_than_greater_than_greater_than } + { HexLiteral = hex_literal } + { HexStringLiteral = hex_string_literal } + { IntKeyword = int_keyword } + { LessThan = less_than } + { LessThanLessThan = less_than_less_than } + { Minus = minus } + { MultilineComment = multiline_comment } + { Percent = percent } + { Plus = plus } + { SingleLineComment = single_line_comment } + { Slash = slash } + { UfixedKeyword = ufixed_keyword } + { UintKeyword = uint_keyword } + { UnicodeStringLiteral = unicode_string_literal } + { Whitespace = whitespace } + { Identifier = identifier } + } + } + LexicalContext::Pragma => { + macro_rules! longest_match { + ($( { $kind:ident = $function:ident } )*) => { + $( + if self.$function(input) && input.position() > furthest_position { + furthest_position = input.position(); + longest_token = Some(TokenKind::$kind); + } + input.set_position(save); + )* + }; + } - fn delimiters() -> &'static [(TokenKind, TokenKind)] { - match LexCtx::value() { - LexicalContext::Default => &[ - (TokenKind::OpenBrace, TokenKind::CloseBrace), - (TokenKind::OpenBracket, TokenKind::CloseBracket), - (TokenKind::OpenParen, TokenKind::CloseParen), - ], - LexicalContext::VersionPragma => &[], - LexicalContext::YulBlock => &[ - (TokenKind::OpenBrace, TokenKind::CloseBrace), - (TokenKind::OpenParen, TokenKind::CloseParen), - ], - } - } + if let Some(kind) = match input.next() { + Some('a') => scan_chars!(input, 'b', 'i', 'c', 'o', 'd', 'e', 'r') + .then_some(TokenKind::AbicoderKeyword), + Some('e') => { + scan_chars!(input, 'x', 'p', 'e', 'r', 'i', 'm', 'e', 'n', 't', 'a', 'l') + .then_some(TokenKind::ExperimentalKeyword) + } + Some('p') => scan_chars!(input, 'r', 'a', 'g', 'm', 'a') + .then_some(TokenKind::PragmaKeyword), + Some('s') => scan_chars!(input, 'o', 'l', 'i', 'd', 'i', 't', 'y') + .then_some(TokenKind::SolidityKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + } { + // Make sure that this is not the start of an identifier + if !self.identifier_part(input) { + furthest_position = input.position(); + longest_token = Some(kind); + } + } + input.set_position(save); - fn next_token(&self, input: &mut ParserContext) -> Option { - let save = input.position(); - let mut furthest_position = input.position(); - let mut longest_token = None; + if let Some(kind) = match input.next() { + Some('.') => Some(TokenKind::Period), + Some(';') => Some(TokenKind::Semicolon), + Some('<') => scan_chars!(input, '=').then_some(TokenKind::LessThanEqual), + Some('>') => scan_chars!(input, '=').then_some(TokenKind::GreaterThanEqual), + Some('|') => scan_chars!(input, '|').then_some(TokenKind::BarBar), + Some('~') => Some(TokenKind::Tilde), + Some(_) => { + input.undo(); + None + } + None => None, + } { + furthest_position = input.position(); + longest_token = Some(kind); + } + input.set_position(save); - match LexCtx::value() { - LexicalContext::Default => { + longest_match! { + { AsciiStringLiteral = ascii_string_literal } + { Caret = caret } + { Equal = equal } + { GreaterThan = greater_than } + { LessThan = less_than } + { Minus = minus } + { VersionPragmaValue = version_pragma_value } + { Identifier = identifier } + } + } + LexicalContext::Yul => { macro_rules! longest_match { ($( { $kind:ident = $function:ident } )*) => { $( @@ -5862,50 +9947,76 @@ impl Lexer for Language { if let Some(kind) = match input.next() { Some('a') => match input.next() { - Some('b') => match input.next() { - Some('i') => scan_chars!(input, 'c', 'o', 'd', 'e', 'r') - .then_some(TokenKind::ABICoderKeyword), - Some('s') => scan_chars!(input, 't', 'r', 'a', 'c', 't') - .then_some(TokenKind::AbstractKeyword), - Some(_) => { - input.undo(); + Some('b') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 's', 't', 'r', 'a', 'c', 't') + .then_some(TokenKind::YulAbstractKeyword) + } else { None } - None => None, - }, + } Some('d') => scan_chars!(input, 'd', 'r', 'e', 's', 's') - .then_some(TokenKind::AddressKeyword), + .then_some(TokenKind::YulAddressKeyword), Some('f') => { - scan_chars!(input, 't', 'e', 'r').then_some(TokenKind::AfterKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 't', 'e', 'r') + .then_some(TokenKind::YulAfterKeyword) + } else { + None + } } Some('l') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'i', 'a', 's').then_some(TokenKind::AliasKeyword) + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'i', 'a', 's') + .then_some(TokenKind::YulAliasKeyword) + } else { + None + } + } + Some('n') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'o', 'n', 'y', 'm', 'o', 'u', 's') + .then_some(TokenKind::YulAnonymousKeyword) } else { None } } - Some('n') => scan_chars!(input, 'o', 'n', 'y', 'm', 'o', 'u', 's') - .then_some(TokenKind::AnonymousKeyword), Some('p') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'p', 'l', 'y').then_some(TokenKind::ApplyKeyword) + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'p', 'l', 'y') + .then_some(TokenKind::YulApplyKeyword) } else { None } } Some('s') => match input.next() { - Some('s') => scan_chars!(input, 'e', 'm', 'b', 'l', 'y') - .then_some(TokenKind::AssemblyKeyword), + Some('s') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e', 'm', 'b', 'l', 'y') + .then_some(TokenKind::YulAssemblyKeyword) + } else { + None + } + } Some(_) => { input.undo(); - Some(TokenKind::AsKeyword) + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulAsKeyword) + } else { + None + } + } + None => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulAsKeyword) + } else { + None + } } - None => Some(TokenKind::AsKeyword), }, Some('u') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 't', 'o').then_some(TokenKind::AutoKeyword) + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 't', 'o').then_some(TokenKind::YulAutoKeyword) } else { None } @@ -5917,11 +10028,19 @@ impl Lexer for Language { None => None, }, Some('b') => match input.next() { - Some('o') => scan_chars!(input, 'o', 'l').then_some(TokenKind::BoolKeyword), + Some('o') => { + if !self.version_is_at_least_0_5_10 { + scan_chars!(input, 'o', 'l').then_some(TokenKind::YulBoolKeyword) + } else { + None + } + } Some('r') => { - scan_chars!(input, 'e', 'a', 'k').then_some(TokenKind::BreakKeyword) + scan_chars!(input, 'e', 'a', 'k').then_some(TokenKind::YulBreakKeyword) + } + Some('y') => { + scan_chars!(input, 't', 'e').then_some(TokenKind::YulByteKeyword) } - Some('y') => scan_chars!(input, 't', 'e').then_some(TokenKind::ByteKeyword), Some(_) => { input.undo(); None @@ -5931,16 +10050,24 @@ impl Lexer for Language { Some('c') => match input.next() { Some('a') => match input.next() { Some('l') => { - if self.version_is_at_least_0_5_0 { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'l', 'd', 'a', 't', 'a') - .then_some(TokenKind::CalldataKeyword) + .then_some(TokenKind::YulCallDataKeyword) } else { None } } - Some('s') => scan_chars!(input, 'e').then_some(TokenKind::CaseKeyword), + Some('s') => { + scan_chars!(input, 'e').then_some(TokenKind::YulCaseKeyword) + } Some('t') => { - scan_chars!(input, 'c', 'h').then_some(TokenKind::CatchKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'c', 'h') + .then_some(TokenKind::YulCatchKeyword) + } else { + None + } } Some(_) => { input.undo(); @@ -5953,12 +10080,20 @@ impl Lexer for Language { Some('s') => { if scan_chars!(input, 't') { match input.next() { - Some('a') => scan_chars!(input, 'n', 't') - .then_some(TokenKind::ConstantKeyword), + Some('a') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'n', 't') + .then_some(TokenKind::YulConstantKeyword) + } else { + None + } + } Some('r') => { - if self.version_is_at_least_0_4_22 { + if self.version_is_at_least_0_5_0 + && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'u', 'c', 't', 'o', 'r') - .then_some(TokenKind::ConstructorKeyword) + .then_some(TokenKind::YulConstructorKeyword) } else { None } @@ -5975,9 +10110,15 @@ impl Lexer for Language { } Some('t') => match input.next() { Some('i') => scan_chars!(input, 'n', 'u', 'e') - .then_some(TokenKind::ContinueKeyword), - Some('r') => scan_chars!(input, 'a', 'c', 't') - .then_some(TokenKind::ContractKeyword), + .then_some(TokenKind::YulContinueKeyword), + Some('r') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'a', 'c', 't') + .then_some(TokenKind::YulContractKeyword) + } else { + None + } + } Some(_) => { input.undo(); None @@ -5991,9 +10132,10 @@ impl Lexer for Language { None => None, }, Some('p') => { - if self.version_is_at_least_0_5_0 { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'y', 'o', 'f') - .then_some(TokenKind::CopyofKeyword) + .then_some(TokenKind::YulCopyOfKeyword) } else { None } @@ -6011,15 +10153,23 @@ impl Lexer for Language { None => None, }, Some('d') => match input.next() { - Some('a') => scan_chars!(input, 'y', 's').then_some(TokenKind::DaysKeyword), + Some('a') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'y', 's').then_some(TokenKind::YulDaysKeyword) + } else { + None + } + } Some('e') => match input.next() { Some('f') => match input.next() { Some('a') => scan_chars!(input, 'u', 'l', 't') - .then_some(TokenKind::DefaultKeyword), + .then_some(TokenKind::YulDefaultKeyword), Some('i') => { - if self.version_is_at_least_0_5_0 { + if self.version_is_at_least_0_5_0 + && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'n', 'e') - .then_some(TokenKind::DefineKeyword) + .then_some(TokenKind::YulDefineKeyword) } else { None } @@ -6030,15 +10180,27 @@ impl Lexer for Language { } None => None, }, - Some('l') => scan_chars!(input, 'e', 't', 'e') - .then_some(TokenKind::DeleteKeyword), + Some('l') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e', 't', 'e') + .then_some(TokenKind::YulDeleteKeyword) + } else { + None + } + } Some(_) => { input.undo(); None } None => None, }, - Some('o') => Some(TokenKind::DoKeyword), + Some('o') => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulDoKeyword) + } else { + None + } + } Some(_) => { input.undo(); None @@ -6046,41 +10208,51 @@ impl Lexer for Language { None => None, }, Some('e') => match input.next() { - Some('l') => scan_chars!(input, 's', 'e').then_some(TokenKind::ElseKeyword), + Some('l') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 's', 'e').then_some(TokenKind::YulElseKeyword) + } else { + None + } + } Some('m') => { - if self.version_is_at_least_0_4_21 { - scan_chars!(input, 'i', 't').then_some(TokenKind::EmitKeyword) + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'i', 't').then_some(TokenKind::YulEmitKeyword) } else { None } } - Some('n') => scan_chars!(input, 'u', 'm').then_some(TokenKind::EnumKeyword), - Some('r') => { - if self.version_is_at_least_0_8_4 { - scan_chars!(input, 'r', 'o', 'r').then_some(TokenKind::ErrorKeyword) + Some('n') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'u', 'm').then_some(TokenKind::YulEnumKeyword) } else { None } } Some('t') => { - scan_chars!(input, 'h', 'e', 'r').then_some(TokenKind::EtherKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'h', 'e', 'r') + .then_some(TokenKind::YulEtherKeyword) + } else { + None + } } Some('v') => { - scan_chars!(input, 'e', 'n', 't').then_some(TokenKind::EventKeyword) - } - Some('x') => match input.next() { - Some('p') => { - scan_chars!(input, 'e', 'r', 'i', 'm', 'e', 'n', 't', 'a', 'l') - .then_some(TokenKind::ExperimentalKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e', 'n', 't') + .then_some(TokenKind::YulEventKeyword) + } else { + None } - Some('t') => scan_chars!(input, 'e', 'r', 'n', 'a', 'l') - .then_some(TokenKind::ExternalKeyword), - Some(_) => { - input.undo(); + } + Some('x') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 't', 'e', 'r', 'n', 'a', 'l') + .then_some(TokenKind::YulExternalKeyword) + } else { None } - None => None, - }, + } Some(_) => { input.undo(); None @@ -6092,16 +10264,17 @@ impl Lexer for Language { if scan_chars!(input, 'l') { match input.next() { Some('l') => { - if self.version_is_at_least_0_6_0 { + if self.version_is_at_least_0_6_0 + && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'b', 'a', 'c', 'k') - .then_some(TokenKind::FallbackKeyword) + .then_some(TokenKind::YulFallbackKeyword) } else { None } } - Some('s') => { - scan_chars!(input, 'e').then_some(TokenKind::FalseKeyword) - } + Some('s') => scan_chars!(input, 'e') + .then_some(TokenKind::YulFalseKeyword), Some(_) => { input.undo(); None @@ -6116,12 +10289,17 @@ impl Lexer for Language { if scan_chars!(input, 'n') { match input.next() { Some('a') => { - scan_chars!(input, 'l').then_some(TokenKind::FinalKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'l') + .then_some(TokenKind::YulFinalKeyword) + } else { + None + } } Some('n') => { if !self.version_is_at_least_0_7_0 { scan_chars!(input, 'e', 'y') - .then_some(TokenKind::FinneyKeyword) + .then_some(TokenKind::YulFinneyKeyword) } else { None } @@ -6136,42 +10314,31 @@ impl Lexer for Language { None } } - Some('o') => scan_chars!(input, 'r').then_some(TokenKind::ForKeyword), - Some('r') => scan_chars!(input, 'o', 'm').then_some(TokenKind::FromKeyword), + Some('o') => scan_chars!(input, 'r').then_some(TokenKind::YulForKeyword), Some('u') => scan_chars!(input, 'n', 'c', 't', 'i', 'o', 'n') - .then_some(TokenKind::FunctionKeyword), + .then_some(TokenKind::YulFunctionKeyword), Some(_) => { input.undo(); None } None => None, }, - Some('g') => match input.next() { - Some('l') => { - if self.version_is_at_least_0_8_13 { - scan_chars!(input, 'o', 'b', 'a', 'l') - .then_some(TokenKind::GlobalKeyword) - } else { - None - } - } - Some('w') => { - if self.version_is_at_least_0_6_11 { - scan_chars!(input, 'e', 'i').then_some(TokenKind::GweiKeyword) - } else { - None - } - } - Some(_) => { - input.undo(); + Some('g') => { + if self.version_is_at_least_0_7_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'w', 'e', 'i').then_some(TokenKind::YulGweiKeyword) + } else { None } - None => None, - }, + } Some('h') => match input.next() { - Some('e') => scan_chars!(input, 'x').then_some(TokenKind::HexKeyword), + Some('e') => scan_chars!(input, 'x').then_some(TokenKind::YulHexKeyword), Some('o') => { - scan_chars!(input, 'u', 'r', 's').then_some(TokenKind::HoursKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'u', 'r', 's') + .then_some(TokenKind::YulHoursKeyword) + } else { + None + } } Some(_) => { input.undo(); @@ -6180,27 +10347,35 @@ impl Lexer for Language { None => None, }, Some('i') => match input.next() { - Some('f') => Some(TokenKind::IfKeyword), + Some('f') => Some(TokenKind::YulIfKeyword), Some('m') => match input.next() { Some('m') => { - if self.version_is_at_least_0_5_0 { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'u', 't', 'a', 'b', 'l', 'e') - .then_some(TokenKind::ImmutableKeyword) + .then_some(TokenKind::YulImmutableKeyword) } else { None } } Some('p') => match input.next() { Some('l') => { - if self.version_is_at_least_0_5_0 { + if self.version_is_at_least_0_5_0 + && !self.version_is_at_least_0_7_1 + { scan_chars!(input, 'e', 'm', 'e', 'n', 't', 's') - .then_some(TokenKind::ImplementsKeyword) + .then_some(TokenKind::YulImplementsKeyword) } else { None } } Some('o') => { - scan_chars!(input, 'r', 't').then_some(TokenKind::ImportKeyword) + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'r', 't') + .then_some(TokenKind::YulImportKeyword) + } else { + None + } } Some(_) => { input.undo(); @@ -6215,17 +10390,41 @@ impl Lexer for Language { None => None, }, Some('n') => match input.next() { - Some('d') => scan_chars!(input, 'e', 'x', 'e', 'd') - .then_some(TokenKind::IndexedKeyword), - Some('l') => scan_chars!(input, 'i', 'n', 'e') - .then_some(TokenKind::InlineKeyword), + Some('d') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e', 'x', 'e', 'd') + .then_some(TokenKind::YulIndexedKeyword) + } else { + None + } + } + Some('l') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'i', 'n', 'e') + .then_some(TokenKind::YulInlineKeyword) + } else { + None + } + } Some('t') => { if scan_chars!(input, 'e', 'r') { match input.next() { - Some('f') => scan_chars!(input, 'a', 'c', 'e') - .then_some(TokenKind::InterfaceKeyword), - Some('n') => scan_chars!(input, 'a', 'l') - .then_some(TokenKind::InternalKeyword), + Some('f') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'a', 'c', 'e') + .then_some(TokenKind::YulInterfaceKeyword) + } else { + None + } + } + Some('n') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'a', 'l') + .then_some(TokenKind::YulInternalKeyword) + } else { + None + } + } Some(_) => { input.undo(); None @@ -6238,96 +10437,54 @@ impl Lexer for Language { } Some(_) => { input.undo(); - Some(TokenKind::InKeyword) + if !self.version_is_at_least_0_6_8 { + Some(TokenKind::YulInKeyword) + } else { + None + } } - None => Some(TokenKind::InKeyword), - }, - Some('s') => Some(TokenKind::IsKeyword), - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('l') => match input.next() { - Some('e') => match input.next() { - Some('a') => { - if self.version_is_at_least_0_6_0 { - scan_chars!(input, 'v', 'e').then_some(TokenKind::LeaveKeyword) + None => { + if !self.version_is_at_least_0_6_8 { + Some(TokenKind::YulInKeyword) } else { None } } - Some('t') => Some(TokenKind::LetKeyword), - Some(_) => { - input.undo(); + }, + Some('s') => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulIsKeyword) + } else { None } - None => None, - }, - Some('i') => scan_chars!(input, 'b', 'r', 'a', 'r', 'y') - .then_some(TokenKind::LibraryKeyword), + } Some(_) => { input.undo(); None } None => None, }, - Some('m') => match input.next() { - Some('a') => match input.next() { - Some('c') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'r', 'o').then_some(TokenKind::MacroKeyword) + Some('l') => match input.next() { + Some('e') => match input.next() { + Some('a') => { + if self.version_is_at_least_0_7_1 { + scan_chars!(input, 'v', 'e') + .then_some(TokenKind::YulLeaveKeyword) } else { None } } - Some('p') => scan_chars!(input, 'p', 'i', 'n', 'g') - .then_some(TokenKind::MappingKeyword), - Some('t') => { - scan_chars!(input, 'c', 'h').then_some(TokenKind::MatchKeyword) - } + Some('t') => Some(TokenKind::YulLetKeyword), Some(_) => { input.undo(); None } None => None, }, - Some('e') => scan_chars!(input, 'm', 'o', 'r', 'y') - .then_some(TokenKind::MemoryKeyword), - Some('i') => scan_chars!(input, 'n', 'u', 't', 'e', 's') - .then_some(TokenKind::MinutesKeyword), - Some('o') => scan_chars!(input, 'd', 'i', 'f', 'i', 'e', 'r') - .then_some(TokenKind::ModifierKeyword), - Some('u') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 't', 'a', 'b', 'l', 'e') - .then_some(TokenKind::MutableKeyword) - } else { - None - } - } - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('n') => match input.next() { - Some('e') => scan_chars!(input, 'w').then_some(TokenKind::NewKeyword), - Some('u') => scan_chars!(input, 'l', 'l').then_some(TokenKind::NullKeyword), - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('o') => match input.next() { - Some('f') => Some(TokenKind::OfKeyword), - Some('v') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'e', 'r', 'r', 'i', 'd', 'e') - .then_some(TokenKind::OverrideKeyword) + Some('i') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'b', 'r', 'a', 'r', 'y') + .then_some(TokenKind::YulLibraryKeyword) } else { None } @@ -6338,179 +10495,67 @@ impl Lexer for Language { } None => None, }, - Some('p') => match input.next() { + Some('m') => match input.next() { Some('a') => match input.next() { - Some('r') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 't', 'i', 'a', 'l') - .then_some(TokenKind::PartialKeyword) + Some('c') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 'r', 'o') + .then_some(TokenKind::YulMacroKeyword) } else { None } } - Some('y') => scan_chars!(input, 'a', 'b', 'l', 'e') - .then_some(TokenKind::PayableKeyword), - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('r') => match input.next() { - Some('a') => scan_chars!(input, 'g', 'm', 'a') - .then_some(TokenKind::PragmaKeyword), - Some('i') => scan_chars!(input, 'v', 'a', 't', 'e') - .then_some(TokenKind::PrivateKeyword), - Some('o') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'm', 'i', 's', 'e') - .then_some(TokenKind::PromiseKeyword) + Some('p') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'p', 'i', 'n', 'g') + .then_some(TokenKind::YulMappingKeyword) } else { None } } - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('u') => match input.next() { - Some('b') => scan_chars!(input, 'l', 'i', 'c') - .then_some(TokenKind::PublicKeyword), - Some('r') => scan_chars!(input, 'e').then_some(TokenKind::PureKeyword), - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('r') => { - if scan_chars!(input, 'e') { - match input.next() { - Some('c') => { - if self.version_is_at_least_0_6_0 { - scan_chars!(input, 'e', 'i', 'v', 'e') - .then_some(TokenKind::ReceiveKeyword) - } else { - None - } - } - Some('f') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'e', 'r', 'e', 'n', 'c', 'e') - .then_some(TokenKind::ReferenceKeyword) - } else { - None - } - } - Some('l') => { - scan_chars!(input, 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e') - .then_some(TokenKind::RelocatableKeyword) - } - Some('t') => { - if scan_chars!(input, 'u', 'r', 'n') { - match input.next() { - Some('s') => Some(TokenKind::ReturnsKeyword), - Some(_) => { - input.undo(); - Some(TokenKind::ReturnKeyword) - } - None => Some(TokenKind::ReturnKeyword), - } - } else { - None - } - } - Some('v') => { - if self.version_is_at_least_0_8_4 { - scan_chars!(input, 'e', 'r', 't') - .then_some(TokenKind::RevertKeyword) - } else { - None - } - } - Some(_) => { - input.undo(); - None - } - None => None, - } - } else { - None - } - } - Some('s') => match input.next() { - Some('e') => match input.next() { - Some('a') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'l', 'e', 'd') - .then_some(TokenKind::SealedKeyword) + Some('t') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'c', 'h') + .then_some(TokenKind::YulMatchKeyword) } else { None } } - Some('c') => scan_chars!(input, 'o', 'n', 'd', 's') - .then_some(TokenKind::SecondsKeyword), Some(_) => { input.undo(); None } None => None, }, - Some('i') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'z', 'e', 'o', 'f') - .then_some(TokenKind::SizeofKeyword) + Some('e') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'm', 'o', 'r', 'y') + .then_some(TokenKind::YulMemoryKeyword) } else { None } } - Some('o') => scan_chars!(input, 'l', 'i', 'd', 'i', 't', 'y') - .then_some(TokenKind::SolidityKeyword), - Some('t') => { - match input.next() { - Some('a') => scan_chars!(input, 't', 'i', 'c') - .then_some(TokenKind::StaticKeyword), - Some('o') => scan_chars!(input, 'r', 'a', 'g', 'e') - .then_some(TokenKind::StorageKeyword), - Some('r') => match input.next() { - Some('i') => scan_chars!(input, 'n', 'g') - .then_some(TokenKind::StringKeyword), - Some('u') => scan_chars!(input, 'c', 't') - .then_some(TokenKind::StructKeyword), - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some(_) => { - input.undo(); - None - } - None => None, + Some('i') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'n', 'u', 't', 'e', 's') + .then_some(TokenKind::YulMinutesKeyword) + } else { + None } } - Some('u') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'p', 'p', 'o', 'r', 't', 's') - .then_some(TokenKind::SupportsKeyword) + Some('o') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'd', 'i', 'f', 'i', 'e', 'r') + .then_some(TokenKind::YulModifierKeyword) } else { None } } - Some('w') => scan_chars!(input, 'i', 't', 'c', 'h') - .then_some(TokenKind::SwitchKeyword), - Some('z') => { - if !self.version_is_at_least_0_7_0 { - scan_chars!(input, 'a', 'b', 'o').then_some(TokenKind::SzaboKeyword) + Some('u') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 't', 'a', 'b', 'l', 'e') + .then_some(TokenKind::YulMutableKeyword) } else { None } @@ -6521,39 +10566,17 @@ impl Lexer for Language { } None => None, }, - Some('t') => match input.next() { - Some('h') => { - scan_chars!(input, 'r', 'o', 'w').then_some(TokenKind::ThrowKeyword) - } - Some('r') => match input.next() { - Some('u') => scan_chars!(input, 'e').then_some(TokenKind::TrueKeyword), - Some('y') => Some(TokenKind::TryKeyword), - Some(_) => { - input.undo(); + Some('n') => match input.next() { + Some('e') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'w').then_some(TokenKind::YulNewKeyword) + } else { None } - None => None, - }, - Some('y') => { - if scan_chars!(input, 'p', 'e') { - match input.next() { - Some('d') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'e', 'f') - .then_some(TokenKind::TypedefKeyword) - } else { - None - } - } - Some('o') => { - scan_chars!(input, 'f').then_some(TokenKind::TypeofKeyword) - } - Some(_) => { - input.undo(); - Some(TokenKind::TypeKeyword) - } - None => Some(TokenKind::TypeKeyword), - } + } + Some('u') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'l', 'l').then_some(TokenKind::YulNullKeyword) } else { None } @@ -6564,17 +10587,21 @@ impl Lexer for Language { } None => None, }, - Some('u') => match input.next() { - Some('n') => { - if self.version_is_at_least_0_5_0 { - scan_chars!(input, 'c', 'h', 'e', 'c', 'k', 'e', 'd') - .then_some(TokenKind::UncheckedKeyword) + Some('o') => match input.next() { + Some('f') => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulOfKeyword) } else { None } } - Some('s') => { - scan_chars!(input, 'i', 'n', 'g').then_some(TokenKind::UsingKeyword) + Some('v') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e', 'r', 'r', 'i', 'd', 'e') + .then_some(TokenKind::YulOverrideKeyword) + } else { + None + } } Some(_) => { input.undo(); @@ -6582,14 +10609,21 @@ impl Lexer for Language { } None => None, }, - Some('v') => match input.next() { - Some('a') => scan_chars!(input, 'r').then_some(TokenKind::VarKeyword), - Some('i') => match input.next() { - Some('e') => scan_chars!(input, 'w').then_some(TokenKind::ViewKeyword), + Some('p') => match input.next() { + Some('a') => match input.next() { Some('r') => { - if self.version_is_at_least_0_6_0 { - scan_chars!(input, 't', 'u', 'a', 'l') - .then_some(TokenKind::VirtualKeyword) + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 't', 'i', 'a', 'l') + .then_some(TokenKind::YulPartialKeyword) + } else { + None + } + } + Some('y') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'a', 'b', 'l', 'e') + .then_some(TokenKind::YulPayableKeyword) } else { None } @@ -6600,353 +10634,410 @@ impl Lexer for Language { } None => None, }, - Some(_) => { - input.undo(); - None - } - None => None, - }, - Some('w') => match input.next() { - Some('e') => match input.next() { - Some('e') => { - scan_chars!(input, 'k', 's').then_some(TokenKind::WeeksKeyword) + Some('r') => match input.next() { + Some('a') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'g', 'm', 'a') + .then_some(TokenKind::YulPragmaKeyword) + } else { + None + } + } + Some('i') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'v', 'a', 't', 'e') + .then_some(TokenKind::YulPrivateKeyword) + } else { + None + } + } + Some('o') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 'm', 'i', 's', 'e') + .then_some(TokenKind::YulPromiseKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('u') => match input.next() { + Some('b') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'l', 'i', 'c') + .then_some(TokenKind::YulPublicKeyword) + } else { + None + } + } + Some('r') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e').then_some(TokenKind::YulPureKeyword) + } else { + None + } } - Some('i') => Some(TokenKind::WeiKeyword), Some(_) => { input.undo(); None } None => None, }, - Some('h') => { - scan_chars!(input, 'i', 'l', 'e').then_some(TokenKind::WhileKeyword) - } Some(_) => { input.undo(); None } None => None, }, - Some('y') => { - scan_chars!(input, 'e', 'a', 'r', 's').then_some(TokenKind::YearsKeyword) - } - Some(_) => { - input.undo(); - None - } - None => None, - } { - // Make sure that this is not the start of an identifier - if !self.identifier_part(input) { - furthest_position = input.position(); - longest_token = Some(kind); - } - } - input.set_position(save); - - if let Some(kind) = match input.next() { - Some('!') => match input.next() { - Some('=') => Some(TokenKind::BangEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Bang) - } - None => Some(TokenKind::Bang), - }, - Some('%') => match input.next() { - Some('=') => Some(TokenKind::PercentEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Percent) - } - None => Some(TokenKind::Percent), - }, - Some('&') => match input.next() { - Some('&') => Some(TokenKind::AmpersandAmpersand), - Some('=') => Some(TokenKind::AmpersandEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Ampersand) - } - None => Some(TokenKind::Ampersand), - }, - Some('(') => Some(TokenKind::OpenParen), - Some(')') => Some(TokenKind::CloseParen), - Some('*') => match input.next() { - Some('*') => Some(TokenKind::AsteriskAsterisk), - Some('=') => Some(TokenKind::AsteriskEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Asterisk) - } - None => Some(TokenKind::Asterisk), - }, - Some('+') => match input.next() { - Some('+') => Some(TokenKind::PlusPlus), - Some('=') => Some(TokenKind::PlusEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Plus) - } - None => Some(TokenKind::Plus), - }, - Some(',') => Some(TokenKind::Comma), - Some('-') => match input.next() { - Some('-') => Some(TokenKind::MinusMinus), - Some('=') => Some(TokenKind::MinusEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Minus) - } - None => Some(TokenKind::Minus), - }, - Some('.') => Some(TokenKind::Period), - Some('/') => match input.next() { - Some('=') => Some(TokenKind::SlashEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Slash) + Some('r') => { + if scan_chars!(input, 'e') { + match input.next() { + Some('c') => { + if self.version_is_at_least_0_6_0 + && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 'e', 'i', 'v', 'e') + .then_some(TokenKind::YulReceiveKeyword) + } else { + None + } + } + Some('f') => { + if self.version_is_at_least_0_5_0 + && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 'e', 'r', 'e', 'n', 'c', 'e') + .then_some(TokenKind::YulReferenceKeyword) + } else { + None + } + } + Some('l') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'o', 'c', 'a', 't', 'a', 'b', 'l', 'e') + .then_some(TokenKind::YulRelocatableKeyword) + } else { + None + } + } + Some('t') => { + if scan_chars!(input, 'u', 'r', 'n') { + match input.next() { + Some('s') => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulReturnsKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + Some(TokenKind::YulReturnKeyword) + } + None => Some(TokenKind::YulReturnKeyword), + } + } else { + None + } + } + Some('v') => scan_chars!(input, 'e', 'r', 't') + .then_some(TokenKind::YulRevertKeyword), + Some(_) => { + input.undo(); + None + } + None => None, + } + } else { + None } - None => Some(TokenKind::Slash), - }, - Some(':') => Some(TokenKind::Colon), - Some(';') => Some(TokenKind::Semicolon), - Some('<') => match input.next() { - Some('<') => match input.next() { - Some('=') => Some(TokenKind::LessThanLessThanEqual), + } + Some('s') => match input.next() { + Some('e') => match input.next() { + Some('a') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 'l', 'e', 'd') + .then_some(TokenKind::YulSealedKeyword) + } else { + None + } + } + Some('c') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'o', 'n', 'd', 's') + .then_some(TokenKind::YulSecondsKeyword) + } else { + None + } + } Some(_) => { input.undo(); - Some(TokenKind::LessThanLessThan) + None } - None => Some(TokenKind::LessThanLessThan), + None => None, }, - Some('=') => Some(TokenKind::LessThanEqual), - Some(_) => { - input.undo(); - Some(TokenKind::LessThan) - } - None => Some(TokenKind::LessThan), - }, - Some('=') => match input.next() { - Some('=') => Some(TokenKind::EqualEqual), - Some('>') => Some(TokenKind::EqualGreaterThan), - Some(_) => { - input.undo(); - Some(TokenKind::Equal) - } - None => Some(TokenKind::Equal), - }, - Some('>') => match input.next() { - Some('=') => Some(TokenKind::GreaterThanEqual), - Some('>') => match input.next() { - Some('=') => Some(TokenKind::GreaterThanGreaterThanEqual), - Some('>') => match input.next() { - Some('=') => { - Some(TokenKind::GreaterThanGreaterThanGreaterThanEqual) + Some('i') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'z', 'e', 'o', 'f') + .then_some(TokenKind::YulSizeOfKeyword) + } else { + None + } + } + Some('t') => match input.next() { + Some('a') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 't', 'i', 'c') + .then_some(TokenKind::YulStaticKeyword) + } else { + None + } + } + Some('o') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'r', 'a', 'g', 'e') + .then_some(TokenKind::YulStorageKeyword) + } else { + None + } + } + Some('r') => match input.next() { + Some('i') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'n', 'g') + .then_some(TokenKind::YulStringKeyword) + } else { + None + } + } + Some('u') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'c', 't') + .then_some(TokenKind::YulStructKeyword) + } else { + None + } } Some(_) => { input.undo(); - Some(TokenKind::GreaterThanGreaterThanGreaterThan) + None } - None => Some(TokenKind::GreaterThanGreaterThanGreaterThan), + None => None, }, Some(_) => { input.undo(); - Some(TokenKind::GreaterThanGreaterThan) + None } - None => Some(TokenKind::GreaterThanGreaterThan), + None => None, }, - Some(_) => { - input.undo(); - Some(TokenKind::GreaterThan) + Some('u') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'p', 'p', 'o', 'r', 't', 's') + .then_some(TokenKind::YulSupportsKeyword) + } else { + None + } } - None => Some(TokenKind::GreaterThan), - }, - Some('?') => Some(TokenKind::QuestionMark), - Some('[') => Some(TokenKind::OpenBracket), - Some(']') => Some(TokenKind::CloseBracket), - Some('^') => match input.next() { - Some('=') => Some(TokenKind::CaretEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Caret) + Some('w') => scan_chars!(input, 'i', 't', 'c', 'h') + .then_some(TokenKind::YulSwitchKeyword), + Some('z') => { + if !self.version_is_at_least_0_7_0 { + scan_chars!(input, 'a', 'b', 'o') + .then_some(TokenKind::YulSzaboKeyword) + } else { + None + } } - None => Some(TokenKind::Caret), - }, - Some('{') => Some(TokenKind::OpenBrace), - Some('|') => match input.next() { - Some('=') => Some(TokenKind::BarEqual), - Some('|') => Some(TokenKind::BarBar), Some(_) => { input.undo(); - Some(TokenKind::Bar) + None } - None => Some(TokenKind::Bar), + None => None, }, - Some('}') => Some(TokenKind::CloseBrace), - Some('~') => Some(TokenKind::Tilde), - Some(_) => { - input.undo(); - None - } - None => None, - } { - furthest_position = input.position(); - longest_token = Some(kind); - } - input.set_position(save); - - longest_match! { - { AsciiStringLiteral = ascii_string_literal } - { DecimalLiteral = decimal_literal } - { EndOfLine = end_of_line } - { FixedBytesType = fixed_bytes_type } - { HexLiteral = hex_literal } - { HexStringLiteral = hex_string_literal } - { MultilineComment = multiline_comment } - { SignedFixedType = signed_fixed_type } - { SignedIntegerType = signed_integer_type } - { SingleLineComment = single_line_comment } - { UnicodeStringLiteral = unicode_string_literal } - { UnsignedFixedType = unsigned_fixed_type } - { UnsignedIntegerType = unsigned_integer_type } - { Whitespace = whitespace } - { Identifier = identifier } - } - } - LexicalContext::VersionPragma => { - macro_rules! longest_match { - ($( { $kind:ident = $function:ident } )*) => { - $( - if self.$function(input) && input.position() > furthest_position { - furthest_position = input.position(); - longest_token = Some(TokenKind::$kind); + Some('t') => match input.next() { + Some('h') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'r', 'o', 'w') + .then_some(TokenKind::YulThrowKeyword) + } else { + None + } + } + Some('r') => match input.next() { + Some('u') => { + scan_chars!(input, 'e').then_some(TokenKind::YulTrueKeyword) + } + Some('y') => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulTryKeyword) + } else { + None } - input.set_position(save); - )* - }; - } - - if let Some(kind) = scan_chars!(input, 's', 'o', 'l', 'i', 'd', 'i', 't', 'y') - .then_some(TokenKind::SolidityKeyword) - { - // Make sure that this is not the start of an identifier - if !self.identifier_part(input) { - furthest_position = input.position(); - longest_token = Some(kind); - } - } - input.set_position(save); - - if let Some(kind) = match input.next() { - Some('-') => Some(TokenKind::Minus), - Some('.') => Some(TokenKind::Period), - Some('<') => match input.next() { - Some('=') => Some(TokenKind::LessThanEqual), - Some(_) => { - input.undo(); - Some(TokenKind::LessThan) + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('y') => { + if scan_chars!(input, 'p', 'e') { + match input.next() { + Some('d') => { + if self.version_is_at_least_0_5_0 + && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 'e', 'f') + .then_some(TokenKind::YulTypeDefKeyword) + } else { + None + } + } + Some('o') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'f') + .then_some(TokenKind::YulTypeOfKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulTypeKeyword) + } else { + None + } + } + None => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulTypeKeyword) + } else { + None + } + } + } + } else { + None + } } - None => Some(TokenKind::LessThan), - }, - Some('=') => Some(TokenKind::Equal), - Some('>') => match input.next() { - Some('=') => Some(TokenKind::GreaterThanEqual), Some(_) => { input.undo(); - Some(TokenKind::GreaterThan) + None } - None => Some(TokenKind::GreaterThan), + None => None, }, - Some('^') => Some(TokenKind::Caret), - Some('|') => scan_chars!(input, '|').then_some(TokenKind::BarBar), - Some('~') => Some(TokenKind::Tilde), - Some(_) => { - input.undo(); - None - } - None => None, - } { - furthest_position = input.position(); - longest_token = Some(kind); - } - input.set_position(save); - - longest_match! { - { VersionPragmaValue = version_pragma_value } - } - } - LexicalContext::YulBlock => { - macro_rules! longest_match { - ($( { $kind:ident = $function:ident } )*) => { - $( - if self.$function(input) && input.position() > furthest_position { - furthest_position = input.position(); - longest_token = Some(TokenKind::$kind); - } - input.set_position(save); - )* - }; - } - - if let Some(kind) = match input.next() { - Some('b') => { - scan_chars!(input, 'r', 'e', 'a', 'k').then_some(TokenKind::BreakKeyword) - } - Some('c') => match input.next() { - Some('a') => scan_chars!(input, 's', 'e').then_some(TokenKind::CaseKeyword), - Some('o') => scan_chars!(input, 'n', 't', 'i', 'n', 'u', 'e') - .then_some(TokenKind::ContinueKeyword), + Some('u') => match input.next() { + Some('n') => { + if self.version_is_at_least_0_5_0 && !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'c', 'h', 'e', 'c', 'k', 'e', 'd') + .then_some(TokenKind::YulUncheckedKeyword) + } else { + None + } + } + Some('s') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'i', 'n', 'g') + .then_some(TokenKind::YulUsingKeyword) + } else { + None + } + } Some(_) => { input.undo(); None } None => None, }, - Some('d') => scan_chars!(input, 'e', 'f', 'a', 'u', 'l', 't') - .then_some(TokenKind::DefaultKeyword), - Some('f') => match input.next() { + Some('v') => match input.next() { Some('a') => { - scan_chars!(input, 'l', 's', 'e').then_some(TokenKind::FalseKeyword) + if !self.version_is_at_least_0_6_5 { + scan_chars!(input, 'r').then_some(TokenKind::YulVarKeyword) + } else { + None + } } - Some('o') => scan_chars!(input, 'r').then_some(TokenKind::ForKeyword), - Some('u') => scan_chars!(input, 'n', 'c', 't', 'i', 'o', 'n') - .then_some(TokenKind::FunctionKeyword), + Some('i') => match input.next() { + Some('e') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'w').then_some(TokenKind::YulViewKeyword) + } else { + None + } + } + Some('r') => { + if self.version_is_at_least_0_6_0 && !self.version_is_at_least_0_7_1 + { + scan_chars!(input, 't', 'u', 'a', 'l') + .then_some(TokenKind::YulVirtualKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, Some(_) => { input.undo(); None } None => None, }, - Some('h') => scan_chars!(input, 'e', 'x').then_some(TokenKind::HexKeyword), - Some('i') => scan_chars!(input, 'f').then_some(TokenKind::IfKeyword), - Some('l') => { - if scan_chars!(input, 'e') { - match input.next() { - Some('a') => { - if self.version_is_at_least_0_6_0 { - scan_chars!(input, 'v', 'e') - .then_some(TokenKind::LeaveKeyword) - } else { - None - } + Some('w') => match input.next() { + Some('e') => match input.next() { + Some('e') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'k', 's') + .then_some(TokenKind::YulWeeksKeyword) + } else { + None } - Some('t') => Some(TokenKind::LetKeyword), - Some(_) => { - input.undo(); + } + Some('i') => { + if !self.version_is_at_least_0_7_1 { + Some(TokenKind::YulWeiKeyword) + } else { None } - None => None, } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('h') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'i', 'l', 'e') + .then_some(TokenKind::YulWhileKeyword) + } else { + None + } + } + Some(_) => { + input.undo(); + None + } + None => None, + }, + Some('y') => { + if !self.version_is_at_least_0_7_1 { + scan_chars!(input, 'e', 'a', 'r', 's') + .then_some(TokenKind::YulYearsKeyword) } else { None } } - Some('s') => scan_chars!(input, 'w', 'i', 't', 'c', 'h') - .then_some(TokenKind::SwitchKeyword), - Some('t') => { - scan_chars!(input, 'r', 'u', 'e').then_some(TokenKind::TrueKeyword) - } Some(_) => { input.undo(); None @@ -6984,9 +11075,14 @@ impl Lexer for Language { longest_match! { { AsciiStringLiteral = ascii_string_literal } { HexStringLiteral = hex_string_literal } + { YulBytesKeyword = yul_bytes_keyword } { YulDecimalLiteral = yul_decimal_literal } + { YulFixedKeyword = yul_fixed_keyword } { YulHexLiteral = yul_hex_literal } { YulIdentifier = yul_identifier } + { YulIntKeyword = yul_int_keyword } + { YulUfixedKeyword = yul_ufixed_keyword } + { YulUintKeyword = yul_uint_keyword } } } } diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.4.11-failure.yml index 3182db5880..ede1a0b025 100644 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.4.11-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected Ampersand or AmpersandAmpersand or AmpersandEqual or Asterisk or AsteriskAsterisk or AsteriskEqual or BangEqual or Bar or BarBar or BarEqual or Caret or CaretEqual or Equal or EqualEqual or GreaterThan or GreaterThanEqual or GreaterThanGreaterThan or GreaterThanGreaterThanEqual or GreaterThanGreaterThanGreaterThan or GreaterThanGreaterThanGreaterThanEqual or LessThan or LessThanEqual or LessThanLessThan or LessThanLessThanEqual or Minus or MinusEqual or Percent or PercentEqual or Plus or PlusEqual or Semicolon or Slash or SlashEqual. + Error: Expected Identifier or MemoryKeyword or StorageKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Block/unchecked/input.sol:1:13] │ 1 │ { unchecked { x = 1; } } @@ -16,10 +16,12 @@ Errors: # 1 total Tree: - Block (Rule): # 0..24 "{ unchecked { x = 1; } }" - OpenBrace (Token): "{" # 0..1 - - StatementsList (Rule): # 1..12 " unchecked " + - Statements (Rule): # 1..12 " unchecked " - Statement (Rule): # 1..12 " unchecked " - - ExpressionStatement (Rule): # 1..12 " unchecked " - - Expression (Rule): # 1..11 " unchecked" - - Identifier (Token): "unchecked" # 2..11 + - VariableDeclarationStatement (Rule): # 1..12 " unchecked " + - VariableDeclarationType (Rule): # 1..11 " unchecked" + - TypeName (Rule): # 1..11 " unchecked" + - IdentifierPath (Rule): # 1..11 " unchecked" + - Identifier (Token): "unchecked" # 2..11 - SKIPPED (Token): "{ x = 1; } " # 12..23 - CloseBrace (Token): "}" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.0-failure.yml index 8486b70dc9..0bfe0112e2 100644 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Block/unchecked/input.sol:1:3] │ 1 │ { unchecked { x = 1; } } @@ -16,5 +16,6 @@ Errors: # 1 total Tree: - Block (Rule): # 0..24 "{ unchecked { x = 1; } }" - OpenBrace (Token): "{" # 0..1 + - Statements (Rule): [] # 1..1 - SKIPPED (Token): "unchecked { x = 1; } " # 2..23 - CloseBrace (Token): "}" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.3-failure.yml index 1c68af4b94..bf376e1c94 100644 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.5.3-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Block/unchecked/input.sol:1:3] │ 1 │ { unchecked { x = 1; } } @@ -16,5 +16,6 @@ Errors: # 1 total Tree: - Block (Rule): # 0..24 "{ unchecked { x = 1; } }" - OpenBrace (Token): "{" # 0..1 + - Statements (Rule): [] # 1..1 - SKIPPED (Token): "unchecked { x = 1; } " # 2..23 - CloseBrace (Token): "}" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.6.0-failure.yml index 2e3dd74e6d..46d8399811 100644 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.6.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Block/unchecked/input.sol:1:3] │ 1 │ { unchecked { x = 1; } } @@ -16,5 +16,6 @@ Errors: # 1 total Tree: - Block (Rule): # 0..24 "{ unchecked { x = 1; } }" - OpenBrace (Token): "{" # 0..1 + - Statements (Rule): [] # 1..1 - SKIPPED (Token): "unchecked { x = 1; } " # 2..23 - CloseBrace (Token): "}" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.7.0-failure.yml index 665285cfb2..95fe0d19d4 100644 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.7.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Block/unchecked/input.sol:1:3] │ 1 │ { unchecked { x = 1; } } @@ -16,5 +16,6 @@ Errors: # 1 total Tree: - Block (Rule): # 0..24 "{ unchecked { x = 1; } }" - OpenBrace (Token): "{" # 0..1 + - Statements (Rule): [] # 1..1 - SKIPPED (Token): "unchecked { x = 1; } " # 2..23 - CloseBrace (Token): "}" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.8.0-success.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.8.0-success.yml index 4779b7c45a..e54c525bb5 100644 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.8.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.8.0-success.yml @@ -8,13 +8,13 @@ Errors: [] Tree: - Block (Rule): # 0..24 "{ unchecked { x = 1; } }" - OpenBrace (Token): "{" # 0..1 - - StatementsList (Rule): # 1..22 " unchecked { x = 1; }" + - Statements (Rule): # 1..22 " unchecked { x = 1; }" - Statement (Rule): # 1..22 " unchecked { x = 1; }" - UncheckedBlock (Rule): # 1..22 " unchecked { x = 1; }" - UncheckedKeyword (Token): "unchecked" # 2..11 - Block (Rule): # 11..22 " { x = 1; }" - OpenBrace (Token): "{" # 12..13 - - StatementsList (Rule): # 13..20 " x = 1;" + - Statements (Rule): # 13..20 " x = 1;" - Statement (Rule): # 13..20 " x = 1;" - ExpressionStatement (Rule): # 13..20 " x = 1;" - Expression (Rule): # 13..19 " x = 1" @@ -23,7 +23,7 @@ Tree: - Identifier (Token): "x" # 14..15 - Equal (Token): "=" # 16..17 - Expression (Rule): # 17..19 " 1" - - NumericExpression (Rule): # 17..19 " 1" + - DecimalNumberExpression (Rule): # 17..19 " 1" - DecimalLiteral (Token): "1" # 18..19 - Semicolon (Token): ";" # 19..20 - CloseBrace (Token): "}" # 21..22 diff --git a/crates/solidity/testing/snapshots/cst_output/ConstantDefinition/int/generated/0.7.4-success.yml b/crates/solidity/testing/snapshots/cst_output/ConstantDefinition/int/generated/0.7.4-success.yml index c69014cca6..47bfd2ebce 100644 --- a/crates/solidity/testing/snapshots/cst_output/ConstantDefinition/int/generated/0.7.4-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ConstantDefinition/int/generated/0.7.4-success.yml @@ -8,11 +8,12 @@ Errors: [] Tree: - ConstantDefinition (Rule): # 0..21 "int constant foo = 0;" - TypeName (Rule): # 0..3 "int" - - SignedIntegerType (Token): "int" # 0..3 + - ElementaryType (Rule): # 0..3 "int" + - IntKeyword (Token): "int" # 0..3 - ConstantKeyword (Token): "constant" # 4..12 - Identifier (Token): "foo" # 13..16 - Equal (Token): "=" # 17..18 - Expression (Rule): # 18..20 " 0" - - NumericExpression (Rule): # 18..20 " 0" + - DecimalNumberExpression (Rule): # 18..20 " 0" - DecimalLiteral (Token): "0" # 19..20 - Semicolon (Token): ";" # 20..21 diff --git a/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.22-failure.yml b/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.22-failure.yml new file mode 100644 index 0000000000..2bb60f49e2 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.22-failure.yml @@ -0,0 +1,17 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ constructor () {} │ 0..17 + +Errors: # 1 total + - > + Error: Expected ConstructorKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/input.sol:1:1] + │ + 1 │ constructor () {} + │ ────────┬──────── + │ ╰────────── Error occurred here. + ───╯ + +Tree: + - SKIPPED (Token): "constructor () {}" # 0..17 diff --git a/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.22-success.yml b/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.5.0-success.yml similarity index 81% rename from crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.22-success.yml rename to crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.5.0-success.yml index 5bc3260939..c20dafe189 100644 --- a/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.4.22-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/simple/generated/0.5.0-success.yml @@ -10,7 +10,10 @@ Tree: - ConstructorKeyword (Token): "constructor" # 0..11 - ParametersDeclaration (Rule): # 11..14 " ()" - OpenParen (Token): "(" # 12..13 + - Parameters (Rule): [] # 13..13 - CloseParen (Token): ")" # 13..14 + - ConstructorAttributes (Rule): [] # 14..14 - Block (Rule): # 14..17 " {}" - OpenBrace (Token): "{" # 15..16 + - Statements (Rule): [] # 16..16 - CloseBrace (Token): "}" # 16..17 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/abstract_contract/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/abstract_contract/generated/0.6.0-success.yml index b888d1908c..7b1cb5c6f3 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/abstract_contract/generated/0.6.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/abstract_contract/generated/0.6.0-success.yml @@ -11,4 +11,5 @@ Tree: - ContractKeyword (Token): "contract" # 9..17 - Identifier (Token): "Sample" # 18..24 - OpenBrace (Token): "{" # 25..26 + - ContractMembers (Rule): [] # 26..26 - CloseBrace (Token): "}" # 26..27 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/empty_contract/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/empty_contract/generated/0.4.11-success.yml index ac41b0a014..aad0456e49 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/empty_contract/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/empty_contract/generated/0.4.11-success.yml @@ -10,4 +10,5 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): [] # 17..17 - CloseBrace (Token): "}" # 17..18 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.4.11-failure.yml index 41b8661c2d..ec799655a0 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.4.11-failure.yml @@ -28,101 +28,115 @@ Tree: - ContractKeyword (Token): "contract" # 32..40 - Identifier (Token): "ABC" # 41..44 - OpenBrace (Token): "{" # 45..46 - - ContractMembersList (Rule): # 47..350 " function sendValue(address payable recipient, ui..." - - FunctionDefinition (Rule): # 47..350 " function sendValue(address payable recipient, ui..." - - FunctionKeyword (Token): "function" # 49..57 - - Identifier (Token): "sendValue" # 58..67 - - ParametersDeclaration (Rule): # 67..110 "(address payable recipient, uint256 amount)" - - OpenParen (Token): "(" # 67..68 - - ParametersList (Rule): # 68..109 "address payable recipient, uint256 amount" - - Parameter (Rule): # 68..93 "address payable recipient" - - TypeName (Rule): # 68..83 "address payable" - - AddressType (Rule): # 68..83 "address payable" - - AddressKeyword (Token): "address" # 68..75 - - PayableKeyword (Token): "payable" # 76..83 - - Identifier (Token): "recipient" # 84..93 - - Comma (Token): "," # 93..94 - - Parameter (Rule): # 94..109 " uint256 amount" - - TypeName (Rule): # 94..102 " uint256" - - UnsignedIntegerType (Token): "uint256" # 95..102 - - Identifier (Token): "amount" # 103..109 - - CloseParen (Token): ")" # 109..110 - - FunctionAttributesList (Rule): # 110..119 " internal" - - InternalKeyword (Token): "internal" # 111..119 - - Block (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' - - OpenBrace (Token): "{" # 120..121 - - StatementsList (Rule): # 122..346 ' require(address(this).balance >= amount, "Addr...' - - Statement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' - - ExpressionStatement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' - - Expression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' - - FunctionCallExpression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' - - Expression (Rule): # 122..133 " require" - - Identifier (Token): "require" # 126..133 - - ArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' - - OpenParen (Token): "(" # 133..134 - - PositionalArgumentsList (Rule): # 134..198 'address(this).balance >= amount, "Address: insuffi...' - - Expression (Rule): # 134..165 "address(this).balance >= amount" - - BinaryExpression (Rule): # 134..165 "address(this).balance >= amount" - - Expression (Rule): # 134..155 "address(this).balance" - - MemberAccessExpression (Rule): # 134..155 "address(this).balance" - - Expression (Rule): # 134..147 "address(this)" - - FunctionCallExpression (Rule): # 134..147 "address(this)" - - Expression (Rule): # 134..141 "address" - - AddressType (Rule): # 134..141 "address" - - AddressKeyword (Token): "address" # 134..141 - - ArgumentsDeclaration (Rule): # 141..147 "(this)" - - OpenParen (Token): "(" # 141..142 - - PositionalArgumentsList (Rule): # 142..146 "this" - - Expression (Rule): # 142..146 "this" - - Identifier (Token): "this" # 142..146 - - CloseParen (Token): ")" # 146..147 - - Period (Token): "." # 147..148 - - Identifier (Token): "balance" # 148..155 - - GreaterThanEqual (Token): ">=" # 156..158 - - Expression (Rule): # 158..165 " amount" - - Identifier (Token): "amount" # 159..165 - - Comma (Token): "," # 165..166 - - Expression (Rule): # 166..198 ' "Address: insufficient balance"' - - AsciiStringLiteralsList (Rule): # 166..198 ' "Address: insufficient balance"' - - AsciiStringLiteral (Token): '"Address: insufficient balance"' # 167..198 - - CloseParen (Token): ")" # 198..199 - - Semicolon (Token): ";" # 199..200 - - Statement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." - - TupleDeconstructionStatement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." - - OpenParen (Token): "(" # 206..207 - - TupleMembersList (Rule): # 207..220 "bool success," - - TupleMember (Rule): # 207..219 "bool success" - - TypeName (Rule): # 207..211 "bool" - - BoolKeyword (Token): "bool" # 207..211 - - Identifier (Token): "success" # 212..219 - - Comma (Token): "," # 219..220 - - TupleMember (Rule): [] # 220..220 - - CloseParen (Token): ")" # 221..222 - - Equal (Token): "=" # 223..224 - - Expression (Rule): # 224..239 " recipient.call" - - MemberAccessExpression (Rule): # 224..239 " recipient.call" - - Expression (Rule): # 224..234 " recipient" - - Identifier (Token): "recipient" # 225..234 - - Period (Token): "." # 234..235 - - Identifier (Token): "call" # 235..239 - - SKIPPED (Token): '{ value: amount }("")' # 239..260 - - Semicolon (Token): ";" # 260..261 - - Statement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' - - ExpressionStatement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' - - Expression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' - - FunctionCallExpression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' - - Expression (Rule): # 262..273 " require" - - Identifier (Token): "require" # 266..273 - - ArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' - - OpenParen (Token): "(" # 273..274 - - PositionalArgumentsList (Rule): # 274..343 'success, "Address: unable to send value, recipient...' - - Expression (Rule): # 274..281 "success" - - Identifier (Token): "success" # 274..281 - - Comma (Token): "," # 281..282 - - Expression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' - - AsciiStringLiteralsList (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' - - AsciiStringLiteral (Token): '"Address: unable to send value, recipient may have...' # 283..343 - - CloseParen (Token): ")" # 343..344 - - Semicolon (Token): ";" # 344..345 - - CloseBrace (Token): "}" # 348..349 + - ContractMembers (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - ContractMember (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - FunctionDefinition (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - FunctionKeyword (Token): "function" # 49..57 + - Identifier (Token): "sendValue" # 58..67 + - ParametersDeclaration (Rule): # 67..110 "(address payable recipient, uint256 amount)" + - OpenParen (Token): "(" # 67..68 + - Parameters (Rule): # 68..109 "address payable recipient, uint256 amount" + - Parameter (Rule): # 68..93 "address payable recipient" + - TypeName (Rule): # 68..83 "address payable" + - ElementaryType (Rule): # 68..83 "address payable" + - AddressType (Rule): # 68..83 "address payable" + - AddressKeyword (Token): "address" # 68..75 + - PayableKeyword (Token): "payable" # 76..83 + - Identifier (Token): "recipient" # 84..93 + - Comma (Token): "," # 93..94 + - Parameter (Rule): # 94..109 " uint256 amount" + - TypeName (Rule): # 94..102 " uint256" + - ElementaryType (Rule): # 94..102 " uint256" + - UintKeyword (Token): "uint256" # 95..102 + - Identifier (Token): "amount" # 103..109 + - CloseParen (Token): ")" # 109..110 + - FunctionAttributes (Rule): # 110..119 " internal" + - FunctionAttribute (Rule): # 110..119 " internal" + - InternalKeyword (Token): "internal" # 111..119 + - FunctionBody (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' + - Block (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' + - OpenBrace (Token): "{" # 120..121 + - Statements (Rule): # 122..346 ' require(address(this).balance >= amount, "Addr...' + - Statement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' + - ExpressionStatement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' + - Expression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' + - FunctionCallExpression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' + - Expression (Rule): # 122..133 " require" + - Identifier (Token): "require" # 126..133 + - ArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' + - PositionalArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' + - OpenParen (Token): "(" # 133..134 + - PositionalArguments (Rule): # 134..198 'address(this).balance >= amount, "Address: insuffi...' + - Expression (Rule): # 134..165 "address(this).balance >= amount" + - BinaryExpression (Rule): # 134..165 "address(this).balance >= amount" + - Expression (Rule): # 134..155 "address(this).balance" + - MemberAccessExpression (Rule): # 134..155 "address(this).balance" + - Expression (Rule): # 134..147 "address(this)" + - FunctionCallExpression (Rule): # 134..147 "address(this)" + - Expression (Rule): # 134..141 "address" + - ElementaryType (Rule): # 134..141 "address" + - AddressType (Rule): # 134..141 "address" + - AddressKeyword (Token): "address" # 134..141 + - ArgumentsDeclaration (Rule): # 141..147 "(this)" + - PositionalArgumentsDeclaration (Rule): # 141..147 "(this)" + - OpenParen (Token): "(" # 141..142 + - PositionalArguments (Rule): # 142..146 "this" + - Expression (Rule): # 142..146 "this" + - Identifier (Token): "this" # 142..146 + - CloseParen (Token): ")" # 146..147 + - Period (Token): "." # 147..148 + - Identifier (Token): "balance" # 148..155 + - GreaterThanEqual (Token): ">=" # 156..158 + - Expression (Rule): # 158..165 " amount" + - Identifier (Token): "amount" # 159..165 + - Comma (Token): "," # 165..166 + - Expression (Rule): # 166..198 ' "Address: insufficient balance"' + - StringExpression (Rule): # 166..198 ' "Address: insufficient balance"' + - AsciiStringLiterals (Rule): # 166..198 ' "Address: insufficient balance"' + - AsciiStringLiteral (Token): '"Address: insufficient balance"' # 167..198 + - CloseParen (Token): ")" # 198..199 + - Semicolon (Token): ";" # 199..200 + - Statement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." + - TupleDeconstructionStatement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." + - OpenParen (Token): "(" # 206..207 + - TupleMembersDeconstruction (Rule): # 207..220 "bool success," + - TupleMemberDeconstruction (Rule): # 207..219 "bool success" + - TupleMember (Rule): # 207..219 "bool success" + - TypedTupleMember (Rule): # 207..219 "bool success" + - TypeName (Rule): # 207..211 "bool" + - ElementaryType (Rule): # 207..211 "bool" + - BoolKeyword (Token): "bool" # 207..211 + - Identifier (Token): "success" # 212..219 + - Comma (Token): "," # 219..220 + - TupleMemberDeconstruction (Rule): [] # 220..220 + - CloseParen (Token): ")" # 221..222 + - Equal (Token): "=" # 223..224 + - Expression (Rule): # 224..239 " recipient.call" + - MemberAccessExpression (Rule): # 224..239 " recipient.call" + - Expression (Rule): # 224..234 " recipient" + - Identifier (Token): "recipient" # 225..234 + - Period (Token): "." # 234..235 + - Identifier (Token): "call" # 235..239 + - SKIPPED (Token): '{ value: amount }("")' # 239..260 + - Semicolon (Token): ";" # 260..261 + - Statement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' + - ExpressionStatement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' + - Expression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' + - FunctionCallExpression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' + - Expression (Rule): # 262..273 " require" + - Identifier (Token): "require" # 266..273 + - ArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' + - PositionalArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' + - OpenParen (Token): "(" # 273..274 + - PositionalArguments (Rule): # 274..343 'success, "Address: unable to send value, recipient...' + - Expression (Rule): # 274..281 "success" + - Identifier (Token): "success" # 274..281 + - Comma (Token): "," # 281..282 + - Expression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - StringExpression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - AsciiStringLiterals (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - AsciiStringLiteral (Token): '"Address: unable to send value, recipient may have...' # 283..343 + - CloseParen (Token): ")" # 343..344 + - Semicolon (Token): ";" # 344..345 + - CloseBrace (Token): "}" # 348..349 - CloseBrace (Token): "}" # 350..351 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.6.2-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.6.2-success.yml index 042b47fad3..d221cd316a 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.6.2-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.6.2-success.yml @@ -20,119 +20,136 @@ Tree: - ContractKeyword (Token): "contract" # 32..40 - Identifier (Token): "ABC" # 41..44 - OpenBrace (Token): "{" # 45..46 - - ContractMembersList (Rule): # 47..350 " function sendValue(address payable recipient, ui..." - - FunctionDefinition (Rule): # 47..350 " function sendValue(address payable recipient, ui..." - - FunctionKeyword (Token): "function" # 49..57 - - Identifier (Token): "sendValue" # 58..67 - - ParametersDeclaration (Rule): # 67..110 "(address payable recipient, uint256 amount)" - - OpenParen (Token): "(" # 67..68 - - ParametersList (Rule): # 68..109 "address payable recipient, uint256 amount" - - Parameter (Rule): # 68..93 "address payable recipient" - - TypeName (Rule): # 68..83 "address payable" - - AddressType (Rule): # 68..83 "address payable" - - AddressKeyword (Token): "address" # 68..75 - - PayableKeyword (Token): "payable" # 76..83 - - Identifier (Token): "recipient" # 84..93 - - Comma (Token): "," # 93..94 - - Parameter (Rule): # 94..109 " uint256 amount" - - TypeName (Rule): # 94..102 " uint256" - - UnsignedIntegerType (Token): "uint256" # 95..102 - - Identifier (Token): "amount" # 103..109 - - CloseParen (Token): ")" # 109..110 - - FunctionAttributesList (Rule): # 110..119 " internal" - - InternalKeyword (Token): "internal" # 111..119 - - Block (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' - - OpenBrace (Token): "{" # 120..121 - - StatementsList (Rule): # 122..346 ' require(address(this).balance >= amount, "Addr...' - - Statement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' - - ExpressionStatement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' - - Expression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' - - FunctionCallExpression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' - - Expression (Rule): # 122..133 " require" - - Identifier (Token): "require" # 126..133 - - ArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' - - OpenParen (Token): "(" # 133..134 - - PositionalArgumentsList (Rule): # 134..198 'address(this).balance >= amount, "Address: insuffi...' - - Expression (Rule): # 134..165 "address(this).balance >= amount" - - BinaryExpression (Rule): # 134..165 "address(this).balance >= amount" - - Expression (Rule): # 134..155 "address(this).balance" - - MemberAccessExpression (Rule): # 134..155 "address(this).balance" - - Expression (Rule): # 134..147 "address(this)" - - FunctionCallExpression (Rule): # 134..147 "address(this)" - - Expression (Rule): # 134..141 "address" - - AddressType (Rule): # 134..141 "address" - - AddressKeyword (Token): "address" # 134..141 - - ArgumentsDeclaration (Rule): # 141..147 "(this)" - - OpenParen (Token): "(" # 141..142 - - PositionalArgumentsList (Rule): # 142..146 "this" - - Expression (Rule): # 142..146 "this" - - Identifier (Token): "this" # 142..146 - - CloseParen (Token): ")" # 146..147 - - Period (Token): "." # 147..148 - - Identifier (Token): "balance" # 148..155 - - GreaterThanEqual (Token): ">=" # 156..158 - - Expression (Rule): # 158..165 " amount" - - Identifier (Token): "amount" # 159..165 - - Comma (Token): "," # 165..166 - - Expression (Rule): # 166..198 ' "Address: insufficient balance"' - - AsciiStringLiteralsList (Rule): # 166..198 ' "Address: insufficient balance"' - - AsciiStringLiteral (Token): '"Address: insufficient balance"' # 167..198 - - CloseParen (Token): ")" # 198..199 - - Semicolon (Token): ";" # 199..200 - - Statement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." - - TupleDeconstructionStatement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." - - OpenParen (Token): "(" # 206..207 - - TupleMembersList (Rule): # 207..220 "bool success," - - TupleMember (Rule): # 207..219 "bool success" - - TypeName (Rule): # 207..211 "bool" - - BoolKeyword (Token): "bool" # 207..211 - - Identifier (Token): "success" # 212..219 - - Comma (Token): "," # 219..220 - - TupleMember (Rule): [] # 220..220 - - CloseParen (Token): ")" # 221..222 - - Equal (Token): "=" # 223..224 - - Expression (Rule): # 224..260 ' recipient.call{ value: amount }("")' - - FunctionCallExpression (Rule): # 224..260 ' recipient.call{ value: amount }("")' - - Expression (Rule): # 224..239 " recipient.call" - - MemberAccessExpression (Rule): # 224..239 " recipient.call" - - Expression (Rule): # 224..234 " recipient" - - Identifier (Token): "recipient" # 225..234 - - Period (Token): "." # 234..235 - - Identifier (Token): "call" # 235..239 - - FunctionCallOptions (Rule): # 239..256 "{ value: amount }" - - NamedArgumentsDeclaration (Rule): # 239..256 "{ value: amount }" - - OpenBrace (Token): "{" # 239..240 - - NamedArgumentsList (Rule): # 240..254 " value: amount" - - NamedArgument (Rule): # 240..254 " value: amount" - - Identifier (Token): "value" # 241..246 - - Colon (Token): ":" # 246..247 - - Expression (Rule): # 247..254 " amount" - - Identifier (Token): "amount" # 248..254 - - CloseBrace (Token): "}" # 255..256 - - ArgumentsDeclaration (Rule): # 256..260 '("")' - - OpenParen (Token): "(" # 256..257 - - PositionalArgumentsList (Rule): # 257..259 '""' - - Expression (Rule): # 257..259 '""' - - AsciiStringLiteralsList (Rule): # 257..259 '""' - - AsciiStringLiteral (Token): '""' # 257..259 - - CloseParen (Token): ")" # 259..260 - - Semicolon (Token): ";" # 260..261 - - Statement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' - - ExpressionStatement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' - - Expression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' - - FunctionCallExpression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' - - Expression (Rule): # 262..273 " require" - - Identifier (Token): "require" # 266..273 - - ArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' - - OpenParen (Token): "(" # 273..274 - - PositionalArgumentsList (Rule): # 274..343 'success, "Address: unable to send value, recipient...' - - Expression (Rule): # 274..281 "success" - - Identifier (Token): "success" # 274..281 - - Comma (Token): "," # 281..282 - - Expression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' - - AsciiStringLiteralsList (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' - - AsciiStringLiteral (Token): '"Address: unable to send value, recipient may have...' # 283..343 - - CloseParen (Token): ")" # 343..344 - - Semicolon (Token): ";" # 344..345 - - CloseBrace (Token): "}" # 348..349 + - ContractMembers (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - ContractMember (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - FunctionDefinition (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - FunctionKeyword (Token): "function" # 49..57 + - Identifier (Token): "sendValue" # 58..67 + - ParametersDeclaration (Rule): # 67..110 "(address payable recipient, uint256 amount)" + - OpenParen (Token): "(" # 67..68 + - Parameters (Rule): # 68..109 "address payable recipient, uint256 amount" + - Parameter (Rule): # 68..93 "address payable recipient" + - TypeName (Rule): # 68..83 "address payable" + - ElementaryType (Rule): # 68..83 "address payable" + - AddressType (Rule): # 68..83 "address payable" + - AddressKeyword (Token): "address" # 68..75 + - PayableKeyword (Token): "payable" # 76..83 + - Identifier (Token): "recipient" # 84..93 + - Comma (Token): "," # 93..94 + - Parameter (Rule): # 94..109 " uint256 amount" + - TypeName (Rule): # 94..102 " uint256" + - ElementaryType (Rule): # 94..102 " uint256" + - UintKeyword (Token): "uint256" # 95..102 + - Identifier (Token): "amount" # 103..109 + - CloseParen (Token): ")" # 109..110 + - FunctionAttributes (Rule): # 110..119 " internal" + - FunctionAttribute (Rule): # 110..119 " internal" + - InternalKeyword (Token): "internal" # 111..119 + - FunctionBody (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' + - Block (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' + - OpenBrace (Token): "{" # 120..121 + - Statements (Rule): # 122..346 ' require(address(this).balance >= amount, "Addr...' + - Statement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' + - ExpressionStatement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' + - Expression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' + - FunctionCallExpression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' + - Expression (Rule): # 122..133 " require" + - Identifier (Token): "require" # 126..133 + - ArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' + - PositionalArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' + - OpenParen (Token): "(" # 133..134 + - PositionalArguments (Rule): # 134..198 'address(this).balance >= amount, "Address: insuffi...' + - Expression (Rule): # 134..165 "address(this).balance >= amount" + - BinaryExpression (Rule): # 134..165 "address(this).balance >= amount" + - Expression (Rule): # 134..155 "address(this).balance" + - MemberAccessExpression (Rule): # 134..155 "address(this).balance" + - Expression (Rule): # 134..147 "address(this)" + - FunctionCallExpression (Rule): # 134..147 "address(this)" + - Expression (Rule): # 134..141 "address" + - ElementaryType (Rule): # 134..141 "address" + - AddressType (Rule): # 134..141 "address" + - AddressKeyword (Token): "address" # 134..141 + - ArgumentsDeclaration (Rule): # 141..147 "(this)" + - PositionalArgumentsDeclaration (Rule): # 141..147 "(this)" + - OpenParen (Token): "(" # 141..142 + - PositionalArguments (Rule): # 142..146 "this" + - Expression (Rule): # 142..146 "this" + - Identifier (Token): "this" # 142..146 + - CloseParen (Token): ")" # 146..147 + - Period (Token): "." # 147..148 + - Identifier (Token): "balance" # 148..155 + - GreaterThanEqual (Token): ">=" # 156..158 + - Expression (Rule): # 158..165 " amount" + - Identifier (Token): "amount" # 159..165 + - Comma (Token): "," # 165..166 + - Expression (Rule): # 166..198 ' "Address: insufficient balance"' + - StringExpression (Rule): # 166..198 ' "Address: insufficient balance"' + - AsciiStringLiterals (Rule): # 166..198 ' "Address: insufficient balance"' + - AsciiStringLiteral (Token): '"Address: insufficient balance"' # 167..198 + - CloseParen (Token): ")" # 198..199 + - Semicolon (Token): ";" # 199..200 + - Statement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." + - TupleDeconstructionStatement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." + - OpenParen (Token): "(" # 206..207 + - TupleMembersDeconstruction (Rule): # 207..220 "bool success," + - TupleMemberDeconstruction (Rule): # 207..219 "bool success" + - TupleMember (Rule): # 207..219 "bool success" + - TypedTupleMember (Rule): # 207..219 "bool success" + - TypeName (Rule): # 207..211 "bool" + - ElementaryType (Rule): # 207..211 "bool" + - BoolKeyword (Token): "bool" # 207..211 + - Identifier (Token): "success" # 212..219 + - Comma (Token): "," # 219..220 + - TupleMemberDeconstruction (Rule): [] # 220..220 + - CloseParen (Token): ")" # 221..222 + - Equal (Token): "=" # 223..224 + - Expression (Rule): # 224..260 ' recipient.call{ value: amount }("")' + - FunctionCallExpression (Rule): # 224..260 ' recipient.call{ value: amount }("")' + - Expression (Rule): # 224..239 " recipient.call" + - MemberAccessExpression (Rule): # 224..239 " recipient.call" + - Expression (Rule): # 224..234 " recipient" + - Identifier (Token): "recipient" # 225..234 + - Period (Token): "." # 234..235 + - Identifier (Token): "call" # 235..239 + - FunctionCallOptions (Rule): # 239..256 "{ value: amount }" + - NamedArgumentGroups (Rule): # 239..256 "{ value: amount }" + - NamedArgumentGroup (Rule): # 239..256 "{ value: amount }" + - OpenBrace (Token): "{" # 239..240 + - NamedArguments (Rule): # 240..254 " value: amount" + - NamedArgument (Rule): # 240..254 " value: amount" + - Identifier (Token): "value" # 241..246 + - Colon (Token): ":" # 246..247 + - Expression (Rule): # 247..254 " amount" + - Identifier (Token): "amount" # 248..254 + - CloseBrace (Token): "}" # 255..256 + - ArgumentsDeclaration (Rule): # 256..260 '("")' + - PositionalArgumentsDeclaration (Rule): # 256..260 '("")' + - OpenParen (Token): "(" # 256..257 + - PositionalArguments (Rule): # 257..259 '""' + - Expression (Rule): # 257..259 '""' + - StringExpression (Rule): # 257..259 '""' + - AsciiStringLiterals (Rule): # 257..259 '""' + - AsciiStringLiteral (Token): '""' # 257..259 + - CloseParen (Token): ")" # 259..260 + - Semicolon (Token): ";" # 260..261 + - Statement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' + - ExpressionStatement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' + - Expression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' + - FunctionCallExpression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' + - Expression (Rule): # 262..273 " require" + - Identifier (Token): "require" # 266..273 + - ArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' + - PositionalArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' + - OpenParen (Token): "(" # 273..274 + - PositionalArguments (Rule): # 274..343 'success, "Address: unable to send value, recipient...' + - Expression (Rule): # 274..281 "success" + - Identifier (Token): "success" # 274..281 + - Comma (Token): "," # 281..282 + - Expression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - StringExpression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - AsciiStringLiterals (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - AsciiStringLiteral (Token): '"Address: unable to send value, recipient may have...' # 283..343 + - CloseParen (Token): ")" # 343..344 + - Semicolon (Token): ";" # 344..345 + - CloseBrace (Token): "}" # 348..349 - CloseBrace (Token): "}" # 350..351 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.8.0-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.8.0-success.yml new file mode 100644 index 0000000000..77f06de88d --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.8.0-success.yml @@ -0,0 +1,154 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ // SPDX-License-Identifier: MIT │ 0..31 + 2 │ contract ABC { │ 32..46 + 3 │ function sendValue(address payable recipient, uint256 amount) internal { │ 47..121 + 4 │ require(address(this).balance >= amount, "Address: insufficient balance"); │ 122..200 + 5 │ │ 201..201 + 6 │ (bool success, ) = recipient.call{ value: amount }(""); │ 202..261 + 7 │ require(success, "Address: unable to send value, recipient may have reverted"); │ 262..345 + 8 │ } │ 346..349 + 9 │ } │ 350..351 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..352 "// SPDX-License-Identifier: MIT\ncontract ABC {\n f..." + - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" + - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 + - ContractKeyword (Token): "contract" # 32..40 + - Identifier (Token): "ABC" # 41..44 + - OpenBrace (Token): "{" # 45..46 + - ContractMembers (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - ContractMember (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - FunctionDefinition (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - FunctionKeyword (Token): "function" # 49..57 + - Identifier (Token): "sendValue" # 58..67 + - ParametersDeclaration (Rule): # 67..110 "(address payable recipient, uint256 amount)" + - OpenParen (Token): "(" # 67..68 + - Parameters (Rule): # 68..109 "address payable recipient, uint256 amount" + - Parameter (Rule): # 68..93 "address payable recipient" + - TypeName (Rule): # 68..83 "address payable" + - ElementaryType (Rule): # 68..83 "address payable" + - AddressType (Rule): # 68..83 "address payable" + - AddressKeyword (Token): "address" # 68..75 + - PayableKeyword (Token): "payable" # 76..83 + - Identifier (Token): "recipient" # 84..93 + - Comma (Token): "," # 93..94 + - Parameter (Rule): # 94..109 " uint256 amount" + - TypeName (Rule): # 94..102 " uint256" + - ElementaryType (Rule): # 94..102 " uint256" + - UintKeyword (Token): "uint256" # 95..102 + - Identifier (Token): "amount" # 103..109 + - CloseParen (Token): ")" # 109..110 + - FunctionAttributes (Rule): # 110..119 " internal" + - FunctionAttribute (Rule): # 110..119 " internal" + - InternalKeyword (Token): "internal" # 111..119 + - FunctionBody (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' + - Block (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' + - OpenBrace (Token): "{" # 120..121 + - Statements (Rule): # 122..346 ' require(address(this).balance >= amount, "Addr...' + - Statement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' + - ExpressionStatement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' + - Expression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' + - FunctionCallExpression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' + - Expression (Rule): # 122..133 " require" + - Identifier (Token): "require" # 126..133 + - ArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' + - PositionalArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' + - OpenParen (Token): "(" # 133..134 + - PositionalArguments (Rule): # 134..198 'address(this).balance >= amount, "Address: insuffi...' + - Expression (Rule): # 134..165 "address(this).balance >= amount" + - BinaryExpression (Rule): # 134..165 "address(this).balance >= amount" + - Expression (Rule): # 134..155 "address(this).balance" + - MemberAccessExpression (Rule): # 134..155 "address(this).balance" + - Expression (Rule): # 134..147 "address(this)" + - FunctionCallExpression (Rule): # 134..147 "address(this)" + - Expression (Rule): # 134..141 "address" + - ElementaryType (Rule): # 134..141 "address" + - AddressType (Rule): # 134..141 "address" + - AddressKeyword (Token): "address" # 134..141 + - ArgumentsDeclaration (Rule): # 141..147 "(this)" + - PositionalArgumentsDeclaration (Rule): # 141..147 "(this)" + - OpenParen (Token): "(" # 141..142 + - PositionalArguments (Rule): # 142..146 "this" + - Expression (Rule): # 142..146 "this" + - Identifier (Token): "this" # 142..146 + - CloseParen (Token): ")" # 146..147 + - Period (Token): "." # 147..148 + - Identifier (Token): "balance" # 148..155 + - GreaterThanEqual (Token): ">=" # 156..158 + - Expression (Rule): # 158..165 " amount" + - Identifier (Token): "amount" # 159..165 + - Comma (Token): "," # 165..166 + - Expression (Rule): # 166..198 ' "Address: insufficient balance"' + - StringExpression (Rule): # 166..198 ' "Address: insufficient balance"' + - AsciiStringLiterals (Rule): # 166..198 ' "Address: insufficient balance"' + - AsciiStringLiteral (Token): '"Address: insufficient balance"' # 167..198 + - CloseParen (Token): ")" # 198..199 + - Semicolon (Token): ";" # 199..200 + - Statement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." + - TupleDeconstructionStatement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." + - OpenParen (Token): "(" # 206..207 + - TupleMembersDeconstruction (Rule): # 207..220 "bool success," + - TupleMemberDeconstruction (Rule): # 207..219 "bool success" + - TupleMember (Rule): # 207..219 "bool success" + - TypedTupleMember (Rule): # 207..219 "bool success" + - TypeName (Rule): # 207..211 "bool" + - ElementaryType (Rule): # 207..211 "bool" + - BoolKeyword (Token): "bool" # 207..211 + - Identifier (Token): "success" # 212..219 + - Comma (Token): "," # 219..220 + - TupleMemberDeconstruction (Rule): [] # 220..220 + - CloseParen (Token): ")" # 221..222 + - Equal (Token): "=" # 223..224 + - Expression (Rule): # 224..260 ' recipient.call{ value: amount }("")' + - FunctionCallExpression (Rule): # 224..260 ' recipient.call{ value: amount }("")' + - Expression (Rule): # 224..239 " recipient.call" + - MemberAccessExpression (Rule): # 224..239 " recipient.call" + - Expression (Rule): # 224..234 " recipient" + - Identifier (Token): "recipient" # 225..234 + - Period (Token): "." # 234..235 + - Identifier (Token): "call" # 235..239 + - FunctionCallOptions (Rule): # 239..256 "{ value: amount }" + - NamedArgumentGroup (Rule): # 239..256 "{ value: amount }" + - OpenBrace (Token): "{" # 239..240 + - NamedArguments (Rule): # 240..254 " value: amount" + - NamedArgument (Rule): # 240..254 " value: amount" + - Identifier (Token): "value" # 241..246 + - Colon (Token): ":" # 246..247 + - Expression (Rule): # 247..254 " amount" + - Identifier (Token): "amount" # 248..254 + - CloseBrace (Token): "}" # 255..256 + - ArgumentsDeclaration (Rule): # 256..260 '("")' + - PositionalArgumentsDeclaration (Rule): # 256..260 '("")' + - OpenParen (Token): "(" # 256..257 + - PositionalArguments (Rule): # 257..259 '""' + - Expression (Rule): # 257..259 '""' + - StringExpression (Rule): # 257..259 '""' + - AsciiStringLiterals (Rule): # 257..259 '""' + - AsciiStringLiteral (Token): '""' # 257..259 + - CloseParen (Token): ")" # 259..260 + - Semicolon (Token): ";" # 260..261 + - Statement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' + - ExpressionStatement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' + - Expression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' + - FunctionCallExpression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' + - Expression (Rule): # 262..273 " require" + - Identifier (Token): "require" # 266..273 + - ArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' + - PositionalArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' + - OpenParen (Token): "(" # 273..274 + - PositionalArguments (Rule): # 274..343 'success, "Address: unable to send value, recipient...' + - Expression (Rule): # 274..281 "success" + - Identifier (Token): "success" # 274..281 + - Comma (Token): "," # 281..282 + - Expression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - StringExpression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - AsciiStringLiterals (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - AsciiStringLiteral (Token): '"Address: unable to send value, recipient may have...' # 283..343 + - CloseParen (Token): ")" # 343..344 + - Semicolon (Token): ";" # 344..345 + - CloseBrace (Token): "}" # 348..349 + - CloseBrace (Token): "}" # 350..351 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/header_comment/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/header_comment/generated/0.4.11-success.yml index b8f3355fed..c35decd21e 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/header_comment/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/header_comment/generated/0.4.11-success.yml @@ -32,4 +32,5 @@ Tree: - ContractKeyword (Token): "contract" # 1986..1994 - Identifier (Token): "Foo" # 1995..1998 - OpenBrace (Token): "{" # 1999..2000 + - ContractMembers (Rule): [] # 2000..2000 - CloseBrace (Token): "}" # 2000..2001 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/generated/0.4.11-success.yml index c52bf5eaa5..fab5d86664 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/generated/0.4.11-success.yml @@ -11,7 +11,7 @@ Tree: - Identifier (Token): "Sample" # 9..15 - InheritanceSpecifier (Rule): # 15..38 " is Foo, Bar(1, 2), Baz" - IsKeyword (Token): "is" # 16..18 - - InheritanceTypesList (Rule): # 18..38 " Foo, Bar(1, 2), Baz" + - InheritanceTypes (Rule): # 18..38 " Foo, Bar(1, 2), Baz" - InheritanceType (Rule): # 18..22 " Foo" - IdentifierPath (Rule): # 18..22 " Foo" - Identifier (Token): "Foo" # 19..22 @@ -20,19 +20,21 @@ Tree: - IdentifierPath (Rule): # 23..27 " Bar" - Identifier (Token): "Bar" # 24..27 - ArgumentsDeclaration (Rule): # 27..33 "(1, 2)" - - OpenParen (Token): "(" # 27..28 - - PositionalArgumentsList (Rule): # 28..32 "1, 2" - - Expression (Rule): # 28..29 "1" - - NumericExpression (Rule): # 28..29 "1" - - DecimalLiteral (Token): "1" # 28..29 - - Comma (Token): "," # 29..30 - - Expression (Rule): # 30..32 " 2" - - NumericExpression (Rule): # 30..32 " 2" - - DecimalLiteral (Token): "2" # 31..32 - - CloseParen (Token): ")" # 32..33 + - PositionalArgumentsDeclaration (Rule): # 27..33 "(1, 2)" + - OpenParen (Token): "(" # 27..28 + - PositionalArguments (Rule): # 28..32 "1, 2" + - Expression (Rule): # 28..29 "1" + - DecimalNumberExpression (Rule): # 28..29 "1" + - DecimalLiteral (Token): "1" # 28..29 + - Comma (Token): "," # 29..30 + - Expression (Rule): # 30..32 " 2" + - DecimalNumberExpression (Rule): # 30..32 " 2" + - DecimalLiteral (Token): "2" # 31..32 + - CloseParen (Token): ")" # 32..33 - Comma (Token): "," # 33..34 - InheritanceType (Rule): # 34..38 " Baz" - IdentifierPath (Rule): # 34..38 " Baz" - Identifier (Token): "Baz" # 35..38 - OpenBrace (Token): "{" # 39..40 + - ContractMembers (Rule): [] # 40..40 - CloseBrace (Token): "}" # 40..41 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.11-failure.yml index 1615c7c2b9..e5f8e9f7f0 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.11-failure.yml @@ -22,10 +22,12 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..31 " constructor" - - StateVariableDefinition (Rule): # 18..31 " constructor" - - TypeName (Rule): # 18..31 " constructor" - - IdentifierPath (Rule): # 18..31 " constructor" - - Identifier (Token): "constructor" # 20..31 + - ContractMembers (Rule): # 18..31 " constructor" + - ContractMember (Rule): # 18..31 " constructor" + - StateVariableDefinition (Rule): # 18..31 " constructor" + - TypeName (Rule): # 18..31 " constructor" + - IdentifierPath (Rule): # 18..31 " constructor" + - Identifier (Token): "constructor" # 20..31 + - StateVariableAttributes (Rule): [] # 31..31 - SKIPPED (Token): "() public {\n }\n" # 31..47 - CloseBrace (Token): "}" # 47..48 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.22-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.22-success.yml deleted file mode 100644 index e4bfe43846..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.22-success.yml +++ /dev/null @@ -1,27 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ contract Sample { │ 0..17 - 2 │ constructor() public { │ 18..42 - 3 │ } │ 43..46 - 4 │ } │ 47..48 - -Errors: [] - -Tree: - - ContractDefinition (Rule): # 0..48 "contract Sample {\n constructor() public {\n }\n}" - - ContractKeyword (Token): "contract" # 0..8 - - Identifier (Token): "Sample" # 9..15 - - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..47 " constructor() public {\n }\n" - - ConstructorDefinition (Rule): # 18..47 " constructor() public {\n }\n" - - ConstructorKeyword (Token): "constructor" # 20..31 - - ParametersDeclaration (Rule): # 31..33 "()" - - OpenParen (Token): "(" # 31..32 - - CloseParen (Token): ")" # 32..33 - - ConstructorAttributesList (Rule): # 33..40 " public" - - PublicKeyword (Token): "public" # 34..40 - - Block (Rule): # 40..47 " {\n }\n" - - OpenBrace (Token): "{" # 41..42 - - CloseBrace (Token): "}" # 45..46 - - CloseBrace (Token): "}" # 47..48 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.5.0-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.5.0-success.yml new file mode 100644 index 0000000000..0dcd0d335c --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.5.0-success.yml @@ -0,0 +1,31 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Sample { │ 0..17 + 2 │ constructor() public { │ 18..42 + 3 │ } │ 43..46 + 4 │ } │ 47..48 + +Errors: [] + +Tree: + - ContractDefinition (Rule): # 0..48 "contract Sample {\n constructor() public {\n }\n}" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): # 18..47 " constructor() public {\n }\n" + - ContractMember (Rule): # 18..47 " constructor() public {\n }\n" + - ConstructorDefinition (Rule): # 18..47 " constructor() public {\n }\n" + - ConstructorKeyword (Token): "constructor" # 20..31 + - ParametersDeclaration (Rule): # 31..33 "()" + - OpenParen (Token): "(" # 31..32 + - Parameters (Rule): [] # 32..32 + - CloseParen (Token): ")" # 32..33 + - ConstructorAttributes (Rule): # 33..40 " public" + - ConstructorAttribute (Rule): # 33..40 " public" + - PublicKeyword (Token): "public" # 34..40 + - Block (Rule): # 40..47 " {\n }\n" + - OpenBrace (Token): "{" # 41..42 + - Statements (Rule): [] # 43..43 + - CloseBrace (Token): "}" # 45..46 + - CloseBrace (Token): "}" # 47..48 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/generated/0.4.11-success.yml index 5f7e784e79..3525acd12b 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/generated/0.4.11-success.yml @@ -16,16 +16,17 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..57 " enum State {\n A,\n B,\n C\n }\n" - - EnumDefinition (Rule): # 18..57 " enum State {\n A,\n B,\n C\n }\n" - - EnumKeyword (Token): "enum" # 20..24 - - Identifier (Token): "State" # 25..30 - - OpenBrace (Token): "{" # 31..32 - - IdentifiersList (Rule): # 33..53 " A,\n B,\n C\n" - - Identifier (Token): "A" # 37..38 - - Comma (Token): "," # 38..39 - - Identifier (Token): "B" # 44..45 - - Comma (Token): "," # 45..46 - - Identifier (Token): "C" # 51..52 - - CloseBrace (Token): "}" # 55..56 + - ContractMembers (Rule): # 18..57 " enum State {\n A,\n B,\n C\n }\n" + - ContractMember (Rule): # 18..57 " enum State {\n A,\n B,\n C\n }\n" + - EnumDefinition (Rule): # 18..57 " enum State {\n A,\n B,\n C\n }\n" + - EnumKeyword (Token): "enum" # 20..24 + - Identifier (Token): "State" # 25..30 + - OpenBrace (Token): "{" # 31..32 + - EnumMembers (Rule): # 33..53 " A,\n B,\n C\n" + - Identifier (Token): "A" # 37..38 + - Comma (Token): "," # 38..39 + - Identifier (Token): "B" # 44..45 + - Comma (Token): "," # 45..46 + - Identifier (Token): "C" # 51..52 + - CloseBrace (Token): "}" # 55..56 - CloseBrace (Token): "}" # 57..58 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.4.11-failure.yml index 545b4d7d83..11d01bd499 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.4.11-failure.yml @@ -20,12 +20,14 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..36 " error Error1();\n" - - StateVariableDefinition (Rule): # 18..36 " error Error1();\n" - - TypeName (Rule): # 18..25 " error" - - IdentifierPath (Rule): # 18..25 " error" - - Identifier (Token): "error" # 20..25 - - Identifier (Token): "Error1" # 26..32 - - SKIPPED (Token): "()" # 32..34 - - Semicolon (Token): ";" # 34..35 + - ContractMembers (Rule): # 18..36 " error Error1();\n" + - ContractMember (Rule): # 18..36 " error Error1();\n" + - StateVariableDefinition (Rule): # 18..36 " error Error1();\n" + - TypeName (Rule): # 18..25 " error" + - IdentifierPath (Rule): # 18..25 " error" + - Identifier (Token): "error" # 20..25 + - StateVariableAttributes (Rule): [] # 25..25 + - Identifier (Token): "Error1" # 26..32 + - SKIPPED (Token): "()" # 32..34 + - Semicolon (Token): ";" # 34..35 - CloseBrace (Token): "}" # 36..37 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.8.4-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.8.4-success.yml index 0f50c271da..e8f91c01d7 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.8.4-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.8.4-success.yml @@ -12,11 +12,14 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..36 " error Error1();\n" - - ErrorDefinition (Rule): # 18..36 " error Error1();\n" - - ErrorKeyword (Token): "error" # 20..25 - - Identifier (Token): "Error1" # 26..32 - - OpenParen (Token): "(" # 32..33 - - CloseParen (Token): ")" # 33..34 - - Semicolon (Token): ";" # 34..35 + - ContractMembers (Rule): # 18..36 " error Error1();\n" + - ContractMember (Rule): # 18..36 " error Error1();\n" + - ErrorDefinition (Rule): # 18..36 " error Error1();\n" + - ErrorKeyword (Token): "error" # 20..25 + - Identifier (Token): "Error1" # 26..32 + - ErrorParametersDeclaration (Rule): # 32..34 "()" + - OpenParen (Token): "(" # 32..33 + - ErrorParameters (Rule): [] # 33..33 + - CloseParen (Token): ")" # 33..34 + - Semicolon (Token): ";" # 34..35 - CloseBrace (Token): "}" # 36..37 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/generated/0.4.11-success.yml index 7a880a0155..80ae96e494 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/generated/0.4.11-success.yml @@ -12,23 +12,27 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..69 " event Log(uint256 indexed a, uint256 indexed b);..." - - EventDefinition (Rule): # 18..69 " event Log(uint256 indexed a, uint256 indexed b);..." - - EventKeyword (Token): "event" # 20..25 - - Identifier (Token): "Log" # 26..29 - - OpenParen (Token): "(" # 29..30 - - EventParametersList (Rule): # 30..66 "uint256 indexed a, uint256 indexed b" - - EventParameter (Rule): # 30..47 "uint256 indexed a" - - TypeName (Rule): # 30..37 "uint256" - - UnsignedIntegerType (Token): "uint256" # 30..37 - - IndexedKeyword (Token): "indexed" # 38..45 - - Identifier (Token): "a" # 46..47 - - Comma (Token): "," # 47..48 - - EventParameter (Rule): # 48..66 " uint256 indexed b" - - TypeName (Rule): # 48..56 " uint256" - - UnsignedIntegerType (Token): "uint256" # 49..56 - - IndexedKeyword (Token): "indexed" # 57..64 - - Identifier (Token): "b" # 65..66 - - CloseParen (Token): ")" # 66..67 - - Semicolon (Token): ";" # 67..68 + - ContractMembers (Rule): # 18..69 " event Log(uint256 indexed a, uint256 indexed b);..." + - ContractMember (Rule): # 18..69 " event Log(uint256 indexed a, uint256 indexed b);..." + - EventDefinition (Rule): # 18..69 " event Log(uint256 indexed a, uint256 indexed b);..." + - EventKeyword (Token): "event" # 20..25 + - Identifier (Token): "Log" # 26..29 + - EventParametersDeclaration (Rule): # 29..67 "(uint256 indexed a, uint256 indexed b)" + - OpenParen (Token): "(" # 29..30 + - EventParameters (Rule): # 30..66 "uint256 indexed a, uint256 indexed b" + - EventParameter (Rule): # 30..47 "uint256 indexed a" + - TypeName (Rule): # 30..37 "uint256" + - ElementaryType (Rule): # 30..37 "uint256" + - UintKeyword (Token): "uint256" # 30..37 + - IndexedKeyword (Token): "indexed" # 38..45 + - Identifier (Token): "a" # 46..47 + - Comma (Token): "," # 47..48 + - EventParameter (Rule): # 48..66 " uint256 indexed b" + - TypeName (Rule): # 48..56 " uint256" + - ElementaryType (Rule): # 48..56 " uint256" + - UintKeyword (Token): "uint256" # 49..56 + - IndexedKeyword (Token): "indexed" # 57..64 + - Identifier (Token): "b" # 65..66 + - CloseParen (Token): ")" # 66..67 + - Semicolon (Token): ";" # 67..68 - CloseBrace (Token): "}" # 69..70 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.4.11-failure.yml index 03f6a67404..4b6fff75ec 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.4.11-failure.yml @@ -22,10 +22,12 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..28 " fallback" - - StateVariableDefinition (Rule): # 18..28 " fallback" - - TypeName (Rule): # 18..28 " fallback" - - IdentifierPath (Rule): # 18..28 " fallback" - - Identifier (Token): "fallback" # 20..28 + - ContractMembers (Rule): # 18..28 " fallback" + - ContractMember (Rule): # 18..28 " fallback" + - StateVariableDefinition (Rule): # 18..28 " fallback" + - TypeName (Rule): # 18..28 " fallback" + - IdentifierPath (Rule): # 18..28 " fallback" + - Identifier (Token): "fallback" # 20..28 + - StateVariableAttributes (Rule): [] # 28..28 - SKIPPED (Token): "() {\n }\n" # 28..37 - CloseBrace (Token): "}" # 37..38 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.6.0-success.yml index 0dd32f0544..1acb65a24c 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.6.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.6.0-success.yml @@ -13,13 +13,18 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..37 " fallback() {\n }\n" - - FallbackFunctionDefinition (Rule): # 18..37 " fallback() {\n }\n" - - FallbackKeyword (Token): "fallback" # 20..28 - - ParametersDeclaration (Rule): # 28..30 "()" - - OpenParen (Token): "(" # 28..29 - - CloseParen (Token): ")" # 29..30 - - Block (Rule): # 30..37 " {\n }\n" - - OpenBrace (Token): "{" # 31..32 - - CloseBrace (Token): "}" # 35..36 + - ContractMembers (Rule): # 18..37 " fallback() {\n }\n" + - ContractMember (Rule): # 18..37 " fallback() {\n }\n" + - FallbackFunctionDefinition (Rule): # 18..37 " fallback() {\n }\n" + - FallbackKeyword (Token): "fallback" # 20..28 + - ParametersDeclaration (Rule): # 28..30 "()" + - OpenParen (Token): "(" # 28..29 + - Parameters (Rule): [] # 29..29 + - CloseParen (Token): ")" # 29..30 + - FallbackFunctionAttributes (Rule): [] # 30..30 + - FunctionBody (Rule): # 30..37 " {\n }\n" + - Block (Rule): # 30..37 " {\n }\n" + - OpenBrace (Token): "{" # 31..32 + - Statements (Rule): [] # 33..33 + - CloseBrace (Token): "}" # 35..36 - CloseBrace (Token): "}" # 37..38 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/generated/0.4.11-success.yml index d74dd4d743..3b48f3afdd 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/generated/0.4.11-success.yml @@ -14,31 +14,36 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..70 " function foo() returns (uint) {\n return 1;\n ..." - - FunctionDefinition (Rule): # 18..70 " function foo() returns (uint) {\n return 1;\n ..." - - FunctionKeyword (Token): "function" # 20..28 - - Identifier (Token): "foo" # 29..32 - - ParametersDeclaration (Rule): # 32..34 "()" - - OpenParen (Token): "(" # 32..33 - - CloseParen (Token): ")" # 33..34 - - ReturnsDeclaration (Rule): # 34..49 " returns (uint)" - - ReturnsKeyword (Token): "returns" # 35..42 - - ParametersDeclaration (Rule): # 42..49 " (uint)" - - OpenParen (Token): "(" # 43..44 - - ParametersList (Rule): # 44..48 "uint" - - Parameter (Rule): # 44..48 "uint" - - TypeName (Rule): # 44..48 "uint" - - UnsignedIntegerType (Token): "uint" # 44..48 - - CloseParen (Token): ")" # 48..49 - - Block (Rule): # 49..70 " {\n return 1;\n }\n" - - OpenBrace (Token): "{" # 50..51 - - StatementsList (Rule): # 52..66 " return 1;\n" - - Statement (Rule): # 52..66 " return 1;\n" - - ReturnStatement (Rule): # 52..66 " return 1;\n" - - ReturnKeyword (Token): "return" # 56..62 - - Expression (Rule): # 62..64 " 1" - - NumericExpression (Rule): # 62..64 " 1" - - DecimalLiteral (Token): "1" # 63..64 - - Semicolon (Token): ";" # 64..65 - - CloseBrace (Token): "}" # 68..69 + - ContractMembers (Rule): # 18..70 " function foo() returns (uint) {\n return 1;\n ..." + - ContractMember (Rule): # 18..70 " function foo() returns (uint) {\n return 1;\n ..." + - FunctionDefinition (Rule): # 18..70 " function foo() returns (uint) {\n return 1;\n ..." + - FunctionKeyword (Token): "function" # 20..28 + - Identifier (Token): "foo" # 29..32 + - ParametersDeclaration (Rule): # 32..34 "()" + - OpenParen (Token): "(" # 32..33 + - Parameters (Rule): [] # 33..33 + - CloseParen (Token): ")" # 33..34 + - FunctionAttributes (Rule): [] # 34..34 + - ReturnsDeclaration (Rule): # 34..49 " returns (uint)" + - ReturnsKeyword (Token): "returns" # 35..42 + - ParametersDeclaration (Rule): # 42..49 " (uint)" + - OpenParen (Token): "(" # 43..44 + - Parameters (Rule): # 44..48 "uint" + - Parameter (Rule): # 44..48 "uint" + - TypeName (Rule): # 44..48 "uint" + - ElementaryType (Rule): # 44..48 "uint" + - UintKeyword (Token): "uint" # 44..48 + - CloseParen (Token): ")" # 48..49 + - FunctionBody (Rule): # 49..70 " {\n return 1;\n }\n" + - Block (Rule): # 49..70 " {\n return 1;\n }\n" + - OpenBrace (Token): "{" # 50..51 + - Statements (Rule): # 52..66 " return 1;\n" + - Statement (Rule): # 52..66 " return 1;\n" + - ReturnStatement (Rule): # 52..66 " return 1;\n" + - ReturnKeyword (Token): "return" # 56..62 + - Expression (Rule): # 62..64 " 1" + - DecimalNumberExpression (Rule): # 62..64 " 1" + - DecimalLiteral (Token): "1" # 63..64 + - Semicolon (Token): ";" # 64..65 + - CloseBrace (Token): "}" # 68..69 - CloseBrace (Token): "}" # 70..71 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/generated/0.4.11-success.yml index c7e3a26c76..965f8c0e31 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/generated/0.4.11-success.yml @@ -14,20 +14,24 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..48 " modifier foo() {\n _;\n }\n" - - ModifierDefinition (Rule): # 18..48 " modifier foo() {\n _;\n }\n" - - ModifierKeyword (Token): "modifier" # 20..28 - - Identifier (Token): "foo" # 29..32 - - ParametersDeclaration (Rule): # 32..34 "()" - - OpenParen (Token): "(" # 32..33 - - CloseParen (Token): ")" # 33..34 - - Block (Rule): # 34..48 " {\n _;\n }\n" - - OpenBrace (Token): "{" # 35..36 - - StatementsList (Rule): # 37..44 " _;\n" - - Statement (Rule): # 37..44 " _;\n" - - ExpressionStatement (Rule): # 37..44 " _;\n" - - Expression (Rule): # 37..42 " _" - - Identifier (Token): "_" # 41..42 - - Semicolon (Token): ";" # 42..43 - - CloseBrace (Token): "}" # 46..47 + - ContractMembers (Rule): # 18..48 " modifier foo() {\n _;\n }\n" + - ContractMember (Rule): # 18..48 " modifier foo() {\n _;\n }\n" + - ModifierDefinition (Rule): # 18..48 " modifier foo() {\n _;\n }\n" + - ModifierKeyword (Token): "modifier" # 20..28 + - Identifier (Token): "foo" # 29..32 + - ParametersDeclaration (Rule): # 32..34 "()" + - OpenParen (Token): "(" # 32..33 + - Parameters (Rule): [] # 33..33 + - CloseParen (Token): ")" # 33..34 + - ModifierAttributes (Rule): [] # 34..34 + - FunctionBody (Rule): # 34..48 " {\n _;\n }\n" + - Block (Rule): # 34..48 " {\n _;\n }\n" + - OpenBrace (Token): "{" # 35..36 + - Statements (Rule): # 37..44 " _;\n" + - Statement (Rule): # 37..44 " _;\n" + - ExpressionStatement (Rule): # 37..44 " _;\n" + - Expression (Rule): # 37..42 " _" + - Identifier (Token): "_" # 41..42 + - Semicolon (Token): ";" # 42..43 + - CloseBrace (Token): "}" # 46..47 - CloseBrace (Token): "}" # 48..49 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.4.11-failure.yml index a9825d4413..d999d34b42 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.4.11-failure.yml @@ -22,10 +22,12 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..27 " receive" - - StateVariableDefinition (Rule): # 18..27 " receive" - - TypeName (Rule): # 18..27 " receive" - - IdentifierPath (Rule): # 18..27 " receive" - - Identifier (Token): "receive" # 20..27 + - ContractMembers (Rule): # 18..27 " receive" + - ContractMember (Rule): # 18..27 " receive" + - StateVariableDefinition (Rule): # 18..27 " receive" + - TypeName (Rule): # 18..27 " receive" + - IdentifierPath (Rule): # 18..27 " receive" + - Identifier (Token): "receive" # 20..27 + - StateVariableAttributes (Rule): [] # 27..27 - SKIPPED (Token): "() {\n }\n" # 27..36 - CloseBrace (Token): "}" # 36..37 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.6.0-success.yml index a353388dd3..68f34947b9 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.6.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.6.0-success.yml @@ -13,13 +13,18 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..36 " receive() {\n }\n" - - ReceiveFunctionDefinition (Rule): # 18..36 " receive() {\n }\n" - - ReceiveKeyword (Token): "receive" # 20..27 - - ParametersDeclaration (Rule): # 27..29 "()" - - OpenParen (Token): "(" # 27..28 - - CloseParen (Token): ")" # 28..29 - - Block (Rule): # 29..36 " {\n }\n" - - OpenBrace (Token): "{" # 30..31 - - CloseBrace (Token): "}" # 34..35 + - ContractMembers (Rule): # 18..36 " receive() {\n }\n" + - ContractMember (Rule): # 18..36 " receive() {\n }\n" + - ReceiveFunctionDefinition (Rule): # 18..36 " receive() {\n }\n" + - ReceiveKeyword (Token): "receive" # 20..27 + - ParametersDeclaration (Rule): # 27..29 "()" + - OpenParen (Token): "(" # 27..28 + - Parameters (Rule): [] # 28..28 + - CloseParen (Token): ")" # 28..29 + - ReceiveFunctionAttributes (Rule): [] # 29..29 + - FunctionBody (Rule): # 29..36 " {\n }\n" + - Block (Rule): # 29..36 " {\n }\n" + - OpenBrace (Token): "{" # 30..31 + - Statements (Rule): [] # 32..32 + - CloseBrace (Token): "}" # 34..35 - CloseBrace (Token): "}" # 36..37 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/generated/0.4.11-success.yml index 2b3ed1b0f6..a4378b1106 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/generated/0.4.11-success.yml @@ -12,12 +12,15 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..35 " uint public a;\n" - - StateVariableDefinition (Rule): # 18..35 " uint public a;\n" - - TypeName (Rule): # 18..24 " uint" - - UnsignedIntegerType (Token): "uint" # 20..24 - - StateVariableAttributesList (Rule): # 24..31 " public" - - PublicKeyword (Token): "public" # 25..31 - - Identifier (Token): "a" # 32..33 - - Semicolon (Token): ";" # 33..34 + - ContractMembers (Rule): # 18..35 " uint public a;\n" + - ContractMember (Rule): # 18..35 " uint public a;\n" + - StateVariableDefinition (Rule): # 18..35 " uint public a;\n" + - TypeName (Rule): # 18..24 " uint" + - ElementaryType (Rule): # 18..24 " uint" + - UintKeyword (Token): "uint" # 20..24 + - StateVariableAttributes (Rule): # 24..31 " public" + - StateVariableAttribute (Rule): # 24..31 " public" + - PublicKeyword (Token): "public" # 25..31 + - Identifier (Token): "a" # 32..33 + - Semicolon (Token): ";" # 33..34 - CloseBrace (Token): "}" # 35..36 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/generated/0.4.11-success.yml index 1b223516ae..682507a89c 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/generated/0.4.11-success.yml @@ -15,21 +15,24 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..59 " struct S {\n uint a;\n uint b;\n }\n" - - StructDefinition (Rule): # 18..59 " struct S {\n uint a;\n uint b;\n }\n" - - StructKeyword (Token): "struct" # 20..26 - - Identifier (Token): "S" # 27..28 - - OpenBrace (Token): "{" # 29..30 - - StructMembersList (Rule): # 31..55 " uint a;\n uint b;\n" - - StructMember (Rule): # 31..43 " uint a;\n" - - TypeName (Rule): # 31..39 " uint" - - UnsignedIntegerType (Token): "uint" # 35..39 - - Identifier (Token): "a" # 40..41 - - Semicolon (Token): ";" # 41..42 - - StructMember (Rule): # 43..55 " uint b;\n" - - TypeName (Rule): # 43..51 " uint" - - UnsignedIntegerType (Token): "uint" # 47..51 - - Identifier (Token): "b" # 52..53 - - Semicolon (Token): ";" # 53..54 - - CloseBrace (Token): "}" # 57..58 + - ContractMembers (Rule): # 18..59 " struct S {\n uint a;\n uint b;\n }\n" + - ContractMember (Rule): # 18..59 " struct S {\n uint a;\n uint b;\n }\n" + - StructDefinition (Rule): # 18..59 " struct S {\n uint a;\n uint b;\n }\n" + - StructKeyword (Token): "struct" # 20..26 + - Identifier (Token): "S" # 27..28 + - OpenBrace (Token): "{" # 29..30 + - StructMembers (Rule): # 31..55 " uint a;\n uint b;\n" + - StructMember (Rule): # 31..43 " uint a;\n" + - TypeName (Rule): # 31..39 " uint" + - ElementaryType (Rule): # 31..39 " uint" + - UintKeyword (Token): "uint" # 35..39 + - Identifier (Token): "a" # 40..41 + - Semicolon (Token): ";" # 41..42 + - StructMember (Rule): # 43..55 " uint b;\n" + - TypeName (Rule): # 43..51 " uint" + - ElementaryType (Rule): # 43..51 " uint" + - UintKeyword (Token): "uint" # 47..51 + - Identifier (Token): "b" # 52..53 + - Semicolon (Token): ";" # 53..54 + - CloseBrace (Token): "}" # 57..58 - CloseBrace (Token): "}" # 59..60 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.4.11-success.yml index 9cb8efa97c..8ef2ca3803 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.4.11-success.yml @@ -13,13 +13,18 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..38 " function () {\n }\n" - - UnnamedFunctionDefinition (Rule): # 18..38 " function () {\n }\n" - - FunctionKeyword (Token): "function" # 20..28 - - ParametersDeclaration (Rule): # 28..31 " ()" - - OpenParen (Token): "(" # 29..30 - - CloseParen (Token): ")" # 30..31 - - Block (Rule): # 31..38 " {\n }\n" - - OpenBrace (Token): "{" # 32..33 - - CloseBrace (Token): "}" # 36..37 + - ContractMembers (Rule): # 18..38 " function () {\n }\n" + - ContractMember (Rule): # 18..38 " function () {\n }\n" + - UnnamedFunctionDefinition (Rule): # 18..38 " function () {\n }\n" + - FunctionKeyword (Token): "function" # 20..28 + - ParametersDeclaration (Rule): # 28..31 " ()" + - OpenParen (Token): "(" # 29..30 + - Parameters (Rule): [] # 30..30 + - CloseParen (Token): ")" # 30..31 + - UnnamedFunctionAttributes (Rule): [] # 31..31 + - FunctionBody (Rule): # 31..38 " {\n }\n" + - Block (Rule): # 31..38 " {\n }\n" + - OpenBrace (Token): "{" # 32..33 + - Statements (Rule): [] # 34..34 + - CloseBrace (Token): "}" # 36..37 - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.0-failure.yml index 005f688bd0..6dd8946864 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.0-failure.yml @@ -22,13 +22,17 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..32 " function () " - - StateVariableDefinition (Rule): # 18..32 " function () " - - TypeName (Rule): # 18..31 " function ()" - - FunctionType (Rule): # 18..31 " function ()" - - FunctionKeyword (Token): "function" # 20..28 - - ParametersDeclaration (Rule): # 28..31 " ()" - - OpenParen (Token): "(" # 29..30 - - CloseParen (Token): ")" # 30..31 + - ContractMembers (Rule): # 18..32 " function () " + - ContractMember (Rule): # 18..32 " function () " + - StateVariableDefinition (Rule): # 18..32 " function () " + - TypeName (Rule): # 18..31 " function ()" + - FunctionType (Rule): # 18..31 " function ()" + - FunctionKeyword (Token): "function" # 20..28 + - ParametersDeclaration (Rule): # 28..31 " ()" + - OpenParen (Token): "(" # 29..30 + - Parameters (Rule): [] # 30..30 + - CloseParen (Token): ")" # 30..31 + - FunctionTypeAttributes (Rule): [] # 31..31 + - StateVariableAttributes (Rule): [] # 31..31 - SKIPPED (Token): "{\n }\n" # 32..38 - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.5-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.5-failure.yml index 643ee0128f..f5ebe10f06 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.5-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.5-failure.yml @@ -22,13 +22,17 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..32 " function () " - - StateVariableDefinition (Rule): # 18..32 " function () " - - TypeName (Rule): # 18..31 " function ()" - - FunctionType (Rule): # 18..31 " function ()" - - FunctionKeyword (Token): "function" # 20..28 - - ParametersDeclaration (Rule): # 28..31 " ()" - - OpenParen (Token): "(" # 29..30 - - CloseParen (Token): ")" # 30..31 + - ContractMembers (Rule): # 18..32 " function () " + - ContractMember (Rule): # 18..32 " function () " + - StateVariableDefinition (Rule): # 18..32 " function () " + - TypeName (Rule): # 18..31 " function ()" + - FunctionType (Rule): # 18..31 " function ()" + - FunctionKeyword (Token): "function" # 20..28 + - ParametersDeclaration (Rule): # 28..31 " ()" + - OpenParen (Token): "(" # 29..30 + - Parameters (Rule): [] # 30..30 + - CloseParen (Token): ")" # 30..31 + - FunctionTypeAttributes (Rule): [] # 31..31 + - StateVariableAttributes (Rule): [] # 31..31 - SKIPPED (Token): "{\n }\n" # 32..38 - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.4.11-success.yml index 6d47d9b4ec..25de6c4a2f 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.4.11-success.yml @@ -12,16 +12,22 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..51 " function() external payable {}\n" - - UnnamedFunctionDefinition (Rule): # 18..51 " function() external payable {}\n" - - FunctionKeyword (Token): "function" # 20..28 - - ParametersDeclaration (Rule): # 28..30 "()" - - OpenParen (Token): "(" # 28..29 - - CloseParen (Token): ")" # 29..30 - - UnnamedFunctionAttributesList (Rule): # 30..47 " external payable" - - ExternalKeyword (Token): "external" # 31..39 - - PayableKeyword (Token): "payable" # 40..47 - - Block (Rule): # 47..51 " {}\n" - - OpenBrace (Token): "{" # 48..49 - - CloseBrace (Token): "}" # 49..50 + - ContractMembers (Rule): # 18..51 " function() external payable {}\n" + - ContractMember (Rule): # 18..51 " function() external payable {}\n" + - UnnamedFunctionDefinition (Rule): # 18..51 " function() external payable {}\n" + - FunctionKeyword (Token): "function" # 20..28 + - ParametersDeclaration (Rule): # 28..30 "()" + - OpenParen (Token): "(" # 28..29 + - Parameters (Rule): [] # 29..29 + - CloseParen (Token): ")" # 29..30 + - UnnamedFunctionAttributes (Rule): # 30..47 " external payable" + - UnnamedFunctionAttribute (Rule): # 30..39 " external" + - ExternalKeyword (Token): "external" # 31..39 + - UnnamedFunctionAttribute (Rule): # 39..47 " payable" + - PayableKeyword (Token): "payable" # 40..47 + - FunctionBody (Rule): # 47..51 " {}\n" + - Block (Rule): # 47..51 " {}\n" + - OpenBrace (Token): "{" # 48..49 + - Statements (Rule): [] # 49..49 + - CloseBrace (Token): "}" # 49..50 - CloseBrace (Token): "}" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.0-failure.yml index e01e31043a..f63e7090dc 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.0-failure.yml @@ -20,16 +20,21 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..48 " function() external payable " - - StateVariableDefinition (Rule): # 18..48 " function() external payable " - - TypeName (Rule): # 18..47 " function() external payable" - - FunctionType (Rule): # 18..47 " function() external payable" - - FunctionKeyword (Token): "function" # 20..28 - - ParametersDeclaration (Rule): # 28..30 "()" - - OpenParen (Token): "(" # 28..29 - - CloseParen (Token): ")" # 29..30 - - FunctionTypeAttributesList (Rule): # 30..47 " external payable" - - ExternalKeyword (Token): "external" # 31..39 - - PayableKeyword (Token): "payable" # 40..47 + - ContractMembers (Rule): # 18..48 " function() external payable " + - ContractMember (Rule): # 18..48 " function() external payable " + - StateVariableDefinition (Rule): # 18..48 " function() external payable " + - TypeName (Rule): # 18..47 " function() external payable" + - FunctionType (Rule): # 18..47 " function() external payable" + - FunctionKeyword (Token): "function" # 20..28 + - ParametersDeclaration (Rule): # 28..30 "()" + - OpenParen (Token): "(" # 28..29 + - Parameters (Rule): [] # 29..29 + - CloseParen (Token): ")" # 29..30 + - FunctionTypeAttributes (Rule): # 30..47 " external payable" + - FunctionTypeAttribute (Rule): # 30..39 " external" + - ExternalKeyword (Token): "external" # 31..39 + - FunctionTypeAttribute (Rule): # 39..47 " payable" + - PayableKeyword (Token): "payable" # 40..47 + - StateVariableAttributes (Rule): [] # 47..47 - SKIPPED (Token): "{}\n" # 48..51 - CloseBrace (Token): "}" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.5-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.5-failure.yml index 14a80288b2..746b0a05d6 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.5-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.5-failure.yml @@ -20,16 +20,21 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..48 " function() external payable " - - StateVariableDefinition (Rule): # 18..48 " function() external payable " - - TypeName (Rule): # 18..47 " function() external payable" - - FunctionType (Rule): # 18..47 " function() external payable" - - FunctionKeyword (Token): "function" # 20..28 - - ParametersDeclaration (Rule): # 28..30 "()" - - OpenParen (Token): "(" # 28..29 - - CloseParen (Token): ")" # 29..30 - - FunctionTypeAttributesList (Rule): # 30..47 " external payable" - - ExternalKeyword (Token): "external" # 31..39 - - PayableKeyword (Token): "payable" # 40..47 + - ContractMembers (Rule): # 18..48 " function() external payable " + - ContractMember (Rule): # 18..48 " function() external payable " + - StateVariableDefinition (Rule): # 18..48 " function() external payable " + - TypeName (Rule): # 18..47 " function() external payable" + - FunctionType (Rule): # 18..47 " function() external payable" + - FunctionKeyword (Token): "function" # 20..28 + - ParametersDeclaration (Rule): # 28..30 "()" + - OpenParen (Token): "(" # 28..29 + - Parameters (Rule): [] # 29..29 + - CloseParen (Token): ")" # 29..30 + - FunctionTypeAttributes (Rule): # 30..47 " external payable" + - FunctionTypeAttribute (Rule): # 30..39 " external" + - ExternalKeyword (Token): "external" # 31..39 + - FunctionTypeAttribute (Rule): # 39..47 " payable" + - PayableKeyword (Token): "payable" # 40..47 + - StateVariableAttributes (Rule): [] # 47..47 - SKIPPED (Token): "{}\n" # 48..51 - CloseBrace (Token): "}" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.11-failure.yml index 3ae8571be1..5a04735477 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.11-failure.yml @@ -7,7 +7,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or CloseBrace or EnumKeyword or EventKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or BytesKeyword or CloseBrace or EnumKeyword or EventKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or ModifierKeyword or PayableKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/input.sol:2:3] │ 2 │ type Foo is bool; @@ -20,5 +20,6 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): [] # 18..18 - SKIPPED (Token): "type Foo is bool;\n" # 20..38 - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.22-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.22-failure.yml index 495410a4c8..fe606928f4 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.22-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.4.22-failure.yml @@ -7,7 +7,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or EventKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or BytesKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or EventKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or ModifierKeyword or PayableKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/input.sol:2:3] │ 2 │ type Foo is bool; @@ -20,5 +20,6 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): [] # 18..18 - SKIPPED (Token): "type Foo is bool;\n" # 20..38 - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.6.0-failure.yml index fb2535e845..45847292f3 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.6.0-failure.yml @@ -7,7 +7,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or EventKeyword or FallbackKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or BytesKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or EventKeyword or FallbackKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/input.sol:2:3] │ 2 │ type Foo is bool; @@ -20,5 +20,6 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): [] # 18..18 - SKIPPED (Token): "type Foo is bool;\n" # 20..38 - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.0-failure.yml index 524b120a70..2757b3be03 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.0-failure.yml @@ -7,7 +7,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or EventKeyword or FallbackKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or EventKeyword or FallbackKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/input.sol:2:3] │ 2 │ type Foo is bool; @@ -20,5 +20,6 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): [] # 18..18 - SKIPPED (Token): "type Foo is bool;\n" # 20..38 - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.4-failure.yml index 23fcd03d3a..7059f60265 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.4-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.4-failure.yml @@ -7,7 +7,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FallbackKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FallbackKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/input.sol:2:3] │ 2 │ type Foo is bool; @@ -20,5 +20,6 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): [] # 18..18 - SKIPPED (Token): "type Foo is bool;\n" # 20..38 - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.8-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.8-success.yml index 8593cb29ea..336b0f7dc6 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.8-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.8-success.yml @@ -12,11 +12,13 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..38 " type Foo is bool;\n" - - UserDefinedValueTypeDefinition (Rule): # 18..38 " type Foo is bool;\n" - - TypeKeyword (Token): "type" # 20..24 - - Identifier (Token): "Foo" # 25..28 - - IsKeyword (Token): "is" # 29..31 - - BoolKeyword (Token): "bool" # 32..36 - - Semicolon (Token): ";" # 36..37 + - ContractMembers (Rule): # 18..38 " type Foo is bool;\n" + - ContractMember (Rule): # 18..38 " type Foo is bool;\n" + - UserDefinedValueTypeDefinition (Rule): # 18..38 " type Foo is bool;\n" + - TypeKeyword (Token): "type" # 20..24 + - Identifier (Token): "Foo" # 25..28 + - IsKeyword (Token): "is" # 29..31 + - ElementaryType (Rule): # 31..36 " bool" + - BoolKeyword (Token): "bool" # 32..36 + - Semicolon (Token): ";" # 36..37 - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/generated/0.4.11-success.yml index 157803ac80..6d991ffe3f 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/generated/0.4.11-success.yml @@ -12,13 +12,15 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..35 " using x for *;\n" - - UsingDirective (Rule): # 18..35 " using x for *;\n" - - UsingKeyword (Token): "using" # 20..25 - - UsingDirectivePath (Rule): # 25..27 " x" - - IdentifierPath (Rule): # 25..27 " x" - - Identifier (Token): "x" # 26..27 - - ForKeyword (Token): "for" # 28..31 - - Asterisk (Token): "*" # 32..33 - - Semicolon (Token): ";" # 33..34 + - ContractMembers (Rule): # 18..35 " using x for *;\n" + - ContractMember (Rule): # 18..35 " using x for *;\n" + - UsingDirective (Rule): # 18..35 " using x for *;\n" + - UsingKeyword (Token): "using" # 20..25 + - UsingSymbol (Rule): # 25..27 " x" + - IdentifierPath (Rule): # 25..27 " x" + - Identifier (Token): "x" # 26..27 + - ForKeyword (Token): "for" # 28..31 + - UsingTarget (Rule): # 31..33 " *" + - Asterisk (Token): "*" # 32..33 + - Semicolon (Token): ";" # 33..34 - CloseBrace (Token): "}" # 35..36 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.4.11-failure.yml index 3d92aed9b4..266e9e0513 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.4.11-failure.yml @@ -20,11 +20,13 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Test" # 9..13 - OpenBrace (Token): "{" # 14..15 - - ContractMembersList (Rule): # 16..25 " field;\n" - - StateVariableDefinition (Rule): # 16..25 " field;\n" - - TypeName (Rule): # 16..23 " field" - - IdentifierPath (Rule): # 16..23 " field" - - Identifier (Token): "field" # 18..23 - - SKIPPED (Token): "" # 23..23 - - Semicolon (Token): ";" # 23..24 + - ContractMembers (Rule): # 16..25 " field;\n" + - ContractMember (Rule): # 16..25 " field;\n" + - StateVariableDefinition (Rule): # 16..25 " field;\n" + - TypeName (Rule): # 16..23 " field" + - IdentifierPath (Rule): # 16..23 " field" + - Identifier (Token): "field" # 18..23 + - StateVariableAttributes (Rule): [] # 23..23 + - SKIPPED (Token): "" # 23..23 + - Semicolon (Token): ";" # 23..24 - CloseBrace (Token): "}" # 25..26 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.5-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.5-failure.yml index bbc9f841d4..a7aefea967 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.5-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.5-failure.yml @@ -20,11 +20,13 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Test" # 9..13 - OpenBrace (Token): "{" # 14..15 - - ContractMembersList (Rule): # 16..25 " field;\n" - - StateVariableDefinition (Rule): # 16..25 " field;\n" - - TypeName (Rule): # 16..23 " field" - - IdentifierPath (Rule): # 16..23 " field" - - Identifier (Token): "field" # 18..23 - - SKIPPED (Token): "" # 23..23 - - Semicolon (Token): ";" # 23..24 + - ContractMembers (Rule): # 16..25 " field;\n" + - ContractMember (Rule): # 16..25 " field;\n" + - StateVariableDefinition (Rule): # 16..25 " field;\n" + - TypeName (Rule): # 16..23 " field" + - IdentifierPath (Rule): # 16..23 " field" + - Identifier (Token): "field" # 18..23 + - StateVariableAttributes (Rule): [] # 23..23 + - SKIPPED (Token): "" # 23..23 + - Semicolon (Token): ";" # 23..24 - CloseBrace (Token): "}" # 25..26 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.4.11-failure.yml index 853d48d94a..88b1c25797 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.4.11-failure.yml @@ -24,7 +24,7 @@ Errors: # 3 total │ ╰──── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/input.sol:3:6] │ 3 │ if(while == pair && !_isExcludedFromFee[to]){ @@ -32,7 +32,7 @@ Errors: # 3 total │ ╰───────────────────── Error occurred here. ───╯ - > - Error: Expected Ampersand or AmpersandAmpersand or AmpersandEqual or Asterisk or AsteriskAsterisk or AsteriskEqual or BangEqual or Bar or BarBar or BarEqual or Caret or CaretEqual or Equal or EqualEqual or GreaterThan or GreaterThanEqual or GreaterThanGreaterThan or GreaterThanGreaterThanEqual or GreaterThanGreaterThanGreaterThan or GreaterThanGreaterThanGreaterThanEqual or LessThan or LessThanEqual or LessThanLessThan or LessThanLessThanEqual or Minus or MinusEqual or Percent or PercentEqual or Plus or PlusEqual or Semicolon or Slash or SlashEqual. + Error: Expected Identifier or MemoryKeyword or StorageKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/input.sol:10:13] │ 10 │ ╭─▶ unchecked { invalid sequence } @@ -46,71 +46,86 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Contract" # 9..17 - OpenBrace (Token): "{" # 18..19 - - ContractMembersList (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "_transfer" # 30..39 - - ParametersDeclaration (Rule): # 39..54 "(address while)" - - OpenParen (Token): "(" # 39..40 - - ParametersList (Rule): # 40..47 "address" - - Parameter (Rule): # 40..47 "address" - - TypeName (Rule): # 40..47 "address" - - AddressType (Rule): # 40..47 "address" - - AddressKeyword (Token): "address" # 40..47 - - SKIPPED (Token): "while" # 48..53 - - CloseParen (Token): ")" # 53..54 - - FunctionAttributesList (Rule): # 54..62 " private" - - PrivateKeyword (Token): "private" # 55..62 - - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." - - OpenBrace (Token): "{" # 63..64 - - StatementsList (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfKeyword (Token): "if" # 67..69 - - OpenParen (Token): "(" # 69..70 - - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 - - CloseParen (Token): ")" # 110..111 - - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - OpenBrace (Token): "{" # 111..112 - - StatementsList (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclaration (Rule): # 113..125 "\t\t\tuint256 a" - - TypeName (Rule): # 113..123 "\t\t\tuint256" - - UnsignedIntegerType (Token): "uint256" # 116..123 - - Identifier (Token): "a" # 124..125 - - Equal (Token): "=" # 126..127 - - Expression (Rule): # 127..129 " 1" - - NumericExpression (Rule): # 127..129 " 1" - - DecimalLiteral (Token): "1" # 128..129 - - Semicolon (Token): ";" # 129..130 - - CloseBrace (Token): "}" # 133..134 - - CloseBrace (Token): "}" # 136..137 - - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "abc" # 149..152 - - ParametersDeclaration (Rule): # 152..154 "()" - - OpenParen (Token): "(" # 152..153 - - CloseParen (Token): ")" # 153..154 - - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." - - OpenBrace (Token): "{" # 155..156 - - StatementsList (Rule): # 157..186 "\t\tuint256 x = 0;\n\t\tunchecked " - - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclaration (Rule): # 157..168 "\t\tuint256 x" - - TypeName (Rule): # 157..166 "\t\tuint256" - - UnsignedIntegerType (Token): "uint256" # 159..166 - - Identifier (Token): "x" # 167..168 - - Equal (Token): "=" # 169..170 - - Expression (Rule): # 170..172 " 0" - - NumericExpression (Rule): # 170..172 " 0" - - DecimalLiteral (Token): "0" # 171..172 - - Semicolon (Token): ";" # 172..173 - - Statement (Rule): # 174..186 "\t\tunchecked " - - ExpressionStatement (Rule): # 174..186 "\t\tunchecked " - - Expression (Rule): # 174..185 "\t\tunchecked" - - Identifier (Token): "unchecked" # 176..185 - - SKIPPED (Token): "{ invalid sequence }\n\t" # 186..208 - - CloseBrace (Token): "}" # 208..209 + - ContractMembers (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." + - ContractMember (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionKeyword (Token): "function" # 21..29 + - Identifier (Token): "_transfer" # 30..39 + - ParametersDeclaration (Rule): # 39..54 "(address while)" + - OpenParen (Token): "(" # 39..40 + - Parameters (Rule): # 40..47 "address" + - Parameter (Rule): # 40..47 "address" + - TypeName (Rule): # 40..47 "address" + - ElementaryType (Rule): # 40..47 "address" + - AddressType (Rule): # 40..47 "address" + - AddressKeyword (Token): "address" # 40..47 + - SKIPPED (Token): "while" # 48..53 + - CloseParen (Token): ")" # 53..54 + - FunctionAttributes (Rule): # 54..62 " private" + - FunctionAttribute (Rule): # 54..62 " private" + - PrivateKeyword (Token): "private" # 55..62 + - FunctionBody (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - OpenBrace (Token): "{" # 63..64 + - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfKeyword (Token): "if" # 67..69 + - OpenParen (Token): "(" # 69..70 + - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 + - CloseParen (Token): ")" # 110..111 + - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - OpenBrace (Token): "{" # 111..112 + - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationType (Rule): # 113..123 "\t\t\tuint256" + - TypeName (Rule): # 113..123 "\t\t\tuint256" + - ElementaryType (Rule): # 113..123 "\t\t\tuint256" + - UintKeyword (Token): "uint256" # 116..123 + - Identifier (Token): "a" # 124..125 + - VariableDeclarationValue (Rule): # 125..129 " = 1" + - Equal (Token): "=" # 126..127 + - Expression (Rule): # 127..129 " 1" + - DecimalNumberExpression (Rule): # 127..129 " 1" + - DecimalLiteral (Token): "1" # 128..129 + - Semicolon (Token): ";" # 129..130 + - CloseBrace (Token): "}" # 133..134 + - ElseBranch (Rule): [] # 135..135 + - CloseBrace (Token): "}" # 136..137 + - ContractMember (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionKeyword (Token): "function" # 140..148 + - Identifier (Token): "abc" # 149..152 + - ParametersDeclaration (Rule): # 152..154 "()" + - OpenParen (Token): "(" # 152..153 + - Parameters (Rule): [] # 153..153 + - CloseParen (Token): ")" # 153..154 + - FunctionAttributes (Rule): [] # 154..154 + - FunctionBody (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - OpenBrace (Token): "{" # 155..156 + - Statements (Rule): # 157..186 "\t\tuint256 x = 0;\n\t\tunchecked " + - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationType (Rule): # 157..166 "\t\tuint256" + - TypeName (Rule): # 157..166 "\t\tuint256" + - ElementaryType (Rule): # 157..166 "\t\tuint256" + - UintKeyword (Token): "uint256" # 159..166 + - Identifier (Token): "x" # 167..168 + - VariableDeclarationValue (Rule): # 168..172 " = 0" + - Equal (Token): "=" # 169..170 + - Expression (Rule): # 170..172 " 0" + - DecimalNumberExpression (Rule): # 170..172 " 0" + - DecimalLiteral (Token): "0" # 171..172 + - Semicolon (Token): ";" # 172..173 + - Statement (Rule): # 174..186 "\t\tunchecked " + - VariableDeclarationStatement (Rule): # 174..186 "\t\tunchecked " + - VariableDeclarationType (Rule): # 174..185 "\t\tunchecked" + - TypeName (Rule): # 174..185 "\t\tunchecked" + - IdentifierPath (Rule): # 174..185 "\t\tunchecked" + - Identifier (Token): "unchecked" # 176..185 + - SKIPPED (Token): "{ invalid sequence }\n\t" # 186..208 + - CloseBrace (Token): "}" # 208..209 - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.0-failure.yml index 663699031f..63ce6126a8 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.0-failure.yml @@ -24,7 +24,7 @@ Errors: # 3 total │ ╰──── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/input.sol:3:6] │ 3 │ if(while == pair && !_isExcludedFromFee[to]){ @@ -32,7 +32,7 @@ Errors: # 3 total │ ╰───────────────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/input.sol:10:3] │ 10 │ ╭─▶ unchecked { invalid sequence } @@ -46,67 +46,80 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Contract" # 9..17 - OpenBrace (Token): "{" # 18..19 - - ContractMembersList (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "_transfer" # 30..39 - - ParametersDeclaration (Rule): # 39..54 "(address while)" - - OpenParen (Token): "(" # 39..40 - - ParametersList (Rule): # 40..47 "address" - - Parameter (Rule): # 40..47 "address" - - TypeName (Rule): # 40..47 "address" - - AddressType (Rule): # 40..47 "address" - - AddressKeyword (Token): "address" # 40..47 - - SKIPPED (Token): "while" # 48..53 - - CloseParen (Token): ")" # 53..54 - - FunctionAttributesList (Rule): # 54..62 " private" - - PrivateKeyword (Token): "private" # 55..62 - - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." - - OpenBrace (Token): "{" # 63..64 - - StatementsList (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfKeyword (Token): "if" # 67..69 - - OpenParen (Token): "(" # 69..70 - - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 - - CloseParen (Token): ")" # 110..111 - - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - OpenBrace (Token): "{" # 111..112 - - StatementsList (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclaration (Rule): # 113..125 "\t\t\tuint256 a" - - TypeName (Rule): # 113..123 "\t\t\tuint256" - - UnsignedIntegerType (Token): "uint256" # 116..123 - - Identifier (Token): "a" # 124..125 - - Equal (Token): "=" # 126..127 - - Expression (Rule): # 127..129 " 1" - - NumericExpression (Rule): # 127..129 " 1" - - DecimalLiteral (Token): "1" # 128..129 - - Semicolon (Token): ";" # 129..130 - - CloseBrace (Token): "}" # 133..134 - - CloseBrace (Token): "}" # 136..137 - - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "abc" # 149..152 - - ParametersDeclaration (Rule): # 152..154 "()" - - OpenParen (Token): "(" # 152..153 - - CloseParen (Token): ")" # 153..154 - - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." - - OpenBrace (Token): "{" # 155..156 - - StatementsList (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclaration (Rule): # 157..168 "\t\tuint256 x" - - TypeName (Rule): # 157..166 "\t\tuint256" - - UnsignedIntegerType (Token): "uint256" # 159..166 - - Identifier (Token): "x" # 167..168 - - Equal (Token): "=" # 169..170 - - Expression (Rule): # 170..172 " 0" - - NumericExpression (Rule): # 170..172 " 0" - - DecimalLiteral (Token): "0" # 171..172 - - Semicolon (Token): ";" # 172..173 - - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 - - CloseBrace (Token): "}" # 208..209 + - ContractMembers (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." + - ContractMember (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionKeyword (Token): "function" # 21..29 + - Identifier (Token): "_transfer" # 30..39 + - ParametersDeclaration (Rule): # 39..54 "(address while)" + - OpenParen (Token): "(" # 39..40 + - Parameters (Rule): # 40..47 "address" + - Parameter (Rule): # 40..47 "address" + - TypeName (Rule): # 40..47 "address" + - ElementaryType (Rule): # 40..47 "address" + - AddressType (Rule): # 40..47 "address" + - AddressKeyword (Token): "address" # 40..47 + - SKIPPED (Token): "while" # 48..53 + - CloseParen (Token): ")" # 53..54 + - FunctionAttributes (Rule): # 54..62 " private" + - FunctionAttribute (Rule): # 54..62 " private" + - PrivateKeyword (Token): "private" # 55..62 + - FunctionBody (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - OpenBrace (Token): "{" # 63..64 + - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfKeyword (Token): "if" # 67..69 + - OpenParen (Token): "(" # 69..70 + - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 + - CloseParen (Token): ")" # 110..111 + - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - OpenBrace (Token): "{" # 111..112 + - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationType (Rule): # 113..123 "\t\t\tuint256" + - TypeName (Rule): # 113..123 "\t\t\tuint256" + - ElementaryType (Rule): # 113..123 "\t\t\tuint256" + - UintKeyword (Token): "uint256" # 116..123 + - Identifier (Token): "a" # 124..125 + - VariableDeclarationValue (Rule): # 125..129 " = 1" + - Equal (Token): "=" # 126..127 + - Expression (Rule): # 127..129 " 1" + - DecimalNumberExpression (Rule): # 127..129 " 1" + - DecimalLiteral (Token): "1" # 128..129 + - Semicolon (Token): ";" # 129..130 + - CloseBrace (Token): "}" # 133..134 + - ElseBranch (Rule): [] # 135..135 + - CloseBrace (Token): "}" # 136..137 + - ContractMember (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionKeyword (Token): "function" # 140..148 + - Identifier (Token): "abc" # 149..152 + - ParametersDeclaration (Rule): # 152..154 "()" + - OpenParen (Token): "(" # 152..153 + - Parameters (Rule): [] # 153..153 + - CloseParen (Token): ")" # 153..154 + - FunctionAttributes (Rule): [] # 154..154 + - FunctionBody (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - OpenBrace (Token): "{" # 155..156 + - Statements (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationType (Rule): # 157..166 "\t\tuint256" + - TypeName (Rule): # 157..166 "\t\tuint256" + - ElementaryType (Rule): # 157..166 "\t\tuint256" + - UintKeyword (Token): "uint256" # 159..166 + - Identifier (Token): "x" # 167..168 + - VariableDeclarationValue (Rule): # 168..172 " = 0" + - Equal (Token): "=" # 169..170 + - Expression (Rule): # 170..172 " 0" + - DecimalNumberExpression (Rule): # 170..172 " 0" + - DecimalLiteral (Token): "0" # 171..172 + - Semicolon (Token): ";" # 172..173 + - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 + - CloseBrace (Token): "}" # 208..209 - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.3-failure.yml index cff00c3411..e5d761856f 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.3-failure.yml @@ -24,7 +24,7 @@ Errors: # 3 total │ ╰──── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/input.sol:3:6] │ 3 │ if(while == pair && !_isExcludedFromFee[to]){ @@ -32,7 +32,7 @@ Errors: # 3 total │ ╰───────────────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/input.sol:10:3] │ 10 │ ╭─▶ unchecked { invalid sequence } @@ -46,67 +46,80 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Contract" # 9..17 - OpenBrace (Token): "{" # 18..19 - - ContractMembersList (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "_transfer" # 30..39 - - ParametersDeclaration (Rule): # 39..54 "(address while)" - - OpenParen (Token): "(" # 39..40 - - ParametersList (Rule): # 40..47 "address" - - Parameter (Rule): # 40..47 "address" - - TypeName (Rule): # 40..47 "address" - - AddressType (Rule): # 40..47 "address" - - AddressKeyword (Token): "address" # 40..47 - - SKIPPED (Token): "while" # 48..53 - - CloseParen (Token): ")" # 53..54 - - FunctionAttributesList (Rule): # 54..62 " private" - - PrivateKeyword (Token): "private" # 55..62 - - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." - - OpenBrace (Token): "{" # 63..64 - - StatementsList (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfKeyword (Token): "if" # 67..69 - - OpenParen (Token): "(" # 69..70 - - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 - - CloseParen (Token): ")" # 110..111 - - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - OpenBrace (Token): "{" # 111..112 - - StatementsList (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclaration (Rule): # 113..125 "\t\t\tuint256 a" - - TypeName (Rule): # 113..123 "\t\t\tuint256" - - UnsignedIntegerType (Token): "uint256" # 116..123 - - Identifier (Token): "a" # 124..125 - - Equal (Token): "=" # 126..127 - - Expression (Rule): # 127..129 " 1" - - NumericExpression (Rule): # 127..129 " 1" - - DecimalLiteral (Token): "1" # 128..129 - - Semicolon (Token): ";" # 129..130 - - CloseBrace (Token): "}" # 133..134 - - CloseBrace (Token): "}" # 136..137 - - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "abc" # 149..152 - - ParametersDeclaration (Rule): # 152..154 "()" - - OpenParen (Token): "(" # 152..153 - - CloseParen (Token): ")" # 153..154 - - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." - - OpenBrace (Token): "{" # 155..156 - - StatementsList (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclaration (Rule): # 157..168 "\t\tuint256 x" - - TypeName (Rule): # 157..166 "\t\tuint256" - - UnsignedIntegerType (Token): "uint256" # 159..166 - - Identifier (Token): "x" # 167..168 - - Equal (Token): "=" # 169..170 - - Expression (Rule): # 170..172 " 0" - - NumericExpression (Rule): # 170..172 " 0" - - DecimalLiteral (Token): "0" # 171..172 - - Semicolon (Token): ";" # 172..173 - - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 - - CloseBrace (Token): "}" # 208..209 + - ContractMembers (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." + - ContractMember (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionKeyword (Token): "function" # 21..29 + - Identifier (Token): "_transfer" # 30..39 + - ParametersDeclaration (Rule): # 39..54 "(address while)" + - OpenParen (Token): "(" # 39..40 + - Parameters (Rule): # 40..47 "address" + - Parameter (Rule): # 40..47 "address" + - TypeName (Rule): # 40..47 "address" + - ElementaryType (Rule): # 40..47 "address" + - AddressType (Rule): # 40..47 "address" + - AddressKeyword (Token): "address" # 40..47 + - SKIPPED (Token): "while" # 48..53 + - CloseParen (Token): ")" # 53..54 + - FunctionAttributes (Rule): # 54..62 " private" + - FunctionAttribute (Rule): # 54..62 " private" + - PrivateKeyword (Token): "private" # 55..62 + - FunctionBody (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - OpenBrace (Token): "{" # 63..64 + - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfKeyword (Token): "if" # 67..69 + - OpenParen (Token): "(" # 69..70 + - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 + - CloseParen (Token): ")" # 110..111 + - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - OpenBrace (Token): "{" # 111..112 + - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationType (Rule): # 113..123 "\t\t\tuint256" + - TypeName (Rule): # 113..123 "\t\t\tuint256" + - ElementaryType (Rule): # 113..123 "\t\t\tuint256" + - UintKeyword (Token): "uint256" # 116..123 + - Identifier (Token): "a" # 124..125 + - VariableDeclarationValue (Rule): # 125..129 " = 1" + - Equal (Token): "=" # 126..127 + - Expression (Rule): # 127..129 " 1" + - DecimalNumberExpression (Rule): # 127..129 " 1" + - DecimalLiteral (Token): "1" # 128..129 + - Semicolon (Token): ";" # 129..130 + - CloseBrace (Token): "}" # 133..134 + - ElseBranch (Rule): [] # 135..135 + - CloseBrace (Token): "}" # 136..137 + - ContractMember (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionKeyword (Token): "function" # 140..148 + - Identifier (Token): "abc" # 149..152 + - ParametersDeclaration (Rule): # 152..154 "()" + - OpenParen (Token): "(" # 152..153 + - Parameters (Rule): [] # 153..153 + - CloseParen (Token): ")" # 153..154 + - FunctionAttributes (Rule): [] # 154..154 + - FunctionBody (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - OpenBrace (Token): "{" # 155..156 + - Statements (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationType (Rule): # 157..166 "\t\tuint256" + - TypeName (Rule): # 157..166 "\t\tuint256" + - ElementaryType (Rule): # 157..166 "\t\tuint256" + - UintKeyword (Token): "uint256" # 159..166 + - Identifier (Token): "x" # 167..168 + - VariableDeclarationValue (Rule): # 168..172 " = 0" + - Equal (Token): "=" # 169..170 + - Expression (Rule): # 170..172 " 0" + - DecimalNumberExpression (Rule): # 170..172 " 0" + - DecimalLiteral (Token): "0" # 171..172 + - Semicolon (Token): ";" # 172..173 + - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 + - CloseBrace (Token): "}" # 208..209 - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.6.0-failure.yml index 9456b4101e..c0127ecf6e 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.6.0-failure.yml @@ -24,7 +24,7 @@ Errors: # 3 total │ ╰──── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/input.sol:3:6] │ 3 │ if(while == pair && !_isExcludedFromFee[to]){ @@ -32,7 +32,7 @@ Errors: # 3 total │ ╰───────────────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/input.sol:10:3] │ 10 │ ╭─▶ unchecked { invalid sequence } @@ -46,67 +46,80 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Contract" # 9..17 - OpenBrace (Token): "{" # 18..19 - - ContractMembersList (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "_transfer" # 30..39 - - ParametersDeclaration (Rule): # 39..54 "(address while)" - - OpenParen (Token): "(" # 39..40 - - ParametersList (Rule): # 40..47 "address" - - Parameter (Rule): # 40..47 "address" - - TypeName (Rule): # 40..47 "address" - - AddressType (Rule): # 40..47 "address" - - AddressKeyword (Token): "address" # 40..47 - - SKIPPED (Token): "while" # 48..53 - - CloseParen (Token): ")" # 53..54 - - FunctionAttributesList (Rule): # 54..62 " private" - - PrivateKeyword (Token): "private" # 55..62 - - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." - - OpenBrace (Token): "{" # 63..64 - - StatementsList (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfKeyword (Token): "if" # 67..69 - - OpenParen (Token): "(" # 69..70 - - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 - - CloseParen (Token): ")" # 110..111 - - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - OpenBrace (Token): "{" # 111..112 - - StatementsList (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclaration (Rule): # 113..125 "\t\t\tuint256 a" - - TypeName (Rule): # 113..123 "\t\t\tuint256" - - UnsignedIntegerType (Token): "uint256" # 116..123 - - Identifier (Token): "a" # 124..125 - - Equal (Token): "=" # 126..127 - - Expression (Rule): # 127..129 " 1" - - NumericExpression (Rule): # 127..129 " 1" - - DecimalLiteral (Token): "1" # 128..129 - - Semicolon (Token): ";" # 129..130 - - CloseBrace (Token): "}" # 133..134 - - CloseBrace (Token): "}" # 136..137 - - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "abc" # 149..152 - - ParametersDeclaration (Rule): # 152..154 "()" - - OpenParen (Token): "(" # 152..153 - - CloseParen (Token): ")" # 153..154 - - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." - - OpenBrace (Token): "{" # 155..156 - - StatementsList (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclaration (Rule): # 157..168 "\t\tuint256 x" - - TypeName (Rule): # 157..166 "\t\tuint256" - - UnsignedIntegerType (Token): "uint256" # 159..166 - - Identifier (Token): "x" # 167..168 - - Equal (Token): "=" # 169..170 - - Expression (Rule): # 170..172 " 0" - - NumericExpression (Rule): # 170..172 " 0" - - DecimalLiteral (Token): "0" # 171..172 - - Semicolon (Token): ";" # 172..173 - - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 - - CloseBrace (Token): "}" # 208..209 + - ContractMembers (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." + - ContractMember (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionKeyword (Token): "function" # 21..29 + - Identifier (Token): "_transfer" # 30..39 + - ParametersDeclaration (Rule): # 39..54 "(address while)" + - OpenParen (Token): "(" # 39..40 + - Parameters (Rule): # 40..47 "address" + - Parameter (Rule): # 40..47 "address" + - TypeName (Rule): # 40..47 "address" + - ElementaryType (Rule): # 40..47 "address" + - AddressType (Rule): # 40..47 "address" + - AddressKeyword (Token): "address" # 40..47 + - SKIPPED (Token): "while" # 48..53 + - CloseParen (Token): ")" # 53..54 + - FunctionAttributes (Rule): # 54..62 " private" + - FunctionAttribute (Rule): # 54..62 " private" + - PrivateKeyword (Token): "private" # 55..62 + - FunctionBody (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - OpenBrace (Token): "{" # 63..64 + - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfKeyword (Token): "if" # 67..69 + - OpenParen (Token): "(" # 69..70 + - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 + - CloseParen (Token): ")" # 110..111 + - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - OpenBrace (Token): "{" # 111..112 + - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationType (Rule): # 113..123 "\t\t\tuint256" + - TypeName (Rule): # 113..123 "\t\t\tuint256" + - ElementaryType (Rule): # 113..123 "\t\t\tuint256" + - UintKeyword (Token): "uint256" # 116..123 + - Identifier (Token): "a" # 124..125 + - VariableDeclarationValue (Rule): # 125..129 " = 1" + - Equal (Token): "=" # 126..127 + - Expression (Rule): # 127..129 " 1" + - DecimalNumberExpression (Rule): # 127..129 " 1" + - DecimalLiteral (Token): "1" # 128..129 + - Semicolon (Token): ";" # 129..130 + - CloseBrace (Token): "}" # 133..134 + - ElseBranch (Rule): [] # 135..135 + - CloseBrace (Token): "}" # 136..137 + - ContractMember (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionKeyword (Token): "function" # 140..148 + - Identifier (Token): "abc" # 149..152 + - ParametersDeclaration (Rule): # 152..154 "()" + - OpenParen (Token): "(" # 152..153 + - Parameters (Rule): [] # 153..153 + - CloseParen (Token): ")" # 153..154 + - FunctionAttributes (Rule): [] # 154..154 + - FunctionBody (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - OpenBrace (Token): "{" # 155..156 + - Statements (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationType (Rule): # 157..166 "\t\tuint256" + - TypeName (Rule): # 157..166 "\t\tuint256" + - ElementaryType (Rule): # 157..166 "\t\tuint256" + - UintKeyword (Token): "uint256" # 159..166 + - Identifier (Token): "x" # 167..168 + - VariableDeclarationValue (Rule): # 168..172 " = 0" + - Equal (Token): "=" # 169..170 + - Expression (Rule): # 170..172 " 0" + - DecimalNumberExpression (Rule): # 170..172 " 0" + - DecimalLiteral (Token): "0" # 171..172 + - Semicolon (Token): ";" # 172..173 + - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 + - CloseBrace (Token): "}" # 208..209 - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.7.0-failure.yml index 9d164e462c..368cca5f63 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.7.0-failure.yml @@ -24,7 +24,7 @@ Errors: # 3 total │ ╰──── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/input.sol:3:6] │ 3 │ if(while == pair && !_isExcludedFromFee[to]){ @@ -32,7 +32,7 @@ Errors: # 3 total │ ╰───────────────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/input.sol:10:3] │ 10 │ ╭─▶ unchecked { invalid sequence } @@ -46,67 +46,80 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Contract" # 9..17 - OpenBrace (Token): "{" # 18..19 - - ContractMembersList (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "_transfer" # 30..39 - - ParametersDeclaration (Rule): # 39..54 "(address while)" - - OpenParen (Token): "(" # 39..40 - - ParametersList (Rule): # 40..47 "address" - - Parameter (Rule): # 40..47 "address" - - TypeName (Rule): # 40..47 "address" - - AddressType (Rule): # 40..47 "address" - - AddressKeyword (Token): "address" # 40..47 - - SKIPPED (Token): "while" # 48..53 - - CloseParen (Token): ")" # 53..54 - - FunctionAttributesList (Rule): # 54..62 " private" - - PrivateKeyword (Token): "private" # 55..62 - - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." - - OpenBrace (Token): "{" # 63..64 - - StatementsList (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfKeyword (Token): "if" # 67..69 - - OpenParen (Token): "(" # 69..70 - - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 - - CloseParen (Token): ")" # 110..111 - - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - OpenBrace (Token): "{" # 111..112 - - StatementsList (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclaration (Rule): # 113..125 "\t\t\tuint256 a" - - TypeName (Rule): # 113..123 "\t\t\tuint256" - - UnsignedIntegerType (Token): "uint256" # 116..123 - - Identifier (Token): "a" # 124..125 - - Equal (Token): "=" # 126..127 - - Expression (Rule): # 127..129 " 1" - - NumericExpression (Rule): # 127..129 " 1" - - DecimalLiteral (Token): "1" # 128..129 - - Semicolon (Token): ";" # 129..130 - - CloseBrace (Token): "}" # 133..134 - - CloseBrace (Token): "}" # 136..137 - - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "abc" # 149..152 - - ParametersDeclaration (Rule): # 152..154 "()" - - OpenParen (Token): "(" # 152..153 - - CloseParen (Token): ")" # 153..154 - - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." - - OpenBrace (Token): "{" # 155..156 - - StatementsList (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclaration (Rule): # 157..168 "\t\tuint256 x" - - TypeName (Rule): # 157..166 "\t\tuint256" - - UnsignedIntegerType (Token): "uint256" # 159..166 - - Identifier (Token): "x" # 167..168 - - Equal (Token): "=" # 169..170 - - Expression (Rule): # 170..172 " 0" - - NumericExpression (Rule): # 170..172 " 0" - - DecimalLiteral (Token): "0" # 171..172 - - Semicolon (Token): ";" # 172..173 - - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 - - CloseBrace (Token): "}" # 208..209 + - ContractMembers (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." + - ContractMember (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionKeyword (Token): "function" # 21..29 + - Identifier (Token): "_transfer" # 30..39 + - ParametersDeclaration (Rule): # 39..54 "(address while)" + - OpenParen (Token): "(" # 39..40 + - Parameters (Rule): # 40..47 "address" + - Parameter (Rule): # 40..47 "address" + - TypeName (Rule): # 40..47 "address" + - ElementaryType (Rule): # 40..47 "address" + - AddressType (Rule): # 40..47 "address" + - AddressKeyword (Token): "address" # 40..47 + - SKIPPED (Token): "while" # 48..53 + - CloseParen (Token): ")" # 53..54 + - FunctionAttributes (Rule): # 54..62 " private" + - FunctionAttribute (Rule): # 54..62 " private" + - PrivateKeyword (Token): "private" # 55..62 + - FunctionBody (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - OpenBrace (Token): "{" # 63..64 + - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfKeyword (Token): "if" # 67..69 + - OpenParen (Token): "(" # 69..70 + - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 + - CloseParen (Token): ")" # 110..111 + - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - OpenBrace (Token): "{" # 111..112 + - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationType (Rule): # 113..123 "\t\t\tuint256" + - TypeName (Rule): # 113..123 "\t\t\tuint256" + - ElementaryType (Rule): # 113..123 "\t\t\tuint256" + - UintKeyword (Token): "uint256" # 116..123 + - Identifier (Token): "a" # 124..125 + - VariableDeclarationValue (Rule): # 125..129 " = 1" + - Equal (Token): "=" # 126..127 + - Expression (Rule): # 127..129 " 1" + - DecimalNumberExpression (Rule): # 127..129 " 1" + - DecimalLiteral (Token): "1" # 128..129 + - Semicolon (Token): ";" # 129..130 + - CloseBrace (Token): "}" # 133..134 + - ElseBranch (Rule): [] # 135..135 + - CloseBrace (Token): "}" # 136..137 + - ContractMember (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionKeyword (Token): "function" # 140..148 + - Identifier (Token): "abc" # 149..152 + - ParametersDeclaration (Rule): # 152..154 "()" + - OpenParen (Token): "(" # 152..153 + - Parameters (Rule): [] # 153..153 + - CloseParen (Token): ")" # 153..154 + - FunctionAttributes (Rule): [] # 154..154 + - FunctionBody (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - OpenBrace (Token): "{" # 155..156 + - Statements (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationType (Rule): # 157..166 "\t\tuint256" + - TypeName (Rule): # 157..166 "\t\tuint256" + - ElementaryType (Rule): # 157..166 "\t\tuint256" + - UintKeyword (Token): "uint256" # 159..166 + - Identifier (Token): "x" # 167..168 + - VariableDeclarationValue (Rule): # 168..172 " = 0" + - Equal (Token): "=" # 169..170 + - Expression (Rule): # 170..172 " 0" + - DecimalNumberExpression (Rule): # 170..172 " 0" + - DecimalLiteral (Token): "0" # 171..172 + - Semicolon (Token): ";" # 172..173 + - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 + - CloseBrace (Token): "}" # 208..209 - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.8.0-failure.yml index 3267d38264..e0f916db50 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.8.0-failure.yml @@ -24,7 +24,7 @@ Errors: # 3 total │ ╰──── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/input.sol:3:6] │ 3 │ if(while == pair && !_isExcludedFromFee[to]){ @@ -45,81 +45,94 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Contract" # 9..17 - OpenBrace (Token): "{" # 18..19 - - ContractMembersList (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "_transfer" # 30..39 - - ParametersDeclaration (Rule): # 39..54 "(address while)" - - OpenParen (Token): "(" # 39..40 - - ParametersList (Rule): # 40..47 "address" - - Parameter (Rule): # 40..47 "address" - - TypeName (Rule): # 40..47 "address" - - AddressType (Rule): # 40..47 "address" - - AddressKeyword (Token): "address" # 40..47 - - SKIPPED (Token): "while" # 48..53 - - CloseParen (Token): ")" # 53..54 - - FunctionAttributesList (Rule): # 54..62 " private" - - PrivateKeyword (Token): "private" # 55..62 - - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." - - OpenBrace (Token): "{" # 63..64 - - StatementsList (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfKeyword (Token): "if" # 67..69 - - OpenParen (Token): "(" # 69..70 - - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 - - CloseParen (Token): ")" # 110..111 - - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - OpenBrace (Token): "{" # 111..112 - - StatementsList (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclaration (Rule): # 113..125 "\t\t\tuint256 a" - - TypeName (Rule): # 113..123 "\t\t\tuint256" - - UnsignedIntegerType (Token): "uint256" # 116..123 - - Identifier (Token): "a" # 124..125 - - Equal (Token): "=" # 126..127 - - Expression (Rule): # 127..129 " 1" - - NumericExpression (Rule): # 127..129 " 1" - - DecimalLiteral (Token): "1" # 128..129 - - Semicolon (Token): ";" # 129..130 - - CloseBrace (Token): "}" # 133..134 - - CloseBrace (Token): "}" # 136..137 - - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "abc" # 149..152 - - ParametersDeclaration (Rule): # 152..154 "()" - - OpenParen (Token): "(" # 152..153 - - CloseParen (Token): ")" # 153..154 - - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." - - OpenBrace (Token): "{" # 155..156 - - StatementsList (Rule): # 157..207 "\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence }\n" - - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclaration (Rule): # 157..168 "\t\tuint256 x" - - TypeName (Rule): # 157..166 "\t\tuint256" - - UnsignedIntegerType (Token): "uint256" # 159..166 - - Identifier (Token): "x" # 167..168 - - Equal (Token): "=" # 169..170 - - Expression (Rule): # 170..172 " 0" - - NumericExpression (Rule): # 170..172 " 0" - - DecimalLiteral (Token): "0" # 171..172 - - Semicolon (Token): ";" # 172..173 - - Statement (Rule): # 174..207 "\t\tunchecked { invalid sequence }\n" - - UncheckedBlock (Rule): # 174..207 "\t\tunchecked { invalid sequence }\n" - - UncheckedKeyword (Token): "unchecked" # 176..185 - - Block (Rule): # 185..207 " { invalid sequence }\n" - - OpenBrace (Token): "{" # 186..187 - - StatementsList (Rule): # 187..205 " invalid sequence " - - Statement (Rule): # 187..205 " invalid sequence " - - VariableDeclarationStatement (Rule): # 187..205 " invalid sequence " - - VariableDeclaration (Rule): # 187..204 " invalid sequence" - - TypeName (Rule): # 187..195 " invalid" - - IdentifierPath (Rule): # 187..195 " invalid" - - Identifier (Token): "invalid" # 188..195 - - Identifier (Token): "sequence" # 196..204 - - SKIPPED (Token): "" # 205..205 - - CloseBrace (Token): "}" # 205..206 - - CloseBrace (Token): "}" # 208..209 + - ContractMembers (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." + - ContractMember (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionKeyword (Token): "function" # 21..29 + - Identifier (Token): "_transfer" # 30..39 + - ParametersDeclaration (Rule): # 39..54 "(address while)" + - OpenParen (Token): "(" # 39..40 + - Parameters (Rule): # 40..47 "address" + - Parameter (Rule): # 40..47 "address" + - TypeName (Rule): # 40..47 "address" + - ElementaryType (Rule): # 40..47 "address" + - AddressType (Rule): # 40..47 "address" + - AddressKeyword (Token): "address" # 40..47 + - SKIPPED (Token): "while" # 48..53 + - CloseParen (Token): ")" # 53..54 + - FunctionAttributes (Rule): # 54..62 " private" + - FunctionAttribute (Rule): # 54..62 " private" + - PrivateKeyword (Token): "private" # 55..62 + - FunctionBody (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - OpenBrace (Token): "{" # 63..64 + - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfKeyword (Token): "if" # 67..69 + - OpenParen (Token): "(" # 69..70 + - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 + - CloseParen (Token): ")" # 110..111 + - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - OpenBrace (Token): "{" # 111..112 + - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationType (Rule): # 113..123 "\t\t\tuint256" + - TypeName (Rule): # 113..123 "\t\t\tuint256" + - ElementaryType (Rule): # 113..123 "\t\t\tuint256" + - UintKeyword (Token): "uint256" # 116..123 + - Identifier (Token): "a" # 124..125 + - VariableDeclarationValue (Rule): # 125..129 " = 1" + - Equal (Token): "=" # 126..127 + - Expression (Rule): # 127..129 " 1" + - DecimalNumberExpression (Rule): # 127..129 " 1" + - DecimalLiteral (Token): "1" # 128..129 + - Semicolon (Token): ";" # 129..130 + - CloseBrace (Token): "}" # 133..134 + - ElseBranch (Rule): [] # 135..135 + - CloseBrace (Token): "}" # 136..137 + - ContractMember (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionKeyword (Token): "function" # 140..148 + - Identifier (Token): "abc" # 149..152 + - ParametersDeclaration (Rule): # 152..154 "()" + - OpenParen (Token): "(" # 152..153 + - Parameters (Rule): [] # 153..153 + - CloseParen (Token): ")" # 153..154 + - FunctionAttributes (Rule): [] # 154..154 + - FunctionBody (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - OpenBrace (Token): "{" # 155..156 + - Statements (Rule): # 157..207 "\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence }\n" + - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationType (Rule): # 157..166 "\t\tuint256" + - TypeName (Rule): # 157..166 "\t\tuint256" + - ElementaryType (Rule): # 157..166 "\t\tuint256" + - UintKeyword (Token): "uint256" # 159..166 + - Identifier (Token): "x" # 167..168 + - VariableDeclarationValue (Rule): # 168..172 " = 0" + - Equal (Token): "=" # 169..170 + - Expression (Rule): # 170..172 " 0" + - DecimalNumberExpression (Rule): # 170..172 " 0" + - DecimalLiteral (Token): "0" # 171..172 + - Semicolon (Token): ";" # 172..173 + - Statement (Rule): # 174..207 "\t\tunchecked { invalid sequence }\n" + - UncheckedBlock (Rule): # 174..207 "\t\tunchecked { invalid sequence }\n" + - UncheckedKeyword (Token): "unchecked" # 176..185 + - Block (Rule): # 185..207 " { invalid sequence }\n" + - OpenBrace (Token): "{" # 186..187 + - Statements (Rule): # 187..205 " invalid sequence " + - Statement (Rule): # 187..205 " invalid sequence " + - VariableDeclarationStatement (Rule): # 187..205 " invalid sequence " + - VariableDeclarationType (Rule): # 187..195 " invalid" + - TypeName (Rule): # 187..195 " invalid" + - IdentifierPath (Rule): # 187..195 " invalid" + - Identifier (Token): "invalid" # 188..195 + - Identifier (Token): "sequence" # 196..204 + - SKIPPED (Token): "" # 205..205 + - CloseBrace (Token): "}" # 205..206 + - CloseBrace (Token): "}" # 208..209 - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.11-failure.yml index 865c891ffb..a22dc7c95f 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.11-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or CloseBrace or EnumKeyword or EventKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or BytesKeyword or CloseBrace or EnumKeyword or EventKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or ModifierKeyword or PayableKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/input.sol:1:18] │ 1 │ contract Sample { @@ -18,4 +18,5 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): [] # 17..17 - SKIPPED (Token): "" # 17..17 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.22-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.22-failure.yml index d1a6024b65..59a7d79000 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.22-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.4.22-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or EventKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or BytesKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or EventKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or ModifierKeyword or PayableKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/input.sol:1:18] │ 1 │ contract Sample { @@ -18,4 +18,5 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): [] # 17..17 - SKIPPED (Token): "" # 17..17 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.6.0-failure.yml index 5cf0553de6..5aac0822ad 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.6.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or EventKeyword or FallbackKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or BytesKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or EventKeyword or FallbackKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/input.sol:1:18] │ 1 │ contract Sample { @@ -18,4 +18,5 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): [] # 17..17 - SKIPPED (Token): "" # 17..17 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.0-failure.yml index bd392f357c..72bc906b83 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or EventKeyword or FallbackKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or EventKeyword or FallbackKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/input.sol:1:18] │ 1 │ contract Sample { @@ -18,4 +18,5 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): [] # 17..17 - SKIPPED (Token): "" # 17..17 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.4-failure.yml index a05a57a206..9591e9c218 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.4-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.4-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FallbackKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FallbackKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/input.sol:1:18] │ 1 │ contract Sample { @@ -18,4 +18,5 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): [] # 17..17 - SKIPPED (Token): "" # 17..17 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.8-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.8-failure.yml index c0b703bf2c..e1302b21b8 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.8-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/generated/0.8.8-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FallbackKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or SignedFixedType or SignedIntegerType or StringKeyword or StructKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or UsingKeyword. + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or CloseBrace or ConstructorKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FallbackKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or ModifierKeyword or PayableKeyword or ReceiveKeyword or StringKeyword or StructKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UsingKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/unterminated_body/input.sol:1:18] │ 1 │ contract Sample { @@ -18,4 +18,5 @@ Tree: - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): [] # 17..17 - SKIPPED (Token): "" # 17..17 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/constructor/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/constructor/generated/0.4.11-failure.yml index 75a5f2eda4..c60b810321 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/constructor/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/constructor/generated/0.4.11-failure.yml @@ -19,4 +19,5 @@ Tree: - TypeName (Rule): # 0..11 "constructor" - IdentifierPath (Rule): # 0..11 "constructor" - Identifier (Token): "constructor" # 0..11 + - StateVariableAttributes (Rule): [] # 11..11 - SKIPPED (Token): "() public {}\n" # 11..24 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/constructor/generated/0.4.22-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/constructor/generated/0.5.0-success.yml similarity index 72% rename from crates/solidity/testing/snapshots/cst_output/ContractMembersList/constructor/generated/0.4.22-success.yml rename to crates/solidity/testing/snapshots/cst_output/ContractMembersList/constructor/generated/0.5.0-success.yml index c4e01f9769..227ed3f38b 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/constructor/generated/0.4.22-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/constructor/generated/0.5.0-success.yml @@ -11,9 +11,12 @@ Tree: - ConstructorKeyword (Token): "constructor" # 0..11 - ParametersDeclaration (Rule): # 11..13 "()" - OpenParen (Token): "(" # 11..12 + - Parameters (Rule): [] # 12..12 - CloseParen (Token): ")" # 12..13 - - ConstructorAttributesList (Rule): # 13..20 " public" - - PublicKeyword (Token): "public" # 14..20 + - ConstructorAttributes (Rule): # 13..20 " public" + - ConstructorAttribute (Rule): # 13..20 " public" + - PublicKeyword (Token): "public" # 14..20 - Block (Rule): # 20..24 " {}\n" - OpenBrace (Token): "{" # 21..22 + - Statements (Rule): [] # 22..22 - CloseBrace (Token): "}" # 22..23 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/local_expression/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/local_expression/generated/0.4.11-success.yml index 1c8297871c..321a000176 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/local_expression/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/local_expression/generated/0.4.11-success.yml @@ -14,31 +14,36 @@ Tree: - Identifier (Token): "func" # 9..13 - ParametersDeclaration (Rule): # 13..15 "()" - OpenParen (Token): "(" # 13..14 + - Parameters (Rule): [] # 14..14 - CloseParen (Token): ")" # 14..15 - - Block (Rule): # 15..42 " {\n uint a = 1 + 2 * 3;\n}\n" - - OpenBrace (Token): "{" # 16..17 - - StatementsList (Rule): # 18..40 " uint a = 1 + 2 * 3;\n" - - Statement (Rule): # 18..40 " uint a = 1 + 2 * 3;\n" - - VariableDeclarationStatement (Rule): # 18..40 " uint a = 1 + 2 * 3;\n" - - VariableDeclaration (Rule): # 18..26 " uint a" - - TypeName (Rule): # 18..24 " uint" - - UnsignedIntegerType (Token): "uint" # 20..24 + - FunctionAttributes (Rule): [] # 15..15 + - FunctionBody (Rule): # 15..42 " {\n uint a = 1 + 2 * 3;\n}\n" + - Block (Rule): # 15..42 " {\n uint a = 1 + 2 * 3;\n}\n" + - OpenBrace (Token): "{" # 16..17 + - Statements (Rule): # 18..40 " uint a = 1 + 2 * 3;\n" + - Statement (Rule): # 18..40 " uint a = 1 + 2 * 3;\n" + - VariableDeclarationStatement (Rule): # 18..40 " uint a = 1 + 2 * 3;\n" + - VariableDeclarationType (Rule): # 18..24 " uint" + - TypeName (Rule): # 18..24 " uint" + - ElementaryType (Rule): # 18..24 " uint" + - UintKeyword (Token): "uint" # 20..24 - Identifier (Token): "a" # 25..26 - - Equal (Token): "=" # 27..28 - - Expression (Rule): # 28..38 " 1 + 2 * 3" - - BinaryExpression (Rule): # 28..38 " 1 + 2 * 3" - - Expression (Rule): # 28..30 " 1" - - NumericExpression (Rule): # 28..30 " 1" - - DecimalLiteral (Token): "1" # 29..30 - - Plus (Token): "+" # 31..32 - - Expression (Rule): # 32..38 " 2 * 3" - - BinaryExpression (Rule): # 32..38 " 2 * 3" - - Expression (Rule): # 32..34 " 2" - - NumericExpression (Rule): # 32..34 " 2" - - DecimalLiteral (Token): "2" # 33..34 - - Asterisk (Token): "*" # 35..36 - - Expression (Rule): # 36..38 " 3" - - NumericExpression (Rule): # 36..38 " 3" - - DecimalLiteral (Token): "3" # 37..38 - - Semicolon (Token): ";" # 38..39 - - CloseBrace (Token): "}" # 40..41 + - VariableDeclarationValue (Rule): # 26..38 " = 1 + 2 * 3" + - Equal (Token): "=" # 27..28 + - Expression (Rule): # 28..38 " 1 + 2 * 3" + - BinaryExpression (Rule): # 28..38 " 1 + 2 * 3" + - Expression (Rule): # 28..30 " 1" + - DecimalNumberExpression (Rule): # 28..30 " 1" + - DecimalLiteral (Token): "1" # 29..30 + - Plus (Token): "+" # 31..32 + - Expression (Rule): # 32..38 " 2 * 3" + - BinaryExpression (Rule): # 32..38 " 2 * 3" + - Expression (Rule): # 32..34 " 2" + - DecimalNumberExpression (Rule): # 32..34 " 2" + - DecimalLiteral (Token): "2" # 33..34 + - Asterisk (Token): "*" # 35..36 + - Expression (Rule): # 36..38 " 3" + - DecimalNumberExpression (Rule): # 36..38 " 3" + - DecimalLiteral (Token): "3" # 37..38 + - Semicolon (Token): ";" # 38..39 + - CloseBrace (Token): "}" # 40..41 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.4.11-failure.yml index 3e0eb63032..d4711c11a4 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.4.11-failure.yml @@ -18,7 +18,7 @@ Errors: # 2 total │ ╰──────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or ThrowKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or VarKeyword or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or ThrowKeyword or TrueKeyword or UfixedKeyword or UintKeyword or VarKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6] │ 4 │ }) @@ -33,37 +33,43 @@ Tree: - Identifier (Token): "someFunc" # 9..17 - ParametersDeclaration (Rule): # 17..19 "()" - OpenParen (Token): "(" # 17..18 + - Parameters (Rule): [] # 18..18 - CloseParen (Token): ")" # 18..19 - - FunctionAttributesList (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - StatementsList (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - StatementsList (Rule): # 35..63 " uint256 arg = (1 + 2" - - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclaration (Rule): # 35..54 " uint256 arg" - - TypeName (Rule): # 35..50 " uint256" - - UnsignedIntegerType (Token): "uint256" # 43..50 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 - Identifier (Token): "arg" # 51..54 - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValuesList (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - NumericExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - NumericExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.4.21-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.4.21-failure.yml index 7a9ed5c3be..31d52988d5 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.4.21-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.4.21-failure.yml @@ -18,7 +18,7 @@ Errors: # 2 total │ ╰──────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or ThrowKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or VarKeyword or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or ThrowKeyword or TrueKeyword or UfixedKeyword or UintKeyword or VarKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6] │ 4 │ }) @@ -33,37 +33,43 @@ Tree: - Identifier (Token): "someFunc" # 9..17 - ParametersDeclaration (Rule): # 17..19 "()" - OpenParen (Token): "(" # 17..18 + - Parameters (Rule): [] # 18..18 - CloseParen (Token): ")" # 18..19 - - FunctionAttributesList (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - StatementsList (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - StatementsList (Rule): # 35..63 " uint256 arg = (1 + 2" - - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclaration (Rule): # 35..54 " uint256 arg" - - TypeName (Rule): # 35..50 " uint256" - - UnsignedIntegerType (Token): "uint256" # 43..50 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 - Identifier (Token): "arg" # 51..54 - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValuesList (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - NumericExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - NumericExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.5.0-failure.yml index 845262152f..45d923d637 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.5.0-failure.yml @@ -18,7 +18,7 @@ Errors: # 2 total │ ╰──────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6] │ 4 │ }) @@ -33,37 +33,43 @@ Tree: - Identifier (Token): "someFunc" # 9..17 - ParametersDeclaration (Rule): # 17..19 "()" - OpenParen (Token): "(" # 17..18 + - Parameters (Rule): [] # 18..18 - CloseParen (Token): ")" # 18..19 - - FunctionAttributesList (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - StatementsList (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - StatementsList (Rule): # 35..63 " uint256 arg = (1 + 2" - - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclaration (Rule): # 35..54 " uint256 arg" - - TypeName (Rule): # 35..50 " uint256" - - UnsignedIntegerType (Token): "uint256" # 43..50 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 - Identifier (Token): "arg" # 51..54 - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValuesList (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - NumericExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - NumericExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.5.3-failure.yml index 315b52aec8..3abe0d2225 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.5.3-failure.yml @@ -18,7 +18,7 @@ Errors: # 2 total │ ╰──────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6] │ 4 │ }) @@ -33,37 +33,43 @@ Tree: - Identifier (Token): "someFunc" # 9..17 - ParametersDeclaration (Rule): # 17..19 "()" - OpenParen (Token): "(" # 17..18 + - Parameters (Rule): [] # 18..18 - CloseParen (Token): ")" # 18..19 - - FunctionAttributesList (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - StatementsList (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - StatementsList (Rule): # 35..63 " uint256 arg = (1 + 2" - - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclaration (Rule): # 35..54 " uint256 arg" - - TypeName (Rule): # 35..50 " uint256" - - UnsignedIntegerType (Token): "uint256" # 43..50 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 - Identifier (Token): "arg" # 51..54 - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValuesList (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - NumericExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - NumericExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.6.0-failure.yml index f12f9bd170..55a5fe48e5 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.6.0-failure.yml @@ -18,7 +18,7 @@ Errors: # 2 total │ ╰──────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6] │ 4 │ }) @@ -33,37 +33,43 @@ Tree: - Identifier (Token): "someFunc" # 9..17 - ParametersDeclaration (Rule): # 17..19 "()" - OpenParen (Token): "(" # 17..18 + - Parameters (Rule): [] # 18..18 - CloseParen (Token): ")" # 18..19 - - FunctionAttributesList (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - StatementsList (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - StatementsList (Rule): # 35..63 " uint256 arg = (1 + 2" - - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclaration (Rule): # 35..54 " uint256 arg" - - TypeName (Rule): # 35..50 " uint256" - - UnsignedIntegerType (Token): "uint256" # 43..50 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 - Identifier (Token): "arg" # 51..54 - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValuesList (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - NumericExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - NumericExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.7.0-failure.yml index cceec63bfa..291f0bf333 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.7.0-failure.yml @@ -18,7 +18,7 @@ Errors: # 2 total │ ╰──────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6] │ 4 │ }) @@ -33,37 +33,43 @@ Tree: - Identifier (Token): "someFunc" # 9..17 - ParametersDeclaration (Rule): # 17..19 "()" - OpenParen (Token): "(" # 17..18 + - Parameters (Rule): [] # 18..18 - CloseParen (Token): ")" # 18..19 - - FunctionAttributesList (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - StatementsList (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - StatementsList (Rule): # 35..63 " uint256 arg = (1 + 2" - - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclaration (Rule): # 35..54 " uint256 arg" - - TypeName (Rule): # 35..50 " uint256" - - UnsignedIntegerType (Token): "uint256" # 43..50 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 - Identifier (Token): "arg" # 51..54 - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValuesList (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - NumericExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - NumericExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.8.0-failure.yml index 16467394a4..a08880bec3 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.8.0-failure.yml @@ -18,7 +18,7 @@ Errors: # 2 total │ ╰──────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UncheckedKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UncheckedKeyword or UnicodeStringLiteral or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6] │ 4 │ }) @@ -33,37 +33,43 @@ Tree: - Identifier (Token): "someFunc" # 9..17 - ParametersDeclaration (Rule): # 17..19 "()" - OpenParen (Token): "(" # 17..18 + - Parameters (Rule): [] # 18..18 - CloseParen (Token): ")" # 18..19 - - FunctionAttributesList (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - StatementsList (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - StatementsList (Rule): # 35..63 " uint256 arg = (1 + 2" - - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclaration (Rule): # 35..54 " uint256 arg" - - TypeName (Rule): # 35..50 " uint256" - - UnsignedIntegerType (Token): "uint256" # 43..50 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 - Identifier (Token): "arg" # 51..54 - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValuesList (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - NumericExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - NumericExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.8.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.8.4-failure.yml index 7a6dc64944..9582f9b0b3 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.8.4-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/generated/0.8.4-failure.yml @@ -18,7 +18,7 @@ Errors: # 2 total │ ╰──────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UncheckedKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UncheckedKeyword or UnicodeStringLiteral or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6] │ 4 │ }) @@ -33,37 +33,43 @@ Tree: - Identifier (Token): "someFunc" # 9..17 - ParametersDeclaration (Rule): # 17..19 "()" - OpenParen (Token): "(" # 17..18 + - Parameters (Rule): [] # 18..18 - CloseParen (Token): ")" # 18..19 - - FunctionAttributesList (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - StatementsList (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - StatementsList (Rule): # 35..63 " uint256 arg = (1 + 2" - - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclaration (Rule): # 35..54 " uint256 arg" - - TypeName (Rule): # 35..50 " uint256" - - UnsignedIntegerType (Token): "uint256" # 43..50 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 - Identifier (Token): "arg" # 51..54 - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValuesList (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - NumericExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - NumericExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.4.11-failure.yml index f99424e0c5..c9efbd929f 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.4.11-failure.yml @@ -24,7 +24,7 @@ Errors: # 10 total │ ╰───────────────────── Error occurred here. ───╯ - > - Error: Expected Semicolon. + Error: Expected Identifier or MemoryKeyword or StorageKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/input.sol:2:18] │ 2 │ msg.sender.call{do: 1, arg: 1 }(); @@ -32,7 +32,7 @@ Errors: # 10 total │ ╰────────── Error occurred here. ───╯ - > - Error: Expected Semicolon. + Error: Expected Identifier or MemoryKeyword or StorageKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/input.sol:3:18] │ 3 │ msg.sender.call{, empty: 1, parse: 2 }(); @@ -40,7 +40,7 @@ Errors: # 10 total │ ╰────────────── Error occurred here. ───╯ - > - Error: Expected Semicolon. + Error: Expected Identifier or MemoryKeyword or StorageKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/input.sol:4:18] │ 4 │ msg.sender.call{arg: 1, missing_expr: , no_semicolon, , }(); @@ -48,7 +48,7 @@ Errors: # 10 total │ ╰─────────────────────── Error occurred here. ───╯ - > - Error: Expected Semicolon. + Error: Expected Identifier or MemoryKeyword or StorageKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/input.sol:5:18] │ 5 │ msg.sender.call{arg: 1 unexpected tokens, not: 2, recovered, yet: 3, }(); @@ -56,7 +56,7 @@ Errors: # 10 total │ ╰────────────────────────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/input.sol:9:50] │ 9 │ function empty() override(some.ident, /* empty */, other.arg.here, and.here); @@ -80,7 +80,7 @@ Errors: # 10 total │ ╰──── Error occurred here. ────╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/input.sol:11:83] │ 11 │ function nested_lists() override(some.ident, next.do.that, other.while, next.one, final, ultimate); @@ -103,181 +103,190 @@ Tree: - Identifier (Token): "all" # 9..12 - ParametersDeclaration (Rule): # 12..14 "()" - OpenParen (Token): "(" # 12..13 + - Parameters (Rule): [] # 13..13 - CloseParen (Token): ")" # 13..14 - - FunctionAttributesList (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." - - ModifierInvocation (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - - IdentifierPath (Rule): # 14..23 " override" - - Identifier (Token): "override" # 15..23 - - ArgumentsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." - - OpenParen (Token): "(" # 23..24 - - PositionalArgumentsList (Rule): # 24..34 "some.ident" - - Expression (Rule): # 24..34 "some.ident" - - MemberAccessExpression (Rule): # 24..34 "some.ident" - - Expression (Rule): # 24..28 "some" - - Identifier (Token): "some" # 24..28 - - Period (Token): "." # 28..29 - - Identifier (Token): "ident" # 29..34 - - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 - - CloseParen (Token): ")" # 75..76 - - PublicKeyword (Token): "public" # 77..83 - - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." - - OpenBrace (Token): "{" # 84..85 - - StatementsList (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." - - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - Expression (Rule): # 86..103 " msg.sender.call" - - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" - - Expression (Rule): # 86..98 " msg.sender" - - MemberAccessExpression (Rule): # 86..98 " msg.sender" - - Expression (Rule): # 86..91 " msg" - - Identifier (Token): "msg" # 88..91 + - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." + - FunctionAttribute (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - ModifierInvocation (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - IdentifierPath (Rule): # 14..23 " override" + - Identifier (Token): "override" # 15..23 + - ArgumentsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." + - PositionalArgumentsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." + - OpenParen (Token): "(" # 23..24 + - PositionalArguments (Rule): # 24..34 "some.ident" + - Expression (Rule): # 24..34 "some.ident" + - MemberAccessExpression (Rule): # 24..34 "some.ident" + - Expression (Rule): # 24..28 "some" + - Identifier (Token): "some" # 24..28 + - Period (Token): "." # 28..29 + - Identifier (Token): "ident" # 29..34 + - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 + - CloseParen (Token): ")" # 75..76 + - FunctionAttribute (Rule): # 76..83 " public" + - PublicKeyword (Token): "public" # 77..83 + - FunctionBody (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - OpenBrace (Token): "{" # 84..85 + - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." + - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - VariableDeclarationStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - VariableDeclarationType (Rule): # 86..103 " msg.sender.call" + - TypeName (Rule): # 86..103 " msg.sender.call" + - IdentifierPath (Rule): # 86..103 " msg.sender.call" + - Identifier (Token): "msg" # 88..91 - Period (Token): "." # 91..92 - Identifier (Token): "sender" # 92..98 - - Period (Token): "." # 98..99 - - Identifier (Token): "call" # 99..103 - - SKIPPED (Token): "{do: 1, arg: 1 }()" # 103..121 - - Semicolon (Token): ";" # 121..122 - - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - Expression (Rule): # 123..140 " msg.sender.call" - - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" - - Expression (Rule): # 123..135 " msg.sender" - - MemberAccessExpression (Rule): # 123..135 " msg.sender" - - Expression (Rule): # 123..128 " msg" - - Identifier (Token): "msg" # 125..128 + - Period (Token): "." # 98..99 + - Identifier (Token): "call" # 99..103 + - SKIPPED (Token): "{do: 1, arg: 1 }()" # 103..121 + - Semicolon (Token): ";" # 121..122 + - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - VariableDeclarationStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - VariableDeclarationType (Rule): # 123..140 " msg.sender.call" + - TypeName (Rule): # 123..140 " msg.sender.call" + - IdentifierPath (Rule): # 123..140 " msg.sender.call" + - Identifier (Token): "msg" # 125..128 - Period (Token): "." # 128..129 - Identifier (Token): "sender" # 129..135 - - Period (Token): "." # 135..136 - - Identifier (Token): "call" # 136..140 - - SKIPPED (Token): "{, empty: 1, parse: 2 }()" # 140..165 - - Semicolon (Token): ";" # 165..166 - - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..184 " msg.sender.call" - - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" - - Expression (Rule): # 167..179 " msg.sender" - - MemberAccessExpression (Rule): # 167..179 " msg.sender" - - Expression (Rule): # 167..172 " msg" - - Identifier (Token): "msg" # 169..172 + - Period (Token): "." # 135..136 + - Identifier (Token): "call" # 136..140 + - SKIPPED (Token): "{, empty: 1, parse: 2 }()" # 140..165 + - Semicolon (Token): ";" # 165..166 + - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - VariableDeclarationStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - VariableDeclarationType (Rule): # 167..184 " msg.sender.call" + - TypeName (Rule): # 167..184 " msg.sender.call" + - IdentifierPath (Rule): # 167..184 " msg.sender.call" + - Identifier (Token): "msg" # 169..172 - Period (Token): "." # 172..173 - Identifier (Token): "sender" # 173..179 - - Period (Token): "." # 179..180 - - Identifier (Token): "call" # 180..184 - - SKIPPED (Token): "{arg: 1, missing_expr: , no_semicolon, , }()" # 184..228 - - Semicolon (Token): ";" # 228..229 - - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..247 " msg.sender.call" - - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" - - Expression (Rule): # 230..242 " msg.sender" - - MemberAccessExpression (Rule): # 230..242 " msg.sender" - - Expression (Rule): # 230..235 " msg" - - Identifier (Token): "msg" # 232..235 + - Period (Token): "." # 179..180 + - Identifier (Token): "call" # 180..184 + - SKIPPED (Token): "{arg: 1, missing_expr: , no_semicolon, , }()" # 184..228 + - Semicolon (Token): ";" # 228..229 + - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - VariableDeclarationStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - VariableDeclarationType (Rule): # 230..247 " msg.sender.call" + - TypeName (Rule): # 230..247 " msg.sender.call" + - IdentifierPath (Rule): # 230..247 " msg.sender.call" + - Identifier (Token): "msg" # 232..235 - Period (Token): "." # 235..236 - Identifier (Token): "sender" # 236..242 - - Period (Token): "." # 242..243 - - Identifier (Token): "call" # 243..247 - - SKIPPED (Token): "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." # 247..304 - - Semicolon (Token): ";" # 304..305 - - CloseBrace (Token): "}" # 307..308 + - Period (Token): "." # 242..243 + - Identifier (Token): "call" # 243..247 + - SKIPPED (Token): "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." # 247..304 + - Semicolon (Token): ";" # 304..305 + - CloseBrace (Token): "}" # 307..308 - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." - FunctionKeyword (Token): "function" # 310..318 - Identifier (Token): "empty" # 319..324 - ParametersDeclaration (Rule): # 324..326 "()" - OpenParen (Token): "(" # 324..325 + - Parameters (Rule): [] # 325..325 - CloseParen (Token): ")" # 325..326 - - FunctionAttributesList (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - ModifierInvocation (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - IdentifierPath (Rule): # 326..335 " override" - - Identifier (Token): "override" # 327..335 - - ArgumentsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." - - OpenParen (Token): "(" # 335..336 - - PositionalArgumentsList (Rule): # 336..347 "some.ident," - - Expression (Rule): # 336..346 "some.ident" - - MemberAccessExpression (Rule): # 336..346 "some.ident" - - Expression (Rule): # 336..340 "some" - - Identifier (Token): "some" # 336..340 - - Period (Token): "." # 340..341 - - Identifier (Token): "ident" # 341..346 - - Comma (Token): "," # 346..347 - - LeadingTrivia (Rule): # 347..359 " /* empty */" - - MultilineComment (Trivia): "/* empty */" # 348..359 - - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 - - CloseParen (Token): ")" # 385..386 - - Semicolon (Token): ";" # 386..387 + - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - FunctionAttribute (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - ModifierInvocation (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - IdentifierPath (Rule): # 326..335 " override" + - Identifier (Token): "override" # 327..335 + - ArgumentsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." + - PositionalArgumentsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." + - OpenParen (Token): "(" # 335..336 + - PositionalArguments (Rule): # 336..347 "some.ident," + - Expression (Rule): # 336..346 "some.ident" + - MemberAccessExpression (Rule): # 336..346 "some.ident" + - Expression (Rule): # 336..340 "some" + - Identifier (Token): "some" # 336..340 + - Period (Token): "." # 340..341 + - Identifier (Token): "ident" # 341..346 + - Comma (Token): "," # 346..347 + - LeadingTrivia (Rule): # 347..359 " /* empty */" + - MultilineComment (Trivia): "/* empty */" # 348..359 + - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 + - CloseParen (Token): ")" # 385..386 + - FunctionBody (Rule): # 386..388 ";\n" + - Semicolon (Token): ";" # 386..387 - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." - FunctionKeyword (Token): "function" # 389..397 - Identifier (Token): "nested_lists" # 398..410 - ParametersDeclaration (Rule): # 410..412 "()" - OpenParen (Token): "(" # 410..411 + - Parameters (Rule): [] # 411..411 - CloseParen (Token): ")" # 411..412 - - FunctionAttributesList (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - ModifierInvocation (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - IdentifierPath (Rule): # 412..421 " override" - - Identifier (Token): "override" # 413..421 - - ArgumentsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." - - OpenParen (Token): "(" # 421..422 - - PositionalArgumentsList (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," - - Expression (Rule): # 422..432 "some.ident" - - MemberAccessExpression (Rule): # 422..432 "some.ident" - - Expression (Rule): # 422..426 "some" - - Identifier (Token): "some" # 422..426 - - Period (Token): "." # 426..427 - - Identifier (Token): "ident" # 427..432 - - Comma (Token): "," # 432..433 - - Expression (Rule): # 433..439 " next." - - Identifier (Token): "next" # 434..438 - - Period (Token): "." # 438..439 - - SKIPPED (Token): "do.that" # 439..446 - - Comma (Token): "," # 446..447 - - Expression (Rule): # 447..454 " other." - - Identifier (Token): "other" # 448..453 - - Period (Token): "." # 453..454 - - SKIPPED (Token): "while" # 454..459 - - Comma (Token): "," # 459..460 - - Expression (Rule): # 460..469 " next.one" - - MemberAccessExpression (Rule): # 460..469 " next.one" - - Expression (Rule): # 460..465 " next" - - Identifier (Token): "next" # 461..465 - - Period (Token): "." # 465..466 - - Identifier (Token): "one" # 466..469 - - Comma (Token): "," # 469..470 - - SKIPPED (Token): "final, ultimate" # 471..486 - - CloseParen (Token): ")" # 486..487 - - Semicolon (Token): ";" # 487..488 + - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - FunctionAttribute (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - ModifierInvocation (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - IdentifierPath (Rule): # 412..421 " override" + - Identifier (Token): "override" # 413..421 + - ArgumentsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." + - PositionalArgumentsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." + - OpenParen (Token): "(" # 421..422 + - PositionalArguments (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," + - Expression (Rule): # 422..432 "some.ident" + - MemberAccessExpression (Rule): # 422..432 "some.ident" + - Expression (Rule): # 422..426 "some" + - Identifier (Token): "some" # 422..426 + - Period (Token): "." # 426..427 + - Identifier (Token): "ident" # 427..432 + - Comma (Token): "," # 432..433 + - Expression (Rule): # 433..439 " next." + - Identifier (Token): "next" # 434..438 + - Period (Token): "." # 438..439 + - SKIPPED (Token): "do.that" # 439..446 + - Comma (Token): "," # 446..447 + - Expression (Rule): # 447..454 " other." + - Identifier (Token): "other" # 448..453 + - Period (Token): "." # 453..454 + - SKIPPED (Token): "while" # 454..459 + - Comma (Token): "," # 459..460 + - Expression (Rule): # 460..469 " next.one" + - MemberAccessExpression (Rule): # 460..469 " next.one" + - Expression (Rule): # 460..465 " next" + - Identifier (Token): "next" # 461..465 + - Period (Token): "." # 465..466 + - Identifier (Token): "one" # 466..469 + - Comma (Token): "," # 469..470 + - SKIPPED (Token): "final, ultimate" # 471..486 + - CloseParen (Token): ")" # 486..487 + - FunctionBody (Rule): # 487..489 ";\n" + - Semicolon (Token): ";" # 487..488 - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." - FunctionKeyword (Token): "function" # 489..497 - Identifier (Token): "nested_lists" # 498..510 - ParametersDeclaration (Rule): # 510..512 "()" - OpenParen (Token): "(" # 510..511 + - Parameters (Rule): [] # 511..511 - CloseParen (Token): ")" # 511..512 - - FunctionAttributesList (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - ModifierInvocation (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - IdentifierPath (Rule): # 512..521 " override" - - Identifier (Token): "override" # 513..521 - - ArgumentsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" - - OpenParen (Token): "(" # 521..522 - - PositionalArgumentsList (Rule): # 522..557 "some., next.arg, next.one, ultimate" - - Expression (Rule): # 522..527 "some." - - Identifier (Token): "some" # 522..526 - - Period (Token): "." # 526..527 - - SKIPPED (Token): "" # 527..527 - - Comma (Token): "," # 527..528 - - Expression (Rule): # 528..537 " next.arg" - - MemberAccessExpression (Rule): # 528..537 " next.arg" - - Expression (Rule): # 528..533 " next" - - Identifier (Token): "next" # 529..533 - - Period (Token): "." # 533..534 - - Identifier (Token): "arg" # 534..537 - - Comma (Token): "," # 537..538 - - Expression (Rule): # 538..547 " next.one" - - MemberAccessExpression (Rule): # 538..547 " next.one" - - Expression (Rule): # 538..543 " next" - - Identifier (Token): "next" # 539..543 - - Period (Token): "." # 543..544 - - Identifier (Token): "one" # 544..547 - - Comma (Token): "," # 547..548 - - Expression (Rule): # 548..557 " ultimate" - - Identifier (Token): "ultimate" # 549..557 - - CloseParen (Token): ")" # 557..558 - - Semicolon (Token): ";" # 558..559 + - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - FunctionAttribute (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - ModifierInvocation (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - IdentifierPath (Rule): # 512..521 " override" + - Identifier (Token): "override" # 513..521 + - ArgumentsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" + - PositionalArgumentsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" + - OpenParen (Token): "(" # 521..522 + - PositionalArguments (Rule): # 522..557 "some., next.arg, next.one, ultimate" + - Expression (Rule): # 522..527 "some." + - Identifier (Token): "some" # 522..526 + - Period (Token): "." # 526..527 + - SKIPPED (Token): "" # 527..527 + - Comma (Token): "," # 527..528 + - Expression (Rule): # 528..537 " next.arg" + - MemberAccessExpression (Rule): # 528..537 " next.arg" + - Expression (Rule): # 528..533 " next" + - Identifier (Token): "next" # 529..533 + - Period (Token): "." # 533..534 + - Identifier (Token): "arg" # 534..537 + - Comma (Token): "," # 537..538 + - Expression (Rule): # 538..547 " next.one" + - MemberAccessExpression (Rule): # 538..547 " next.one" + - Expression (Rule): # 538..543 " next" + - Identifier (Token): "next" # 539..543 + - Period (Token): "." # 543..544 + - Identifier (Token): "one" # 544..547 + - Comma (Token): "," # 547..548 + - Expression (Rule): # 548..557 " ultimate" + - Identifier (Token): "ultimate" # 549..557 + - CloseParen (Token): ")" # 557..558 + - FunctionBody (Rule): # 558..560 ";\n" + - Semicolon (Token): ";" # 558..559 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.5.0-failure.yml index 88fef61f5c..b43729a5c8 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.5.0-failure.yml @@ -24,7 +24,7 @@ Errors: # 10 total │ ╰───────────────────── Error occurred here. ───╯ - > - Error: Expected Semicolon. + Error: Expected CallDataKeyword or Identifier or MemoryKeyword or StorageKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/input.sol:2:18] │ 2 │ msg.sender.call{do: 1, arg: 1 }(); @@ -32,7 +32,7 @@ Errors: # 10 total │ ╰────────── Error occurred here. ───╯ - > - Error: Expected Semicolon. + Error: Expected CallDataKeyword or Identifier or MemoryKeyword or StorageKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/input.sol:3:18] │ 3 │ msg.sender.call{, empty: 1, parse: 2 }(); @@ -40,7 +40,7 @@ Errors: # 10 total │ ╰────────────── Error occurred here. ───╯ - > - Error: Expected Semicolon. + Error: Expected CallDataKeyword or Identifier or MemoryKeyword or StorageKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/input.sol:4:18] │ 4 │ msg.sender.call{arg: 1, missing_expr: , no_semicolon, , }(); @@ -48,7 +48,7 @@ Errors: # 10 total │ ╰─────────────────────── Error occurred here. ───╯ - > - Error: Expected Semicolon. + Error: Expected CallDataKeyword or Identifier or MemoryKeyword or StorageKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/input.sol:5:18] │ 5 │ msg.sender.call{arg: 1 unexpected tokens, not: 2, recovered, yet: 3, }(); @@ -103,161 +103,166 @@ Tree: - Identifier (Token): "all" # 9..12 - ParametersDeclaration (Rule): # 12..14 "()" - OpenParen (Token): "(" # 12..13 + - Parameters (Rule): [] # 13..13 - CloseParen (Token): ")" # 13..14 - - FunctionAttributesList (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideKeyword (Token): "override" # 15..23 - - OpenParen (Token): "(" # 23..24 - - IdentifierPathsList (Rule): # 24..34 "some.ident" - - IdentifierPath (Rule): # 24..34 "some.ident" - - Identifier (Token): "some" # 24..28 - - Period (Token): "." # 28..29 - - Identifier (Token): "ident" # 29..34 - - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 - - CloseParen (Token): ")" # 75..76 - - PublicKeyword (Token): "public" # 77..83 - - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." - - OpenBrace (Token): "{" # 84..85 - - StatementsList (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." - - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - Expression (Rule): # 86..103 " msg.sender.call" - - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" - - Expression (Rule): # 86..98 " msg.sender" - - MemberAccessExpression (Rule): # 86..98 " msg.sender" - - Expression (Rule): # 86..91 " msg" - - Identifier (Token): "msg" # 88..91 + - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." + - FunctionAttribute (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideKeyword (Token): "override" # 15..23 + - OpenParen (Token): "(" # 23..24 + - OverridePaths (Rule): # 24..34 "some.ident" + - IdentifierPath (Rule): # 24..34 "some.ident" + - Identifier (Token): "some" # 24..28 + - Period (Token): "." # 28..29 + - Identifier (Token): "ident" # 29..34 + - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 + - CloseParen (Token): ")" # 75..76 + - FunctionAttribute (Rule): # 76..83 " public" + - PublicKeyword (Token): "public" # 77..83 + - FunctionBody (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - OpenBrace (Token): "{" # 84..85 + - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." + - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - VariableDeclarationStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - VariableDeclarationType (Rule): # 86..103 " msg.sender.call" + - TypeName (Rule): # 86..103 " msg.sender.call" + - IdentifierPath (Rule): # 86..103 " msg.sender.call" + - Identifier (Token): "msg" # 88..91 - Period (Token): "." # 91..92 - Identifier (Token): "sender" # 92..98 - - Period (Token): "." # 98..99 - - Identifier (Token): "call" # 99..103 - - SKIPPED (Token): "{do: 1, arg: 1 }()" # 103..121 - - Semicolon (Token): ";" # 121..122 - - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - Expression (Rule): # 123..140 " msg.sender.call" - - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" - - Expression (Rule): # 123..135 " msg.sender" - - MemberAccessExpression (Rule): # 123..135 " msg.sender" - - Expression (Rule): # 123..128 " msg" - - Identifier (Token): "msg" # 125..128 + - Period (Token): "." # 98..99 + - Identifier (Token): "call" # 99..103 + - SKIPPED (Token): "{do: 1, arg: 1 }()" # 103..121 + - Semicolon (Token): ";" # 121..122 + - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - VariableDeclarationStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - VariableDeclarationType (Rule): # 123..140 " msg.sender.call" + - TypeName (Rule): # 123..140 " msg.sender.call" + - IdentifierPath (Rule): # 123..140 " msg.sender.call" + - Identifier (Token): "msg" # 125..128 - Period (Token): "." # 128..129 - Identifier (Token): "sender" # 129..135 - - Period (Token): "." # 135..136 - - Identifier (Token): "call" # 136..140 - - SKIPPED (Token): "{, empty: 1, parse: 2 }()" # 140..165 - - Semicolon (Token): ";" # 165..166 - - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..184 " msg.sender.call" - - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" - - Expression (Rule): # 167..179 " msg.sender" - - MemberAccessExpression (Rule): # 167..179 " msg.sender" - - Expression (Rule): # 167..172 " msg" - - Identifier (Token): "msg" # 169..172 + - Period (Token): "." # 135..136 + - Identifier (Token): "call" # 136..140 + - SKIPPED (Token): "{, empty: 1, parse: 2 }()" # 140..165 + - Semicolon (Token): ";" # 165..166 + - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - VariableDeclarationStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - VariableDeclarationType (Rule): # 167..184 " msg.sender.call" + - TypeName (Rule): # 167..184 " msg.sender.call" + - IdentifierPath (Rule): # 167..184 " msg.sender.call" + - Identifier (Token): "msg" # 169..172 - Period (Token): "." # 172..173 - Identifier (Token): "sender" # 173..179 - - Period (Token): "." # 179..180 - - Identifier (Token): "call" # 180..184 - - SKIPPED (Token): "{arg: 1, missing_expr: , no_semicolon, , }()" # 184..228 - - Semicolon (Token): ";" # 228..229 - - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..247 " msg.sender.call" - - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" - - Expression (Rule): # 230..242 " msg.sender" - - MemberAccessExpression (Rule): # 230..242 " msg.sender" - - Expression (Rule): # 230..235 " msg" - - Identifier (Token): "msg" # 232..235 + - Period (Token): "." # 179..180 + - Identifier (Token): "call" # 180..184 + - SKIPPED (Token): "{arg: 1, missing_expr: , no_semicolon, , }()" # 184..228 + - Semicolon (Token): ";" # 228..229 + - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - VariableDeclarationStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - VariableDeclarationType (Rule): # 230..247 " msg.sender.call" + - TypeName (Rule): # 230..247 " msg.sender.call" + - IdentifierPath (Rule): # 230..247 " msg.sender.call" + - Identifier (Token): "msg" # 232..235 - Period (Token): "." # 235..236 - Identifier (Token): "sender" # 236..242 - - Period (Token): "." # 242..243 - - Identifier (Token): "call" # 243..247 - - SKIPPED (Token): "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." # 247..304 - - Semicolon (Token): ";" # 304..305 - - CloseBrace (Token): "}" # 307..308 + - Period (Token): "." # 242..243 + - Identifier (Token): "call" # 243..247 + - SKIPPED (Token): "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." # 247..304 + - Semicolon (Token): ";" # 304..305 + - CloseBrace (Token): "}" # 307..308 - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." - FunctionKeyword (Token): "function" # 310..318 - Identifier (Token): "empty" # 319..324 - ParametersDeclaration (Rule): # 324..326 "()" - OpenParen (Token): "(" # 324..325 + - Parameters (Rule): [] # 325..325 - CloseParen (Token): ")" # 325..326 - - FunctionAttributesList (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideKeyword (Token): "override" # 327..335 - - OpenParen (Token): "(" # 335..336 - - IdentifierPathsList (Rule): # 336..347 "some.ident," - - IdentifierPath (Rule): # 336..346 "some.ident" - - Identifier (Token): "some" # 336..340 - - Period (Token): "." # 340..341 - - Identifier (Token): "ident" # 341..346 - - Comma (Token): "," # 346..347 - - LeadingTrivia (Rule): # 347..359 " /* empty */" - - MultilineComment (Trivia): "/* empty */" # 348..359 - - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 - - CloseParen (Token): ")" # 385..386 - - Semicolon (Token): ";" # 386..387 + - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - FunctionAttribute (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideKeyword (Token): "override" # 327..335 + - OpenParen (Token): "(" # 335..336 + - OverridePaths (Rule): # 336..347 "some.ident," + - IdentifierPath (Rule): # 336..346 "some.ident" + - Identifier (Token): "some" # 336..340 + - Period (Token): "." # 340..341 + - Identifier (Token): "ident" # 341..346 + - Comma (Token): "," # 346..347 + - LeadingTrivia (Rule): # 347..359 " /* empty */" + - MultilineComment (Trivia): "/* empty */" # 348..359 + - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 + - CloseParen (Token): ")" # 385..386 + - FunctionBody (Rule): # 386..388 ";\n" + - Semicolon (Token): ";" # 386..387 - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." - FunctionKeyword (Token): "function" # 389..397 - Identifier (Token): "nested_lists" # 398..410 - ParametersDeclaration (Rule): # 410..412 "()" - OpenParen (Token): "(" # 410..411 + - Parameters (Rule): [] # 411..411 - CloseParen (Token): ")" # 411..412 - - FunctionAttributesList (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideKeyword (Token): "override" # 413..421 - - OpenParen (Token): "(" # 421..422 - - IdentifierPathsList (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," - - IdentifierPath (Rule): # 422..432 "some.ident" - - Identifier (Token): "some" # 422..426 - - Period (Token): "." # 426..427 - - Identifier (Token): "ident" # 427..432 - - Comma (Token): "," # 432..433 - - IdentifierPath (Rule): # 433..439 " next." - - Identifier (Token): "next" # 434..438 - - Period (Token): "." # 438..439 - - SKIPPED (Token): "do.that" # 439..446 - - Comma (Token): "," # 446..447 - - IdentifierPath (Rule): # 447..454 " other." - - Identifier (Token): "other" # 448..453 - - Period (Token): "." # 453..454 - - SKIPPED (Token): "while" # 454..459 - - Comma (Token): "," # 459..460 - - IdentifierPath (Rule): # 460..469 " next.one" - - Identifier (Token): "next" # 461..465 - - Period (Token): "." # 465..466 - - Identifier (Token): "one" # 466..469 - - Comma (Token): "," # 469..470 - - SKIPPED (Token): "final, ultimate" # 471..486 - - CloseParen (Token): ")" # 486..487 - - Semicolon (Token): ";" # 487..488 + - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - FunctionAttribute (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideKeyword (Token): "override" # 413..421 + - OpenParen (Token): "(" # 421..422 + - OverridePaths (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," + - IdentifierPath (Rule): # 422..432 "some.ident" + - Identifier (Token): "some" # 422..426 + - Period (Token): "." # 426..427 + - Identifier (Token): "ident" # 427..432 + - Comma (Token): "," # 432..433 + - IdentifierPath (Rule): # 433..439 " next." + - Identifier (Token): "next" # 434..438 + - Period (Token): "." # 438..439 + - SKIPPED (Token): "do.that" # 439..446 + - Comma (Token): "," # 446..447 + - IdentifierPath (Rule): # 447..454 " other." + - Identifier (Token): "other" # 448..453 + - Period (Token): "." # 453..454 + - SKIPPED (Token): "while" # 454..459 + - Comma (Token): "," # 459..460 + - IdentifierPath (Rule): # 460..469 " next.one" + - Identifier (Token): "next" # 461..465 + - Period (Token): "." # 465..466 + - Identifier (Token): "one" # 466..469 + - Comma (Token): "," # 469..470 + - SKIPPED (Token): "final, ultimate" # 471..486 + - CloseParen (Token): ")" # 486..487 + - FunctionBody (Rule): # 487..489 ";\n" + - Semicolon (Token): ";" # 487..488 - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." - FunctionKeyword (Token): "function" # 489..497 - Identifier (Token): "nested_lists" # 498..510 - ParametersDeclaration (Rule): # 510..512 "()" - OpenParen (Token): "(" # 510..511 + - Parameters (Rule): [] # 511..511 - CloseParen (Token): ")" # 511..512 - - FunctionAttributesList (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideKeyword (Token): "override" # 513..521 - - OpenParen (Token): "(" # 521..522 - - IdentifierPathsList (Rule): # 522..557 "some., next.arg, next.one, ultimate" - - IdentifierPath (Rule): # 522..527 "some." - - Identifier (Token): "some" # 522..526 - - Period (Token): "." # 526..527 - - SKIPPED (Token): "" # 527..527 - - Comma (Token): "," # 527..528 - - IdentifierPath (Rule): # 528..537 " next.arg" - - Identifier (Token): "next" # 529..533 - - Period (Token): "." # 533..534 - - Identifier (Token): "arg" # 534..537 - - Comma (Token): "," # 537..538 - - IdentifierPath (Rule): # 538..547 " next.one" - - Identifier (Token): "next" # 539..543 - - Period (Token): "." # 543..544 - - Identifier (Token): "one" # 544..547 - - Comma (Token): "," # 547..548 - - IdentifierPath (Rule): # 548..557 " ultimate" - - Identifier (Token): "ultimate" # 549..557 - - CloseParen (Token): ")" # 557..558 - - Semicolon (Token): ";" # 558..559 + - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - FunctionAttribute (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideKeyword (Token): "override" # 513..521 + - OpenParen (Token): "(" # 521..522 + - OverridePaths (Rule): # 522..557 "some., next.arg, next.one, ultimate" + - IdentifierPath (Rule): # 522..527 "some." + - Identifier (Token): "some" # 522..526 + - Period (Token): "." # 526..527 + - SKIPPED (Token): "" # 527..527 + - Comma (Token): "," # 527..528 + - IdentifierPath (Rule): # 528..537 " next.arg" + - Identifier (Token): "next" # 529..533 + - Period (Token): "." # 533..534 + - Identifier (Token): "arg" # 534..537 + - Comma (Token): "," # 537..538 + - IdentifierPath (Rule): # 538..547 " next.one" + - Identifier (Token): "next" # 539..543 + - Period (Token): "." # 543..544 + - Identifier (Token): "one" # 544..547 + - Comma (Token): "," # 547..548 + - IdentifierPath (Rule): # 548..557 " ultimate" + - Identifier (Token): "ultimate" # 549..557 + - CloseParen (Token): ")" # 557..558 + - FunctionBody (Rule): # 558..560 ";\n" + - Semicolon (Token): ";" # 558..559 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.6.2-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.6.2-failure.yml index e739e6c311..b2fdd8e4c4 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.6.2-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.6.2-failure.yml @@ -40,7 +40,7 @@ Errors: # 12 total │ ╰──────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/input.sol:4:40] │ 4 │ msg.sender.call{arg: 1, missing_expr: , no_semicolon, , }(); @@ -119,221 +119,248 @@ Tree: - Identifier (Token): "all" # 9..12 - ParametersDeclaration (Rule): # 12..14 "()" - OpenParen (Token): "(" # 12..13 + - Parameters (Rule): [] # 13..13 - CloseParen (Token): ")" # 13..14 - - FunctionAttributesList (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideKeyword (Token): "override" # 15..23 - - OpenParen (Token): "(" # 23..24 - - IdentifierPathsList (Rule): # 24..34 "some.ident" - - IdentifierPath (Rule): # 24..34 "some.ident" - - Identifier (Token): "some" # 24..28 - - Period (Token): "." # 28..29 - - Identifier (Token): "ident" # 29..34 - - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 - - CloseParen (Token): ")" # 75..76 - - PublicKeyword (Token): "public" # 77..83 - - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." - - OpenBrace (Token): "{" # 84..85 - - StatementsList (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." - - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - Expression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" - - FunctionCallExpression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" - - Expression (Rule): # 86..103 " msg.sender.call" - - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" - - Expression (Rule): # 86..98 " msg.sender" - - MemberAccessExpression (Rule): # 86..98 " msg.sender" - - Expression (Rule): # 86..91 " msg" - - Identifier (Token): "msg" # 88..91 - - Period (Token): "." # 91..92 - - Identifier (Token): "sender" # 92..98 - - Period (Token): "." # 98..99 - - Identifier (Token): "call" # 99..103 - - FunctionCallOptions (Rule): # 103..119 "{do: 1, arg: 1 }" - - NamedArgumentsDeclaration (Rule): # 103..119 "{do: 1, arg: 1 }" - - OpenBrace (Token): "{" # 103..104 - - SKIPPED (Token): "do: 1, arg: 1 " # 104..118 - - CloseBrace (Token): "}" # 118..119 - - ArgumentsDeclaration (Rule): # 119..121 "()" - - OpenParen (Token): "(" # 119..120 - - CloseParen (Token): ")" # 120..121 - - Semicolon (Token): ";" # 121..122 - - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - Expression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" - - FunctionCallExpression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" - - Expression (Rule): # 123..140 " msg.sender.call" - - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" - - Expression (Rule): # 123..135 " msg.sender" - - MemberAccessExpression (Rule): # 123..135 " msg.sender" - - Expression (Rule): # 123..128 " msg" - - Identifier (Token): "msg" # 125..128 - - Period (Token): "." # 128..129 - - Identifier (Token): "sender" # 129..135 - - Period (Token): "." # 135..136 - - Identifier (Token): "call" # 136..140 - - FunctionCallOptions (Rule): # 140..163 "{, empty: 1, parse: 2 }" - - NamedArgumentsDeclaration (Rule): # 140..163 "{, empty: 1, parse: 2 }" - - OpenBrace (Token): "{" # 140..141 - - SKIPPED (Token): ", empty: 1, parse: 2 " # 141..162 - - CloseBrace (Token): "}" # 162..163 - - ArgumentsDeclaration (Rule): # 163..165 "()" - - OpenParen (Token): "(" # 163..164 - - CloseParen (Token): ")" # 164..165 - - Semicolon (Token): ";" # 165..166 - - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - FunctionCallExpression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..184 " msg.sender.call" - - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" - - Expression (Rule): # 167..179 " msg.sender" - - MemberAccessExpression (Rule): # 167..179 " msg.sender" - - Expression (Rule): # 167..172 " msg" - - Identifier (Token): "msg" # 169..172 - - Period (Token): "." # 172..173 - - Identifier (Token): "sender" # 173..179 - - Period (Token): "." # 179..180 - - Identifier (Token): "call" # 180..184 - - FunctionCallOptions (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" - - NamedArgumentsDeclaration (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" - - OpenBrace (Token): "{" # 184..185 - - NamedArgumentsList (Rule): # 185..222 "arg: 1, missing_expr: , no_semicolon," - - NamedArgument (Rule): # 185..191 "arg: 1" - - Identifier (Token): "arg" # 185..188 - - Colon (Token): ":" # 188..189 - - Expression (Rule): # 189..191 " 1" - - NumericExpression (Rule): # 189..191 " 1" - - DecimalLiteral (Token): "1" # 190..191 - - Comma (Token): "," # 191..192 - - NamedArgument (Rule): # 192..206 " missing_expr:" - - Identifier (Token): "missing_expr" # 193..205 - - Colon (Token): ":" # 205..206 - - SKIPPED (Token): " " # 206..207 - - Comma (Token): "," # 207..208 - - NamedArgument (Rule): # 208..221 " no_semicolon" - - Identifier (Token): "no_semicolon" # 209..221 - - SKIPPED (Token): "" # 221..221 - - Comma (Token): "," # 221..222 - - SKIPPED (Token): ", " # 223..225 - - CloseBrace (Token): "}" # 225..226 - - ArgumentsDeclaration (Rule): # 226..228 "()" - - OpenParen (Token): "(" # 226..227 - - CloseParen (Token): ")" # 227..228 - - Semicolon (Token): ";" # 228..229 - - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - FunctionCallExpression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..247 " msg.sender.call" - - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" - - Expression (Rule): # 230..242 " msg.sender" - - MemberAccessExpression (Rule): # 230..242 " msg.sender" - - Expression (Rule): # 230..235 " msg" - - Identifier (Token): "msg" # 232..235 - - Period (Token): "." # 235..236 - - Identifier (Token): "sender" # 236..242 - - Period (Token): "." # 242..243 - - Identifier (Token): "call" # 243..247 - - FunctionCallOptions (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - - NamedArgumentsDeclaration (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - - OpenBrace (Token): "{" # 247..248 - - NamedArgumentsList (Rule): # 248..254 "arg: 1" - - NamedArgument (Rule): # 248..254 "arg: 1" - - Identifier (Token): "arg" # 248..251 - - Colon (Token): ":" # 251..252 - - Expression (Rule): # 252..254 " 1" - - NumericExpression (Rule): # 252..254 " 1" - - DecimalLiteral (Token): "1" # 253..254 - - SKIPPED (Token): "unexpected tokens, not: 2, recovered, yet: 3, " # 255..301 - - CloseBrace (Token): "}" # 301..302 - - ArgumentsDeclaration (Rule): # 302..304 "()" - - OpenParen (Token): "(" # 302..303 - - CloseParen (Token): ")" # 303..304 - - Semicolon (Token): ";" # 304..305 - - CloseBrace (Token): "}" # 307..308 + - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." + - FunctionAttribute (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideKeyword (Token): "override" # 15..23 + - OpenParen (Token): "(" # 23..24 + - OverridePaths (Rule): # 24..34 "some.ident" + - IdentifierPath (Rule): # 24..34 "some.ident" + - Identifier (Token): "some" # 24..28 + - Period (Token): "." # 28..29 + - Identifier (Token): "ident" # 29..34 + - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 + - CloseParen (Token): ")" # 75..76 + - FunctionAttribute (Rule): # 76..83 " public" + - PublicKeyword (Token): "public" # 77..83 + - FunctionBody (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - OpenBrace (Token): "{" # 84..85 + - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." + - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - Expression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" + - FunctionCallExpression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" + - Expression (Rule): # 86..103 " msg.sender.call" + - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" + - Expression (Rule): # 86..98 " msg.sender" + - MemberAccessExpression (Rule): # 86..98 " msg.sender" + - Expression (Rule): # 86..91 " msg" + - Identifier (Token): "msg" # 88..91 + - Period (Token): "." # 91..92 + - Identifier (Token): "sender" # 92..98 + - Period (Token): "." # 98..99 + - Identifier (Token): "call" # 99..103 + - FunctionCallOptions (Rule): # 103..119 "{do: 1, arg: 1 }" + - NamedArgumentGroups (Rule): # 103..119 "{do: 1, arg: 1 }" + - NamedArgumentGroup (Rule): # 103..119 "{do: 1, arg: 1 }" + - OpenBrace (Token): "{" # 103..104 + - NamedArguments (Rule): [] # 104..104 + - SKIPPED (Token): "do: 1, arg: 1 " # 104..118 + - CloseBrace (Token): "}" # 118..119 + - ArgumentsDeclaration (Rule): # 119..121 "()" + - PositionalArgumentsDeclaration (Rule): # 119..121 "()" + - OpenParen (Token): "(" # 119..120 + - PositionalArguments (Rule): [] # 120..120 + - CloseParen (Token): ")" # 120..121 + - Semicolon (Token): ";" # 121..122 + - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - Expression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" + - FunctionCallExpression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" + - Expression (Rule): # 123..140 " msg.sender.call" + - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" + - Expression (Rule): # 123..135 " msg.sender" + - MemberAccessExpression (Rule): # 123..135 " msg.sender" + - Expression (Rule): # 123..128 " msg" + - Identifier (Token): "msg" # 125..128 + - Period (Token): "." # 128..129 + - Identifier (Token): "sender" # 129..135 + - Period (Token): "." # 135..136 + - Identifier (Token): "call" # 136..140 + - FunctionCallOptions (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - NamedArgumentGroups (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - NamedArgumentGroup (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - OpenBrace (Token): "{" # 140..141 + - NamedArguments (Rule): [] # 141..141 + - SKIPPED (Token): ", empty: 1, parse: 2 " # 141..162 + - CloseBrace (Token): "}" # 162..163 + - ArgumentsDeclaration (Rule): # 163..165 "()" + - PositionalArgumentsDeclaration (Rule): # 163..165 "()" + - OpenParen (Token): "(" # 163..164 + - PositionalArguments (Rule): [] # 164..164 + - CloseParen (Token): ")" # 164..165 + - Semicolon (Token): ";" # 165..166 + - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - FunctionCallExpression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..184 " msg.sender.call" + - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" + - Expression (Rule): # 167..179 " msg.sender" + - MemberAccessExpression (Rule): # 167..179 " msg.sender" + - Expression (Rule): # 167..172 " msg" + - Identifier (Token): "msg" # 169..172 + - Period (Token): "." # 172..173 + - Identifier (Token): "sender" # 173..179 + - Period (Token): "." # 179..180 + - Identifier (Token): "call" # 180..184 + - FunctionCallOptions (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - NamedArgumentGroups (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - NamedArgumentGroup (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - OpenBrace (Token): "{" # 184..185 + - NamedArguments (Rule): # 185..222 "arg: 1, missing_expr: , no_semicolon," + - NamedArgument (Rule): # 185..191 "arg: 1" + - Identifier (Token): "arg" # 185..188 + - Colon (Token): ":" # 188..189 + - Expression (Rule): # 189..191 " 1" + - DecimalNumberExpression (Rule): # 189..191 " 1" + - DecimalLiteral (Token): "1" # 190..191 + - Comma (Token): "," # 191..192 + - NamedArgument (Rule): # 192..206 " missing_expr:" + - Identifier (Token): "missing_expr" # 193..205 + - Colon (Token): ":" # 205..206 + - SKIPPED (Token): " " # 206..207 + - Comma (Token): "," # 207..208 + - NamedArgument (Rule): # 208..221 " no_semicolon" + - Identifier (Token): "no_semicolon" # 209..221 + - SKIPPED (Token): "" # 221..221 + - Comma (Token): "," # 221..222 + - SKIPPED (Token): ", " # 223..225 + - CloseBrace (Token): "}" # 225..226 + - ArgumentsDeclaration (Rule): # 226..228 "()" + - PositionalArgumentsDeclaration (Rule): # 226..228 "()" + - OpenParen (Token): "(" # 226..227 + - PositionalArguments (Rule): [] # 227..227 + - CloseParen (Token): ")" # 227..228 + - Semicolon (Token): ";" # 228..229 + - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - FunctionCallExpression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..247 " msg.sender.call" + - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" + - Expression (Rule): # 230..242 " msg.sender" + - MemberAccessExpression (Rule): # 230..242 " msg.sender" + - Expression (Rule): # 230..235 " msg" + - Identifier (Token): "msg" # 232..235 + - Period (Token): "." # 235..236 + - Identifier (Token): "sender" # 236..242 + - Period (Token): "." # 242..243 + - Identifier (Token): "call" # 243..247 + - FunctionCallOptions (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - NamedArgumentGroups (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - NamedArgumentGroup (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - OpenBrace (Token): "{" # 247..248 + - NamedArguments (Rule): # 248..254 "arg: 1" + - NamedArgument (Rule): # 248..254 "arg: 1" + - Identifier (Token): "arg" # 248..251 + - Colon (Token): ":" # 251..252 + - Expression (Rule): # 252..254 " 1" + - DecimalNumberExpression (Rule): # 252..254 " 1" + - DecimalLiteral (Token): "1" # 253..254 + - SKIPPED (Token): "unexpected tokens, not: 2, recovered, yet: 3, " # 255..301 + - CloseBrace (Token): "}" # 301..302 + - ArgumentsDeclaration (Rule): # 302..304 "()" + - PositionalArgumentsDeclaration (Rule): # 302..304 "()" + - OpenParen (Token): "(" # 302..303 + - PositionalArguments (Rule): [] # 303..303 + - CloseParen (Token): ")" # 303..304 + - Semicolon (Token): ";" # 304..305 + - CloseBrace (Token): "}" # 307..308 - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." - FunctionKeyword (Token): "function" # 310..318 - Identifier (Token): "empty" # 319..324 - ParametersDeclaration (Rule): # 324..326 "()" - OpenParen (Token): "(" # 324..325 + - Parameters (Rule): [] # 325..325 - CloseParen (Token): ")" # 325..326 - - FunctionAttributesList (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideKeyword (Token): "override" # 327..335 - - OpenParen (Token): "(" # 335..336 - - IdentifierPathsList (Rule): # 336..347 "some.ident," - - IdentifierPath (Rule): # 336..346 "some.ident" - - Identifier (Token): "some" # 336..340 - - Period (Token): "." # 340..341 - - Identifier (Token): "ident" # 341..346 - - Comma (Token): "," # 346..347 - - LeadingTrivia (Rule): # 347..359 " /* empty */" - - MultilineComment (Trivia): "/* empty */" # 348..359 - - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 - - CloseParen (Token): ")" # 385..386 - - Semicolon (Token): ";" # 386..387 + - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - FunctionAttribute (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideKeyword (Token): "override" # 327..335 + - OpenParen (Token): "(" # 335..336 + - OverridePaths (Rule): # 336..347 "some.ident," + - IdentifierPath (Rule): # 336..346 "some.ident" + - Identifier (Token): "some" # 336..340 + - Period (Token): "." # 340..341 + - Identifier (Token): "ident" # 341..346 + - Comma (Token): "," # 346..347 + - LeadingTrivia (Rule): # 347..359 " /* empty */" + - MultilineComment (Trivia): "/* empty */" # 348..359 + - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 + - CloseParen (Token): ")" # 385..386 + - FunctionBody (Rule): # 386..388 ";\n" + - Semicolon (Token): ";" # 386..387 - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." - FunctionKeyword (Token): "function" # 389..397 - Identifier (Token): "nested_lists" # 398..410 - ParametersDeclaration (Rule): # 410..412 "()" - OpenParen (Token): "(" # 410..411 + - Parameters (Rule): [] # 411..411 - CloseParen (Token): ")" # 411..412 - - FunctionAttributesList (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideKeyword (Token): "override" # 413..421 - - OpenParen (Token): "(" # 421..422 - - IdentifierPathsList (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," - - IdentifierPath (Rule): # 422..432 "some.ident" - - Identifier (Token): "some" # 422..426 - - Period (Token): "." # 426..427 - - Identifier (Token): "ident" # 427..432 - - Comma (Token): "," # 432..433 - - IdentifierPath (Rule): # 433..439 " next." - - Identifier (Token): "next" # 434..438 - - Period (Token): "." # 438..439 - - SKIPPED (Token): "do.that" # 439..446 - - Comma (Token): "," # 446..447 - - IdentifierPath (Rule): # 447..454 " other." - - Identifier (Token): "other" # 448..453 - - Period (Token): "." # 453..454 - - SKIPPED (Token): "while" # 454..459 - - Comma (Token): "," # 459..460 - - IdentifierPath (Rule): # 460..469 " next.one" - - Identifier (Token): "next" # 461..465 - - Period (Token): "." # 465..466 - - Identifier (Token): "one" # 466..469 - - Comma (Token): "," # 469..470 - - SKIPPED (Token): "final, ultimate" # 471..486 - - CloseParen (Token): ")" # 486..487 - - Semicolon (Token): ";" # 487..488 + - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - FunctionAttribute (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideKeyword (Token): "override" # 413..421 + - OpenParen (Token): "(" # 421..422 + - OverridePaths (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," + - IdentifierPath (Rule): # 422..432 "some.ident" + - Identifier (Token): "some" # 422..426 + - Period (Token): "." # 426..427 + - Identifier (Token): "ident" # 427..432 + - Comma (Token): "," # 432..433 + - IdentifierPath (Rule): # 433..439 " next." + - Identifier (Token): "next" # 434..438 + - Period (Token): "." # 438..439 + - SKIPPED (Token): "do.that" # 439..446 + - Comma (Token): "," # 446..447 + - IdentifierPath (Rule): # 447..454 " other." + - Identifier (Token): "other" # 448..453 + - Period (Token): "." # 453..454 + - SKIPPED (Token): "while" # 454..459 + - Comma (Token): "," # 459..460 + - IdentifierPath (Rule): # 460..469 " next.one" + - Identifier (Token): "next" # 461..465 + - Period (Token): "." # 465..466 + - Identifier (Token): "one" # 466..469 + - Comma (Token): "," # 469..470 + - SKIPPED (Token): "final, ultimate" # 471..486 + - CloseParen (Token): ")" # 486..487 + - FunctionBody (Rule): # 487..489 ";\n" + - Semicolon (Token): ";" # 487..488 - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." - FunctionKeyword (Token): "function" # 489..497 - Identifier (Token): "nested_lists" # 498..510 - ParametersDeclaration (Rule): # 510..512 "()" - OpenParen (Token): "(" # 510..511 + - Parameters (Rule): [] # 511..511 - CloseParen (Token): ")" # 511..512 - - FunctionAttributesList (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideKeyword (Token): "override" # 513..521 - - OpenParen (Token): "(" # 521..522 - - IdentifierPathsList (Rule): # 522..557 "some., next.arg, next.one, ultimate" - - IdentifierPath (Rule): # 522..527 "some." - - Identifier (Token): "some" # 522..526 - - Period (Token): "." # 526..527 - - SKIPPED (Token): "" # 527..527 - - Comma (Token): "," # 527..528 - - IdentifierPath (Rule): # 528..537 " next.arg" - - Identifier (Token): "next" # 529..533 - - Period (Token): "." # 533..534 - - Identifier (Token): "arg" # 534..537 - - Comma (Token): "," # 537..538 - - IdentifierPath (Rule): # 538..547 " next.one" - - Identifier (Token): "next" # 539..543 - - Period (Token): "." # 543..544 - - Identifier (Token): "one" # 544..547 - - Comma (Token): "," # 547..548 - - IdentifierPath (Rule): # 548..557 " ultimate" - - Identifier (Token): "ultimate" # 549..557 - - CloseParen (Token): ")" # 557..558 - - Semicolon (Token): ";" # 558..559 + - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - FunctionAttribute (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideKeyword (Token): "override" # 513..521 + - OpenParen (Token): "(" # 521..522 + - OverridePaths (Rule): # 522..557 "some., next.arg, next.one, ultimate" + - IdentifierPath (Rule): # 522..527 "some." + - Identifier (Token): "some" # 522..526 + - Period (Token): "." # 526..527 + - SKIPPED (Token): "" # 527..527 + - Comma (Token): "," # 527..528 + - IdentifierPath (Rule): # 528..537 " next.arg" + - Identifier (Token): "next" # 529..533 + - Period (Token): "." # 533..534 + - Identifier (Token): "arg" # 534..537 + - Comma (Token): "," # 537..538 + - IdentifierPath (Rule): # 538..547 " next.one" + - Identifier (Token): "next" # 539..543 + - Period (Token): "." # 543..544 + - Identifier (Token): "one" # 544..547 + - Comma (Token): "," # 547..548 + - IdentifierPath (Rule): # 548..557 " ultimate" + - Identifier (Token): "ultimate" # 549..557 + - CloseParen (Token): ")" # 557..558 + - FunctionBody (Rule): # 558..560 ";\n" + - Semicolon (Token): ";" # 558..559 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.7.0-failure.yml index 6dc05f3059..1b7f05ff16 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.7.0-failure.yml @@ -40,7 +40,7 @@ Errors: # 12 total │ ╰──────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/input.sol:4:40] │ 4 │ msg.sender.call{arg: 1, missing_expr: , no_semicolon, , }(); @@ -119,221 +119,248 @@ Tree: - Identifier (Token): "all" # 9..12 - ParametersDeclaration (Rule): # 12..14 "()" - OpenParen (Token): "(" # 12..13 + - Parameters (Rule): [] # 13..13 - CloseParen (Token): ")" # 13..14 - - FunctionAttributesList (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideKeyword (Token): "override" # 15..23 - - OpenParen (Token): "(" # 23..24 - - IdentifierPathsList (Rule): # 24..34 "some.ident" - - IdentifierPath (Rule): # 24..34 "some.ident" - - Identifier (Token): "some" # 24..28 - - Period (Token): "." # 28..29 - - Identifier (Token): "ident" # 29..34 - - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 - - CloseParen (Token): ")" # 75..76 - - PublicKeyword (Token): "public" # 77..83 - - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." - - OpenBrace (Token): "{" # 84..85 - - StatementsList (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." - - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - Expression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" - - FunctionCallExpression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" - - Expression (Rule): # 86..103 " msg.sender.call" - - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" - - Expression (Rule): # 86..98 " msg.sender" - - MemberAccessExpression (Rule): # 86..98 " msg.sender" - - Expression (Rule): # 86..91 " msg" - - Identifier (Token): "msg" # 88..91 - - Period (Token): "." # 91..92 - - Identifier (Token): "sender" # 92..98 - - Period (Token): "." # 98..99 - - Identifier (Token): "call" # 99..103 - - FunctionCallOptions (Rule): # 103..119 "{do: 1, arg: 1 }" - - NamedArgumentsDeclaration (Rule): # 103..119 "{do: 1, arg: 1 }" - - OpenBrace (Token): "{" # 103..104 - - SKIPPED (Token): "do: 1, arg: 1 " # 104..118 - - CloseBrace (Token): "}" # 118..119 - - ArgumentsDeclaration (Rule): # 119..121 "()" - - OpenParen (Token): "(" # 119..120 - - CloseParen (Token): ")" # 120..121 - - Semicolon (Token): ";" # 121..122 - - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - Expression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" - - FunctionCallExpression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" - - Expression (Rule): # 123..140 " msg.sender.call" - - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" - - Expression (Rule): # 123..135 " msg.sender" - - MemberAccessExpression (Rule): # 123..135 " msg.sender" - - Expression (Rule): # 123..128 " msg" - - Identifier (Token): "msg" # 125..128 - - Period (Token): "." # 128..129 - - Identifier (Token): "sender" # 129..135 - - Period (Token): "." # 135..136 - - Identifier (Token): "call" # 136..140 - - FunctionCallOptions (Rule): # 140..163 "{, empty: 1, parse: 2 }" - - NamedArgumentsDeclaration (Rule): # 140..163 "{, empty: 1, parse: 2 }" - - OpenBrace (Token): "{" # 140..141 - - SKIPPED (Token): ", empty: 1, parse: 2 " # 141..162 - - CloseBrace (Token): "}" # 162..163 - - ArgumentsDeclaration (Rule): # 163..165 "()" - - OpenParen (Token): "(" # 163..164 - - CloseParen (Token): ")" # 164..165 - - Semicolon (Token): ";" # 165..166 - - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - FunctionCallExpression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..184 " msg.sender.call" - - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" - - Expression (Rule): # 167..179 " msg.sender" - - MemberAccessExpression (Rule): # 167..179 " msg.sender" - - Expression (Rule): # 167..172 " msg" - - Identifier (Token): "msg" # 169..172 - - Period (Token): "." # 172..173 - - Identifier (Token): "sender" # 173..179 - - Period (Token): "." # 179..180 - - Identifier (Token): "call" # 180..184 - - FunctionCallOptions (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" - - NamedArgumentsDeclaration (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" - - OpenBrace (Token): "{" # 184..185 - - NamedArgumentsList (Rule): # 185..222 "arg: 1, missing_expr: , no_semicolon," - - NamedArgument (Rule): # 185..191 "arg: 1" - - Identifier (Token): "arg" # 185..188 - - Colon (Token): ":" # 188..189 - - Expression (Rule): # 189..191 " 1" - - NumericExpression (Rule): # 189..191 " 1" - - DecimalLiteral (Token): "1" # 190..191 - - Comma (Token): "," # 191..192 - - NamedArgument (Rule): # 192..206 " missing_expr:" - - Identifier (Token): "missing_expr" # 193..205 - - Colon (Token): ":" # 205..206 - - SKIPPED (Token): " " # 206..207 - - Comma (Token): "," # 207..208 - - NamedArgument (Rule): # 208..221 " no_semicolon" - - Identifier (Token): "no_semicolon" # 209..221 - - SKIPPED (Token): "" # 221..221 - - Comma (Token): "," # 221..222 - - SKIPPED (Token): ", " # 223..225 - - CloseBrace (Token): "}" # 225..226 - - ArgumentsDeclaration (Rule): # 226..228 "()" - - OpenParen (Token): "(" # 226..227 - - CloseParen (Token): ")" # 227..228 - - Semicolon (Token): ";" # 228..229 - - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - FunctionCallExpression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..247 " msg.sender.call" - - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" - - Expression (Rule): # 230..242 " msg.sender" - - MemberAccessExpression (Rule): # 230..242 " msg.sender" - - Expression (Rule): # 230..235 " msg" - - Identifier (Token): "msg" # 232..235 - - Period (Token): "." # 235..236 - - Identifier (Token): "sender" # 236..242 - - Period (Token): "." # 242..243 - - Identifier (Token): "call" # 243..247 - - FunctionCallOptions (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - - NamedArgumentsDeclaration (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - - OpenBrace (Token): "{" # 247..248 - - NamedArgumentsList (Rule): # 248..254 "arg: 1" - - NamedArgument (Rule): # 248..254 "arg: 1" - - Identifier (Token): "arg" # 248..251 - - Colon (Token): ":" # 251..252 - - Expression (Rule): # 252..254 " 1" - - NumericExpression (Rule): # 252..254 " 1" - - DecimalLiteral (Token): "1" # 253..254 - - SKIPPED (Token): "unexpected tokens, not: 2, recovered, yet: 3, " # 255..301 - - CloseBrace (Token): "}" # 301..302 - - ArgumentsDeclaration (Rule): # 302..304 "()" - - OpenParen (Token): "(" # 302..303 - - CloseParen (Token): ")" # 303..304 - - Semicolon (Token): ";" # 304..305 - - CloseBrace (Token): "}" # 307..308 + - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." + - FunctionAttribute (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideKeyword (Token): "override" # 15..23 + - OpenParen (Token): "(" # 23..24 + - OverridePaths (Rule): # 24..34 "some.ident" + - IdentifierPath (Rule): # 24..34 "some.ident" + - Identifier (Token): "some" # 24..28 + - Period (Token): "." # 28..29 + - Identifier (Token): "ident" # 29..34 + - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 + - CloseParen (Token): ")" # 75..76 + - FunctionAttribute (Rule): # 76..83 " public" + - PublicKeyword (Token): "public" # 77..83 + - FunctionBody (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - OpenBrace (Token): "{" # 84..85 + - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." + - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - Expression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" + - FunctionCallExpression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" + - Expression (Rule): # 86..103 " msg.sender.call" + - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" + - Expression (Rule): # 86..98 " msg.sender" + - MemberAccessExpression (Rule): # 86..98 " msg.sender" + - Expression (Rule): # 86..91 " msg" + - Identifier (Token): "msg" # 88..91 + - Period (Token): "." # 91..92 + - Identifier (Token): "sender" # 92..98 + - Period (Token): "." # 98..99 + - Identifier (Token): "call" # 99..103 + - FunctionCallOptions (Rule): # 103..119 "{do: 1, arg: 1 }" + - NamedArgumentGroups (Rule): # 103..119 "{do: 1, arg: 1 }" + - NamedArgumentGroup (Rule): # 103..119 "{do: 1, arg: 1 }" + - OpenBrace (Token): "{" # 103..104 + - NamedArguments (Rule): [] # 104..104 + - SKIPPED (Token): "do: 1, arg: 1 " # 104..118 + - CloseBrace (Token): "}" # 118..119 + - ArgumentsDeclaration (Rule): # 119..121 "()" + - PositionalArgumentsDeclaration (Rule): # 119..121 "()" + - OpenParen (Token): "(" # 119..120 + - PositionalArguments (Rule): [] # 120..120 + - CloseParen (Token): ")" # 120..121 + - Semicolon (Token): ";" # 121..122 + - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - Expression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" + - FunctionCallExpression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" + - Expression (Rule): # 123..140 " msg.sender.call" + - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" + - Expression (Rule): # 123..135 " msg.sender" + - MemberAccessExpression (Rule): # 123..135 " msg.sender" + - Expression (Rule): # 123..128 " msg" + - Identifier (Token): "msg" # 125..128 + - Period (Token): "." # 128..129 + - Identifier (Token): "sender" # 129..135 + - Period (Token): "." # 135..136 + - Identifier (Token): "call" # 136..140 + - FunctionCallOptions (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - NamedArgumentGroups (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - NamedArgumentGroup (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - OpenBrace (Token): "{" # 140..141 + - NamedArguments (Rule): [] # 141..141 + - SKIPPED (Token): ", empty: 1, parse: 2 " # 141..162 + - CloseBrace (Token): "}" # 162..163 + - ArgumentsDeclaration (Rule): # 163..165 "()" + - PositionalArgumentsDeclaration (Rule): # 163..165 "()" + - OpenParen (Token): "(" # 163..164 + - PositionalArguments (Rule): [] # 164..164 + - CloseParen (Token): ")" # 164..165 + - Semicolon (Token): ";" # 165..166 + - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - FunctionCallExpression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..184 " msg.sender.call" + - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" + - Expression (Rule): # 167..179 " msg.sender" + - MemberAccessExpression (Rule): # 167..179 " msg.sender" + - Expression (Rule): # 167..172 " msg" + - Identifier (Token): "msg" # 169..172 + - Period (Token): "." # 172..173 + - Identifier (Token): "sender" # 173..179 + - Period (Token): "." # 179..180 + - Identifier (Token): "call" # 180..184 + - FunctionCallOptions (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - NamedArgumentGroups (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - NamedArgumentGroup (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - OpenBrace (Token): "{" # 184..185 + - NamedArguments (Rule): # 185..222 "arg: 1, missing_expr: , no_semicolon," + - NamedArgument (Rule): # 185..191 "arg: 1" + - Identifier (Token): "arg" # 185..188 + - Colon (Token): ":" # 188..189 + - Expression (Rule): # 189..191 " 1" + - DecimalNumberExpression (Rule): # 189..191 " 1" + - DecimalLiteral (Token): "1" # 190..191 + - Comma (Token): "," # 191..192 + - NamedArgument (Rule): # 192..206 " missing_expr:" + - Identifier (Token): "missing_expr" # 193..205 + - Colon (Token): ":" # 205..206 + - SKIPPED (Token): " " # 206..207 + - Comma (Token): "," # 207..208 + - NamedArgument (Rule): # 208..221 " no_semicolon" + - Identifier (Token): "no_semicolon" # 209..221 + - SKIPPED (Token): "" # 221..221 + - Comma (Token): "," # 221..222 + - SKIPPED (Token): ", " # 223..225 + - CloseBrace (Token): "}" # 225..226 + - ArgumentsDeclaration (Rule): # 226..228 "()" + - PositionalArgumentsDeclaration (Rule): # 226..228 "()" + - OpenParen (Token): "(" # 226..227 + - PositionalArguments (Rule): [] # 227..227 + - CloseParen (Token): ")" # 227..228 + - Semicolon (Token): ";" # 228..229 + - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - FunctionCallExpression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..247 " msg.sender.call" + - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" + - Expression (Rule): # 230..242 " msg.sender" + - MemberAccessExpression (Rule): # 230..242 " msg.sender" + - Expression (Rule): # 230..235 " msg" + - Identifier (Token): "msg" # 232..235 + - Period (Token): "." # 235..236 + - Identifier (Token): "sender" # 236..242 + - Period (Token): "." # 242..243 + - Identifier (Token): "call" # 243..247 + - FunctionCallOptions (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - NamedArgumentGroups (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - NamedArgumentGroup (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - OpenBrace (Token): "{" # 247..248 + - NamedArguments (Rule): # 248..254 "arg: 1" + - NamedArgument (Rule): # 248..254 "arg: 1" + - Identifier (Token): "arg" # 248..251 + - Colon (Token): ":" # 251..252 + - Expression (Rule): # 252..254 " 1" + - DecimalNumberExpression (Rule): # 252..254 " 1" + - DecimalLiteral (Token): "1" # 253..254 + - SKIPPED (Token): "unexpected tokens, not: 2, recovered, yet: 3, " # 255..301 + - CloseBrace (Token): "}" # 301..302 + - ArgumentsDeclaration (Rule): # 302..304 "()" + - PositionalArgumentsDeclaration (Rule): # 302..304 "()" + - OpenParen (Token): "(" # 302..303 + - PositionalArguments (Rule): [] # 303..303 + - CloseParen (Token): ")" # 303..304 + - Semicolon (Token): ";" # 304..305 + - CloseBrace (Token): "}" # 307..308 - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." - FunctionKeyword (Token): "function" # 310..318 - Identifier (Token): "empty" # 319..324 - ParametersDeclaration (Rule): # 324..326 "()" - OpenParen (Token): "(" # 324..325 + - Parameters (Rule): [] # 325..325 - CloseParen (Token): ")" # 325..326 - - FunctionAttributesList (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideKeyword (Token): "override" # 327..335 - - OpenParen (Token): "(" # 335..336 - - IdentifierPathsList (Rule): # 336..347 "some.ident," - - IdentifierPath (Rule): # 336..346 "some.ident" - - Identifier (Token): "some" # 336..340 - - Period (Token): "." # 340..341 - - Identifier (Token): "ident" # 341..346 - - Comma (Token): "," # 346..347 - - LeadingTrivia (Rule): # 347..359 " /* empty */" - - MultilineComment (Trivia): "/* empty */" # 348..359 - - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 - - CloseParen (Token): ")" # 385..386 - - Semicolon (Token): ";" # 386..387 + - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - FunctionAttribute (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideKeyword (Token): "override" # 327..335 + - OpenParen (Token): "(" # 335..336 + - OverridePaths (Rule): # 336..347 "some.ident," + - IdentifierPath (Rule): # 336..346 "some.ident" + - Identifier (Token): "some" # 336..340 + - Period (Token): "." # 340..341 + - Identifier (Token): "ident" # 341..346 + - Comma (Token): "," # 346..347 + - LeadingTrivia (Rule): # 347..359 " /* empty */" + - MultilineComment (Trivia): "/* empty */" # 348..359 + - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 + - CloseParen (Token): ")" # 385..386 + - FunctionBody (Rule): # 386..388 ";\n" + - Semicolon (Token): ";" # 386..387 - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." - FunctionKeyword (Token): "function" # 389..397 - Identifier (Token): "nested_lists" # 398..410 - ParametersDeclaration (Rule): # 410..412 "()" - OpenParen (Token): "(" # 410..411 + - Parameters (Rule): [] # 411..411 - CloseParen (Token): ")" # 411..412 - - FunctionAttributesList (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideKeyword (Token): "override" # 413..421 - - OpenParen (Token): "(" # 421..422 - - IdentifierPathsList (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," - - IdentifierPath (Rule): # 422..432 "some.ident" - - Identifier (Token): "some" # 422..426 - - Period (Token): "." # 426..427 - - Identifier (Token): "ident" # 427..432 - - Comma (Token): "," # 432..433 - - IdentifierPath (Rule): # 433..439 " next." - - Identifier (Token): "next" # 434..438 - - Period (Token): "." # 438..439 - - SKIPPED (Token): "do.that" # 439..446 - - Comma (Token): "," # 446..447 - - IdentifierPath (Rule): # 447..454 " other." - - Identifier (Token): "other" # 448..453 - - Period (Token): "." # 453..454 - - SKIPPED (Token): "while" # 454..459 - - Comma (Token): "," # 459..460 - - IdentifierPath (Rule): # 460..469 " next.one" - - Identifier (Token): "next" # 461..465 - - Period (Token): "." # 465..466 - - Identifier (Token): "one" # 466..469 - - Comma (Token): "," # 469..470 - - SKIPPED (Token): "final, ultimate" # 471..486 - - CloseParen (Token): ")" # 486..487 - - Semicolon (Token): ";" # 487..488 + - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - FunctionAttribute (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideKeyword (Token): "override" # 413..421 + - OpenParen (Token): "(" # 421..422 + - OverridePaths (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," + - IdentifierPath (Rule): # 422..432 "some.ident" + - Identifier (Token): "some" # 422..426 + - Period (Token): "." # 426..427 + - Identifier (Token): "ident" # 427..432 + - Comma (Token): "," # 432..433 + - IdentifierPath (Rule): # 433..439 " next." + - Identifier (Token): "next" # 434..438 + - Period (Token): "." # 438..439 + - SKIPPED (Token): "do.that" # 439..446 + - Comma (Token): "," # 446..447 + - IdentifierPath (Rule): # 447..454 " other." + - Identifier (Token): "other" # 448..453 + - Period (Token): "." # 453..454 + - SKIPPED (Token): "while" # 454..459 + - Comma (Token): "," # 459..460 + - IdentifierPath (Rule): # 460..469 " next.one" + - Identifier (Token): "next" # 461..465 + - Period (Token): "." # 465..466 + - Identifier (Token): "one" # 466..469 + - Comma (Token): "," # 469..470 + - SKIPPED (Token): "final, ultimate" # 471..486 + - CloseParen (Token): ")" # 486..487 + - FunctionBody (Rule): # 487..489 ";\n" + - Semicolon (Token): ";" # 487..488 - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." - FunctionKeyword (Token): "function" # 489..497 - Identifier (Token): "nested_lists" # 498..510 - ParametersDeclaration (Rule): # 510..512 "()" - OpenParen (Token): "(" # 510..511 + - Parameters (Rule): [] # 511..511 - CloseParen (Token): ")" # 511..512 - - FunctionAttributesList (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideKeyword (Token): "override" # 513..521 - - OpenParen (Token): "(" # 521..522 - - IdentifierPathsList (Rule): # 522..557 "some., next.arg, next.one, ultimate" - - IdentifierPath (Rule): # 522..527 "some." - - Identifier (Token): "some" # 522..526 - - Period (Token): "." # 526..527 - - SKIPPED (Token): "" # 527..527 - - Comma (Token): "," # 527..528 - - IdentifierPath (Rule): # 528..537 " next.arg" - - Identifier (Token): "next" # 529..533 - - Period (Token): "." # 533..534 - - Identifier (Token): "arg" # 534..537 - - Comma (Token): "," # 537..538 - - IdentifierPath (Rule): # 538..547 " next.one" - - Identifier (Token): "next" # 539..543 - - Period (Token): "." # 543..544 - - Identifier (Token): "one" # 544..547 - - Comma (Token): "," # 547..548 - - IdentifierPath (Rule): # 548..557 " ultimate" - - Identifier (Token): "ultimate" # 549..557 - - CloseParen (Token): ")" # 557..558 - - Semicolon (Token): ";" # 558..559 + - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - FunctionAttribute (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideKeyword (Token): "override" # 513..521 + - OpenParen (Token): "(" # 521..522 + - OverridePaths (Rule): # 522..557 "some., next.arg, next.one, ultimate" + - IdentifierPath (Rule): # 522..527 "some." + - Identifier (Token): "some" # 522..526 + - Period (Token): "." # 526..527 + - SKIPPED (Token): "" # 527..527 + - Comma (Token): "," # 527..528 + - IdentifierPath (Rule): # 528..537 " next.arg" + - Identifier (Token): "next" # 529..533 + - Period (Token): "." # 533..534 + - Identifier (Token): "arg" # 534..537 + - Comma (Token): "," # 537..538 + - IdentifierPath (Rule): # 538..547 " next.one" + - Identifier (Token): "next" # 539..543 + - Period (Token): "." # 543..544 + - Identifier (Token): "one" # 544..547 + - Comma (Token): "," # 547..548 + - IdentifierPath (Rule): # 548..557 " ultimate" + - Identifier (Token): "ultimate" # 549..557 + - CloseParen (Token): ")" # 557..558 + - FunctionBody (Rule): # 558..560 ";\n" + - Semicolon (Token): ";" # 558..559 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.8.0-failure.yml index 564c9af893..d072355da1 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.8.0-failure.yml @@ -40,7 +40,7 @@ Errors: # 12 total │ ╰──────────── Error occurred here. ───╯ - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/input.sol:4:40] │ 4 │ msg.sender.call{arg: 1, missing_expr: , no_semicolon, , }(); @@ -119,221 +119,244 @@ Tree: - Identifier (Token): "all" # 9..12 - ParametersDeclaration (Rule): # 12..14 "()" - OpenParen (Token): "(" # 12..13 + - Parameters (Rule): [] # 13..13 - CloseParen (Token): ")" # 13..14 - - FunctionAttributesList (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideKeyword (Token): "override" # 15..23 - - OpenParen (Token): "(" # 23..24 - - IdentifierPathsList (Rule): # 24..34 "some.ident" - - IdentifierPath (Rule): # 24..34 "some.ident" - - Identifier (Token): "some" # 24..28 - - Period (Token): "." # 28..29 - - Identifier (Token): "ident" # 29..34 - - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 - - CloseParen (Token): ")" # 75..76 - - PublicKeyword (Token): "public" # 77..83 - - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." - - OpenBrace (Token): "{" # 84..85 - - StatementsList (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." - - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - Expression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" - - FunctionCallExpression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" - - Expression (Rule): # 86..103 " msg.sender.call" - - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" - - Expression (Rule): # 86..98 " msg.sender" - - MemberAccessExpression (Rule): # 86..98 " msg.sender" - - Expression (Rule): # 86..91 " msg" - - Identifier (Token): "msg" # 88..91 - - Period (Token): "." # 91..92 - - Identifier (Token): "sender" # 92..98 - - Period (Token): "." # 98..99 - - Identifier (Token): "call" # 99..103 - - FunctionCallOptions (Rule): # 103..119 "{do: 1, arg: 1 }" - - NamedArgumentsDeclaration (Rule): # 103..119 "{do: 1, arg: 1 }" - - OpenBrace (Token): "{" # 103..104 - - SKIPPED (Token): "do: 1, arg: 1 " # 104..118 - - CloseBrace (Token): "}" # 118..119 - - ArgumentsDeclaration (Rule): # 119..121 "()" - - OpenParen (Token): "(" # 119..120 - - CloseParen (Token): ")" # 120..121 - - Semicolon (Token): ";" # 121..122 - - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - Expression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" - - FunctionCallExpression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" - - Expression (Rule): # 123..140 " msg.sender.call" - - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" - - Expression (Rule): # 123..135 " msg.sender" - - MemberAccessExpression (Rule): # 123..135 " msg.sender" - - Expression (Rule): # 123..128 " msg" - - Identifier (Token): "msg" # 125..128 - - Period (Token): "." # 128..129 - - Identifier (Token): "sender" # 129..135 - - Period (Token): "." # 135..136 - - Identifier (Token): "call" # 136..140 - - FunctionCallOptions (Rule): # 140..163 "{, empty: 1, parse: 2 }" - - NamedArgumentsDeclaration (Rule): # 140..163 "{, empty: 1, parse: 2 }" - - OpenBrace (Token): "{" # 140..141 - - SKIPPED (Token): ", empty: 1, parse: 2 " # 141..162 - - CloseBrace (Token): "}" # 162..163 - - ArgumentsDeclaration (Rule): # 163..165 "()" - - OpenParen (Token): "(" # 163..164 - - CloseParen (Token): ")" # 164..165 - - Semicolon (Token): ";" # 165..166 - - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - FunctionCallExpression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..184 " msg.sender.call" - - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" - - Expression (Rule): # 167..179 " msg.sender" - - MemberAccessExpression (Rule): # 167..179 " msg.sender" - - Expression (Rule): # 167..172 " msg" - - Identifier (Token): "msg" # 169..172 - - Period (Token): "." # 172..173 - - Identifier (Token): "sender" # 173..179 - - Period (Token): "." # 179..180 - - Identifier (Token): "call" # 180..184 - - FunctionCallOptions (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" - - NamedArgumentsDeclaration (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" - - OpenBrace (Token): "{" # 184..185 - - NamedArgumentsList (Rule): # 185..222 "arg: 1, missing_expr: , no_semicolon," - - NamedArgument (Rule): # 185..191 "arg: 1" - - Identifier (Token): "arg" # 185..188 - - Colon (Token): ":" # 188..189 - - Expression (Rule): # 189..191 " 1" - - NumericExpression (Rule): # 189..191 " 1" - - DecimalLiteral (Token): "1" # 190..191 - - Comma (Token): "," # 191..192 - - NamedArgument (Rule): # 192..206 " missing_expr:" - - Identifier (Token): "missing_expr" # 193..205 - - Colon (Token): ":" # 205..206 - - SKIPPED (Token): " " # 206..207 - - Comma (Token): "," # 207..208 - - NamedArgument (Rule): # 208..221 " no_semicolon" - - Identifier (Token): "no_semicolon" # 209..221 - - SKIPPED (Token): "" # 221..221 - - Comma (Token): "," # 221..222 - - SKIPPED (Token): ", " # 223..225 - - CloseBrace (Token): "}" # 225..226 - - ArgumentsDeclaration (Rule): # 226..228 "()" - - OpenParen (Token): "(" # 226..227 - - CloseParen (Token): ")" # 227..228 - - Semicolon (Token): ";" # 228..229 - - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - FunctionCallExpression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..247 " msg.sender.call" - - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" - - Expression (Rule): # 230..242 " msg.sender" - - MemberAccessExpression (Rule): # 230..242 " msg.sender" - - Expression (Rule): # 230..235 " msg" - - Identifier (Token): "msg" # 232..235 - - Period (Token): "." # 235..236 - - Identifier (Token): "sender" # 236..242 - - Period (Token): "." # 242..243 - - Identifier (Token): "call" # 243..247 - - FunctionCallOptions (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - - NamedArgumentsDeclaration (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - - OpenBrace (Token): "{" # 247..248 - - NamedArgumentsList (Rule): # 248..254 "arg: 1" - - NamedArgument (Rule): # 248..254 "arg: 1" - - Identifier (Token): "arg" # 248..251 - - Colon (Token): ":" # 251..252 - - Expression (Rule): # 252..254 " 1" - - NumericExpression (Rule): # 252..254 " 1" - - DecimalLiteral (Token): "1" # 253..254 - - SKIPPED (Token): "unexpected tokens, not: 2, recovered, yet: 3, " # 255..301 - - CloseBrace (Token): "}" # 301..302 - - ArgumentsDeclaration (Rule): # 302..304 "()" - - OpenParen (Token): "(" # 302..303 - - CloseParen (Token): ")" # 303..304 - - Semicolon (Token): ";" # 304..305 - - CloseBrace (Token): "}" # 307..308 + - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." + - FunctionAttribute (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideKeyword (Token): "override" # 15..23 + - OpenParen (Token): "(" # 23..24 + - OverridePaths (Rule): # 24..34 "some.ident" + - IdentifierPath (Rule): # 24..34 "some.ident" + - Identifier (Token): "some" # 24..28 + - Period (Token): "." # 28..29 + - Identifier (Token): "ident" # 29..34 + - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 + - CloseParen (Token): ")" # 75..76 + - FunctionAttribute (Rule): # 76..83 " public" + - PublicKeyword (Token): "public" # 77..83 + - FunctionBody (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - OpenBrace (Token): "{" # 84..85 + - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." + - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - Expression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" + - FunctionCallExpression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" + - Expression (Rule): # 86..103 " msg.sender.call" + - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" + - Expression (Rule): # 86..98 " msg.sender" + - MemberAccessExpression (Rule): # 86..98 " msg.sender" + - Expression (Rule): # 86..91 " msg" + - Identifier (Token): "msg" # 88..91 + - Period (Token): "." # 91..92 + - Identifier (Token): "sender" # 92..98 + - Period (Token): "." # 98..99 + - Identifier (Token): "call" # 99..103 + - FunctionCallOptions (Rule): # 103..119 "{do: 1, arg: 1 }" + - NamedArgumentGroup (Rule): # 103..119 "{do: 1, arg: 1 }" + - OpenBrace (Token): "{" # 103..104 + - NamedArguments (Rule): [] # 104..104 + - SKIPPED (Token): "do: 1, arg: 1 " # 104..118 + - CloseBrace (Token): "}" # 118..119 + - ArgumentsDeclaration (Rule): # 119..121 "()" + - PositionalArgumentsDeclaration (Rule): # 119..121 "()" + - OpenParen (Token): "(" # 119..120 + - PositionalArguments (Rule): [] # 120..120 + - CloseParen (Token): ")" # 120..121 + - Semicolon (Token): ";" # 121..122 + - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - Expression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" + - FunctionCallExpression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" + - Expression (Rule): # 123..140 " msg.sender.call" + - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" + - Expression (Rule): # 123..135 " msg.sender" + - MemberAccessExpression (Rule): # 123..135 " msg.sender" + - Expression (Rule): # 123..128 " msg" + - Identifier (Token): "msg" # 125..128 + - Period (Token): "." # 128..129 + - Identifier (Token): "sender" # 129..135 + - Period (Token): "." # 135..136 + - Identifier (Token): "call" # 136..140 + - FunctionCallOptions (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - NamedArgumentGroup (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - OpenBrace (Token): "{" # 140..141 + - NamedArguments (Rule): [] # 141..141 + - SKIPPED (Token): ", empty: 1, parse: 2 " # 141..162 + - CloseBrace (Token): "}" # 162..163 + - ArgumentsDeclaration (Rule): # 163..165 "()" + - PositionalArgumentsDeclaration (Rule): # 163..165 "()" + - OpenParen (Token): "(" # 163..164 + - PositionalArguments (Rule): [] # 164..164 + - CloseParen (Token): ")" # 164..165 + - Semicolon (Token): ";" # 165..166 + - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - FunctionCallExpression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..184 " msg.sender.call" + - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" + - Expression (Rule): # 167..179 " msg.sender" + - MemberAccessExpression (Rule): # 167..179 " msg.sender" + - Expression (Rule): # 167..172 " msg" + - Identifier (Token): "msg" # 169..172 + - Period (Token): "." # 172..173 + - Identifier (Token): "sender" # 173..179 + - Period (Token): "." # 179..180 + - Identifier (Token): "call" # 180..184 + - FunctionCallOptions (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - NamedArgumentGroup (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - OpenBrace (Token): "{" # 184..185 + - NamedArguments (Rule): # 185..222 "arg: 1, missing_expr: , no_semicolon," + - NamedArgument (Rule): # 185..191 "arg: 1" + - Identifier (Token): "arg" # 185..188 + - Colon (Token): ":" # 188..189 + - Expression (Rule): # 189..191 " 1" + - DecimalNumberExpression (Rule): # 189..191 " 1" + - DecimalLiteral (Token): "1" # 190..191 + - Comma (Token): "," # 191..192 + - NamedArgument (Rule): # 192..206 " missing_expr:" + - Identifier (Token): "missing_expr" # 193..205 + - Colon (Token): ":" # 205..206 + - SKIPPED (Token): " " # 206..207 + - Comma (Token): "," # 207..208 + - NamedArgument (Rule): # 208..221 " no_semicolon" + - Identifier (Token): "no_semicolon" # 209..221 + - SKIPPED (Token): "" # 221..221 + - Comma (Token): "," # 221..222 + - SKIPPED (Token): ", " # 223..225 + - CloseBrace (Token): "}" # 225..226 + - ArgumentsDeclaration (Rule): # 226..228 "()" + - PositionalArgumentsDeclaration (Rule): # 226..228 "()" + - OpenParen (Token): "(" # 226..227 + - PositionalArguments (Rule): [] # 227..227 + - CloseParen (Token): ")" # 227..228 + - Semicolon (Token): ";" # 228..229 + - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - FunctionCallExpression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..247 " msg.sender.call" + - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" + - Expression (Rule): # 230..242 " msg.sender" + - MemberAccessExpression (Rule): # 230..242 " msg.sender" + - Expression (Rule): # 230..235 " msg" + - Identifier (Token): "msg" # 232..235 + - Period (Token): "." # 235..236 + - Identifier (Token): "sender" # 236..242 + - Period (Token): "." # 242..243 + - Identifier (Token): "call" # 243..247 + - FunctionCallOptions (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - NamedArgumentGroup (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - OpenBrace (Token): "{" # 247..248 + - NamedArguments (Rule): # 248..254 "arg: 1" + - NamedArgument (Rule): # 248..254 "arg: 1" + - Identifier (Token): "arg" # 248..251 + - Colon (Token): ":" # 251..252 + - Expression (Rule): # 252..254 " 1" + - DecimalNumberExpression (Rule): # 252..254 " 1" + - DecimalLiteral (Token): "1" # 253..254 + - SKIPPED (Token): "unexpected tokens, not: 2, recovered, yet: 3, " # 255..301 + - CloseBrace (Token): "}" # 301..302 + - ArgumentsDeclaration (Rule): # 302..304 "()" + - PositionalArgumentsDeclaration (Rule): # 302..304 "()" + - OpenParen (Token): "(" # 302..303 + - PositionalArguments (Rule): [] # 303..303 + - CloseParen (Token): ")" # 303..304 + - Semicolon (Token): ";" # 304..305 + - CloseBrace (Token): "}" # 307..308 - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." - FunctionKeyword (Token): "function" # 310..318 - Identifier (Token): "empty" # 319..324 - ParametersDeclaration (Rule): # 324..326 "()" - OpenParen (Token): "(" # 324..325 + - Parameters (Rule): [] # 325..325 - CloseParen (Token): ")" # 325..326 - - FunctionAttributesList (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideKeyword (Token): "override" # 327..335 - - OpenParen (Token): "(" # 335..336 - - IdentifierPathsList (Rule): # 336..347 "some.ident," - - IdentifierPath (Rule): # 336..346 "some.ident" - - Identifier (Token): "some" # 336..340 - - Period (Token): "." # 340..341 - - Identifier (Token): "ident" # 341..346 - - Comma (Token): "," # 346..347 - - LeadingTrivia (Rule): # 347..359 " /* empty */" - - MultilineComment (Trivia): "/* empty */" # 348..359 - - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 - - CloseParen (Token): ")" # 385..386 - - Semicolon (Token): ";" # 386..387 + - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - FunctionAttribute (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideKeyword (Token): "override" # 327..335 + - OpenParen (Token): "(" # 335..336 + - OverridePaths (Rule): # 336..347 "some.ident," + - IdentifierPath (Rule): # 336..346 "some.ident" + - Identifier (Token): "some" # 336..340 + - Period (Token): "." # 340..341 + - Identifier (Token): "ident" # 341..346 + - Comma (Token): "," # 346..347 + - LeadingTrivia (Rule): # 347..359 " /* empty */" + - MultilineComment (Trivia): "/* empty */" # 348..359 + - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 + - CloseParen (Token): ")" # 385..386 + - FunctionBody (Rule): # 386..388 ";\n" + - Semicolon (Token): ";" # 386..387 - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." - FunctionKeyword (Token): "function" # 389..397 - Identifier (Token): "nested_lists" # 398..410 - ParametersDeclaration (Rule): # 410..412 "()" - OpenParen (Token): "(" # 410..411 + - Parameters (Rule): [] # 411..411 - CloseParen (Token): ")" # 411..412 - - FunctionAttributesList (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideKeyword (Token): "override" # 413..421 - - OpenParen (Token): "(" # 421..422 - - IdentifierPathsList (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," - - IdentifierPath (Rule): # 422..432 "some.ident" - - Identifier (Token): "some" # 422..426 - - Period (Token): "." # 426..427 - - Identifier (Token): "ident" # 427..432 - - Comma (Token): "," # 432..433 - - IdentifierPath (Rule): # 433..439 " next." - - Identifier (Token): "next" # 434..438 - - Period (Token): "." # 438..439 - - SKIPPED (Token): "do.that" # 439..446 - - Comma (Token): "," # 446..447 - - IdentifierPath (Rule): # 447..454 " other." - - Identifier (Token): "other" # 448..453 - - Period (Token): "." # 453..454 - - SKIPPED (Token): "while" # 454..459 - - Comma (Token): "," # 459..460 - - IdentifierPath (Rule): # 460..469 " next.one" - - Identifier (Token): "next" # 461..465 - - Period (Token): "." # 465..466 - - Identifier (Token): "one" # 466..469 - - Comma (Token): "," # 469..470 - - SKIPPED (Token): "final, ultimate" # 471..486 - - CloseParen (Token): ")" # 486..487 - - Semicolon (Token): ";" # 487..488 + - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - FunctionAttribute (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideKeyword (Token): "override" # 413..421 + - OpenParen (Token): "(" # 421..422 + - OverridePaths (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," + - IdentifierPath (Rule): # 422..432 "some.ident" + - Identifier (Token): "some" # 422..426 + - Period (Token): "." # 426..427 + - Identifier (Token): "ident" # 427..432 + - Comma (Token): "," # 432..433 + - IdentifierPath (Rule): # 433..439 " next." + - Identifier (Token): "next" # 434..438 + - Period (Token): "." # 438..439 + - SKIPPED (Token): "do.that" # 439..446 + - Comma (Token): "," # 446..447 + - IdentifierPath (Rule): # 447..454 " other." + - Identifier (Token): "other" # 448..453 + - Period (Token): "." # 453..454 + - SKIPPED (Token): "while" # 454..459 + - Comma (Token): "," # 459..460 + - IdentifierPath (Rule): # 460..469 " next.one" + - Identifier (Token): "next" # 461..465 + - Period (Token): "." # 465..466 + - Identifier (Token): "one" # 466..469 + - Comma (Token): "," # 469..470 + - SKIPPED (Token): "final, ultimate" # 471..486 + - CloseParen (Token): ")" # 486..487 + - FunctionBody (Rule): # 487..489 ";\n" + - Semicolon (Token): ";" # 487..488 - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." - FunctionKeyword (Token): "function" # 489..497 - Identifier (Token): "nested_lists" # 498..510 - ParametersDeclaration (Rule): # 510..512 "()" - OpenParen (Token): "(" # 510..511 + - Parameters (Rule): [] # 511..511 - CloseParen (Token): ")" # 511..512 - - FunctionAttributesList (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideKeyword (Token): "override" # 513..521 - - OpenParen (Token): "(" # 521..522 - - IdentifierPathsList (Rule): # 522..557 "some., next.arg, next.one, ultimate" - - IdentifierPath (Rule): # 522..527 "some." - - Identifier (Token): "some" # 522..526 - - Period (Token): "." # 526..527 - - SKIPPED (Token): "" # 527..527 - - Comma (Token): "," # 527..528 - - IdentifierPath (Rule): # 528..537 " next.arg" - - Identifier (Token): "next" # 529..533 - - Period (Token): "." # 533..534 - - Identifier (Token): "arg" # 534..537 - - Comma (Token): "," # 537..538 - - IdentifierPath (Rule): # 538..547 " next.one" - - Identifier (Token): "next" # 539..543 - - Period (Token): "." # 543..544 - - Identifier (Token): "one" # 544..547 - - Comma (Token): "," # 547..548 - - IdentifierPath (Rule): # 548..557 " ultimate" - - Identifier (Token): "ultimate" # 549..557 - - CloseParen (Token): ")" # 557..558 - - Semicolon (Token): ";" # 558..559 + - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - FunctionAttribute (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideKeyword (Token): "override" # 513..521 + - OpenParen (Token): "(" # 521..522 + - OverridePaths (Rule): # 522..557 "some., next.arg, next.one, ultimate" + - IdentifierPath (Rule): # 522..527 "some." + - Identifier (Token): "some" # 522..526 + - Period (Token): "." # 526..527 + - SKIPPED (Token): "" # 527..527 + - Comma (Token): "," # 527..528 + - IdentifierPath (Rule): # 528..537 " next.arg" + - Identifier (Token): "next" # 529..533 + - Period (Token): "." # 533..534 + - Identifier (Token): "arg" # 534..537 + - Comma (Token): "," # 537..538 + - IdentifierPath (Rule): # 538..547 " next.one" + - Identifier (Token): "next" # 539..543 + - Period (Token): "." # 543..544 + - Identifier (Token): "one" # 544..547 + - Comma (Token): "," # 547..548 + - IdentifierPath (Rule): # 548..557 " ultimate" + - Identifier (Token): "ultimate" # 549..557 + - CloseParen (Token): ")" # 557..558 + - FunctionBody (Rule): # 558..560 ";\n" + - Semicolon (Token): ";" # 558..559 diff --git a/crates/solidity/testing/snapshots/cst_output/EnumDefinition/multiple_members/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/EnumDefinition/multiple_members/generated/0.4.11-success.yml index e81624bc7d..2ec4c6333a 100644 --- a/crates/solidity/testing/snapshots/cst_output/EnumDefinition/multiple_members/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/EnumDefinition/multiple_members/generated/0.4.11-success.yml @@ -14,7 +14,7 @@ Tree: - EnumKeyword (Token): "enum" # 0..4 - Identifier (Token): "Foo" # 5..8 - OpenBrace (Token): "{" # 9..10 - - IdentifiersList (Rule): # 11..40 " Bar1,\n Bar2,\n Bar3\n" + - EnumMembers (Rule): # 11..40 " Bar1,\n Bar2,\n Bar3\n" - Identifier (Token): "Bar1" # 15..19 - Comma (Token): "," # 19..20 - Identifier (Token): "Bar2" # 25..29 diff --git a/crates/solidity/testing/snapshots/cst_output/EnumDefinition/no_members/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/EnumDefinition/no_members/generated/0.4.11-success.yml index 3bda446e79..a73cca0eb1 100644 --- a/crates/solidity/testing/snapshots/cst_output/EnumDefinition/no_members/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/EnumDefinition/no_members/generated/0.4.11-success.yml @@ -10,4 +10,5 @@ Tree: - EnumKeyword (Token): "enum" # 0..4 - Identifier (Token): "Foo" # 5..8 - OpenBrace (Token): "{" # 9..10 + - EnumMembers (Rule): [] # 10..10 - CloseBrace (Token): "}" # 11..12 diff --git a/crates/solidity/testing/snapshots/cst_output/ErrorDefinition/top_level/generated/0.8.4-success.yml b/crates/solidity/testing/snapshots/cst_output/ErrorDefinition/top_level/generated/0.8.4-success.yml index 40dc3a895e..f7145cf684 100644 --- a/crates/solidity/testing/snapshots/cst_output/ErrorDefinition/top_level/generated/0.8.4-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ErrorDefinition/top_level/generated/0.8.4-success.yml @@ -9,6 +9,8 @@ Tree: - ErrorDefinition (Rule): # 0..16 "error MyError();" - ErrorKeyword (Token): "error" # 0..5 - Identifier (Token): "MyError" # 6..13 - - OpenParen (Token): "(" # 13..14 - - CloseParen (Token): ")" # 14..15 + - ErrorParametersDeclaration (Rule): # 13..15 "()" + - OpenParen (Token): "(" # 13..14 + - ErrorParameters (Rule): [] # 14..14 + - CloseParen (Token): ")" # 14..15 - Semicolon (Token): ";" # 15..16 diff --git a/crates/solidity/testing/snapshots/cst_output/EventDefinition/transfer/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/EventDefinition/transfer/generated/0.4.11-failure.yml index 589149e0e6..1eb444f926 100644 --- a/crates/solidity/testing/snapshots/cst_output/EventDefinition/transfer/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/EventDefinition/transfer/generated/0.4.11-failure.yml @@ -17,13 +17,15 @@ Tree: - EventDefinition (Rule): # 0..73 "event Transfer(address indexed from, address index..." - EventKeyword (Token): "event" # 0..5 - Identifier (Token): "Transfer" # 6..14 - - OpenParen (Token): "(" # 14..15 - - EventParametersList (Rule): # 15..30 "address indexed" - - EventParameter (Rule): # 15..30 "address indexed" - - TypeName (Rule): # 15..22 "address" - - AddressType (Rule): # 15..22 "address" - - AddressKeyword (Token): "address" # 15..22 - - IndexedKeyword (Token): "indexed" # 23..30 - - SKIPPED (Token): "from, address indexed to, uint256 value" # 31..70 - - CloseParen (Token): ")" # 70..71 + - EventParametersDeclaration (Rule): # 14..71 "(address indexed from, address indexed to, uint256..." + - OpenParen (Token): "(" # 14..15 + - EventParameters (Rule): # 15..30 "address indexed" + - EventParameter (Rule): # 15..30 "address indexed" + - TypeName (Rule): # 15..22 "address" + - ElementaryType (Rule): # 15..22 "address" + - AddressType (Rule): # 15..22 "address" + - AddressKeyword (Token): "address" # 15..22 + - IndexedKeyword (Token): "indexed" # 23..30 + - SKIPPED (Token): "from, address indexed to, uint256 value" # 31..70 + - CloseParen (Token): ")" # 70..71 - Semicolon (Token): ";" # 71..72 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/address_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/address_call/generated/0.4.11-success.yml index d1474ede65..efd2ffc2b8 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/address_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/address_call/generated/0.4.11-success.yml @@ -9,11 +9,13 @@ Tree: - Expression (Rule): # 0..14 "address(value)" - FunctionCallExpression (Rule): # 0..14 "address(value)" - Expression (Rule): # 0..7 "address" - - AddressType (Rule): # 0..7 "address" - - AddressKeyword (Token): "address" # 0..7 + - ElementaryType (Rule): # 0..7 "address" + - AddressType (Rule): # 0..7 "address" + - AddressKeyword (Token): "address" # 0..7 - ArgumentsDeclaration (Rule): # 7..14 "(value)" - - OpenParen (Token): "(" # 7..8 - - PositionalArgumentsList (Rule): # 8..13 "value" - - Expression (Rule): # 8..13 "value" - - Identifier (Token): "value" # 8..13 - - CloseParen (Token): ")" # 13..14 + - PositionalArgumentsDeclaration (Rule): # 7..14 "(value)" + - OpenParen (Token): "(" # 7..8 + - PositionalArguments (Rule): # 8..13 "value" + - Expression (Rule): # 8..13 "value" + - Identifier (Token): "value" # 8..13 + - CloseParen (Token): ")" # 13..14 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/address_payable_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/address_payable_call/generated/0.4.11-success.yml index d49e154919..a251949d96 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/address_payable_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/address_payable_call/generated/0.4.11-success.yml @@ -9,12 +9,14 @@ Tree: - Expression (Rule): # 0..22 "address payable(value)" - FunctionCallExpression (Rule): # 0..22 "address payable(value)" - Expression (Rule): # 0..15 "address payable" - - AddressType (Rule): # 0..15 "address payable" - - AddressKeyword (Token): "address" # 0..7 - - PayableKeyword (Token): "payable" # 8..15 + - ElementaryType (Rule): # 0..15 "address payable" + - AddressType (Rule): # 0..15 "address payable" + - AddressKeyword (Token): "address" # 0..7 + - PayableKeyword (Token): "payable" # 8..15 - ArgumentsDeclaration (Rule): # 15..22 "(value)" - - OpenParen (Token): "(" # 15..16 - - PositionalArgumentsList (Rule): # 16..21 "value" - - Expression (Rule): # 16..21 "value" - - Identifier (Token): "value" # 16..21 - - CloseParen (Token): ")" # 21..22 + - PositionalArgumentsDeclaration (Rule): # 15..22 "(value)" + - OpenParen (Token): "(" # 15..16 + - PositionalArguments (Rule): # 16..21 "value" + - Expression (Rule): # 16..21 "value" + - Identifier (Token): "value" # 16..21 + - CloseParen (Token): ")" # 21..22 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_base/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_base/generated/0.4.11-success.yml index 2791370ebe..3b021353bc 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_base/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_base/generated/0.4.11-success.yml @@ -11,14 +11,15 @@ Tree: - Expression (Rule): # 0..12 "(foo == bar)" - TupleExpression (Rule): # 0..12 "(foo == bar)" - OpenParen (Token): "(" # 0..1 - - TupleValuesList (Rule): # 1..11 "foo == bar" - - Expression (Rule): # 1..11 "foo == bar" - - BinaryExpression (Rule): # 1..11 "foo == bar" - - Expression (Rule): # 1..4 "foo" - - Identifier (Token): "foo" # 1..4 - - EqualEqual (Token): "==" # 5..7 - - Expression (Rule): # 7..11 " bar" - - Identifier (Token): "bar" # 8..11 + - TupleValues (Rule): # 1..11 "foo == bar" + - TupleValue (Rule): # 1..11 "foo == bar" + - Expression (Rule): # 1..11 "foo == bar" + - BinaryExpression (Rule): # 1..11 "foo == bar" + - Expression (Rule): # 1..4 "foo" + - Identifier (Token): "foo" # 1..4 + - EqualEqual (Token): "==" # 5..7 + - Expression (Rule): # 7..11 " bar" + - Identifier (Token): "bar" # 8..11 - CloseParen (Token): ")" # 11..12 - QuestionMark (Token): "?" # 13..14 - Expression (Rule): # 14..19 " true" diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_conditions/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_conditions/generated/0.4.11-success.yml index 88caf9a361..7420172850 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_conditions/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/conditional_expression_nested_conditions/generated/0.4.11-success.yml @@ -14,25 +14,27 @@ Tree: - Expression (Rule): # 5..13 " (a + b)" - TupleExpression (Rule): # 5..13 " (a + b)" - OpenParen (Token): "(" # 6..7 - - TupleValuesList (Rule): # 7..12 "a + b" - - Expression (Rule): # 7..12 "a + b" - - BinaryExpression (Rule): # 7..12 "a + b" - - Expression (Rule): # 7..8 "a" - - Identifier (Token): "a" # 7..8 - - Plus (Token): "+" # 9..10 - - Expression (Rule): # 10..12 " b" - - Identifier (Token): "b" # 11..12 + - TupleValues (Rule): # 7..12 "a + b" + - TupleValue (Rule): # 7..12 "a + b" + - Expression (Rule): # 7..12 "a + b" + - BinaryExpression (Rule): # 7..12 "a + b" + - Expression (Rule): # 7..8 "a" + - Identifier (Token): "a" # 7..8 + - Plus (Token): "+" # 9..10 + - Expression (Rule): # 10..12 " b" + - Identifier (Token): "b" # 11..12 - CloseParen (Token): ")" # 12..13 - Colon (Token): ":" # 14..15 - Expression (Rule): # 15..23 " (c + d)" - TupleExpression (Rule): # 15..23 " (c + d)" - OpenParen (Token): "(" # 16..17 - - TupleValuesList (Rule): # 17..22 "c + d" - - Expression (Rule): # 17..22 "c + d" - - BinaryExpression (Rule): # 17..22 "c + d" - - Expression (Rule): # 17..18 "c" - - Identifier (Token): "c" # 17..18 - - Plus (Token): "+" # 19..20 - - Expression (Rule): # 20..22 " d" - - Identifier (Token): "d" # 21..22 + - TupleValues (Rule): # 17..22 "c + d" + - TupleValue (Rule): # 17..22 "c + d" + - Expression (Rule): # 17..22 "c + d" + - BinaryExpression (Rule): # 17..22 "c + d" + - Expression (Rule): # 17..18 "c" + - Identifier (Token): "c" # 17..18 + - Plus (Token): "+" # 19..20 + - Expression (Rule): # 20..22 " d" + - Identifier (Token): "d" # 21..22 - CloseParen (Token): ")" # 22..23 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call/generated/0.4.11-success.yml index 162a2096ad..37b13962bd 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call/generated/0.4.11-success.yml @@ -11,13 +11,14 @@ Tree: - Expression (Rule): # 0..1 "x" - Identifier (Token): "x" # 0..1 - ArgumentsDeclaration (Rule): # 1..7 "(1, 2)" - - OpenParen (Token): "(" # 1..2 - - PositionalArgumentsList (Rule): # 2..6 "1, 2" - - Expression (Rule): # 2..3 "1" - - NumericExpression (Rule): # 2..3 "1" - - DecimalLiteral (Token): "1" # 2..3 - - Comma (Token): "," # 3..4 - - Expression (Rule): # 4..6 " 2" - - NumericExpression (Rule): # 4..6 " 2" - - DecimalLiteral (Token): "2" # 5..6 - - CloseParen (Token): ")" # 6..7 + - PositionalArgumentsDeclaration (Rule): # 1..7 "(1, 2)" + - OpenParen (Token): "(" # 1..2 + - PositionalArguments (Rule): # 2..6 "1, 2" + - Expression (Rule): # 2..3 "1" + - DecimalNumberExpression (Rule): # 2..3 "1" + - DecimalLiteral (Token): "1" # 2..3 + - Comma (Token): "," # 3..4 + - Expression (Rule): # 4..6 " 2" + - DecimalNumberExpression (Rule): # 4..6 " 2" + - DecimalLiteral (Token): "2" # 5..6 + - CloseParen (Token): ")" # 6..7 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_argument_has_type_name_as_prefix/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_argument_has_type_name_as_prefix/generated/0.4.11-success.yml index d1f85453f7..8bacf17bce 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_argument_has_type_name_as_prefix/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_argument_has_type_name_as_prefix/generated/0.4.11-success.yml @@ -11,8 +11,9 @@ Tree: - Expression (Rule): # 0..1 "x" - Identifier (Token): "x" # 0..1 - ArgumentsDeclaration (Rule): # 1..13 "(interested)" - - OpenParen (Token): "(" # 1..2 - - PositionalArgumentsList (Rule): # 2..12 "interested" - - Expression (Rule): # 2..12 "interested" - - Identifier (Token): "interested" # 2..12 - - CloseParen (Token): ")" # 12..13 + - PositionalArgumentsDeclaration (Rule): # 1..13 "(interested)" + - OpenParen (Token): "(" # 1..2 + - PositionalArguments (Rule): # 2..12 "interested" + - Expression (Rule): # 2..12 "interested" + - Identifier (Token): "interested" # 2..12 + - CloseParen (Token): ")" # 12..13 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_chain/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_chain/generated/0.4.11-success.yml index 2f2e3b2a80..6f03a109b9 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_chain/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_chain/generated/0.4.11-success.yml @@ -13,8 +13,12 @@ Tree: - Expression (Rule): # 0..1 "x" - Identifier (Token): "x" # 0..1 - ArgumentsDeclaration (Rule): # 1..3 "()" - - OpenParen (Token): "(" # 1..2 - - CloseParen (Token): ")" # 2..3 + - PositionalArgumentsDeclaration (Rule): # 1..3 "()" + - OpenParen (Token): "(" # 1..2 + - PositionalArguments (Rule): [] # 2..2 + - CloseParen (Token): ")" # 2..3 - ArgumentsDeclaration (Rule): # 3..5 "()" - - OpenParen (Token): "(" # 3..4 - - CloseParen (Token): ")" # 4..5 + - PositionalArgumentsDeclaration (Rule): # 3..5 "()" + - OpenParen (Token): "(" # 3..4 + - PositionalArguments (Rule): [] # 4..4 + - CloseParen (Token): ")" # 4..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_member_access/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_member_access/generated/0.4.11-success.yml index 6c8e6134fd..2c43c02b76 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_member_access/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_member_access/generated/0.4.11-success.yml @@ -13,7 +13,9 @@ Tree: - Expression (Rule): # 0..1 "x" - Identifier (Token): "x" # 0..1 - ArgumentsDeclaration (Rule): # 1..3 "()" - - OpenParen (Token): "(" # 1..2 - - CloseParen (Token): ")" # 2..3 + - PositionalArgumentsDeclaration (Rule): # 1..3 "()" + - OpenParen (Token): "(" # 1..2 + - PositionalArguments (Rule): [] # 2..2 + - CloseParen (Token): ")" # 2..3 - Period (Token): "." # 3..4 - Identifier (Token): "y" # 4..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.6.2-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.6.2-success.yml index 2cf894b710..71b1934a52 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.6.2-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.6.2-success.yml @@ -15,27 +15,30 @@ Tree: - Period (Token): "." # 1..2 - Identifier (Token): "b" # 2..3 - FunctionCallOptions (Rule): # 3..21 "{value: 0, gas: 1}" - - NamedArgumentsDeclaration (Rule): # 3..21 "{value: 0, gas: 1}" - - OpenBrace (Token): "{" # 3..4 - - NamedArgumentsList (Rule): # 4..20 "value: 0, gas: 1" - - NamedArgument (Rule): # 4..12 "value: 0" - - Identifier (Token): "value" # 4..9 - - Colon (Token): ":" # 9..10 - - Expression (Rule): # 10..12 " 0" - - NumericExpression (Rule): # 10..12 " 0" - - DecimalLiteral (Token): "0" # 11..12 - - Comma (Token): "," # 12..13 - - NamedArgument (Rule): # 13..20 " gas: 1" - - Identifier (Token): "gas" # 14..17 - - Colon (Token): ":" # 17..18 - - Expression (Rule): # 18..20 " 1" - - NumericExpression (Rule): # 18..20 " 1" - - DecimalLiteral (Token): "1" # 19..20 - - CloseBrace (Token): "}" # 20..21 + - NamedArgumentGroups (Rule): # 3..21 "{value: 0, gas: 1}" + - NamedArgumentGroup (Rule): # 3..21 "{value: 0, gas: 1}" + - OpenBrace (Token): "{" # 3..4 + - NamedArguments (Rule): # 4..20 "value: 0, gas: 1" + - NamedArgument (Rule): # 4..12 "value: 0" + - Identifier (Token): "value" # 4..9 + - Colon (Token): ":" # 9..10 + - Expression (Rule): # 10..12 " 0" + - DecimalNumberExpression (Rule): # 10..12 " 0" + - DecimalLiteral (Token): "0" # 11..12 + - Comma (Token): "," # 12..13 + - NamedArgument (Rule): # 13..20 " gas: 1" + - Identifier (Token): "gas" # 14..17 + - Colon (Token): ":" # 17..18 + - Expression (Rule): # 18..20 " 1" + - DecimalNumberExpression (Rule): # 18..20 " 1" + - DecimalLiteral (Token): "1" # 19..20 + - CloseBrace (Token): "}" # 20..21 - ArgumentsDeclaration (Rule): # 21..25 '("")' - - OpenParen (Token): "(" # 21..22 - - PositionalArgumentsList (Rule): # 22..24 '""' - - Expression (Rule): # 22..24 '""' - - AsciiStringLiteralsList (Rule): # 22..24 '""' - - AsciiStringLiteral (Token): '""' # 22..24 - - CloseParen (Token): ")" # 24..25 + - PositionalArgumentsDeclaration (Rule): # 21..25 '("")' + - OpenParen (Token): "(" # 21..22 + - PositionalArguments (Rule): # 22..24 '""' + - Expression (Rule): # 22..24 '""' + - StringExpression (Rule): # 22..24 '""' + - AsciiStringLiterals (Rule): # 22..24 '""' + - AsciiStringLiteral (Token): '""' # 22..24 + - CloseParen (Token): ")" # 24..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.8.0-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.8.0-success.yml new file mode 100644 index 0000000000..d838fa9114 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.8.0-success.yml @@ -0,0 +1,43 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ a.b{value: 0, gas: 1}("") │ 0..25 + +Errors: [] + +Tree: + - Expression (Rule): # 0..25 'a.b{value: 0, gas: 1}("")' + - FunctionCallExpression (Rule): # 0..25 'a.b{value: 0, gas: 1}("")' + - Expression (Rule): # 0..3 "a.b" + - MemberAccessExpression (Rule): # 0..3 "a.b" + - Expression (Rule): # 0..1 "a" + - Identifier (Token): "a" # 0..1 + - Period (Token): "." # 1..2 + - Identifier (Token): "b" # 2..3 + - FunctionCallOptions (Rule): # 3..21 "{value: 0, gas: 1}" + - NamedArgumentGroup (Rule): # 3..21 "{value: 0, gas: 1}" + - OpenBrace (Token): "{" # 3..4 + - NamedArguments (Rule): # 4..20 "value: 0, gas: 1" + - NamedArgument (Rule): # 4..12 "value: 0" + - Identifier (Token): "value" # 4..9 + - Colon (Token): ":" # 9..10 + - Expression (Rule): # 10..12 " 0" + - DecimalNumberExpression (Rule): # 10..12 " 0" + - DecimalLiteral (Token): "0" # 11..12 + - Comma (Token): "," # 12..13 + - NamedArgument (Rule): # 13..20 " gas: 1" + - Identifier (Token): "gas" # 14..17 + - Colon (Token): ":" # 17..18 + - Expression (Rule): # 18..20 " 1" + - DecimalNumberExpression (Rule): # 18..20 " 1" + - DecimalLiteral (Token): "1" # 19..20 + - CloseBrace (Token): "}" # 20..21 + - ArgumentsDeclaration (Rule): # 21..25 '("")' + - PositionalArgumentsDeclaration (Rule): # 21..25 '("")' + - OpenParen (Token): "(" # 21..22 + - PositionalArguments (Rule): # 22..24 '""' + - Expression (Rule): # 22..24 '""' + - StringExpression (Rule): # 22..24 '""' + - AsciiStringLiterals (Rule): # 22..24 '""' + - AsciiStringLiteral (Token): '""' # 22..24 + - CloseParen (Token): ")" # 24..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.6.2-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.6.2-success.yml index 096d9aa6b8..f7c36c2f29 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.6.2-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.6.2-success.yml @@ -15,30 +15,33 @@ Tree: - Period (Token): "." # 1..2 - Identifier (Token): "b" # 2..3 - FunctionCallOptions (Rule): # 3..21 "{value: 0}{gas: 1}" - - NamedArgumentsDeclaration (Rule): # 3..13 "{value: 0}" - - OpenBrace (Token): "{" # 3..4 - - NamedArgumentsList (Rule): # 4..12 "value: 0" - - NamedArgument (Rule): # 4..12 "value: 0" - - Identifier (Token): "value" # 4..9 - - Colon (Token): ":" # 9..10 - - Expression (Rule): # 10..12 " 0" - - NumericExpression (Rule): # 10..12 " 0" - - DecimalLiteral (Token): "0" # 11..12 - - CloseBrace (Token): "}" # 12..13 - - NamedArgumentsDeclaration (Rule): # 13..21 "{gas: 1}" - - OpenBrace (Token): "{" # 13..14 - - NamedArgumentsList (Rule): # 14..20 "gas: 1" - - NamedArgument (Rule): # 14..20 "gas: 1" - - Identifier (Token): "gas" # 14..17 - - Colon (Token): ":" # 17..18 - - Expression (Rule): # 18..20 " 1" - - NumericExpression (Rule): # 18..20 " 1" - - DecimalLiteral (Token): "1" # 19..20 - - CloseBrace (Token): "}" # 20..21 + - NamedArgumentGroups (Rule): # 3..21 "{value: 0}{gas: 1}" + - NamedArgumentGroup (Rule): # 3..13 "{value: 0}" + - OpenBrace (Token): "{" # 3..4 + - NamedArguments (Rule): # 4..12 "value: 0" + - NamedArgument (Rule): # 4..12 "value: 0" + - Identifier (Token): "value" # 4..9 + - Colon (Token): ":" # 9..10 + - Expression (Rule): # 10..12 " 0" + - DecimalNumberExpression (Rule): # 10..12 " 0" + - DecimalLiteral (Token): "0" # 11..12 + - CloseBrace (Token): "}" # 12..13 + - NamedArgumentGroup (Rule): # 13..21 "{gas: 1}" + - OpenBrace (Token): "{" # 13..14 + - NamedArguments (Rule): # 14..20 "gas: 1" + - NamedArgument (Rule): # 14..20 "gas: 1" + - Identifier (Token): "gas" # 14..17 + - Colon (Token): ":" # 17..18 + - Expression (Rule): # 18..20 " 1" + - DecimalNumberExpression (Rule): # 18..20 " 1" + - DecimalLiteral (Token): "1" # 19..20 + - CloseBrace (Token): "}" # 20..21 - ArgumentsDeclaration (Rule): # 21..25 '("")' - - OpenParen (Token): "(" # 21..22 - - PositionalArgumentsList (Rule): # 22..24 '""' - - Expression (Rule): # 22..24 '""' - - AsciiStringLiteralsList (Rule): # 22..24 '""' - - AsciiStringLiteral (Token): '""' # 22..24 - - CloseParen (Token): ")" # 24..25 + - PositionalArgumentsDeclaration (Rule): # 21..25 '("")' + - OpenParen (Token): "(" # 21..22 + - PositionalArguments (Rule): # 22..24 '""' + - Expression (Rule): # 22..24 '""' + - StringExpression (Rule): # 22..24 '""' + - AsciiStringLiterals (Rule): # 22..24 '""' + - AsciiStringLiteral (Token): '""' # 22..24 + - CloseParen (Token): ")" # 24..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/identifier_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/identifier_call/generated/0.4.11-success.yml index 9f6c4ac337..1e98e959e8 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/identifier_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/identifier_call/generated/0.4.11-success.yml @@ -11,8 +11,9 @@ Tree: - Expression (Rule): # 0..13 "function_name" - Identifier (Token): "function_name" # 0..13 - ArgumentsDeclaration (Rule): # 13..20 "(value)" - - OpenParen (Token): "(" # 13..14 - - PositionalArgumentsList (Rule): # 14..19 "value" - - Expression (Rule): # 14..19 "value" - - Identifier (Token): "value" # 14..19 - - CloseParen (Token): ")" # 19..20 + - PositionalArgumentsDeclaration (Rule): # 13..20 "(value)" + - OpenParen (Token): "(" # 13..14 + - PositionalArguments (Rule): # 14..19 "value" + - Expression (Rule): # 14..19 "value" + - Identifier (Token): "value" # 14..19 + - CloseParen (Token): ")" # 19..20 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/incomplete_operand/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/incomplete_operand/generated/0.4.11-failure.yml index cc2c8cbe24..6ba8946815 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/incomplete_operand/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/incomplete_operand/generated/0.4.11-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or BytesKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or PayableKeyword or StringKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/incomplete_operand/input.sol:1:9] │ 1 │ 2 * new @@ -15,7 +15,7 @@ Errors: # 1 total Tree: - Expression (Rule): # 0..8 "2 * new\n" - - NumericExpression (Rule): # 0..1 "2" + - DecimalNumberExpression (Rule): # 0..1 "2" - DecimalLiteral (Token): "2" # 0..1 - BinaryExpression (Rule): # 1..3 " *" - Asterisk (Token): "*" # 2..3 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/incomplete_operand/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/incomplete_operand/generated/0.8.0-failure.yml index 867e141d8a..cfab07a5ed 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/incomplete_operand/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/incomplete_operand/generated/0.8.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or PayableKeyword or StringKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/incomplete_operand/input.sol:1:9] │ 1 │ 2 * new @@ -15,7 +15,7 @@ Errors: # 1 total Tree: - Expression (Rule): # 0..8 "2 * new\n" - - NumericExpression (Rule): # 0..1 "2" + - DecimalNumberExpression (Rule): # 0..1 "2" - DecimalLiteral (Token): "2" # 0..1 - BinaryExpression (Rule): # 1..3 " *" - Asterisk (Token): "*" # 2..3 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_end/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_end/generated/0.4.11-success.yml index b83e96cd68..bfa1a01032 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_end/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_end/generated/0.4.11-success.yml @@ -11,7 +11,8 @@ Tree: - Expression (Rule): # 0..3 "arr" - Identifier (Token): "arr" # 0..3 - OpenBracket (Token): "[" # 3..4 - - Colon (Token): ":" # 4..5 - - Expression (Rule): # 5..8 "end" - - Identifier (Token): "end" # 5..8 + - IndexAccessEnd (Rule): # 4..8 ":end" + - Colon (Token): ":" # 4..5 + - Expression (Rule): # 5..8 "end" + - Identifier (Token): "end" # 5..8 - CloseBracket (Token): "]" # 8..9 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start/generated/0.4.11-success.yml index d8e8d07b1f..abc7f34656 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start/generated/0.4.11-success.yml @@ -13,5 +13,6 @@ Tree: - OpenBracket (Token): "[" # 3..4 - Expression (Rule): # 4..9 "start" - Identifier (Token): "start" # 4..9 - - Colon (Token): ":" # 9..10 + - IndexAccessEnd (Rule): # 9..10 ":" + - Colon (Token): ":" # 9..10 - CloseBracket (Token): "]" # 10..11 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start_end/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start_end/generated/0.4.11-success.yml index 9c394bfb08..bab2b1cf62 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start_end/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_start_end/generated/0.4.11-success.yml @@ -13,7 +13,8 @@ Tree: - OpenBracket (Token): "[" # 3..4 - Expression (Rule): # 4..9 "start" - Identifier (Token): "start" # 4..9 - - Colon (Token): ":" # 9..10 - - Expression (Rule): # 10..13 "end" - - Identifier (Token): "end" # 10..13 + - IndexAccessEnd (Rule): # 9..13 ":end" + - Colon (Token): ":" # 9..10 + - Expression (Rule): # 10..13 "end" + - Identifier (Token): "end" # 10..13 - CloseBracket (Token): "]" # 13..14 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_unbounded/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_unbounded/generated/0.4.11-success.yml index d4a159481d..97158ca73e 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_unbounded/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/index_slice_unbounded/generated/0.4.11-success.yml @@ -11,5 +11,6 @@ Tree: - Expression (Rule): # 0..3 "arr" - Identifier (Token): "arr" # 0..3 - OpenBracket (Token): "[" # 3..4 - - Colon (Token): ":" # 4..5 + - IndexAccessEnd (Rule): # 4..5 ":" + - Colon (Token): ":" # 4..5 - CloseBracket (Token): "]" # 5..6 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 e2348878e9..54ff495a7f 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/input.sol:1:1] │ 1 │ alias 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 1103bcf27d..0e2bafa9c3 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/input.sol:1:1] │ 1 │ alias 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 0475df607d..6ad163579e 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/input.sol:1:1] │ 1 │ alias 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 fd7ae46804..a7acc4996e 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_alias/input.sol:1:1] │ 1 │ alias 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 99c188105e..ac18734c19 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/input.sol:1:1] │ 1 │ apply 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 f750c89f6e..9958da91c0 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/input.sol:1:1] │ 1 │ apply 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 a56e383584..200d75cf50 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/input.sol:1:1] │ 1 │ apply 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 5c69d9fd07..3373f3751e 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_apply/input.sol:1:1] │ 1 │ apply 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 f6e7985714..104bc7f6af 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/input.sol:1:1] │ 1 │ auto 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 c3e9f379f2..25a029c89e 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/input.sol:1:1] │ 1 │ auto 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 8efdc8d555..8170eb0e41 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/input.sol:1:1] │ 1 │ auto 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 b9b6838647..7f80a7e407 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_auto/input.sol:1:1] │ 1 │ auto 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 efab080810..5c608c547b 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/input.sol:1:1] │ 1 │ calldata 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 555b191fb5..b0cfca5886 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/input.sol:1:1] │ 1 │ calldata 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 f89fba4ca5..54094b3b42 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/input.sol:1:1] │ 1 │ calldata 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 72ec35a227..23b7cca330 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_calldata/input.sol:1:1] │ 1 │ calldata diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.4.22-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.5.0-failure.yml similarity index 66% rename from crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.4.22-failure.yml rename to crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.5.0-failure.yml index d57b503f04..a6c6a4ffdf 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.4.22-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/generated/0.5.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/input.sol:1:1] │ 1 │ constructor 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 69533b22db..57f3018c3b 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/input.sol:1:1] │ 1 │ constructor 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 d9646c222f..fa925bf1f9 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/input.sol:1:1] │ 1 │ constructor 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 ee4b00a1ba..fe1fbe8573 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_constructor/input.sol:1:1] │ 1 │ constructor 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 8ed1235501..950c3f833b 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/input.sol:1:1] │ 1 │ copyof 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 0a50ddc05b..edfc9b0423 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/input.sol:1:1] │ 1 │ copyof 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 30db44b09e..27700f2aa4 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/input.sol:1:1] │ 1 │ copyof 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 9cd06bae31..9328aab040 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_copyof/input.sol:1:1] │ 1 │ copyof 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 bdbf2e00ce..dffce50d53 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/input.sol:1:1] │ 1 │ define 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 57d3021b90..d8df32779f 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/input.sol:1:1] │ 1 │ define 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 e54c24a830..09d3ef1c6b 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/input.sol:1:1] │ 1 │ define 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 c217e8dc43..2478ba4375 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_define/input.sol:1:1] │ 1 │ define diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.4.21-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.5.0-failure.yml similarity index 64% rename from crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.4.21-failure.yml rename to crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.5.0-failure.yml index b401e9bba3..31bb504216 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.4.21-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/generated/0.5.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/input.sol:1:1] │ 1 │ emit 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 4f64f5ad7d..065fd6d02f 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/input.sol:1:1] │ 1 │ emit 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 f70ba21dad..69c9d4965c 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/input.sol:1:1] │ 1 │ emit 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 1e79276b45..6d48356cc1 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_emit/input.sol:1:1] │ 1 │ emit 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 fac39b4033..67e942348e 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/input.sol:1:1] │ 1 │ fallback 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 d1b9eb58a2..5e962785f0 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/input.sol:1:1] │ 1 │ fallback 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 e2870db608..f4af42ff8a 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_fallback/input.sol:1:1] │ 1 │ fallback 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 ced00d73f7..f39ca5f83b 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/input.sol:1:1] │ 1 │ finney 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 27b1909b54..8b23fd7ac9 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_finney/input.sol:1:1] │ 1 │ finney 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 b1c2c96510..4f7172a067 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/input.sol:1:1] │ 1 │ immutable 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 86e36aee0b..69dc430a6c 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/input.sol:1:1] │ 1 │ immutable 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 c6819e6fd6..42992d09e0 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/input.sol:1:1] │ 1 │ immutable 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 3ec77c7293..97d5ad521f 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_immutable/input.sol:1:1] │ 1 │ immutable 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 7c892dbb86..0ff6c11318 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/input.sol:1:1] │ 1 │ implements 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 3b34ed7aa6..e87e30c02b 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/input.sol:1:1] │ 1 │ implements 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 cca43ada49..e3e183cd12 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/input.sol:1:1] │ 1 │ implements 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 a1bb23c07f..922e564cde 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_implements/input.sol:1:1] │ 1 │ implements 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 705f8680cd..07d1bdbfc9 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/input.sol:1:1] │ 1 │ macro 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 3c2a387301..0f3636676c 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/input.sol:1:1] │ 1 │ macro 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 0b7d4f19f0..112cd4000a 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/input.sol:1:1] │ 1 │ macro 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 807a0cddc6..5fb51563b4 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_macro/input.sol:1:1] │ 1 │ macro 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 5e397c766e..d988414b88 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/input.sol:1:1] │ 1 │ mutable 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 04583fbd3a..afa4787f2d 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/input.sol:1:1] │ 1 │ mutable 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 c3b84307f8..41647ddb0e 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/input.sol:1:1] │ 1 │ mutable 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 e349e8289e..b00c7896b6 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_mutable/input.sol:1:1] │ 1 │ mutable 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 53f54e4a69..f52971ad0b 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/input.sol:1:1] │ 1 │ override 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 8aaa397830..8e61f61565 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/input.sol:1:1] │ 1 │ override 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 42501cfed4..763b9299d2 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/input.sol:1:1] │ 1 │ override 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 d7d6c479e6..1602741853 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_override/input.sol:1:1] │ 1 │ override 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 8dc52ef05f..19f7335495 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/input.sol:1:1] │ 1 │ partial 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 cd2aa74228..eae98300b3 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/input.sol:1:1] │ 1 │ partial 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 380454687c..2049db3f24 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/input.sol:1:1] │ 1 │ partial 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 9e4ca480bd..2996cfc376 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_partial/input.sol:1:1] │ 1 │ partial 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 46909ffcec..ab10b06ad0 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/input.sol:1:1] │ 1 │ promise 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 aad46fa858..15d7593694 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/input.sol:1:1] │ 1 │ promise 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 3c6983afa0..06c596ca70 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/input.sol:1:1] │ 1 │ promise 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 a1fef6f660..ff5fee3e7b 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_promise/input.sol:1:1] │ 1 │ promise 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 33f935bdb9..1a422c7511 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/input.sol:1:1] │ 1 │ receive 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 3714879ad3..9089ea5f2e 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/input.sol:1:1] │ 1 │ receive 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 54cbd09def..044a70985f 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_receive/input.sol:1:1] │ 1 │ receive 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 025e3ad00d..47ea977468 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/input.sol:1:1] │ 1 │ reference 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 69ef8dfef3..c49b9869e0 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/input.sol:1:1] │ 1 │ reference 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 4beea70935..2692ea68ab 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/input.sol:1:1] │ 1 │ reference 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 279e0678a3..6da979352d 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_reference/input.sol:1:1] │ 1 │ reference 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 29bf1c7fb6..26bb0651be 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/input.sol:1:1] │ 1 │ sealed 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 3f7b989694..0c680c952b 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/input.sol:1:1] │ 1 │ sealed 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 60e2908d29..5034673b8d 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/input.sol:1:1] │ 1 │ sealed 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 75dfaea3b3..2f262e6bc1 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_sealed/input.sol:1:1] │ 1 │ sealed 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 6ef9f7566c..27ec306b15 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/input.sol:1:1] │ 1 │ sizeof 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 f0c62deec6..cdaa699106 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/input.sol:1:1] │ 1 │ sizeof 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 bf8b86f3ac..6bfcd64ca2 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/input.sol:1:1] │ 1 │ sizeof 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 04adeeb62d..b53dce42aa 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_sizeof/input.sol:1:1] │ 1 │ sizeof 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 0819edc8d8..9a8f608df0 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/input.sol:1:1] │ 1 │ supports 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 c42c37e11f..b19590ad31 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/input.sol:1:1] │ 1 │ supports 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 c6b81e4488..6cea0cddad 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/input.sol:1:1] │ 1 │ supports 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 c1f3e30680..fdbe6330d5 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_supports/input.sol:1:1] │ 1 │ supports 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 b1504825b2..4982368d15 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/input.sol:1:1] │ 1 │ szabo 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 6172efaad3..758653bc6f 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_szabo/input.sol:1:1] │ 1 │ szabo 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 4f4621a24a..d2eea5b98d 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/input.sol:1:1] │ 1 │ typedef 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 d1a318dea8..06500b2f8e 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/input.sol:1:1] │ 1 │ typedef 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 391ee2a3d3..d8c4e605c7 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/input.sol:1:1] │ 1 │ typedef 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 1a22adc8f8..9d6ff68ec4 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_typedef/input.sol:1:1] │ 1 │ typedef 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 0b2596487e..fe082bed22 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/input.sol:1:1] │ 1 │ unchecked 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 9584f88474..ace08112ab 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/input.sol:1:1] │ 1 │ unchecked 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 da6b5b841f..d839d1608e 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/input.sol:1:1] │ 1 │ unchecked 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 769dc09f05..bdb9227e0b 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_unchecked/input.sol:1:1] │ 1 │ unchecked 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 3851d5bc66..04bf5f1c49 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/input.sol:1:1] │ 1 │ virtual 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 5e741d38cb..fd100915ea 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/input.sol:1:1] │ 1 │ virtual 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 4a3f92e589..e709485201 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/keyword_virtual/input.sol:1:1] │ 1 │ virtual diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_function_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_function_call/generated/0.4.11-success.yml index 2e2dfb8e53..22235cf0fc 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_function_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_function_call/generated/0.4.11-success.yml @@ -15,5 +15,7 @@ Tree: - Period (Token): "." # 1..2 - Identifier (Token): "y" # 2..3 - ArgumentsDeclaration (Rule): # 3..5 "()" - - OpenParen (Token): "(" # 3..4 - - CloseParen (Token): ")" # 4..5 + - PositionalArgumentsDeclaration (Rule): # 3..5 "()" + - OpenParen (Token): "(" # 3..4 + - PositionalArguments (Rule): [] # 4..4 + - CloseParen (Token): ")" # 4..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/payable_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/payable_call/generated/0.4.11-success.yml index 488cdd6cc9..7b91b0dfd2 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/payable_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/payable_call/generated/0.4.11-success.yml @@ -9,11 +9,12 @@ Tree: - Expression (Rule): # 0..14 "payable(value)" - FunctionCallExpression (Rule): # 0..14 "payable(value)" - Expression (Rule): # 0..7 "payable" - - AddressType (Rule): # 0..7 "payable" + - ElementaryType (Rule): # 0..7 "payable" - PayableKeyword (Token): "payable" # 0..7 - ArgumentsDeclaration (Rule): # 7..14 "(value)" - - OpenParen (Token): "(" # 7..8 - - PositionalArgumentsList (Rule): # 8..13 "value" - - Expression (Rule): # 8..13 "value" - - Identifier (Token): "value" # 8..13 - - CloseParen (Token): ")" # 13..14 + - PositionalArgumentsDeclaration (Rule): # 7..14 "(value)" + - OpenParen (Token): "(" # 7..8 + - PositionalArguments (Rule): # 8..13 "value" + - Expression (Rule): # 8..13 "value" + - Identifier (Token): "value" # 8..13 + - CloseParen (Token): ")" # 13..14 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 b6a43407c9..d96eca9250 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/input.sol:1:1] │ 1 │ +foo 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 bb57b515d4..e4c198b15e 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/input.sol:1:1] │ 1 │ +foo 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 f71234c88f..c9c495a853 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/input.sol:1:1] │ 1 │ +foo 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 d0868fee82..192ec69321 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/prefix_plus/input.sol:1:1] │ 1 │ +foo 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 f1306d3714..f1fa8fe096 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/returns/input.sol:1:1] │ 1 │ returns 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 c61acacb9b..449cfe9a71 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/returns/input.sol:1:1] │ 1 │ returns 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 64d80509c4..b82eeb22af 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or ByteKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/returns/input.sol:1:1] │ 1 │ returns 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 a1113cb155..a014e7a67c 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or DecimalLiteral or FalseKeyword or FixedBytesType or HexLiteral or HexStringLiteral or Identifier or NewKeyword or OpenBracket or OpenParen or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or AsciiStringLiteral or BoolKeyword or BytesKeyword or DecimalLiteral or FalseKeyword or FixedKeyword or HexLiteral or HexStringLiteral or Identifier or IntKeyword or NewKeyword or OpenBracket or OpenParen or PayableKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral. ╭─[crates/solidity/testing/snapshots/cst_output/Expression/returns/input.sol:1:1] │ 1 │ returns diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.7.0-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.7.0-success.yml index 67cb94bfb3..66f24a295e 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.7.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.7.0-success.yml @@ -7,5 +7,6 @@ Errors: [] Tree: - Expression (Rule): # 0..25 'unicode"This Emoji: 😃"' - - UnicodeStringLiteralsList (Rule): # 0..25 'unicode"This Emoji: 😃"' - - UnicodeStringLiteral (Token): 'unicode"This Emoji: 😃"' # 0..25 + - StringExpression (Rule): # 0..25 'unicode"This Emoji: 😃"' + - UnicodeStringLiterals (Rule): # 0..25 'unicode"This Emoji: 😃"' + - UnicodeStringLiteral (Token): 'unicode"This Emoji: 😃"' # 0..25 diff --git a/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.6.0-success.yml index 29c55ce289..3590d0bcae 100644 --- a/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.6.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.6.0-success.yml @@ -10,7 +10,11 @@ Tree: - FallbackKeyword (Token): "fallback" # 0..8 - ParametersDeclaration (Rule): # 8..11 " ()" - OpenParen (Token): "(" # 9..10 + - Parameters (Rule): [] # 10..10 - CloseParen (Token): ")" # 10..11 - - Block (Rule): # 11..14 " {}" - - OpenBrace (Token): "{" # 12..13 - - CloseBrace (Token): "}" # 13..14 + - FallbackFunctionAttributes (Rule): [] # 11..11 + - FunctionBody (Rule): # 11..14 " {}" + - Block (Rule): # 11..14 " {}" + - OpenBrace (Token): "{" # 12..13 + - Statements (Rule): [] # 13..13 + - CloseBrace (Token): "}" # 13..14 diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.4.11-success.yml index 87bc523ab2..0d8879603a 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.4.11-success.yml @@ -11,9 +11,13 @@ Tree: - Identifier (Token): "a" # 9..10 - ParametersDeclaration (Rule): # 10..12 "()" - OpenParen (Token): "(" # 10..11 + - Parameters (Rule): [] # 11..11 - CloseParen (Token): ")" # 11..12 - - FunctionAttributesList (Rule): # 12..21 " constant" - - ConstantKeyword (Token): "constant" # 13..21 - - Block (Rule): # 21..24 " {}" - - OpenBrace (Token): "{" # 22..23 - - CloseBrace (Token): "}" # 23..24 + - FunctionAttributes (Rule): # 12..21 " constant" + - FunctionAttribute (Rule): # 12..21 " constant" + - ConstantKeyword (Token): "constant" # 13..21 + - FunctionBody (Rule): # 21..24 " {}" + - Block (Rule): # 21..24 " {}" + - OpenBrace (Token): "{" # 22..23 + - Statements (Rule): [] # 23..23 + - CloseBrace (Token): "}" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.5.0-failure.yml index 3224b8e0a1..e0a614446e 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.5.0-failure.yml @@ -19,5 +19,7 @@ Tree: - Identifier (Token): "a" # 9..10 - ParametersDeclaration (Rule): # 10..12 "()" - OpenParen (Token): "(" # 10..11 + - Parameters (Rule): [] # 11..11 - CloseParen (Token): ")" # 11..12 + - FunctionAttributes (Rule): [] # 12..12 - SKIPPED (Token): " constant {}" # 12..24 diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/from_contextual_keyword/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/from_contextual_keyword/generated/0.4.11-failure.yml index 842c29c973..e348ba5fae 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/from_contextual_keyword/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/from_contextual_keyword/generated/0.4.11-failure.yml @@ -19,22 +19,26 @@ Tree: - Identifier (Token): "transferFrom" # 9..21 - ParametersDeclaration (Rule): # 21..63 "(address from, address to, uint256 amount)" - OpenParen (Token): "(" # 21..22 - - ParametersList (Rule): # 22..29 "address" + - Parameters (Rule): # 22..29 "address" - Parameter (Rule): # 22..29 "address" - TypeName (Rule): # 22..29 "address" - - AddressType (Rule): # 22..29 "address" - - AddressKeyword (Token): "address" # 22..29 + - ElementaryType (Rule): # 22..29 "address" + - AddressType (Rule): # 22..29 "address" + - AddressKeyword (Token): "address" # 22..29 - SKIPPED (Token): "from, address to, uint256 amount" # 30..62 - CloseParen (Token): ")" # 62..63 - - FunctionAttributesList (Rule): # 63..72 " external" - - ExternalKeyword (Token): "external" # 64..72 + - FunctionAttributes (Rule): # 63..72 " external" + - FunctionAttribute (Rule): # 63..72 " external" + - ExternalKeyword (Token): "external" # 64..72 - ReturnsDeclaration (Rule): # 72..87 " returns (bool)" - ReturnsKeyword (Token): "returns" # 73..80 - ParametersDeclaration (Rule): # 80..87 " (bool)" - OpenParen (Token): "(" # 81..82 - - ParametersList (Rule): # 82..86 "bool" + - Parameters (Rule): # 82..86 "bool" - Parameter (Rule): # 82..86 "bool" - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 - CloseParen (Token): ")" # 86..87 - - Semicolon (Token): ";" # 87..88 + - FunctionBody (Rule): # 87..89 ";\n" + - Semicolon (Token): ";" # 87..88 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/generated/0.4.11-success.yml index f954111db8..818df85769 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/generated/0.4.11-success.yml @@ -8,22 +8,25 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..45 'import { A1 as A2, B1, C1 as C2 } from "foo";' - ImportKeyword (Token): "import" # 0..6 - - DeconstructionImport (Rule): # 6..44 ' { A1 as A2, B1, C1 as C2 } from "foo"' - - OpenBrace (Token): "{" # 7..8 - - DeconstructionImportSymbolsList (Rule): # 8..31 " A1 as A2, B1, C1 as C2" - - DeconstructionImportSymbol (Rule): # 8..17 " A1 as A2" - - Identifier (Token): "A1" # 9..11 - - AsKeyword (Token): "as" # 12..14 - - Identifier (Token): "A2" # 15..17 - - Comma (Token): "," # 17..18 - - DeconstructionImportSymbol (Rule): # 18..21 " B1" - - Identifier (Token): "B1" # 19..21 - - Comma (Token): "," # 21..22 - - DeconstructionImportSymbol (Rule): # 22..31 " C1 as C2" - - Identifier (Token): "C1" # 23..25 - - AsKeyword (Token): "as" # 26..28 - - Identifier (Token): "C2" # 29..31 - - CloseBrace (Token): "}" # 32..33 - - FromKeyword (Token): "from" # 34..38 - - AsciiStringLiteral (Token): '"foo"' # 39..44 + - ImportSymbol (Rule): # 6..44 ' { A1 as A2, B1, C1 as C2 } from "foo"' + - ImportSymbolDeconstruction (Rule): # 6..44 ' { A1 as A2, B1, C1 as C2 } from "foo"' + - OpenBrace (Token): "{" # 7..8 + - ImportDeconstructionFields (Rule): # 8..31 " A1 as A2, B1, C1 as C2" + - ImportDeconstructionField (Rule): # 8..17 " A1 as A2" + - Identifier (Token): "A1" # 9..11 + - ImportAlias (Rule): # 11..17 " as A2" + - AsKeyword (Token): "as" # 12..14 + - Identifier (Token): "A2" # 15..17 + - Comma (Token): "," # 17..18 + - ImportDeconstructionField (Rule): # 18..21 " B1" + - Identifier (Token): "B1" # 19..21 + - Comma (Token): "," # 21..22 + - ImportDeconstructionField (Rule): # 22..31 " C1 as C2" + - Identifier (Token): "C1" # 23..25 + - ImportAlias (Rule): # 25..31 " as C2" + - AsKeyword (Token): "as" # 26..28 + - Identifier (Token): "C2" # 29..31 + - CloseBrace (Token): "}" # 32..33 + - FromKeyword (Token): "from" # 34..38 + - AsciiStringLiteral (Token): '"foo"' # 39..44 - Semicolon (Token): ";" # 44..45 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_single/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_single/generated/0.4.11-success.yml index d62862b618..46cf9b241c 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_single/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_single/generated/0.4.11-success.yml @@ -8,14 +8,16 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..29 'import { x as y } from "foo";' - ImportKeyword (Token): "import" # 0..6 - - DeconstructionImport (Rule): # 6..28 ' { x as y } from "foo"' - - OpenBrace (Token): "{" # 7..8 - - DeconstructionImportSymbolsList (Rule): # 8..15 " x as y" - - DeconstructionImportSymbol (Rule): # 8..15 " x as y" - - Identifier (Token): "x" # 9..10 - - AsKeyword (Token): "as" # 11..13 - - Identifier (Token): "y" # 14..15 - - CloseBrace (Token): "}" # 16..17 - - FromKeyword (Token): "from" # 18..22 - - AsciiStringLiteral (Token): '"foo"' # 23..28 + - ImportSymbol (Rule): # 6..28 ' { x as y } from "foo"' + - ImportSymbolDeconstruction (Rule): # 6..28 ' { x as y } from "foo"' + - OpenBrace (Token): "{" # 7..8 + - ImportDeconstructionFields (Rule): # 8..15 " x as y" + - ImportDeconstructionField (Rule): # 8..15 " x as y" + - Identifier (Token): "x" # 9..10 + - ImportAlias (Rule): # 10..15 " as y" + - AsKeyword (Token): "as" # 11..13 + - Identifier (Token): "y" # 14..15 + - CloseBrace (Token): "}" # 16..17 + - FromKeyword (Token): "from" # 18..22 + - AsciiStringLiteral (Token): '"foo"' # 23..28 - Semicolon (Token): ";" # 28..29 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/named_import/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/named_import/generated/0.4.11-success.yml index 03a76fb81c..f875653a54 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/named_import/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/named_import/generated/0.4.11-success.yml @@ -8,10 +8,12 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..27 'import * as foo from "bar";' - ImportKeyword (Token): "import" # 0..6 - - NamedImport (Rule): # 6..26 ' * as foo from "bar"' - - Asterisk (Token): "*" # 7..8 - - AsKeyword (Token): "as" # 9..11 - - Identifier (Token): "foo" # 12..15 - - FromKeyword (Token): "from" # 16..20 - - AsciiStringLiteral (Token): '"bar"' # 21..26 + - ImportSymbol (Rule): # 6..26 ' * as foo from "bar"' + - NamedImportSymbol (Rule): # 6..26 ' * as foo from "bar"' + - Asterisk (Token): "*" # 7..8 + - ImportAlias (Rule): # 8..15 " as foo" + - AsKeyword (Token): "as" # 9..11 + - Identifier (Token): "foo" # 12..15 + - FromKeyword (Token): "from" # 16..20 + - AsciiStringLiteral (Token): '"bar"' # 21..26 - Semicolon (Token): ";" # 26..27 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import/generated/0.4.11-success.yml index 9052382ab0..674d7a995e 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import/generated/0.4.11-success.yml @@ -8,6 +8,7 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..13 'import "foo";' - ImportKeyword (Token): "import" # 0..6 - - PathImport (Rule): # 6..12 ' "foo"' - - AsciiStringLiteral (Token): '"foo"' # 7..12 + - ImportSymbol (Rule): # 6..12 ' "foo"' + - PathImportSymbol (Rule): # 6..12 ' "foo"' + - AsciiStringLiteral (Token): '"foo"' # 7..12 - Semicolon (Token): ";" # 12..13 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import_with_alias/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import_with_alias/generated/0.4.11-success.yml index a8a320ec38..aea31ef671 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import_with_alias/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import_with_alias/generated/0.4.11-success.yml @@ -8,8 +8,10 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..20 'import "foo" as bar;' - ImportKeyword (Token): "import" # 0..6 - - PathImport (Rule): # 6..19 ' "foo" as bar' - - AsciiStringLiteral (Token): '"foo"' # 7..12 - - AsKeyword (Token): "as" # 13..15 - - Identifier (Token): "bar" # 16..19 + - ImportSymbol (Rule): # 6..19 ' "foo" as bar' + - PathImportSymbol (Rule): # 6..19 ' "foo" as bar' + - AsciiStringLiteral (Token): '"foo"' # 7..12 + - ImportAlias (Rule): # 12..19 " as bar" + - AsKeyword (Token): "as" # 13..15 + - Identifier (Token): "bar" # 16..19 - Semicolon (Token): ";" # 19..20 diff --git a/crates/solidity/testing/snapshots/cst_output/InterfaceDefinition/sample_counter/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/InterfaceDefinition/sample_counter/generated/0.4.11-success.yml index e96fd9328b..a1c65b7812 100644 --- a/crates/solidity/testing/snapshots/cst_output/InterfaceDefinition/sample_counter/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/InterfaceDefinition/sample_counter/generated/0.4.11-success.yml @@ -16,37 +16,47 @@ Tree: - InterfaceKeyword (Token): "interface" # 0..9 - Identifier (Token): "ICounter" # 10..18 - OpenBrace (Token): "{" # 19..20 - - InterfaceMembersList (Rule): # 21..171 " // returns the current count\n function coun..." - - FunctionDefinition (Rule): # 21..105 " // returns the current count\n function coun..." - - LeadingTrivia (Rule): # 21..58 " // returns the current count\n " - - SingleLineComment (Trivia): "// returns the current count" # 25..53 - - FunctionKeyword (Token): "function" # 58..66 - - Identifier (Token): "count" # 67..72 - - ParametersDeclaration (Rule): # 72..74 "()" - - OpenParen (Token): "(" # 72..73 - - CloseParen (Token): ")" # 73..74 - - FunctionAttributesList (Rule): # 74..88 " external view" - - ExternalKeyword (Token): "external" # 75..83 - - ViewKeyword (Token): "view" # 84..88 - - ReturnsDeclaration (Rule): # 88..103 " returns (uint)" - - ReturnsKeyword (Token): "returns" # 89..96 - - ParametersDeclaration (Rule): # 96..103 " (uint)" - - OpenParen (Token): "(" # 97..98 - - ParametersList (Rule): # 98..102 "uint" - - Parameter (Rule): # 98..102 "uint" - - TypeName (Rule): # 98..102 "uint" - - UnsignedIntegerType (Token): "uint" # 98..102 - - CloseParen (Token): ")" # 102..103 - - Semicolon (Token): ";" # 103..104 - - FunctionDefinition (Rule): # 105..171 "\n // increments the counter\n function increm..." - - LeadingTrivia (Rule): # 105..140 "\n // increments the counter\n " - - SingleLineComment (Trivia): "// increments the counter" # 110..135 - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "increment" # 149..158 - - ParametersDeclaration (Rule): # 158..160 "()" - - OpenParen (Token): "(" # 158..159 - - CloseParen (Token): ")" # 159..160 - - FunctionAttributesList (Rule): # 160..169 " external" - - ExternalKeyword (Token): "external" # 161..169 - - Semicolon (Token): ";" # 169..170 + - InterfaceMembers (Rule): # 21..171 " // returns the current count\n function coun..." + - ContractMember (Rule): # 21..105 " // returns the current count\n function coun..." + - FunctionDefinition (Rule): # 21..105 " // returns the current count\n function coun..." + - LeadingTrivia (Rule): # 21..58 " // returns the current count\n " + - SingleLineComment (Trivia): "// returns the current count" # 25..53 + - FunctionKeyword (Token): "function" # 58..66 + - Identifier (Token): "count" # 67..72 + - ParametersDeclaration (Rule): # 72..74 "()" + - OpenParen (Token): "(" # 72..73 + - Parameters (Rule): [] # 73..73 + - CloseParen (Token): ")" # 73..74 + - FunctionAttributes (Rule): # 74..88 " external view" + - FunctionAttribute (Rule): # 74..83 " external" + - ExternalKeyword (Token): "external" # 75..83 + - FunctionAttribute (Rule): # 83..88 " view" + - ViewKeyword (Token): "view" # 84..88 + - ReturnsDeclaration (Rule): # 88..103 " returns (uint)" + - ReturnsKeyword (Token): "returns" # 89..96 + - ParametersDeclaration (Rule): # 96..103 " (uint)" + - OpenParen (Token): "(" # 97..98 + - Parameters (Rule): # 98..102 "uint" + - Parameter (Rule): # 98..102 "uint" + - TypeName (Rule): # 98..102 "uint" + - ElementaryType (Rule): # 98..102 "uint" + - UintKeyword (Token): "uint" # 98..102 + - CloseParen (Token): ")" # 102..103 + - FunctionBody (Rule): # 103..105 ";\n" + - Semicolon (Token): ";" # 103..104 + - ContractMember (Rule): # 105..171 "\n // increments the counter\n function increm..." + - FunctionDefinition (Rule): # 105..171 "\n // increments the counter\n function increm..." + - LeadingTrivia (Rule): # 105..140 "\n // increments the counter\n " + - SingleLineComment (Trivia): "// increments the counter" # 110..135 + - FunctionKeyword (Token): "function" # 140..148 + - Identifier (Token): "increment" # 149..158 + - ParametersDeclaration (Rule): # 158..160 "()" + - OpenParen (Token): "(" # 158..159 + - Parameters (Rule): [] # 159..159 + - CloseParen (Token): ")" # 159..160 + - FunctionAttributes (Rule): # 160..169 " external" + - FunctionAttribute (Rule): # 160..169 " external" + - ExternalKeyword (Token): "external" # 161..169 + - FunctionBody (Rule): # 169..171 ";\n" + - Semicolon (Token): ";" # 169..170 - CloseBrace (Token): "}" # 171..172 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.4.11-failure.yml index 174ca74981..611e2bda9e 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.4.11-failure.yml @@ -17,7 +17,9 @@ Tree: - MappingType (Rule): # 0..34 "mapping(string Foo => bytes32 Bar)" - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - - MappingKeyType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKey (Rule): # 8..14 "string" + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - SKIPPED (Token): "Foo => bytes32 Bar" # 15..33 - CloseParen (Token): ")" # 33..34 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.8.18-success.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.8.18-success.yml index 47946947fa..b169874b39 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.8.18-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.8.18-success.yml @@ -9,12 +9,15 @@ Tree: - MappingType (Rule): # 0..34 "mapping(string Foo => bytes32 Bar)" - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - - MappingKeyType (Rule): # 8..18 "string Foo" - - StringKeyword (Token): "string" # 8..14 + - MappingKey (Rule): # 8..18 "string Foo" + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - Identifier (Token): "Foo" # 15..18 - EqualGreaterThan (Token): "=>" # 19..21 - - MappingValueType (Rule): # 21..33 " bytes32 Bar" + - MappingValue (Rule): # 21..33 " bytes32 Bar" - TypeName (Rule): # 21..29 " bytes32" - - FixedBytesType (Token): "bytes32" # 22..29 + - ElementaryType (Rule): # 21..29 " bytes32" + - BytesKeyword (Token): "bytes32" # 22..29 - Identifier (Token): "Bar" # 30..33 - CloseParen (Token): ")" # 33..34 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.4.11-failure.yml index 2110c69fb5..1dd051615d 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.4.11-failure.yml @@ -17,7 +17,9 @@ Tree: - MappingType (Rule): # 0..30 "mapping(string Foo => bytes32)" - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - - MappingKeyType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKey (Rule): # 8..14 "string" + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - SKIPPED (Token): "Foo => bytes32" # 15..29 - CloseParen (Token): ")" # 29..30 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.8.18-success.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.8.18-success.yml index a95005a73d..1494214225 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.8.18-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.8.18-success.yml @@ -9,11 +9,14 @@ Tree: - MappingType (Rule): # 0..30 "mapping(string Foo => bytes32)" - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - - MappingKeyType (Rule): # 8..18 "string Foo" - - StringKeyword (Token): "string" # 8..14 + - MappingKey (Rule): # 8..18 "string Foo" + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - Identifier (Token): "Foo" # 15..18 - EqualGreaterThan (Token): "=>" # 19..21 - - MappingValueType (Rule): # 21..29 " bytes32" + - MappingValue (Rule): # 21..29 " bytes32" - TypeName (Rule): # 21..29 " bytes32" - - FixedBytesType (Token): "bytes32" # 22..29 + - ElementaryType (Rule): # 21..29 " bytes32" + - BytesKeyword (Token): "bytes32" # 22..29 - CloseParen (Token): ")" # 29..30 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.4.11-failure.yml index fc9b983ad0..ea84e86f37 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.4.11-failure.yml @@ -17,11 +17,14 @@ Tree: - MappingType (Rule): # 0..30 "mapping(string => bytes32 Bar)" - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - - MappingKeyType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKey (Rule): # 8..14 "string" + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - EqualGreaterThan (Token): "=>" # 15..17 - - MappingValueType (Rule): # 17..25 " bytes32" + - MappingValue (Rule): # 17..25 " bytes32" - TypeName (Rule): # 17..25 " bytes32" - - FixedBytesType (Token): "bytes32" # 18..25 + - ElementaryType (Rule): # 17..25 " bytes32" + - BytesKeyword (Token): "bytes32" # 18..25 - SKIPPED (Token): "Bar" # 26..29 - CloseParen (Token): ")" # 29..30 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.8.18-success.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.8.18-success.yml index f340a0f3ab..f5b5db9edc 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.8.18-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.8.18-success.yml @@ -9,11 +9,14 @@ Tree: - MappingType (Rule): # 0..30 "mapping(string => bytes32 Bar)" - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - - MappingKeyType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKey (Rule): # 8..14 "string" + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - EqualGreaterThan (Token): "=>" # 15..17 - - MappingValueType (Rule): # 17..29 " bytes32 Bar" + - MappingValue (Rule): # 17..29 " bytes32 Bar" - TypeName (Rule): # 17..25 " bytes32" - - FixedBytesType (Token): "bytes32" # 18..25 + - ElementaryType (Rule): # 17..25 " bytes32" + - BytesKeyword (Token): "bytes32" # 18..25 - Identifier (Token): "Bar" # 26..29 - CloseParen (Token): ")" # 29..30 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.4.11-failure.yml index 96dbde6754..966863fc40 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.4.11-failure.yml @@ -17,11 +17,14 @@ Tree: - MappingType (Rule): # 0..32 "mapping(string => bytes32] arg)\n" - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - - MappingKeyType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKey (Rule): # 8..14 "string" + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - EqualGreaterThan (Token): "=>" # 15..17 - - MappingValueType (Rule): # 17..25 " bytes32" + - MappingValue (Rule): # 17..25 " bytes32" - TypeName (Rule): # 17..25 " bytes32" - - FixedBytesType (Token): "bytes32" # 18..25 + - ElementaryType (Rule): # 17..25 " bytes32" + - BytesKeyword (Token): "bytes32" # 18..25 - SKIPPED (Token): "] arg" # 25..30 - CloseParen (Token): ")" # 30..31 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.8.18-failure.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.8.18-failure.yml index 17ad50e1c9..39175e0ef4 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.8.18-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.8.18-failure.yml @@ -17,11 +17,14 @@ Tree: - MappingType (Rule): # 0..32 "mapping(string => bytes32] arg)\n" - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - - MappingKeyType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKey (Rule): # 8..14 "string" + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - EqualGreaterThan (Token): "=>" # 15..17 - - MappingValueType (Rule): # 17..25 " bytes32" + - MappingValue (Rule): # 17..25 " bytes32" - TypeName (Rule): # 17..25 " bytes32" - - FixedBytesType (Token): "bytes32" # 18..25 + - ElementaryType (Rule): # 17..25 " bytes32" + - BytesKeyword (Token): "bytes32" # 18..25 - SKIPPED (Token): "] arg" # 25..30 - CloseParen (Token): ")" # 30..31 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/unnamed/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/unnamed/generated/0.4.11-success.yml index 03ee0e26bc..e7f2a2deb0 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/unnamed/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/unnamed/generated/0.4.11-success.yml @@ -9,10 +9,13 @@ Tree: - MappingType (Rule): # 0..26 "mapping(string => bytes32)" - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - - MappingKeyType (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKey (Rule): # 8..14 "string" + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - EqualGreaterThan (Token): "=>" # 15..17 - - MappingValueType (Rule): # 17..25 " bytes32" + - MappingValue (Rule): # 17..25 " bytes32" - TypeName (Rule): # 17..25 " bytes32" - - FixedBytesType (Token): "bytes32" # 18..25 + - ElementaryType (Rule): # 17..25 " bytes32" + - BytesKeyword (Token): "bytes32" # 18..25 - CloseParen (Token): ")" # 25..26 diff --git a/crates/solidity/testing/snapshots/cst_output/NewExpression/array_1d_expression/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/NewExpression/array_1d_expression/generated/0.4.11-success.yml index 1720fd73a5..06f31ec361 100644 --- a/crates/solidity/testing/snapshots/cst_output/NewExpression/array_1d_expression/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/NewExpression/array_1d_expression/generated/0.4.11-success.yml @@ -15,6 +15,6 @@ Tree: - Identifier (Token): "Foo" # 4..7 - OpenBracket (Token): "[" # 7..8 - Expression (Rule): # 8..10 "10" - - NumericExpression (Rule): # 8..10 "10" + - DecimalNumberExpression (Rule): # 8..10 "10" - DecimalLiteral (Token): "10" # 8..10 - CloseBracket (Token): "]" # 10..11 diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/generated/0.4.11-success.yml index 7727faf7a8..5d155752db 100644 --- a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/generated/0.4.11-success.yml @@ -8,7 +8,8 @@ Errors: [] Tree: - PragmaDirective (Rule): # 0..20 "pragma abicoder foo;" - PragmaKeyword (Token): "pragma" # 0..6 - - ABICoderPragma (Rule): # 6..19 " abicoder foo" - - ABICoderKeyword (Token): "abicoder" # 7..15 - - Identifier (Token): "foo" # 16..19 + - Pragma (Rule): # 6..19 " abicoder foo" + - ABICoderPragma (Rule): # 6..19 " abicoder foo" + - AbicoderKeyword (Token): "abicoder" # 7..15 + - Identifier (Token): "foo" # 16..19 - Semicolon (Token): ";" # 19..20 diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/generated/0.4.11-success.yml index cdb0e5ce6f..33c59374af 100644 --- a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/generated/0.4.11-success.yml @@ -8,7 +8,9 @@ Errors: [] Tree: - PragmaDirective (Rule): # 0..24 "pragma experimental foo;" - PragmaKeyword (Token): "pragma" # 0..6 - - ExperimentalPragma (Rule): # 6..23 " experimental foo" - - ExperimentalKeyword (Token): "experimental" # 7..19 - - Identifier (Token): "foo" # 20..23 + - Pragma (Rule): # 6..23 " experimental foo" + - ExperimentalPragma (Rule): # 6..23 " experimental foo" + - ExperimentalKeyword (Token): "experimental" # 7..19 + - ExperimentalFeature (Rule): # 19..23 " foo" + - Identifier (Token): "foo" # 20..23 - Semicolon (Token): ";" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental_string/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental_string/generated/0.4.11-success.yml index 678215f877..c46544ad5d 100644 --- a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental_string/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental_string/generated/0.4.11-success.yml @@ -8,7 +8,9 @@ Errors: [] Tree: - PragmaDirective (Rule): # 0..36 'pragma experimental "ABIEncoderV2";\n' - PragmaKeyword (Token): "pragma" # 0..6 - - ExperimentalPragma (Rule): # 6..34 ' experimental "ABIEncoderV2"' - - ExperimentalKeyword (Token): "experimental" # 7..19 - - AsciiStringLiteral (Token): '"ABIEncoderV2"' # 20..34 + - Pragma (Rule): # 6..34 ' experimental "ABIEncoderV2"' + - ExperimentalPragma (Rule): # 6..34 ' experimental "ABIEncoderV2"' + - ExperimentalKeyword (Token): "experimental" # 7..19 + - ExperimentalFeature (Rule): # 19..34 ' "ABIEncoderV2"' + - AsciiStringLiteral (Token): '"ABIEncoderV2"' # 20..34 - Semicolon (Token): ";" # 34..35 diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/generated/0.4.11-success.yml index b5742cfc7a..3c1ba86aaf 100644 --- a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/generated/0.4.11-success.yml @@ -8,14 +8,15 @@ Errors: [] Tree: - PragmaDirective (Rule): # 0..22 "pragma solidity 1.0.0;" - PragmaKeyword (Token): "pragma" # 0..6 - - VersionPragma (Rule): # 6..21 " solidity 1.0.0" - - SolidityKeyword (Token): "solidity" # 7..15 - - VersionPragmaExpressionsList (Rule): # 15..21 " 1.0.0" - - VersionPragmaExpression (Rule): # 15..21 " 1.0.0" - - VersionPragmaSpecifier (Rule): # 15..21 " 1.0.0" - - VersionPragmaValue (Token): "1" # 16..17 - - Period (Token): "." # 17..18 - - VersionPragmaValue (Token): "0" # 18..19 - - Period (Token): "." # 19..20 - - VersionPragmaValue (Token): "0" # 20..21 + - Pragma (Rule): # 6..21 " solidity 1.0.0" + - VersionPragma (Rule): # 6..21 " solidity 1.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 1.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 1.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 1.0.0" + - VersionPragmaValue (Token): "1" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 - Semicolon (Token): ";" # 21..22 diff --git a/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.6.0-success.yml index 2431c16c35..fc2c8bb2ba 100644 --- a/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.6.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.6.0-success.yml @@ -10,7 +10,11 @@ Tree: - ReceiveKeyword (Token): "receive" # 0..7 - ParametersDeclaration (Rule): # 7..10 " ()" - OpenParen (Token): "(" # 8..9 + - Parameters (Rule): [] # 9..9 - CloseParen (Token): ")" # 9..10 - - Block (Rule): # 10..13 " {}" - - OpenBrace (Token): "{" # 11..12 - - CloseBrace (Token): "}" # 12..13 + - ReceiveFunctionAttributes (Rule): [] # 10..10 + - FunctionBody (Rule): # 10..13 " {}" + - Block (Rule): # 10..13 " {}" + - OpenBrace (Token): "{" # 11..12 + - Statements (Rule): [] # 12..12 + - CloseBrace (Token): "}" # 12..13 diff --git a/crates/solidity/testing/snapshots/cst_output/ReturnStatement/invalid_terminator/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ReturnStatement/invalid_terminator/generated/0.4.11-failure.yml index 15f97d59d9..f43ed89169 100644 --- a/crates/solidity/testing/snapshots/cst_output/ReturnStatement/invalid_terminator/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ReturnStatement/invalid_terminator/generated/0.4.11-failure.yml @@ -27,7 +27,7 @@ Tree: - Expression (Rule): # 10..19 " 2 * some" - BinaryExpression (Rule): # 10..19 " 2 * some" - Expression (Rule): # 10..12 " 2" - - NumericExpression (Rule): # 10..12 " 2" + - DecimalNumberExpression (Rule): # 10..12 " 2" - DecimalLiteral (Token): "2" # 11..12 - Asterisk (Token): "*" # 13..14 - Expression (Rule): # 14..19 " some" diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.4.11-failure.yml index 38f77e69bb..97e63669f7 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.4.11-failure.yml @@ -13,7 +13,7 @@ Source: > Errors: # 1 total - > - Error: Expected Ampersand or AmpersandAmpersand or AmpersandEqual or Asterisk or AsteriskAsterisk or AsteriskEqual or BangEqual or Bar or BarBar or BarEqual or Caret or CaretEqual or Equal or EqualEqual or GreaterThan or GreaterThanEqual or GreaterThanGreaterThan or GreaterThanGreaterThanEqual or GreaterThanGreaterThanGreaterThan or GreaterThanGreaterThanGreaterThanEqual or LessThan or LessThanEqual or LessThanLessThan or LessThanLessThanEqual or Minus or MinusEqual or Percent or PercentEqual or Plus or PlusEqual or Semicolon or Slash or SlashEqual. + Error: Expected Identifier or MemoryKeyword or StorageKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/input.sol:3:15] │ 3 │ ╭─▶ unchecked { @@ -25,51 +25,62 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - SourceUnitMembersList (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryKeyword (Token): "library" # 0..7 - - Identifier (Token): "SafeMath" # 8..16 - - OpenBrace (Token): "{" # 17..18 - - LibraryMembersList (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "tryAdd" # 30..36 - - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" - - OpenParen (Token): "(" # 36..37 - - ParametersList (Rule): # 37..57 "uint256 a, uint256 b" - - Parameter (Rule): # 37..46 "uint256 a" - - TypeName (Rule): # 37..44 "uint256" - - UnsignedIntegerType (Token): "uint256" # 37..44 - - Identifier (Token): "a" # 45..46 - - Comma (Token): "," # 46..47 - - Parameter (Rule): # 47..57 " uint256 b" - - TypeName (Rule): # 47..55 " uint256" - - UnsignedIntegerType (Token): "uint256" # 48..55 - - Identifier (Token): "b" # 56..57 - - CloseParen (Token): ")" # 57..58 - - FunctionAttributesList (Rule): # 58..72 " internal pure" - - InternalKeyword (Token): "internal" # 59..67 - - PureKeyword (Token): "pure" # 68..72 - - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" - - ReturnsKeyword (Token): "returns" # 73..80 - - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" - - OpenParen (Token): "(" # 81..82 - - ParametersList (Rule): # 82..95 "bool, uint256" - - Parameter (Rule): # 82..86 "bool" - - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 - - Comma (Token): "," # 86..87 - - Parameter (Rule): # 87..95 " uint256" - - TypeName (Rule): # 87..95 " uint256" - - UnsignedIntegerType (Token): "uint256" # 88..95 - - CloseParen (Token): ")" # 95..96 - - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." - - OpenBrace (Token): "{" # 97..98 - - StatementsList (Rule): # 99..113 " unchecked " - - Statement (Rule): # 99..113 " unchecked " - - ExpressionStatement (Rule): # 99..113 " unchecked " - - Expression (Rule): # 99..112 " unchecked" - - Identifier (Token): "unchecked" # 103..112 - - SKIPPED (Token): "{\n uint256 c = a + b;\n if (c < a) return..." # 113..208 - - CloseBrace (Token): "}" # 208..209 - - CloseBrace (Token): "}" # 210..211 + - SourceUnitMembers (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - SourceUnitMember (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryKeyword (Token): "library" # 0..7 + - Identifier (Token): "SafeMath" # 8..16 + - OpenBrace (Token): "{" # 17..18 + - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - ContractMember (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionKeyword (Token): "function" # 21..29 + - Identifier (Token): "tryAdd" # 30..36 + - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" + - OpenParen (Token): "(" # 36..37 + - Parameters (Rule): # 37..57 "uint256 a, uint256 b" + - Parameter (Rule): # 37..46 "uint256 a" + - TypeName (Rule): # 37..44 "uint256" + - ElementaryType (Rule): # 37..44 "uint256" + - UintKeyword (Token): "uint256" # 37..44 + - Identifier (Token): "a" # 45..46 + - Comma (Token): "," # 46..47 + - Parameter (Rule): # 47..57 " uint256 b" + - TypeName (Rule): # 47..55 " uint256" + - ElementaryType (Rule): # 47..55 " uint256" + - UintKeyword (Token): "uint256" # 48..55 + - Identifier (Token): "b" # 56..57 + - CloseParen (Token): ")" # 57..58 + - FunctionAttributes (Rule): # 58..72 " internal pure" + - FunctionAttribute (Rule): # 58..67 " internal" + - InternalKeyword (Token): "internal" # 59..67 + - FunctionAttribute (Rule): # 67..72 " pure" + - PureKeyword (Token): "pure" # 68..72 + - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" + - ReturnsKeyword (Token): "returns" # 73..80 + - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" + - OpenParen (Token): "(" # 81..82 + - Parameters (Rule): # 82..95 "bool, uint256" + - Parameter (Rule): # 82..86 "bool" + - TypeName (Rule): # 82..86 "bool" + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 + - Comma (Token): "," # 86..87 + - Parameter (Rule): # 87..95 " uint256" + - TypeName (Rule): # 87..95 " uint256" + - ElementaryType (Rule): # 87..95 " uint256" + - UintKeyword (Token): "uint256" # 88..95 + - CloseParen (Token): ")" # 95..96 + - FunctionBody (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - OpenBrace (Token): "{" # 97..98 + - Statements (Rule): # 99..113 " unchecked " + - Statement (Rule): # 99..113 " unchecked " + - VariableDeclarationStatement (Rule): # 99..113 " unchecked " + - VariableDeclarationType (Rule): # 99..112 " unchecked" + - TypeName (Rule): # 99..112 " unchecked" + - IdentifierPath (Rule): # 99..112 " unchecked" + - Identifier (Token): "unchecked" # 103..112 + - SKIPPED (Token): "{\n uint256 c = a + b;\n if (c < a) return..." # 113..208 + - CloseBrace (Token): "}" # 208..209 + - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.0-failure.yml index 4a7edf125f..8d87746678 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.0-failure.yml @@ -13,7 +13,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/input.sol:3:5] │ 3 │ ╭─▶ unchecked { @@ -25,46 +25,56 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - SourceUnitMembersList (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryKeyword (Token): "library" # 0..7 - - Identifier (Token): "SafeMath" # 8..16 - - OpenBrace (Token): "{" # 17..18 - - LibraryMembersList (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "tryAdd" # 30..36 - - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" - - OpenParen (Token): "(" # 36..37 - - ParametersList (Rule): # 37..57 "uint256 a, uint256 b" - - Parameter (Rule): # 37..46 "uint256 a" - - TypeName (Rule): # 37..44 "uint256" - - UnsignedIntegerType (Token): "uint256" # 37..44 - - Identifier (Token): "a" # 45..46 - - Comma (Token): "," # 46..47 - - Parameter (Rule): # 47..57 " uint256 b" - - TypeName (Rule): # 47..55 " uint256" - - UnsignedIntegerType (Token): "uint256" # 48..55 - - Identifier (Token): "b" # 56..57 - - CloseParen (Token): ")" # 57..58 - - FunctionAttributesList (Rule): # 58..72 " internal pure" - - InternalKeyword (Token): "internal" # 59..67 - - PureKeyword (Token): "pure" # 68..72 - - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" - - ReturnsKeyword (Token): "returns" # 73..80 - - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" - - OpenParen (Token): "(" # 81..82 - - ParametersList (Rule): # 82..95 "bool, uint256" - - Parameter (Rule): # 82..86 "bool" - - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 - - Comma (Token): "," # 86..87 - - Parameter (Rule): # 87..95 " uint256" - - TypeName (Rule): # 87..95 " uint256" - - UnsignedIntegerType (Token): "uint256" # 88..95 - - CloseParen (Token): ")" # 95..96 - - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." - - OpenBrace (Token): "{" # 97..98 - - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 - - CloseBrace (Token): "}" # 208..209 - - CloseBrace (Token): "}" # 210..211 + - SourceUnitMembers (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - SourceUnitMember (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryKeyword (Token): "library" # 0..7 + - Identifier (Token): "SafeMath" # 8..16 + - OpenBrace (Token): "{" # 17..18 + - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - ContractMember (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionKeyword (Token): "function" # 21..29 + - Identifier (Token): "tryAdd" # 30..36 + - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" + - OpenParen (Token): "(" # 36..37 + - Parameters (Rule): # 37..57 "uint256 a, uint256 b" + - Parameter (Rule): # 37..46 "uint256 a" + - TypeName (Rule): # 37..44 "uint256" + - ElementaryType (Rule): # 37..44 "uint256" + - UintKeyword (Token): "uint256" # 37..44 + - Identifier (Token): "a" # 45..46 + - Comma (Token): "," # 46..47 + - Parameter (Rule): # 47..57 " uint256 b" + - TypeName (Rule): # 47..55 " uint256" + - ElementaryType (Rule): # 47..55 " uint256" + - UintKeyword (Token): "uint256" # 48..55 + - Identifier (Token): "b" # 56..57 + - CloseParen (Token): ")" # 57..58 + - FunctionAttributes (Rule): # 58..72 " internal pure" + - FunctionAttribute (Rule): # 58..67 " internal" + - InternalKeyword (Token): "internal" # 59..67 + - FunctionAttribute (Rule): # 67..72 " pure" + - PureKeyword (Token): "pure" # 68..72 + - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" + - ReturnsKeyword (Token): "returns" # 73..80 + - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" + - OpenParen (Token): "(" # 81..82 + - Parameters (Rule): # 82..95 "bool, uint256" + - Parameter (Rule): # 82..86 "bool" + - TypeName (Rule): # 82..86 "bool" + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 + - Comma (Token): "," # 86..87 + - Parameter (Rule): # 87..95 " uint256" + - TypeName (Rule): # 87..95 " uint256" + - ElementaryType (Rule): # 87..95 " uint256" + - UintKeyword (Token): "uint256" # 88..95 + - CloseParen (Token): ")" # 95..96 + - FunctionBody (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - OpenBrace (Token): "{" # 97..98 + - Statements (Rule): [] # 99..99 + - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 + - CloseBrace (Token): "}" # 208..209 + - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.3-failure.yml index a6231d0612..09b0527b22 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.3-failure.yml @@ -13,7 +13,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/input.sol:3:5] │ 3 │ ╭─▶ unchecked { @@ -25,46 +25,56 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - SourceUnitMembersList (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryKeyword (Token): "library" # 0..7 - - Identifier (Token): "SafeMath" # 8..16 - - OpenBrace (Token): "{" # 17..18 - - LibraryMembersList (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "tryAdd" # 30..36 - - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" - - OpenParen (Token): "(" # 36..37 - - ParametersList (Rule): # 37..57 "uint256 a, uint256 b" - - Parameter (Rule): # 37..46 "uint256 a" - - TypeName (Rule): # 37..44 "uint256" - - UnsignedIntegerType (Token): "uint256" # 37..44 - - Identifier (Token): "a" # 45..46 - - Comma (Token): "," # 46..47 - - Parameter (Rule): # 47..57 " uint256 b" - - TypeName (Rule): # 47..55 " uint256" - - UnsignedIntegerType (Token): "uint256" # 48..55 - - Identifier (Token): "b" # 56..57 - - CloseParen (Token): ")" # 57..58 - - FunctionAttributesList (Rule): # 58..72 " internal pure" - - InternalKeyword (Token): "internal" # 59..67 - - PureKeyword (Token): "pure" # 68..72 - - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" - - ReturnsKeyword (Token): "returns" # 73..80 - - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" - - OpenParen (Token): "(" # 81..82 - - ParametersList (Rule): # 82..95 "bool, uint256" - - Parameter (Rule): # 82..86 "bool" - - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 - - Comma (Token): "," # 86..87 - - Parameter (Rule): # 87..95 " uint256" - - TypeName (Rule): # 87..95 " uint256" - - UnsignedIntegerType (Token): "uint256" # 88..95 - - CloseParen (Token): ")" # 95..96 - - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." - - OpenBrace (Token): "{" # 97..98 - - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 - - CloseBrace (Token): "}" # 208..209 - - CloseBrace (Token): "}" # 210..211 + - SourceUnitMembers (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - SourceUnitMember (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryKeyword (Token): "library" # 0..7 + - Identifier (Token): "SafeMath" # 8..16 + - OpenBrace (Token): "{" # 17..18 + - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - ContractMember (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionKeyword (Token): "function" # 21..29 + - Identifier (Token): "tryAdd" # 30..36 + - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" + - OpenParen (Token): "(" # 36..37 + - Parameters (Rule): # 37..57 "uint256 a, uint256 b" + - Parameter (Rule): # 37..46 "uint256 a" + - TypeName (Rule): # 37..44 "uint256" + - ElementaryType (Rule): # 37..44 "uint256" + - UintKeyword (Token): "uint256" # 37..44 + - Identifier (Token): "a" # 45..46 + - Comma (Token): "," # 46..47 + - Parameter (Rule): # 47..57 " uint256 b" + - TypeName (Rule): # 47..55 " uint256" + - ElementaryType (Rule): # 47..55 " uint256" + - UintKeyword (Token): "uint256" # 48..55 + - Identifier (Token): "b" # 56..57 + - CloseParen (Token): ")" # 57..58 + - FunctionAttributes (Rule): # 58..72 " internal pure" + - FunctionAttribute (Rule): # 58..67 " internal" + - InternalKeyword (Token): "internal" # 59..67 + - FunctionAttribute (Rule): # 67..72 " pure" + - PureKeyword (Token): "pure" # 68..72 + - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" + - ReturnsKeyword (Token): "returns" # 73..80 + - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" + - OpenParen (Token): "(" # 81..82 + - Parameters (Rule): # 82..95 "bool, uint256" + - Parameter (Rule): # 82..86 "bool" + - TypeName (Rule): # 82..86 "bool" + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 + - Comma (Token): "," # 86..87 + - Parameter (Rule): # 87..95 " uint256" + - TypeName (Rule): # 87..95 " uint256" + - ElementaryType (Rule): # 87..95 " uint256" + - UintKeyword (Token): "uint256" # 88..95 + - CloseParen (Token): ")" # 95..96 + - FunctionBody (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - OpenBrace (Token): "{" # 97..98 + - Statements (Rule): [] # 99..99 + - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 + - CloseBrace (Token): "}" # 208..209 + - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.6.0-failure.yml index 4523781b0c..3e56ca7363 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.6.0-failure.yml @@ -13,7 +13,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/input.sol:3:5] │ 3 │ ╭─▶ unchecked { @@ -25,46 +25,56 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - SourceUnitMembersList (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryKeyword (Token): "library" # 0..7 - - Identifier (Token): "SafeMath" # 8..16 - - OpenBrace (Token): "{" # 17..18 - - LibraryMembersList (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "tryAdd" # 30..36 - - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" - - OpenParen (Token): "(" # 36..37 - - ParametersList (Rule): # 37..57 "uint256 a, uint256 b" - - Parameter (Rule): # 37..46 "uint256 a" - - TypeName (Rule): # 37..44 "uint256" - - UnsignedIntegerType (Token): "uint256" # 37..44 - - Identifier (Token): "a" # 45..46 - - Comma (Token): "," # 46..47 - - Parameter (Rule): # 47..57 " uint256 b" - - TypeName (Rule): # 47..55 " uint256" - - UnsignedIntegerType (Token): "uint256" # 48..55 - - Identifier (Token): "b" # 56..57 - - CloseParen (Token): ")" # 57..58 - - FunctionAttributesList (Rule): # 58..72 " internal pure" - - InternalKeyword (Token): "internal" # 59..67 - - PureKeyword (Token): "pure" # 68..72 - - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" - - ReturnsKeyword (Token): "returns" # 73..80 - - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" - - OpenParen (Token): "(" # 81..82 - - ParametersList (Rule): # 82..95 "bool, uint256" - - Parameter (Rule): # 82..86 "bool" - - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 - - Comma (Token): "," # 86..87 - - Parameter (Rule): # 87..95 " uint256" - - TypeName (Rule): # 87..95 " uint256" - - UnsignedIntegerType (Token): "uint256" # 88..95 - - CloseParen (Token): ")" # 95..96 - - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." - - OpenBrace (Token): "{" # 97..98 - - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 - - CloseBrace (Token): "}" # 208..209 - - CloseBrace (Token): "}" # 210..211 + - SourceUnitMembers (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - SourceUnitMember (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryKeyword (Token): "library" # 0..7 + - Identifier (Token): "SafeMath" # 8..16 + - OpenBrace (Token): "{" # 17..18 + - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - ContractMember (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionKeyword (Token): "function" # 21..29 + - Identifier (Token): "tryAdd" # 30..36 + - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" + - OpenParen (Token): "(" # 36..37 + - Parameters (Rule): # 37..57 "uint256 a, uint256 b" + - Parameter (Rule): # 37..46 "uint256 a" + - TypeName (Rule): # 37..44 "uint256" + - ElementaryType (Rule): # 37..44 "uint256" + - UintKeyword (Token): "uint256" # 37..44 + - Identifier (Token): "a" # 45..46 + - Comma (Token): "," # 46..47 + - Parameter (Rule): # 47..57 " uint256 b" + - TypeName (Rule): # 47..55 " uint256" + - ElementaryType (Rule): # 47..55 " uint256" + - UintKeyword (Token): "uint256" # 48..55 + - Identifier (Token): "b" # 56..57 + - CloseParen (Token): ")" # 57..58 + - FunctionAttributes (Rule): # 58..72 " internal pure" + - FunctionAttribute (Rule): # 58..67 " internal" + - InternalKeyword (Token): "internal" # 59..67 + - FunctionAttribute (Rule): # 67..72 " pure" + - PureKeyword (Token): "pure" # 68..72 + - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" + - ReturnsKeyword (Token): "returns" # 73..80 + - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" + - OpenParen (Token): "(" # 81..82 + - Parameters (Rule): # 82..95 "bool, uint256" + - Parameter (Rule): # 82..86 "bool" + - TypeName (Rule): # 82..86 "bool" + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 + - Comma (Token): "," # 86..87 + - Parameter (Rule): # 87..95 " uint256" + - TypeName (Rule): # 87..95 " uint256" + - ElementaryType (Rule): # 87..95 " uint256" + - UintKeyword (Token): "uint256" # 88..95 + - CloseParen (Token): ")" # 95..96 + - FunctionBody (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - OpenBrace (Token): "{" # 97..98 + - Statements (Rule): [] # 99..99 + - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 + - CloseBrace (Token): "}" # 208..209 + - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.7.0-failure.yml index 092cfa3712..f0d7f68116 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.7.0-failure.yml @@ -13,7 +13,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/input.sol:3:5] │ 3 │ ╭─▶ unchecked { @@ -25,46 +25,56 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - SourceUnitMembersList (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryKeyword (Token): "library" # 0..7 - - Identifier (Token): "SafeMath" # 8..16 - - OpenBrace (Token): "{" # 17..18 - - LibraryMembersList (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "tryAdd" # 30..36 - - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" - - OpenParen (Token): "(" # 36..37 - - ParametersList (Rule): # 37..57 "uint256 a, uint256 b" - - Parameter (Rule): # 37..46 "uint256 a" - - TypeName (Rule): # 37..44 "uint256" - - UnsignedIntegerType (Token): "uint256" # 37..44 - - Identifier (Token): "a" # 45..46 - - Comma (Token): "," # 46..47 - - Parameter (Rule): # 47..57 " uint256 b" - - TypeName (Rule): # 47..55 " uint256" - - UnsignedIntegerType (Token): "uint256" # 48..55 - - Identifier (Token): "b" # 56..57 - - CloseParen (Token): ")" # 57..58 - - FunctionAttributesList (Rule): # 58..72 " internal pure" - - InternalKeyword (Token): "internal" # 59..67 - - PureKeyword (Token): "pure" # 68..72 - - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" - - ReturnsKeyword (Token): "returns" # 73..80 - - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" - - OpenParen (Token): "(" # 81..82 - - ParametersList (Rule): # 82..95 "bool, uint256" - - Parameter (Rule): # 82..86 "bool" - - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 - - Comma (Token): "," # 86..87 - - Parameter (Rule): # 87..95 " uint256" - - TypeName (Rule): # 87..95 " uint256" - - UnsignedIntegerType (Token): "uint256" # 88..95 - - CloseParen (Token): ")" # 95..96 - - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." - - OpenBrace (Token): "{" # 97..98 - - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 - - CloseBrace (Token): "}" # 208..209 - - CloseBrace (Token): "}" # 210..211 + - SourceUnitMembers (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - SourceUnitMember (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryKeyword (Token): "library" # 0..7 + - Identifier (Token): "SafeMath" # 8..16 + - OpenBrace (Token): "{" # 17..18 + - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - ContractMember (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionKeyword (Token): "function" # 21..29 + - Identifier (Token): "tryAdd" # 30..36 + - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" + - OpenParen (Token): "(" # 36..37 + - Parameters (Rule): # 37..57 "uint256 a, uint256 b" + - Parameter (Rule): # 37..46 "uint256 a" + - TypeName (Rule): # 37..44 "uint256" + - ElementaryType (Rule): # 37..44 "uint256" + - UintKeyword (Token): "uint256" # 37..44 + - Identifier (Token): "a" # 45..46 + - Comma (Token): "," # 46..47 + - Parameter (Rule): # 47..57 " uint256 b" + - TypeName (Rule): # 47..55 " uint256" + - ElementaryType (Rule): # 47..55 " uint256" + - UintKeyword (Token): "uint256" # 48..55 + - Identifier (Token): "b" # 56..57 + - CloseParen (Token): ")" # 57..58 + - FunctionAttributes (Rule): # 58..72 " internal pure" + - FunctionAttribute (Rule): # 58..67 " internal" + - InternalKeyword (Token): "internal" # 59..67 + - FunctionAttribute (Rule): # 67..72 " pure" + - PureKeyword (Token): "pure" # 68..72 + - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" + - ReturnsKeyword (Token): "returns" # 73..80 + - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" + - OpenParen (Token): "(" # 81..82 + - Parameters (Rule): # 82..95 "bool, uint256" + - Parameter (Rule): # 82..86 "bool" + - TypeName (Rule): # 82..86 "bool" + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 + - Comma (Token): "," # 86..87 + - Parameter (Rule): # 87..95 " uint256" + - TypeName (Rule): # 87..95 " uint256" + - ElementaryType (Rule): # 87..95 " uint256" + - UintKeyword (Token): "uint256" # 88..95 + - CloseParen (Token): ")" # 95..96 + - FunctionBody (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - OpenBrace (Token): "{" # 97..98 + - Statements (Rule): [] # 99..99 + - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 + - CloseBrace (Token): "}" # 208..209 + - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.8.0-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.8.0-success.yml index 160bc34757..0bb9e6e34a 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.8.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.8.0-success.yml @@ -15,109 +15,125 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - SourceUnitMembersList (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryKeyword (Token): "library" # 0..7 - - Identifier (Token): "SafeMath" # 8..16 - - OpenBrace (Token): "{" # 17..18 - - LibraryMembersList (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "tryAdd" # 30..36 - - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" - - OpenParen (Token): "(" # 36..37 - - ParametersList (Rule): # 37..57 "uint256 a, uint256 b" - - Parameter (Rule): # 37..46 "uint256 a" - - TypeName (Rule): # 37..44 "uint256" - - UnsignedIntegerType (Token): "uint256" # 37..44 - - Identifier (Token): "a" # 45..46 - - Comma (Token): "," # 46..47 - - Parameter (Rule): # 47..57 " uint256 b" - - TypeName (Rule): # 47..55 " uint256" - - UnsignedIntegerType (Token): "uint256" # 48..55 - - Identifier (Token): "b" # 56..57 - - CloseParen (Token): ")" # 57..58 - - FunctionAttributesList (Rule): # 58..72 " internal pure" - - InternalKeyword (Token): "internal" # 59..67 - - PureKeyword (Token): "pure" # 68..72 - - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" - - ReturnsKeyword (Token): "returns" # 73..80 - - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" - - OpenParen (Token): "(" # 81..82 - - ParametersList (Rule): # 82..95 "bool, uint256" - - Parameter (Rule): # 82..86 "bool" - - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 - - Comma (Token): "," # 86..87 - - Parameter (Rule): # 87..95 " uint256" - - TypeName (Rule): # 87..95 " uint256" - - UnsignedIntegerType (Token): "uint256" # 88..95 - - CloseParen (Token): ")" # 95..96 - - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." - - OpenBrace (Token): "{" # 97..98 - - StatementsList (Rule): # 99..206 " unchecked {\n uint256 c = a + b;\n if ..." - - Statement (Rule): # 99..206 " unchecked {\n uint256 c = a + b;\n if ..." - - UncheckedBlock (Rule): # 99..206 " unchecked {\n uint256 c = a + b;\n if ..." - - UncheckedKeyword (Token): "unchecked" # 103..112 - - Block (Rule): # 112..206 " {\n uint256 c = a + b;\n if (c < a) retur..." - - OpenBrace (Token): "{" # 113..114 - - StatementsList (Rule): # 115..200 " uint256 c = a + b;\n if (c < a) return (..." - - Statement (Rule): # 115..140 " uint256 c = a + b;\n" - - VariableDeclarationStatement (Rule): # 115..140 " uint256 c = a + b;\n" - - VariableDeclaration (Rule): # 115..130 " uint256 c" - - TypeName (Rule): # 115..128 " uint256" - - UnsignedIntegerType (Token): "uint256" # 121..128 - - Identifier (Token): "c" # 129..130 - - Equal (Token): "=" # 131..132 - - Expression (Rule): # 132..138 " a + b" - - BinaryExpression (Rule): # 132..138 " a + b" - - Expression (Rule): # 132..134 " a" - - Identifier (Token): "a" # 133..134 - - Plus (Token): "+" # 135..136 - - Expression (Rule): # 136..138 " b" - - Identifier (Token): "b" # 137..138 - - Semicolon (Token): ";" # 138..139 - - Statement (Rule): # 140..176 " if (c < a) return (false, 0);\n" - - IfStatement (Rule): # 140..176 " if (c < a) return (false, 0);\n" - - IfKeyword (Token): "if" # 146..148 - - OpenParen (Token): "(" # 149..150 - - Expression (Rule): # 150..155 "c < a" - - BinaryExpression (Rule): # 150..155 "c < a" - - Expression (Rule): # 150..151 "c" - - Identifier (Token): "c" # 150..151 - - LessThan (Token): "<" # 152..153 - - Expression (Rule): # 153..155 " a" - - Identifier (Token): "a" # 154..155 - - CloseParen (Token): ")" # 155..156 - - Statement (Rule): # 156..176 " return (false, 0);\n" - - ReturnStatement (Rule): # 156..176 " return (false, 0);\n" - - ReturnKeyword (Token): "return" # 157..163 - - Expression (Rule): # 163..174 " (false, 0)" - - TupleExpression (Rule): # 163..174 " (false, 0)" - - OpenParen (Token): "(" # 164..165 - - TupleValuesList (Rule): # 165..173 "false, 0" - - Expression (Rule): # 165..170 "false" - - FalseKeyword (Token): "false" # 165..170 - - Comma (Token): "," # 170..171 - - Expression (Rule): # 171..173 " 0" - - NumericExpression (Rule): # 171..173 " 0" - - DecimalLiteral (Token): "0" # 172..173 - - CloseParen (Token): ")" # 173..174 - - Semicolon (Token): ";" # 174..175 - - Statement (Rule): # 176..200 " return (true, c);\n" - - ReturnStatement (Rule): # 176..200 " return (true, c);\n" - - ReturnKeyword (Token): "return" # 182..188 - - Expression (Rule): # 188..198 " (true, c)" - - TupleExpression (Rule): # 188..198 " (true, c)" - - OpenParen (Token): "(" # 189..190 - - TupleValuesList (Rule): # 190..197 "true, c" - - Expression (Rule): # 190..194 "true" - - TrueKeyword (Token): "true" # 190..194 - - Comma (Token): "," # 194..195 - - Expression (Rule): # 195..197 " c" - - Identifier (Token): "c" # 196..197 - - CloseParen (Token): ")" # 197..198 - - Semicolon (Token): ";" # 198..199 - - CloseBrace (Token): "}" # 204..205 - - CloseBrace (Token): "}" # 208..209 - - CloseBrace (Token): "}" # 210..211 + - SourceUnitMembers (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - SourceUnitMember (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryKeyword (Token): "library" # 0..7 + - Identifier (Token): "SafeMath" # 8..16 + - OpenBrace (Token): "{" # 17..18 + - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - ContractMember (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionKeyword (Token): "function" # 21..29 + - Identifier (Token): "tryAdd" # 30..36 + - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" + - OpenParen (Token): "(" # 36..37 + - Parameters (Rule): # 37..57 "uint256 a, uint256 b" + - Parameter (Rule): # 37..46 "uint256 a" + - TypeName (Rule): # 37..44 "uint256" + - ElementaryType (Rule): # 37..44 "uint256" + - UintKeyword (Token): "uint256" # 37..44 + - Identifier (Token): "a" # 45..46 + - Comma (Token): "," # 46..47 + - Parameter (Rule): # 47..57 " uint256 b" + - TypeName (Rule): # 47..55 " uint256" + - ElementaryType (Rule): # 47..55 " uint256" + - UintKeyword (Token): "uint256" # 48..55 + - Identifier (Token): "b" # 56..57 + - CloseParen (Token): ")" # 57..58 + - FunctionAttributes (Rule): # 58..72 " internal pure" + - FunctionAttribute (Rule): # 58..67 " internal" + - InternalKeyword (Token): "internal" # 59..67 + - FunctionAttribute (Rule): # 67..72 " pure" + - PureKeyword (Token): "pure" # 68..72 + - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" + - ReturnsKeyword (Token): "returns" # 73..80 + - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" + - OpenParen (Token): "(" # 81..82 + - Parameters (Rule): # 82..95 "bool, uint256" + - Parameter (Rule): # 82..86 "bool" + - TypeName (Rule): # 82..86 "bool" + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 + - Comma (Token): "," # 86..87 + - Parameter (Rule): # 87..95 " uint256" + - TypeName (Rule): # 87..95 " uint256" + - ElementaryType (Rule): # 87..95 " uint256" + - UintKeyword (Token): "uint256" # 88..95 + - CloseParen (Token): ")" # 95..96 + - FunctionBody (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - OpenBrace (Token): "{" # 97..98 + - Statements (Rule): # 99..206 " unchecked {\n uint256 c = a + b;\n if ..." + - Statement (Rule): # 99..206 " unchecked {\n uint256 c = a + b;\n if ..." + - UncheckedBlock (Rule): # 99..206 " unchecked {\n uint256 c = a + b;\n if ..." + - UncheckedKeyword (Token): "unchecked" # 103..112 + - Block (Rule): # 112..206 " {\n uint256 c = a + b;\n if (c < a) retur..." + - OpenBrace (Token): "{" # 113..114 + - Statements (Rule): # 115..200 " uint256 c = a + b;\n if (c < a) return (..." + - Statement (Rule): # 115..140 " uint256 c = a + b;\n" + - VariableDeclarationStatement (Rule): # 115..140 " uint256 c = a + b;\n" + - VariableDeclarationType (Rule): # 115..128 " uint256" + - TypeName (Rule): # 115..128 " uint256" + - ElementaryType (Rule): # 115..128 " uint256" + - UintKeyword (Token): "uint256" # 121..128 + - Identifier (Token): "c" # 129..130 + - VariableDeclarationValue (Rule): # 130..138 " = a + b" + - Equal (Token): "=" # 131..132 + - Expression (Rule): # 132..138 " a + b" + - BinaryExpression (Rule): # 132..138 " a + b" + - Expression (Rule): # 132..134 " a" + - Identifier (Token): "a" # 133..134 + - Plus (Token): "+" # 135..136 + - Expression (Rule): # 136..138 " b" + - Identifier (Token): "b" # 137..138 + - Semicolon (Token): ";" # 138..139 + - Statement (Rule): # 140..200 " if (c < a) return (false, 0);\n return (..." + - IfStatement (Rule): # 140..200 " if (c < a) return (false, 0);\n return (..." + - IfKeyword (Token): "if" # 146..148 + - OpenParen (Token): "(" # 149..150 + - Expression (Rule): # 150..155 "c < a" + - BinaryExpression (Rule): # 150..155 "c < a" + - Expression (Rule): # 150..151 "c" + - Identifier (Token): "c" # 150..151 + - LessThan (Token): "<" # 152..153 + - Expression (Rule): # 153..155 " a" + - Identifier (Token): "a" # 154..155 + - CloseParen (Token): ")" # 155..156 + - Statement (Rule): # 156..176 " return (false, 0);\n" + - ReturnStatement (Rule): # 156..176 " return (false, 0);\n" + - ReturnKeyword (Token): "return" # 157..163 + - Expression (Rule): # 163..174 " (false, 0)" + - TupleExpression (Rule): # 163..174 " (false, 0)" + - OpenParen (Token): "(" # 164..165 + - TupleValues (Rule): # 165..173 "false, 0" + - TupleValue (Rule): # 165..170 "false" + - Expression (Rule): # 165..170 "false" + - FalseKeyword (Token): "false" # 165..170 + - Comma (Token): "," # 170..171 + - TupleValue (Rule): # 171..173 " 0" + - Expression (Rule): # 171..173 " 0" + - DecimalNumberExpression (Rule): # 171..173 " 0" + - DecimalLiteral (Token): "0" # 172..173 + - CloseParen (Token): ")" # 173..174 + - Semicolon (Token): ";" # 174..175 + - ElseBranch (Rule): # 176..200 " return (true, c);\n" + - Statement (Rule): # 176..200 " return (true, c);\n" + - ReturnStatement (Rule): # 176..200 " return (true, c);\n" + - ReturnKeyword (Token): "return" # 182..188 + - Expression (Rule): # 188..198 " (true, c)" + - TupleExpression (Rule): # 188..198 " (true, c)" + - OpenParen (Token): "(" # 189..190 + - TupleValues (Rule): # 190..197 "true, c" + - TupleValue (Rule): # 190..194 "true" + - Expression (Rule): # 190..194 "true" + - TrueKeyword (Token): "true" # 190..194 + - Comma (Token): "," # 194..195 + - TupleValue (Rule): # 195..197 " c" + - Expression (Rule): # 195..197 " c" + - Identifier (Token): "c" # 196..197 + - CloseParen (Token): ")" # 197..198 + - Semicolon (Token): ";" # 198..199 + - CloseBrace (Token): "}" # 204..205 + - CloseBrace (Token): "}" # 208..209 + - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/empty_file/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/empty_file/generated/0.4.11-success.yml index 764a111789..8163379115 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/empty_file/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/empty_file/generated/0.4.11-success.yml @@ -6,3 +6,4 @@ Errors: [] Tree: - SourceUnit (Rule): [] # 0..0 + - SourceUnitMembers (Rule): [] # 0..0 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11-failure.yml new file mode 100644 index 0000000000..985f184657 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11-failure.yml @@ -0,0 +1,33 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract X { } │ 0..14 + 2 │ │ 15..19 + 3 │ // spaces before this │ 20..41 + 4 │ │ 42..42 + 5 │ /* new lines after this */ │ 43..69 + 6 │ │ 70..70 + +Errors: # 1 total + - > + Error: Expected ContractKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/input.sol:2:1] + │ + 2 │ ╭─▶ + ┆ ┆ + 6 │ ├─▶ + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..71 "contract X { }\n \n// spaces before this\n\n/* new ..." + - SourceUnitMembers (Rule): # 0..15 "contract X { }\n" + - SourceUnitMember (Rule): # 0..15 "contract X { }\n" + - ContractDefinition (Rule): # 0..15 "contract X { }\n" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "X" # 9..10 + - OpenBrace (Token): "{" # 11..12 + - ContractMembers (Rule): [] # 12..12 + - CloseBrace (Token): "}" # 13..14 + - SKIPPED (Token): " \n// spaces before this\n\n/* new lines after thi..." # 15..71 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11-success.yml deleted file mode 100644 index 20f76a55e1..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11-success.yml +++ /dev/null @@ -1,23 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ contract X { } │ 0..14 - 2 │ │ 15..19 - 3 │ // spaces before this │ 20..41 - 4 │ │ 42..42 - 5 │ /* new lines after this */ │ 43..69 - 6 │ │ 70..70 - -Errors: [] - -Tree: - - SourceUnit (Rule): # 0..71 "contract X { }\n \n// spaces before this\n\n/* new ..." - - SourceUnitMembersList (Rule): # 0..15 "contract X { }\n" - - ContractDefinition (Rule): # 0..15 "contract X { }\n" - - ContractKeyword (Token): "contract" # 0..8 - - Identifier (Token): "X" # 9..10 - - OpenBrace (Token): "{" # 11..12 - - CloseBrace (Token): "}" # 13..14 - - EndOfFileTrivia (Rule): # 15..71 " \n// spaces before this\n\n/* new lines after thi..." - - SingleLineComment (Trivia): "// spaces before this" # 20..41 - - MultilineComment (Trivia): "/* new lines after this */" # 43..69 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.6.0-failure.yml new file mode 100644 index 0000000000..6f04fef6c9 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.6.0-failure.yml @@ -0,0 +1,33 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract X { } │ 0..14 + 2 │ │ 15..19 + 3 │ // spaces before this │ 20..41 + 4 │ │ 42..42 + 5 │ /* new lines after this */ │ 43..69 + 6 │ │ 70..70 + +Errors: # 1 total + - > + Error: Expected ContractKeyword or EnumKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword or StructKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/input.sol:2:1] + │ + 2 │ ╭─▶ + ┆ ┆ + 6 │ ├─▶ + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..71 "contract X { }\n \n// spaces before this\n\n/* new ..." + - SourceUnitMembers (Rule): # 0..15 "contract X { }\n" + - SourceUnitMember (Rule): # 0..15 "contract X { }\n" + - ContractDefinition (Rule): # 0..15 "contract X { }\n" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "X" # 9..10 + - OpenBrace (Token): "{" # 11..12 + - ContractMembers (Rule): [] # 12..12 + - CloseBrace (Token): "}" # 13..14 + - SKIPPED (Token): " \n// spaces before this\n\n/* new lines after thi..." # 15..71 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.7.1-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.7.1-failure.yml new file mode 100644 index 0000000000..c95640d5fb --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.7.1-failure.yml @@ -0,0 +1,33 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract X { } │ 0..14 + 2 │ │ 15..19 + 3 │ // spaces before this │ 20..41 + 4 │ │ 42..42 + 5 │ /* new lines after this */ │ 43..69 + 6 │ │ 70..70 + +Errors: # 1 total + - > + Error: Expected ContractKeyword or EnumKeyword or FunctionKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword or StructKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/input.sol:2:1] + │ + 2 │ ╭─▶ + ┆ ┆ + 6 │ ├─▶ + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..71 "contract X { }\n \n// spaces before this\n\n/* new ..." + - SourceUnitMembers (Rule): # 0..15 "contract X { }\n" + - SourceUnitMember (Rule): # 0..15 "contract X { }\n" + - ContractDefinition (Rule): # 0..15 "contract X { }\n" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "X" # 9..10 + - OpenBrace (Token): "{" # 11..12 + - ContractMembers (Rule): [] # 12..12 + - CloseBrace (Token): "}" # 13..14 + - SKIPPED (Token): " \n// spaces before this\n\n/* new lines after thi..." # 15..71 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.7.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.7.4-failure.yml new file mode 100644 index 0000000000..4fee184c98 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.7.4-failure.yml @@ -0,0 +1,33 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract X { } │ 0..14 + 2 │ │ 15..19 + 3 │ // spaces before this │ 20..41 + 4 │ │ 42..42 + 5 │ /* new lines after this */ │ 43..69 + 6 │ │ 70..70 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or BytesKeyword or ContractKeyword or EnumKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/input.sol:2:1] + │ + 2 │ ╭─▶ + ┆ ┆ + 6 │ ├─▶ + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..71 "contract X { }\n \n// spaces before this\n\n/* new ..." + - SourceUnitMembers (Rule): # 0..15 "contract X { }\n" + - SourceUnitMember (Rule): # 0..15 "contract X { }\n" + - ContractDefinition (Rule): # 0..15 "contract X { }\n" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "X" # 9..10 + - OpenBrace (Token): "{" # 11..12 + - ContractMembers (Rule): [] # 12..12 + - CloseBrace (Token): "}" # 13..14 + - SKIPPED (Token): " \n// spaces before this\n\n/* new lines after thi..." # 15..71 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.0-failure.yml new file mode 100644 index 0000000000..3ce38da0a2 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.0-failure.yml @@ -0,0 +1,33 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract X { } │ 0..14 + 2 │ │ 15..19 + 3 │ // spaces before this │ 20..41 + 4 │ │ 42..42 + 5 │ /* new lines after this */ │ 43..69 + 6 │ │ 70..70 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/input.sol:2:1] + │ + 2 │ ╭─▶ + ┆ ┆ + 6 │ ├─▶ + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..71 "contract X { }\n \n// spaces before this\n\n/* new ..." + - SourceUnitMembers (Rule): # 0..15 "contract X { }\n" + - SourceUnitMember (Rule): # 0..15 "contract X { }\n" + - ContractDefinition (Rule): # 0..15 "contract X { }\n" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "X" # 9..10 + - OpenBrace (Token): "{" # 11..12 + - ContractMembers (Rule): [] # 12..12 + - CloseBrace (Token): "}" # 13..14 + - SKIPPED (Token): " \n// spaces before this\n\n/* new lines after thi..." # 15..71 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.13-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.13-failure.yml new file mode 100644 index 0000000000..8e525cc69b --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.13-failure.yml @@ -0,0 +1,33 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract X { } │ 0..14 + 2 │ │ 15..19 + 3 │ // spaces before this │ 20..41 + 4 │ │ 42..42 + 5 │ /* new lines after this */ │ 43..69 + 6 │ │ 70..70 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or ErrorKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UsingKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/input.sol:2:1] + │ + 2 │ ╭─▶ + ┆ ┆ + 6 │ ├─▶ + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..71 "contract X { }\n \n// spaces before this\n\n/* new ..." + - SourceUnitMembers (Rule): # 0..15 "contract X { }\n" + - SourceUnitMember (Rule): # 0..15 "contract X { }\n" + - ContractDefinition (Rule): # 0..15 "contract X { }\n" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "X" # 9..10 + - OpenBrace (Token): "{" # 11..12 + - ContractMembers (Rule): [] # 12..12 + - CloseBrace (Token): "}" # 13..14 + - SKIPPED (Token): " \n// spaces before this\n\n/* new lines after thi..." # 15..71 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.22-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.22-failure.yml new file mode 100644 index 0000000000..12e588c5d7 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.22-failure.yml @@ -0,0 +1,33 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract X { } │ 0..14 + 2 │ │ 15..19 + 3 │ // spaces before this │ 20..41 + 4 │ │ 42..42 + 5 │ /* new lines after this */ │ 43..69 + 6 │ │ 70..70 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or ErrorKeyword or EventKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UsingKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/input.sol:2:1] + │ + 2 │ ╭─▶ + ┆ ┆ + 6 │ ├─▶ + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..71 "contract X { }\n \n// spaces before this\n\n/* new ..." + - SourceUnitMembers (Rule): # 0..15 "contract X { }\n" + - SourceUnitMember (Rule): # 0..15 "contract X { }\n" + - ContractDefinition (Rule): # 0..15 "contract X { }\n" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "X" # 9..10 + - OpenBrace (Token): "{" # 11..12 + - ContractMembers (Rule): [] # 12..12 + - CloseBrace (Token): "}" # 13..14 + - SKIPPED (Token): " \n// spaces before this\n\n/* new lines after thi..." # 15..71 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.4-failure.yml new file mode 100644 index 0000000000..cf19cd8a57 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.4-failure.yml @@ -0,0 +1,33 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract X { } │ 0..14 + 2 │ │ 15..19 + 3 │ // spaces before this │ 20..41 + 4 │ │ 42..42 + 5 │ /* new lines after this */ │ 43..69 + 6 │ │ 70..70 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or ErrorKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/input.sol:2:1] + │ + 2 │ ╭─▶ + ┆ ┆ + 6 │ ├─▶ + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..71 "contract X { }\n \n// spaces before this\n\n/* new ..." + - SourceUnitMembers (Rule): # 0..15 "contract X { }\n" + - SourceUnitMember (Rule): # 0..15 "contract X { }\n" + - ContractDefinition (Rule): # 0..15 "contract X { }\n" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "X" # 9..10 + - OpenBrace (Token): "{" # 11..12 + - ContractMembers (Rule): [] # 12..12 + - CloseBrace (Token): "}" # 13..14 + - SKIPPED (Token): " \n// spaces before this\n\n/* new lines after thi..." # 15..71 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.8-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.8-failure.yml new file mode 100644 index 0000000000..52441f80d6 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.8.8-failure.yml @@ -0,0 +1,33 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract X { } │ 0..14 + 2 │ │ 15..19 + 3 │ // spaces before this │ 20..41 + 4 │ │ 42..42 + 5 │ /* new lines after this */ │ 43..69 + 6 │ │ 70..70 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or ErrorKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or TypeKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/input.sol:2:1] + │ + 2 │ ╭─▶ + ┆ ┆ + 6 │ ├─▶ + │ │ + │ ╰────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..71 "contract X { }\n \n// spaces before this\n\n/* new ..." + - SourceUnitMembers (Rule): # 0..15 "contract X { }\n" + - SourceUnitMember (Rule): # 0..15 "contract X { }\n" + - ContractDefinition (Rule): # 0..15 "contract X { }\n" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "X" # 9..10 + - OpenBrace (Token): "{" # 11..12 + - ContractMembers (Rule): [] # 12..12 + - CloseBrace (Token): "}" # 13..14 + - SKIPPED (Token): " \n// spaces before this\n\n/* new lines after thi..." # 15..71 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.4.11-failure.yml index 1bd97cba98..c6e9c11dcd 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.4.11-failure.yml @@ -29,10 +29,10 @@ Source: > Errors: # 1 total - > - Error: Expected EndOfLine or MultilineComment or SingleLineComment or Whitespace. - ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol:5:1] + Error: Expected ContractKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol:4:1] │ - 5 │ ╭─▶ using A for B; + 4 │ ╭─▶ ┆ ┆ 25 │ ├─▶ event E1(uint256 value); │ │ @@ -41,24 +41,27 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' - - SourceUnitMembersList (Rule): # 0..42 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n' - - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" - - PragmaKeyword (Token): "pragma" # 0..6 - - VersionPragma (Rule): # 6..21 " solidity 0.0.0" - - SolidityKeyword (Token): "solidity" # 7..15 - - VersionPragmaExpressionsList (Rule): # 15..21 " 0.0.0" - - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" - - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" - - VersionPragmaValue (Token): "0" # 16..17 - - Period (Token): "." # 17..18 - - VersionPragmaValue (Token): "0" # 18..19 - - Period (Token): "." # 19..20 - - VersionPragmaValue (Token): "0" # 20..21 - - Semicolon (Token): ";" # 21..22 - - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' - - ImportKeyword (Token): "import" # 24..30 - - PathImport (Rule): # 30..40 ' "foo.sol"' - - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 - - Semicolon (Token): ";" # 40..41 - - EndOfFileTrivia (Rule): "\n" # 42..43 - - SKIPPED (Token): "using A for B;\n\ncontract C { }\n\ninterface I { }\n\nl..." # 43..243 + - SourceUnitMembers (Rule): # 0..42 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n' + - SourceUnitMember (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - Pragma (Rule): # 6..21 " solidity 0.0.0" + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - SourceUnitMember (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - ImportSymbol (Rule): # 30..40 ' "foo.sol"' + - PathImportSymbol (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 + - SKIPPED (Token): "\nusing A for B;\n\ncontract C { }\n\ninterface I { }\n\n..." # 42..243 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.6.0-failure.yml new file mode 100644 index 0000000000..1bb6878c69 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.6.0-failure.yml @@ -0,0 +1,67 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ pragma solidity 0.0.0; │ 0..22 + 2 │ │ 23..23 + 3 │ import "foo.sol"; │ 24..41 + 4 │ │ 42..42 + 5 │ using A for B; │ 43..57 + 6 │ │ 58..58 + 7 │ contract C { } │ 59..73 + 8 │ │ 74..74 + 9 │ interface I { } │ 75..90 + 10 │ │ 91..91 + 11 │ library L { } │ 92..105 + 12 │ │ 106..106 + 13 │ struct S { } │ 107..119 + 14 │ │ 120..120 + 15 │ enum E { } │ 121..131 + 16 │ │ 132..132 + 17 │ uint32 constant x = 0; │ 133..155 + 18 │ │ 156..156 + 19 │ function f() public { } │ 157..180 + 20 │ │ 181..181 + 21 │ error E1(string); │ 182..199 + 22 │ │ 200..200 + 23 │ type T is bool; │ 201..216 + 24 │ │ 217..217 + 25 │ event E1(uint256 value); │ 218..242 + +Errors: # 1 total + - > + Error: Expected ContractKeyword or EnumKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword or StructKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol:4:1] + │ + 4 │ ╭─▶ + ┆ ┆ + 25 │ ├─▶ event E1(uint256 value); + │ │ + │ ╰────────────────────────────── Error occurred here. + ────╯ + +Tree: + - SourceUnit (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' + - SourceUnitMembers (Rule): # 0..42 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n' + - SourceUnitMember (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - Pragma (Rule): # 6..21 " solidity 0.0.0" + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - SourceUnitMember (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - ImportSymbol (Rule): # 30..40 ' "foo.sol"' + - PathImportSymbol (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 + - SKIPPED (Token): "\nusing A for B;\n\ncontract C { }\n\ninterface I { }\n\n..." # 42..243 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.7.1-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.7.1-failure.yml new file mode 100644 index 0000000000..7c637a44d4 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.7.1-failure.yml @@ -0,0 +1,67 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ pragma solidity 0.0.0; │ 0..22 + 2 │ │ 23..23 + 3 │ import "foo.sol"; │ 24..41 + 4 │ │ 42..42 + 5 │ using A for B; │ 43..57 + 6 │ │ 58..58 + 7 │ contract C { } │ 59..73 + 8 │ │ 74..74 + 9 │ interface I { } │ 75..90 + 10 │ │ 91..91 + 11 │ library L { } │ 92..105 + 12 │ │ 106..106 + 13 │ struct S { } │ 107..119 + 14 │ │ 120..120 + 15 │ enum E { } │ 121..131 + 16 │ │ 132..132 + 17 │ uint32 constant x = 0; │ 133..155 + 18 │ │ 156..156 + 19 │ function f() public { } │ 157..180 + 20 │ │ 181..181 + 21 │ error E1(string); │ 182..199 + 22 │ │ 200..200 + 23 │ type T is bool; │ 201..216 + 24 │ │ 217..217 + 25 │ event E1(uint256 value); │ 218..242 + +Errors: # 1 total + - > + Error: Expected ContractKeyword or EnumKeyword or FunctionKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword or StructKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol:4:1] + │ + 4 │ ╭─▶ + ┆ ┆ + 25 │ ├─▶ event E1(uint256 value); + │ │ + │ ╰────────────────────────────── Error occurred here. + ────╯ + +Tree: + - SourceUnit (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' + - SourceUnitMembers (Rule): # 0..42 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n' + - SourceUnitMember (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - Pragma (Rule): # 6..21 " solidity 0.0.0" + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - SourceUnitMember (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - ImportSymbol (Rule): # 30..40 ' "foo.sol"' + - PathImportSymbol (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 + - SKIPPED (Token): "\nusing A for B;\n\ncontract C { }\n\ninterface I { }\n\n..." # 42..243 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.7.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.7.4-failure.yml new file mode 100644 index 0000000000..31d556c1ad --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.7.4-failure.yml @@ -0,0 +1,67 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ pragma solidity 0.0.0; │ 0..22 + 2 │ │ 23..23 + 3 │ import "foo.sol"; │ 24..41 + 4 │ │ 42..42 + 5 │ using A for B; │ 43..57 + 6 │ │ 58..58 + 7 │ contract C { } │ 59..73 + 8 │ │ 74..74 + 9 │ interface I { } │ 75..90 + 10 │ │ 91..91 + 11 │ library L { } │ 92..105 + 12 │ │ 106..106 + 13 │ struct S { } │ 107..119 + 14 │ │ 120..120 + 15 │ enum E { } │ 121..131 + 16 │ │ 132..132 + 17 │ uint32 constant x = 0; │ 133..155 + 18 │ │ 156..156 + 19 │ function f() public { } │ 157..180 + 20 │ │ 181..181 + 21 │ error E1(string); │ 182..199 + 22 │ │ 200..200 + 23 │ type T is bool; │ 201..216 + 24 │ │ 217..217 + 25 │ event E1(uint256 value); │ 218..242 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or BytesKeyword or ContractKeyword or EnumKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol:4:1] + │ + 4 │ ╭─▶ + ┆ ┆ + 25 │ ├─▶ event E1(uint256 value); + │ │ + │ ╰────────────────────────────── Error occurred here. + ────╯ + +Tree: + - SourceUnit (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' + - SourceUnitMembers (Rule): # 0..42 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n' + - SourceUnitMember (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - Pragma (Rule): # 6..21 " solidity 0.0.0" + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - SourceUnitMember (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - ImportSymbol (Rule): # 30..40 ' "foo.sol"' + - PathImportSymbol (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 + - SKIPPED (Token): "\nusing A for B;\n\ncontract C { }\n\ninterface I { }\n\n..." # 42..243 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.0-failure.yml new file mode 100644 index 0000000000..b30dec334d --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.0-failure.yml @@ -0,0 +1,67 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ pragma solidity 0.0.0; │ 0..22 + 2 │ │ 23..23 + 3 │ import "foo.sol"; │ 24..41 + 4 │ │ 42..42 + 5 │ using A for B; │ 43..57 + 6 │ │ 58..58 + 7 │ contract C { } │ 59..73 + 8 │ │ 74..74 + 9 │ interface I { } │ 75..90 + 10 │ │ 91..91 + 11 │ library L { } │ 92..105 + 12 │ │ 106..106 + 13 │ struct S { } │ 107..119 + 14 │ │ 120..120 + 15 │ enum E { } │ 121..131 + 16 │ │ 132..132 + 17 │ uint32 constant x = 0; │ 133..155 + 18 │ │ 156..156 + 19 │ function f() public { } │ 157..180 + 20 │ │ 181..181 + 21 │ error E1(string); │ 182..199 + 22 │ │ 200..200 + 23 │ type T is bool; │ 201..216 + 24 │ │ 217..217 + 25 │ event E1(uint256 value); │ 218..242 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol:4:1] + │ + 4 │ ╭─▶ + ┆ ┆ + 25 │ ├─▶ event E1(uint256 value); + │ │ + │ ╰────────────────────────────── Error occurred here. + ────╯ + +Tree: + - SourceUnit (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' + - SourceUnitMembers (Rule): # 0..42 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n' + - SourceUnitMember (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - Pragma (Rule): # 6..21 " solidity 0.0.0" + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - SourceUnitMember (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - ImportSymbol (Rule): # 30..40 ' "foo.sol"' + - PathImportSymbol (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 + - SKIPPED (Token): "\nusing A for B;\n\ncontract C { }\n\ninterface I { }\n\n..." # 42..243 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.13-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.13-failure.yml index 38199a8fc8..bc557d4ac9 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.13-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.13-failure.yml @@ -29,106 +29,134 @@ Source: > Errors: # 1 total - > - Error: Expected EndOfLine or MultilineComment or SingleLineComment or Whitespace. - ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol:25:1] + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or ErrorKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UsingKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol:24:1] │ - 25 │ event E1(uint256 value); - │ ────────────┬──────────── - │ ╰────────────── Error occurred here. + 24 │ ╭─▶ + 25 │ ├─▶ event E1(uint256 value); + │ │ + │ ╰────────────────────────────── Error occurred here. ────╯ Tree: - SourceUnit (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' - - SourceUnitMembersList (Rule): # 0..217 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' - - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" - - PragmaKeyword (Token): "pragma" # 0..6 - - VersionPragma (Rule): # 6..21 " solidity 0.0.0" - - SolidityKeyword (Token): "solidity" # 7..15 - - VersionPragmaExpressionsList (Rule): # 15..21 " 0.0.0" - - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" - - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" - - VersionPragmaValue (Token): "0" # 16..17 - - Period (Token): "." # 17..18 - - VersionPragmaValue (Token): "0" # 18..19 - - Period (Token): "." # 19..20 - - VersionPragmaValue (Token): "0" # 20..21 - - Semicolon (Token): ";" # 21..22 - - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' - - ImportKeyword (Token): "import" # 24..30 - - PathImport (Rule): # 30..40 ' "foo.sol"' - - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 - - Semicolon (Token): ";" # 40..41 - - UsingDirective (Rule): # 42..58 "\nusing A for B;\n" - - UsingKeyword (Token): "using" # 43..48 - - UsingDirectivePath (Rule): # 48..50 " A" - - IdentifierPath (Rule): # 48..50 " A" - - Identifier (Token): "A" # 49..50 - - ForKeyword (Token): "for" # 51..54 - - TypeName (Rule): # 54..56 " B" - - IdentifierPath (Rule): # 54..56 " B" - - Identifier (Token): "B" # 55..56 - - Semicolon (Token): ";" # 56..57 - - ContractDefinition (Rule): # 58..74 "\ncontract C { }\n" - - ContractKeyword (Token): "contract" # 59..67 - - Identifier (Token): "C" # 68..69 - - OpenBrace (Token): "{" # 70..71 - - CloseBrace (Token): "}" # 72..73 - - InterfaceDefinition (Rule): # 74..91 "\ninterface I { }\n" - - InterfaceKeyword (Token): "interface" # 75..84 - - Identifier (Token): "I" # 85..86 - - OpenBrace (Token): "{" # 87..88 - - CloseBrace (Token): "}" # 89..90 - - LibraryDefinition (Rule): # 91..106 "\nlibrary L { }\n" - - LibraryKeyword (Token): "library" # 92..99 - - Identifier (Token): "L" # 100..101 - - OpenBrace (Token): "{" # 102..103 - - CloseBrace (Token): "}" # 104..105 - - StructDefinition (Rule): # 106..120 "\nstruct S { }\n" - - StructKeyword (Token): "struct" # 107..113 - - Identifier (Token): "S" # 114..115 - - OpenBrace (Token): "{" # 116..117 - - CloseBrace (Token): "}" # 118..119 - - EnumDefinition (Rule): # 120..132 "\nenum E { }\n" - - EnumKeyword (Token): "enum" # 121..125 - - Identifier (Token): "E" # 126..127 - - OpenBrace (Token): "{" # 128..129 - - CloseBrace (Token): "}" # 130..131 - - ConstantDefinition (Rule): # 132..156 "\nuint32 constant x = 0;\n" - - TypeName (Rule): # 132..139 "\nuint32" - - UnsignedIntegerType (Token): "uint32" # 133..139 - - ConstantKeyword (Token): "constant" # 140..148 - - Identifier (Token): "x" # 149..150 - - Equal (Token): "=" # 151..152 - - Expression (Rule): # 152..154 " 0" - - NumericExpression (Rule): # 152..154 " 0" - - DecimalLiteral (Token): "0" # 153..154 - - Semicolon (Token): ";" # 154..155 - - FunctionDefinition (Rule): # 156..181 "\nfunction f() public { }\n" - - FunctionKeyword (Token): "function" # 157..165 - - Identifier (Token): "f" # 166..167 - - ParametersDeclaration (Rule): # 167..169 "()" - - OpenParen (Token): "(" # 167..168 - - CloseParen (Token): ")" # 168..169 - - FunctionAttributesList (Rule): # 169..176 " public" - - PublicKeyword (Token): "public" # 170..176 - - Block (Rule): # 176..181 " { }\n" - - OpenBrace (Token): "{" # 177..178 - - CloseBrace (Token): "}" # 179..180 - - ErrorDefinition (Rule): # 181..200 "\nerror E1(string);\n" - - ErrorKeyword (Token): "error" # 182..187 - - Identifier (Token): "E1" # 188..190 - - OpenParen (Token): "(" # 190..191 - - ErrorParametersList (Rule): # 191..197 "string" - - ErrorParameter (Rule): # 191..197 "string" - - TypeName (Rule): # 191..197 "string" - - StringKeyword (Token): "string" # 191..197 - - CloseParen (Token): ")" # 197..198 - - Semicolon (Token): ";" # 198..199 - - UserDefinedValueTypeDefinition (Rule): # 200..217 "\ntype T is bool;\n" - - TypeKeyword (Token): "type" # 201..205 - - Identifier (Token): "T" # 206..207 - - IsKeyword (Token): "is" # 208..210 - - BoolKeyword (Token): "bool" # 211..215 - - Semicolon (Token): ";" # 215..216 - - EndOfFileTrivia (Rule): "\n" # 217..218 - - SKIPPED (Token): "event E1(uint256 value);\n" # 218..243 + - SourceUnitMembers (Rule): # 0..217 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' + - SourceUnitMember (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - Pragma (Rule): # 6..21 " solidity 0.0.0" + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - SourceUnitMember (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - ImportSymbol (Rule): # 30..40 ' "foo.sol"' + - PathImportSymbol (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 + - SourceUnitMember (Rule): # 42..58 "\nusing A for B;\n" + - UsingDirective (Rule): # 42..58 "\nusing A for B;\n" + - UsingKeyword (Token): "using" # 43..48 + - UsingSymbol (Rule): # 48..50 " A" + - IdentifierPath (Rule): # 48..50 " A" + - Identifier (Token): "A" # 49..50 + - ForKeyword (Token): "for" # 51..54 + - UsingTarget (Rule): # 54..56 " B" + - TypeName (Rule): # 54..56 " B" + - IdentifierPath (Rule): # 54..56 " B" + - Identifier (Token): "B" # 55..56 + - Semicolon (Token): ";" # 56..57 + - SourceUnitMember (Rule): # 58..74 "\ncontract C { }\n" + - ContractDefinition (Rule): # 58..74 "\ncontract C { }\n" + - ContractKeyword (Token): "contract" # 59..67 + - Identifier (Token): "C" # 68..69 + - OpenBrace (Token): "{" # 70..71 + - ContractMembers (Rule): [] # 71..71 + - CloseBrace (Token): "}" # 72..73 + - SourceUnitMember (Rule): # 74..91 "\ninterface I { }\n" + - InterfaceDefinition (Rule): # 74..91 "\ninterface I { }\n" + - InterfaceKeyword (Token): "interface" # 75..84 + - Identifier (Token): "I" # 85..86 + - OpenBrace (Token): "{" # 87..88 + - InterfaceMembers (Rule): [] # 88..88 + - CloseBrace (Token): "}" # 89..90 + - SourceUnitMember (Rule): # 91..106 "\nlibrary L { }\n" + - LibraryDefinition (Rule): # 91..106 "\nlibrary L { }\n" + - LibraryKeyword (Token): "library" # 92..99 + - Identifier (Token): "L" # 100..101 + - OpenBrace (Token): "{" # 102..103 + - LibraryMembers (Rule): [] # 103..103 + - CloseBrace (Token): "}" # 104..105 + - SourceUnitMember (Rule): # 106..120 "\nstruct S { }\n" + - StructDefinition (Rule): # 106..120 "\nstruct S { }\n" + - StructKeyword (Token): "struct" # 107..113 + - Identifier (Token): "S" # 114..115 + - OpenBrace (Token): "{" # 116..117 + - StructMembers (Rule): [] # 117..117 + - CloseBrace (Token): "}" # 118..119 + - SourceUnitMember (Rule): # 120..132 "\nenum E { }\n" + - EnumDefinition (Rule): # 120..132 "\nenum E { }\n" + - EnumKeyword (Token): "enum" # 121..125 + - Identifier (Token): "E" # 126..127 + - OpenBrace (Token): "{" # 128..129 + - EnumMembers (Rule): [] # 129..129 + - CloseBrace (Token): "}" # 130..131 + - SourceUnitMember (Rule): # 132..156 "\nuint32 constant x = 0;\n" + - ConstantDefinition (Rule): # 132..156 "\nuint32 constant x = 0;\n" + - TypeName (Rule): # 132..139 "\nuint32" + - ElementaryType (Rule): # 132..139 "\nuint32" + - UintKeyword (Token): "uint32" # 133..139 + - ConstantKeyword (Token): "constant" # 140..148 + - Identifier (Token): "x" # 149..150 + - Equal (Token): "=" # 151..152 + - Expression (Rule): # 152..154 " 0" + - DecimalNumberExpression (Rule): # 152..154 " 0" + - DecimalLiteral (Token): "0" # 153..154 + - Semicolon (Token): ";" # 154..155 + - SourceUnitMember (Rule): # 156..181 "\nfunction f() public { }\n" + - FunctionDefinition (Rule): # 156..181 "\nfunction f() public { }\n" + - FunctionKeyword (Token): "function" # 157..165 + - Identifier (Token): "f" # 166..167 + - ParametersDeclaration (Rule): # 167..169 "()" + - OpenParen (Token): "(" # 167..168 + - Parameters (Rule): [] # 168..168 + - CloseParen (Token): ")" # 168..169 + - FunctionAttributes (Rule): # 169..176 " public" + - FunctionAttribute (Rule): # 169..176 " public" + - PublicKeyword (Token): "public" # 170..176 + - FunctionBody (Rule): # 176..181 " { }\n" + - Block (Rule): # 176..181 " { }\n" + - OpenBrace (Token): "{" # 177..178 + - Statements (Rule): [] # 178..178 + - CloseBrace (Token): "}" # 179..180 + - SourceUnitMember (Rule): # 181..200 "\nerror E1(string);\n" + - ErrorDefinition (Rule): # 181..200 "\nerror E1(string);\n" + - ErrorKeyword (Token): "error" # 182..187 + - Identifier (Token): "E1" # 188..190 + - ErrorParametersDeclaration (Rule): # 190..198 "(string)" + - OpenParen (Token): "(" # 190..191 + - ErrorParameters (Rule): # 191..197 "string" + - ErrorParameter (Rule): # 191..197 "string" + - TypeName (Rule): # 191..197 "string" + - ElementaryType (Rule): # 191..197 "string" + - StringKeyword (Token): "string" # 191..197 + - CloseParen (Token): ")" # 197..198 + - Semicolon (Token): ";" # 198..199 + - SourceUnitMember (Rule): # 200..217 "\ntype T is bool;\n" + - UserDefinedValueTypeDefinition (Rule): # 200..217 "\ntype T is bool;\n" + - TypeKeyword (Token): "type" # 201..205 + - Identifier (Token): "T" # 206..207 + - IsKeyword (Token): "is" # 208..210 + - ElementaryType (Rule): # 210..215 " bool" + - BoolKeyword (Token): "bool" # 211..215 + - Semicolon (Token): ";" # 215..216 + - SKIPPED (Token): "\nevent E1(uint256 value);\n" # 217..243 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.22-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.22-success.yml index 681f4e6046..71ecf6e8ed 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.22-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.22-success.yml @@ -31,105 +31,136 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' - - SourceUnitMembersList (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' - - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" - - PragmaKeyword (Token): "pragma" # 0..6 - - VersionPragma (Rule): # 6..21 " solidity 0.0.0" - - SolidityKeyword (Token): "solidity" # 7..15 - - VersionPragmaExpressionsList (Rule): # 15..21 " 0.0.0" - - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" - - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" - - VersionPragmaValue (Token): "0" # 16..17 - - Period (Token): "." # 17..18 - - VersionPragmaValue (Token): "0" # 18..19 - - Period (Token): "." # 19..20 - - VersionPragmaValue (Token): "0" # 20..21 - - Semicolon (Token): ";" # 21..22 - - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' - - ImportKeyword (Token): "import" # 24..30 - - PathImport (Rule): # 30..40 ' "foo.sol"' - - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 - - Semicolon (Token): ";" # 40..41 - - UsingDirective (Rule): # 42..58 "\nusing A for B;\n" - - UsingKeyword (Token): "using" # 43..48 - - UsingDirectivePath (Rule): # 48..50 " A" - - IdentifierPath (Rule): # 48..50 " A" - - Identifier (Token): "A" # 49..50 - - ForKeyword (Token): "for" # 51..54 - - TypeName (Rule): # 54..56 " B" - - IdentifierPath (Rule): # 54..56 " B" - - Identifier (Token): "B" # 55..56 - - Semicolon (Token): ";" # 56..57 - - ContractDefinition (Rule): # 58..74 "\ncontract C { }\n" - - ContractKeyword (Token): "contract" # 59..67 - - Identifier (Token): "C" # 68..69 - - OpenBrace (Token): "{" # 70..71 - - CloseBrace (Token): "}" # 72..73 - - InterfaceDefinition (Rule): # 74..91 "\ninterface I { }\n" - - InterfaceKeyword (Token): "interface" # 75..84 - - Identifier (Token): "I" # 85..86 - - OpenBrace (Token): "{" # 87..88 - - CloseBrace (Token): "}" # 89..90 - - LibraryDefinition (Rule): # 91..106 "\nlibrary L { }\n" - - LibraryKeyword (Token): "library" # 92..99 - - Identifier (Token): "L" # 100..101 - - OpenBrace (Token): "{" # 102..103 - - CloseBrace (Token): "}" # 104..105 - - StructDefinition (Rule): # 106..120 "\nstruct S { }\n" - - StructKeyword (Token): "struct" # 107..113 - - Identifier (Token): "S" # 114..115 - - OpenBrace (Token): "{" # 116..117 - - CloseBrace (Token): "}" # 118..119 - - EnumDefinition (Rule): # 120..132 "\nenum E { }\n" - - EnumKeyword (Token): "enum" # 121..125 - - Identifier (Token): "E" # 126..127 - - OpenBrace (Token): "{" # 128..129 - - CloseBrace (Token): "}" # 130..131 - - ConstantDefinition (Rule): # 132..156 "\nuint32 constant x = 0;\n" - - TypeName (Rule): # 132..139 "\nuint32" - - UnsignedIntegerType (Token): "uint32" # 133..139 - - ConstantKeyword (Token): "constant" # 140..148 - - Identifier (Token): "x" # 149..150 - - Equal (Token): "=" # 151..152 - - Expression (Rule): # 152..154 " 0" - - NumericExpression (Rule): # 152..154 " 0" - - DecimalLiteral (Token): "0" # 153..154 - - Semicolon (Token): ";" # 154..155 - - FunctionDefinition (Rule): # 156..181 "\nfunction f() public { }\n" - - FunctionKeyword (Token): "function" # 157..165 - - Identifier (Token): "f" # 166..167 - - ParametersDeclaration (Rule): # 167..169 "()" - - OpenParen (Token): "(" # 167..168 - - CloseParen (Token): ")" # 168..169 - - FunctionAttributesList (Rule): # 169..176 " public" - - PublicKeyword (Token): "public" # 170..176 - - Block (Rule): # 176..181 " { }\n" - - OpenBrace (Token): "{" # 177..178 - - CloseBrace (Token): "}" # 179..180 - - ErrorDefinition (Rule): # 181..200 "\nerror E1(string);\n" - - ErrorKeyword (Token): "error" # 182..187 - - Identifier (Token): "E1" # 188..190 - - OpenParen (Token): "(" # 190..191 - - ErrorParametersList (Rule): # 191..197 "string" - - ErrorParameter (Rule): # 191..197 "string" - - TypeName (Rule): # 191..197 "string" - - StringKeyword (Token): "string" # 191..197 - - CloseParen (Token): ")" # 197..198 - - Semicolon (Token): ";" # 198..199 - - UserDefinedValueTypeDefinition (Rule): # 200..217 "\ntype T is bool;\n" - - TypeKeyword (Token): "type" # 201..205 - - Identifier (Token): "T" # 206..207 - - IsKeyword (Token): "is" # 208..210 - - BoolKeyword (Token): "bool" # 211..215 - - Semicolon (Token): ";" # 215..216 - - EventDefinition (Rule): # 217..243 "\nevent E1(uint256 value);\n" - - EventKeyword (Token): "event" # 218..223 - - Identifier (Token): "E1" # 224..226 - - OpenParen (Token): "(" # 226..227 - - EventParametersList (Rule): # 227..240 "uint256 value" - - EventParameter (Rule): # 227..240 "uint256 value" - - TypeName (Rule): # 227..234 "uint256" - - UnsignedIntegerType (Token): "uint256" # 227..234 - - Identifier (Token): "value" # 235..240 - - CloseParen (Token): ")" # 240..241 - - Semicolon (Token): ";" # 241..242 + - SourceUnitMembers (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' + - SourceUnitMember (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - Pragma (Rule): # 6..21 " solidity 0.0.0" + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - SourceUnitMember (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - ImportSymbol (Rule): # 30..40 ' "foo.sol"' + - PathImportSymbol (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 + - SourceUnitMember (Rule): # 42..58 "\nusing A for B;\n" + - UsingDirective (Rule): # 42..58 "\nusing A for B;\n" + - UsingKeyword (Token): "using" # 43..48 + - UsingSymbol (Rule): # 48..50 " A" + - IdentifierPath (Rule): # 48..50 " A" + - Identifier (Token): "A" # 49..50 + - ForKeyword (Token): "for" # 51..54 + - UsingTarget (Rule): # 54..56 " B" + - TypeName (Rule): # 54..56 " B" + - IdentifierPath (Rule): # 54..56 " B" + - Identifier (Token): "B" # 55..56 + - Semicolon (Token): ";" # 56..57 + - SourceUnitMember (Rule): # 58..74 "\ncontract C { }\n" + - ContractDefinition (Rule): # 58..74 "\ncontract C { }\n" + - ContractKeyword (Token): "contract" # 59..67 + - Identifier (Token): "C" # 68..69 + - OpenBrace (Token): "{" # 70..71 + - ContractMembers (Rule): [] # 71..71 + - CloseBrace (Token): "}" # 72..73 + - SourceUnitMember (Rule): # 74..91 "\ninterface I { }\n" + - InterfaceDefinition (Rule): # 74..91 "\ninterface I { }\n" + - InterfaceKeyword (Token): "interface" # 75..84 + - Identifier (Token): "I" # 85..86 + - OpenBrace (Token): "{" # 87..88 + - InterfaceMembers (Rule): [] # 88..88 + - CloseBrace (Token): "}" # 89..90 + - SourceUnitMember (Rule): # 91..106 "\nlibrary L { }\n" + - LibraryDefinition (Rule): # 91..106 "\nlibrary L { }\n" + - LibraryKeyword (Token): "library" # 92..99 + - Identifier (Token): "L" # 100..101 + - OpenBrace (Token): "{" # 102..103 + - LibraryMembers (Rule): [] # 103..103 + - CloseBrace (Token): "}" # 104..105 + - SourceUnitMember (Rule): # 106..120 "\nstruct S { }\n" + - StructDefinition (Rule): # 106..120 "\nstruct S { }\n" + - StructKeyword (Token): "struct" # 107..113 + - Identifier (Token): "S" # 114..115 + - OpenBrace (Token): "{" # 116..117 + - StructMembers (Rule): [] # 117..117 + - CloseBrace (Token): "}" # 118..119 + - SourceUnitMember (Rule): # 120..132 "\nenum E { }\n" + - EnumDefinition (Rule): # 120..132 "\nenum E { }\n" + - EnumKeyword (Token): "enum" # 121..125 + - Identifier (Token): "E" # 126..127 + - OpenBrace (Token): "{" # 128..129 + - EnumMembers (Rule): [] # 129..129 + - CloseBrace (Token): "}" # 130..131 + - SourceUnitMember (Rule): # 132..156 "\nuint32 constant x = 0;\n" + - ConstantDefinition (Rule): # 132..156 "\nuint32 constant x = 0;\n" + - TypeName (Rule): # 132..139 "\nuint32" + - ElementaryType (Rule): # 132..139 "\nuint32" + - UintKeyword (Token): "uint32" # 133..139 + - ConstantKeyword (Token): "constant" # 140..148 + - Identifier (Token): "x" # 149..150 + - Equal (Token): "=" # 151..152 + - Expression (Rule): # 152..154 " 0" + - DecimalNumberExpression (Rule): # 152..154 " 0" + - DecimalLiteral (Token): "0" # 153..154 + - Semicolon (Token): ";" # 154..155 + - SourceUnitMember (Rule): # 156..181 "\nfunction f() public { }\n" + - FunctionDefinition (Rule): # 156..181 "\nfunction f() public { }\n" + - FunctionKeyword (Token): "function" # 157..165 + - Identifier (Token): "f" # 166..167 + - ParametersDeclaration (Rule): # 167..169 "()" + - OpenParen (Token): "(" # 167..168 + - Parameters (Rule): [] # 168..168 + - CloseParen (Token): ")" # 168..169 + - FunctionAttributes (Rule): # 169..176 " public" + - FunctionAttribute (Rule): # 169..176 " public" + - PublicKeyword (Token): "public" # 170..176 + - FunctionBody (Rule): # 176..181 " { }\n" + - Block (Rule): # 176..181 " { }\n" + - OpenBrace (Token): "{" # 177..178 + - Statements (Rule): [] # 178..178 + - CloseBrace (Token): "}" # 179..180 + - SourceUnitMember (Rule): # 181..200 "\nerror E1(string);\n" + - ErrorDefinition (Rule): # 181..200 "\nerror E1(string);\n" + - ErrorKeyword (Token): "error" # 182..187 + - Identifier (Token): "E1" # 188..190 + - ErrorParametersDeclaration (Rule): # 190..198 "(string)" + - OpenParen (Token): "(" # 190..191 + - ErrorParameters (Rule): # 191..197 "string" + - ErrorParameter (Rule): # 191..197 "string" + - TypeName (Rule): # 191..197 "string" + - ElementaryType (Rule): # 191..197 "string" + - StringKeyword (Token): "string" # 191..197 + - CloseParen (Token): ")" # 197..198 + - Semicolon (Token): ";" # 198..199 + - SourceUnitMember (Rule): # 200..217 "\ntype T is bool;\n" + - UserDefinedValueTypeDefinition (Rule): # 200..217 "\ntype T is bool;\n" + - TypeKeyword (Token): "type" # 201..205 + - Identifier (Token): "T" # 206..207 + - IsKeyword (Token): "is" # 208..210 + - ElementaryType (Rule): # 210..215 " bool" + - BoolKeyword (Token): "bool" # 211..215 + - Semicolon (Token): ";" # 215..216 + - SourceUnitMember (Rule): # 217..243 "\nevent E1(uint256 value);\n" + - EventDefinition (Rule): # 217..243 "\nevent E1(uint256 value);\n" + - EventKeyword (Token): "event" # 218..223 + - Identifier (Token): "E1" # 224..226 + - EventParametersDeclaration (Rule): # 226..241 "(uint256 value)" + - OpenParen (Token): "(" # 226..227 + - EventParameters (Rule): # 227..240 "uint256 value" + - EventParameter (Rule): # 227..240 "uint256 value" + - TypeName (Rule): # 227..234 "uint256" + - ElementaryType (Rule): # 227..234 "uint256" + - UintKeyword (Token): "uint256" # 227..234 + - Identifier (Token): "value" # 235..240 + - CloseParen (Token): ")" # 240..241 + - Semicolon (Token): ";" # 241..242 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.4-failure.yml new file mode 100644 index 0000000000..d09fccf389 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.4-failure.yml @@ -0,0 +1,67 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ pragma solidity 0.0.0; │ 0..22 + 2 │ │ 23..23 + 3 │ import "foo.sol"; │ 24..41 + 4 │ │ 42..42 + 5 │ using A for B; │ 43..57 + 6 │ │ 58..58 + 7 │ contract C { } │ 59..73 + 8 │ │ 74..74 + 9 │ interface I { } │ 75..90 + 10 │ │ 91..91 + 11 │ library L { } │ 92..105 + 12 │ │ 106..106 + 13 │ struct S { } │ 107..119 + 14 │ │ 120..120 + 15 │ enum E { } │ 121..131 + 16 │ │ 132..132 + 17 │ uint32 constant x = 0; │ 133..155 + 18 │ │ 156..156 + 19 │ function f() public { } │ 157..180 + 20 │ │ 181..181 + 21 │ error E1(string); │ 182..199 + 22 │ │ 200..200 + 23 │ type T is bool; │ 201..216 + 24 │ │ 217..217 + 25 │ event E1(uint256 value); │ 218..242 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or ErrorKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol:4:1] + │ + 4 │ ╭─▶ + ┆ ┆ + 25 │ ├─▶ event E1(uint256 value); + │ │ + │ ╰────────────────────────────── Error occurred here. + ────╯ + +Tree: + - SourceUnit (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' + - SourceUnitMembers (Rule): # 0..42 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n' + - SourceUnitMember (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - Pragma (Rule): # 6..21 " solidity 0.0.0" + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - SourceUnitMember (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - ImportSymbol (Rule): # 30..40 ' "foo.sol"' + - PathImportSymbol (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 + - SKIPPED (Token): "\nusing A for B;\n\ncontract C { }\n\ninterface I { }\n\n..." # 42..243 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.8-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.8-failure.yml new file mode 100644 index 0000000000..d4ef53c28d --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.8-failure.yml @@ -0,0 +1,67 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ pragma solidity 0.0.0; │ 0..22 + 2 │ │ 23..23 + 3 │ import "foo.sol"; │ 24..41 + 4 │ │ 42..42 + 5 │ using A for B; │ 43..57 + 6 │ │ 58..58 + 7 │ contract C { } │ 59..73 + 8 │ │ 74..74 + 9 │ interface I { } │ 75..90 + 10 │ │ 91..91 + 11 │ library L { } │ 92..105 + 12 │ │ 106..106 + 13 │ struct S { } │ 107..119 + 14 │ │ 120..120 + 15 │ enum E { } │ 121..131 + 16 │ │ 132..132 + 17 │ uint32 constant x = 0; │ 133..155 + 18 │ │ 156..156 + 19 │ function f() public { } │ 157..180 + 20 │ │ 181..181 + 21 │ error E1(string); │ 182..199 + 22 │ │ 200..200 + 23 │ type T is bool; │ 201..216 + 24 │ │ 217..217 + 25 │ event E1(uint256 value); │ 218..242 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or ErrorKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or TypeKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/input.sol:4:1] + │ + 4 │ ╭─▶ + ┆ ┆ + 25 │ ├─▶ event E1(uint256 value); + │ │ + │ ╰────────────────────────────── Error occurred here. + ────╯ + +Tree: + - SourceUnit (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' + - SourceUnitMembers (Rule): # 0..42 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n' + - SourceUnitMember (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - Pragma (Rule): # 6..21 " solidity 0.0.0" + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - SourceUnitMember (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - ImportSymbol (Rule): # 30..40 ' "foo.sol"' + - PathImportSymbol (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 + - SKIPPED (Token): "\nusing A for B;\n\ncontract C { }\n\ninterface I { }\n\n..." # 42..243 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/partial_definition/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/partial_definition/generated/0.4.11-failure.yml index e735e099da..a4a4b58e1c 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/partial_definition/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/partial_definition/generated/0.4.11-failure.yml @@ -16,12 +16,14 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..28 "contract Sample {\n function" - - SourceUnitMembersList (Rule): # 0..28 "contract Sample {\n function" - - ContractDefinition (Rule): # 0..28 "contract Sample {\n function" - - ContractKeyword (Token): "contract" # 0..8 - - Identifier (Token): "Sample" # 9..15 - - OpenBrace (Token): "{" # 16..17 - - ContractMembersList (Rule): # 18..28 " function" - - FunctionDefinition (Rule): # 18..28 " function" - - FunctionKeyword (Token): "function" # 20..28 + - SourceUnitMembers (Rule): # 0..28 "contract Sample {\n function" + - SourceUnitMember (Rule): # 0..28 "contract Sample {\n function" + - ContractDefinition (Rule): # 0..28 "contract Sample {\n function" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): # 18..28 " function" + - ContractMember (Rule): # 18..28 " function" + - FunctionDefinition (Rule): # 18..28 " function" + - FunctionKeyword (Token): "function" # 20..28 - SKIPPED (Token): "" # 28..28 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.4.11-failure.yml index 9fbdda7698..7632cf4add 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.4.11-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected EndOfLine or MultilineComment or SingleLineComment or Whitespace. + Error: Expected ContractKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/input.sol:1:1] │ 1 │ event E1(uint256 value); @@ -15,4 +15,5 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..25 "event E1(uint256 value);\n" + - SourceUnitMembers (Rule): [] # 0..0 - SKIPPED (Token): "event E1(uint256 value);\n" # 0..25 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.6.0-failure.yml new file mode 100644 index 0000000000..86d0a905a5 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.6.0-failure.yml @@ -0,0 +1,19 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ event E1(uint256 value); │ 0..24 + +Errors: # 1 total + - > + Error: Expected ContractKeyword or EnumKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword or StructKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/input.sol:1:1] + │ + 1 │ event E1(uint256 value); + │ ────────────┬──────────── + │ ╰────────────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..25 "event E1(uint256 value);\n" + - SourceUnitMembers (Rule): [] # 0..0 + - SKIPPED (Token): "event E1(uint256 value);\n" # 0..25 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.7.1-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.7.1-failure.yml new file mode 100644 index 0000000000..9debb5fb35 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.7.1-failure.yml @@ -0,0 +1,19 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ event E1(uint256 value); │ 0..24 + +Errors: # 1 total + - > + Error: Expected ContractKeyword or EnumKeyword or FunctionKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword or StructKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/input.sol:1:1] + │ + 1 │ event E1(uint256 value); + │ ────────────┬──────────── + │ ╰────────────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..25 "event E1(uint256 value);\n" + - SourceUnitMembers (Rule): [] # 0..0 + - SKIPPED (Token): "event E1(uint256 value);\n" # 0..25 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.7.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.7.4-failure.yml new file mode 100644 index 0000000000..9022021d88 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.7.4-failure.yml @@ -0,0 +1,19 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ event E1(uint256 value); │ 0..24 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or BytesKeyword or ContractKeyword or EnumKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/input.sol:1:1] + │ + 1 │ event E1(uint256 value); + │ ────────────┬──────────── + │ ╰────────────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..25 "event E1(uint256 value);\n" + - SourceUnitMembers (Rule): [] # 0..0 + - SKIPPED (Token): "event E1(uint256 value);\n" # 0..25 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.0-failure.yml new file mode 100644 index 0000000000..87c36e2923 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.0-failure.yml @@ -0,0 +1,19 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ event E1(uint256 value); │ 0..24 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/input.sol:1:1] + │ + 1 │ event E1(uint256 value); + │ ────────────┬──────────── + │ ╰────────────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..25 "event E1(uint256 value);\n" + - SourceUnitMembers (Rule): [] # 0..0 + - SKIPPED (Token): "event E1(uint256 value);\n" # 0..25 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.13-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.13-failure.yml new file mode 100644 index 0000000000..f1a808fb6d --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.13-failure.yml @@ -0,0 +1,19 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ event E1(uint256 value); │ 0..24 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or ErrorKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UsingKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/input.sol:1:1] + │ + 1 │ event E1(uint256 value); + │ ────────────┬──────────── + │ ╰────────────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..25 "event E1(uint256 value);\n" + - SourceUnitMembers (Rule): [] # 0..0 + - SKIPPED (Token): "event E1(uint256 value);\n" # 0..25 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.22-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.22-success.yml index d0a39be628..81a26a495b 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.22-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.22-success.yml @@ -7,15 +7,18 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..25 "event E1(uint256 value);\n" - - SourceUnitMembersList (Rule): # 0..25 "event E1(uint256 value);\n" - - EventDefinition (Rule): # 0..25 "event E1(uint256 value);\n" - - EventKeyword (Token): "event" # 0..5 - - Identifier (Token): "E1" # 6..8 - - OpenParen (Token): "(" # 8..9 - - EventParametersList (Rule): # 9..22 "uint256 value" - - EventParameter (Rule): # 9..22 "uint256 value" - - TypeName (Rule): # 9..16 "uint256" - - UnsignedIntegerType (Token): "uint256" # 9..16 - - Identifier (Token): "value" # 17..22 - - CloseParen (Token): ")" # 22..23 - - Semicolon (Token): ";" # 23..24 + - SourceUnitMembers (Rule): # 0..25 "event E1(uint256 value);\n" + - SourceUnitMember (Rule): # 0..25 "event E1(uint256 value);\n" + - EventDefinition (Rule): # 0..25 "event E1(uint256 value);\n" + - EventKeyword (Token): "event" # 0..5 + - Identifier (Token): "E1" # 6..8 + - EventParametersDeclaration (Rule): # 8..23 "(uint256 value)" + - OpenParen (Token): "(" # 8..9 + - EventParameters (Rule): # 9..22 "uint256 value" + - EventParameter (Rule): # 9..22 "uint256 value" + - TypeName (Rule): # 9..16 "uint256" + - ElementaryType (Rule): # 9..16 "uint256" + - UintKeyword (Token): "uint256" # 9..16 + - Identifier (Token): "value" # 17..22 + - CloseParen (Token): ")" # 22..23 + - Semicolon (Token): ";" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.4-failure.yml new file mode 100644 index 0000000000..40f2cf604b --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.4-failure.yml @@ -0,0 +1,19 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ event E1(uint256 value); │ 0..24 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or ErrorKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/input.sol:1:1] + │ + 1 │ event E1(uint256 value); + │ ────────────┬──────────── + │ ╰────────────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..25 "event E1(uint256 value);\n" + - SourceUnitMembers (Rule): [] # 0..0 + - SKIPPED (Token): "event E1(uint256 value);\n" # 0..25 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.8-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.8-failure.yml new file mode 100644 index 0000000000..c7e63f5668 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.8-failure.yml @@ -0,0 +1,19 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ event E1(uint256 value); │ 0..24 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or ErrorKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or TypeKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/input.sol:1:1] + │ + 1 │ event E1(uint256 value); + │ ────────────┬──────────── + │ ╰────────────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..25 "event E1(uint256 value);\n" + - SourceUnitMembers (Rule): [] # 0..0 + - SKIPPED (Token): "event E1(uint256 value);\n" # 0..25 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.4.11-failure.yml index 8436ee2f36..cdeba495c8 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.4.11-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected EndOfLine or MultilineComment or SingleLineComment or Whitespace. + Error: Expected ContractKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/input.sol:1:1] │ 1 │ function foo() { } @@ -15,4 +15,5 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..18 "function foo() { }" + - SourceUnitMembers (Rule): [] # 0..0 - SKIPPED (Token): "function foo() { }" # 0..18 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.6.0-failure.yml new file mode 100644 index 0000000000..8ea99138a8 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.6.0-failure.yml @@ -0,0 +1,19 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ function foo() { } │ 0..18 + +Errors: # 1 total + - > + Error: Expected ContractKeyword or EnumKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword or StructKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/input.sol:1:1] + │ + 1 │ function foo() { } + │ ─────────┬──────── + │ ╰────────── Error occurred here. + ───╯ + +Tree: + - SourceUnit (Rule): # 0..18 "function foo() { }" + - SourceUnitMembers (Rule): [] # 0..0 + - SKIPPED (Token): "function foo() { }" # 0..18 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.7.1-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.7.1-success.yml index 815e86f99e..367c7970c9 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.7.1-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.7.1-success.yml @@ -7,13 +7,18 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..18 "function foo() { }" - - SourceUnitMembersList (Rule): # 0..18 "function foo() { }" - - FunctionDefinition (Rule): # 0..18 "function foo() { }" - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "foo" # 9..12 - - ParametersDeclaration (Rule): # 12..14 "()" - - OpenParen (Token): "(" # 12..13 - - CloseParen (Token): ")" # 13..14 - - Block (Rule): # 14..18 " { }" - - OpenBrace (Token): "{" # 15..16 - - CloseBrace (Token): "}" # 17..18 + - SourceUnitMembers (Rule): # 0..18 "function foo() { }" + - SourceUnitMember (Rule): # 0..18 "function foo() { }" + - FunctionDefinition (Rule): # 0..18 "function foo() { }" + - FunctionKeyword (Token): "function" # 0..8 + - Identifier (Token): "foo" # 9..12 + - ParametersDeclaration (Rule): # 12..14 "()" + - OpenParen (Token): "(" # 12..13 + - Parameters (Rule): [] # 13..13 + - CloseParen (Token): ")" # 13..14 + - FunctionAttributes (Rule): [] # 14..14 + - FunctionBody (Rule): # 14..18 " { }" + - Block (Rule): # 14..18 " { }" + - OpenBrace (Token): "{" # 15..16 + - Statements (Rule): [] # 16..16 + - CloseBrace (Token): "}" # 17..18 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/trailing_trivia/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/trailing_trivia/generated/0.4.11-success.yml index 48415b2c88..d0ee465280 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/trailing_trivia/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/trailing_trivia/generated/0.4.11-success.yml @@ -14,17 +14,21 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..148 "contract First {}\n\n\n// Newlines both before and af..." - - SourceUnitMembersList (Rule): # 0..148 "contract First {}\n\n\n// Newlines both before and af..." - - ContractDefinition (Rule): # 0..18 "contract First {}\n" - - ContractKeyword (Token): "contract" # 0..8 - - Identifier (Token): "First" # 9..14 - - OpenBrace (Token): "{" # 15..16 - - CloseBrace (Token): "}" # 16..17 - - ContractDefinition (Rule): # 18..148 "\n\n// Newlines both before and after this comment s..." - - LeadingTrivia (Rule): # 18..129 "\n\n// Newlines both before and after this comment s..." - - SingleLineComment (Trivia): "// Newlines both before and after this comment sho..." # 20..73 - - SingleLineComment (Trivia): "// be included in the trivia of the second contrac..." # 74..126 - - ContractKeyword (Token): "contract" # 129..137 - - Identifier (Token): "Second" # 138..144 - - OpenBrace (Token): "{" # 145..146 - - CloseBrace (Token): "}" # 146..147 + - SourceUnitMembers (Rule): # 0..148 "contract First {}\n\n\n// Newlines both before and af..." + - SourceUnitMember (Rule): # 0..18 "contract First {}\n" + - ContractDefinition (Rule): # 0..18 "contract First {}\n" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "First" # 9..14 + - OpenBrace (Token): "{" # 15..16 + - ContractMembers (Rule): [] # 16..16 + - CloseBrace (Token): "}" # 16..17 + - SourceUnitMember (Rule): # 18..148 "\n\n// Newlines both before and after this comment s..." + - ContractDefinition (Rule): # 18..148 "\n\n// Newlines both before and after this comment s..." + - LeadingTrivia (Rule): # 18..129 "\n\n// Newlines both before and after this comment s..." + - SingleLineComment (Trivia): "// Newlines both before and after this comment sho..." # 20..73 + - SingleLineComment (Trivia): "// be included in the trivia of the second contrac..." # 74..126 + - ContractKeyword (Token): "contract" # 129..137 + - Identifier (Token): "Second" # 138..144 + - OpenBrace (Token): "{" # 145..146 + - ContractMembers (Rule): [] # 146..146 + - CloseBrace (Token): "}" # 146..147 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.4.11-failure.yml index 147d1ee2c7..9e9bf80c9d 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.4.11-failure.yml @@ -27,10 +27,10 @@ Source: > Errors: # 1 total - > - Error: Expected EndOfLine or MultilineComment or SingleLineComment or Whitespace. - ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/input.sol:4:1] + Error: Expected ContractKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/input.sol:3:1] │ - 4 │ ╭─▶ using EnvelopeUtils for Envelope global; + 3 │ ╭─▶ ┆ ┆ 23 │ ├─▶ } │ │ @@ -39,24 +39,25 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..793 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." - - SourceUnitMembersList (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." - - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." - - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" - - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 - - PragmaKeyword (Token): "pragma" # 32..38 - - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" - - SolidityKeyword (Token): "solidity" # 39..47 - - VersionPragmaExpressionsList (Rule): # 47..54 " ^0.8.0" - - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" - - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" - - Caret (Token): "^" # 48..49 - - VersionPragmaExpression (Rule): # 49..54 "0.8.0" - - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" - - VersionPragmaValue (Token): "0" # 49..50 - - Period (Token): "." # 50..51 - - VersionPragmaValue (Token): "8" # 51..52 - - Period (Token): "." # 52..53 - - VersionPragmaValue (Token): "0" # 53..54 - - Semicolon (Token): ";" # 54..55 - - EndOfFileTrivia (Rule): "\n" # 56..57 - - SKIPPED (Token): "using EnvelopeUtils for Envelope global;\nusing Tra..." # 57..793 + - SourceUnitMembers (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMember (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" + - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 + - PragmaKeyword (Token): "pragma" # 32..38 + - Pragma (Rule): # 38..54 " solidity ^0.8.0" + - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" + - SolidityKeyword (Token): "solidity" # 39..47 + - VersionPragmaExpressions (Rule): # 47..54 " ^0.8.0" + - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" + - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" + - Caret (Token): "^" # 48..49 + - VersionPragmaExpression (Rule): # 49..54 "0.8.0" + - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" + - VersionPragmaValue (Token): "0" # 49..50 + - Period (Token): "." # 50..51 + - VersionPragmaValue (Token): "8" # 51..52 + - Period (Token): "." # 52..53 + - VersionPragmaValue (Token): "0" # 53..54 + - Semicolon (Token): ";" # 54..55 + - SKIPPED (Token): "\nusing EnvelopeUtils for Envelope global;\nusing Tr..." # 56..793 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.6.0-failure.yml new file mode 100644 index 0000000000..c07d14cc45 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.6.0-failure.yml @@ -0,0 +1,63 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ // SPDX-License-Identifier: MIT │ 0..31 + 2 │ pragma solidity ^0.8.0; │ 32..55 + 3 │ │ 56..56 + 4 │ using EnvelopeUtils for Envelope global; │ 57..97 + 5 │ using TransactionUtils for Transaction global; │ 98..144 + 6 │ │ 145..145 + 7 │ /** │ 146..149 + 8 │ * @notice Object with the necessary information to define a unique envelope │ 150..226 + 9 │ * @param nonce sequential (unique) numeric indicator of the Envelope creation │ 227..305 + 10 │ * @param origin address that originated the bridging of a message │ 306..372 + 11 │ * @param destination address where the message needs to be sent │ 373..437 + 12 │ * @param originChainId id of the chain where the message originated │ 438..506 + 13 │ * @param destinationChainId id of the chain where the message needs to be bridged │ 507..589 + 14 │ * @param message bytes that needs to be bridged │ 590..638 + 15 │ */ │ 639..642 + 16 │ struct Envelope { │ 643..660 + 17 │ uint256 nonce; │ 661..677 + 18 │ address origin; │ 678..695 + 19 │ address destination; │ 696..718 + 20 │ uint256 originChainId; │ 719..743 + 21 │ uint256 destinationChainId; │ 744..773 + 22 │ bytes message; │ 774..790 + 23 │ } │ 791..792 + +Errors: # 1 total + - > + Error: Expected ContractKeyword or EnumKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword or StructKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/input.sol:3:1] + │ + 3 │ ╭─▶ + ┆ ┆ + 23 │ ├─▶ } + │ │ + │ ╰─────── Error occurred here. + ────╯ + +Tree: + - SourceUnit (Rule): # 0..793 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMembers (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMember (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" + - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 + - PragmaKeyword (Token): "pragma" # 32..38 + - Pragma (Rule): # 38..54 " solidity ^0.8.0" + - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" + - SolidityKeyword (Token): "solidity" # 39..47 + - VersionPragmaExpressions (Rule): # 47..54 " ^0.8.0" + - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" + - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" + - Caret (Token): "^" # 48..49 + - VersionPragmaExpression (Rule): # 49..54 "0.8.0" + - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" + - VersionPragmaValue (Token): "0" # 49..50 + - Period (Token): "." # 50..51 + - VersionPragmaValue (Token): "8" # 51..52 + - Period (Token): "." # 52..53 + - VersionPragmaValue (Token): "0" # 53..54 + - Semicolon (Token): ";" # 54..55 + - SKIPPED (Token): "\nusing EnvelopeUtils for Envelope global;\nusing Tr..." # 56..793 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.7.1-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.7.1-failure.yml new file mode 100644 index 0000000000..32c6f906b1 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.7.1-failure.yml @@ -0,0 +1,63 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ // SPDX-License-Identifier: MIT │ 0..31 + 2 │ pragma solidity ^0.8.0; │ 32..55 + 3 │ │ 56..56 + 4 │ using EnvelopeUtils for Envelope global; │ 57..97 + 5 │ using TransactionUtils for Transaction global; │ 98..144 + 6 │ │ 145..145 + 7 │ /** │ 146..149 + 8 │ * @notice Object with the necessary information to define a unique envelope │ 150..226 + 9 │ * @param nonce sequential (unique) numeric indicator of the Envelope creation │ 227..305 + 10 │ * @param origin address that originated the bridging of a message │ 306..372 + 11 │ * @param destination address where the message needs to be sent │ 373..437 + 12 │ * @param originChainId id of the chain where the message originated │ 438..506 + 13 │ * @param destinationChainId id of the chain where the message needs to be bridged │ 507..589 + 14 │ * @param message bytes that needs to be bridged │ 590..638 + 15 │ */ │ 639..642 + 16 │ struct Envelope { │ 643..660 + 17 │ uint256 nonce; │ 661..677 + 18 │ address origin; │ 678..695 + 19 │ address destination; │ 696..718 + 20 │ uint256 originChainId; │ 719..743 + 21 │ uint256 destinationChainId; │ 744..773 + 22 │ bytes message; │ 774..790 + 23 │ } │ 791..792 + +Errors: # 1 total + - > + Error: Expected ContractKeyword or EnumKeyword or FunctionKeyword or ImportKeyword or InterfaceKeyword or LibraryKeyword or PragmaKeyword or StructKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/input.sol:3:1] + │ + 3 │ ╭─▶ + ┆ ┆ + 23 │ ├─▶ } + │ │ + │ ╰─────── Error occurred here. + ────╯ + +Tree: + - SourceUnit (Rule): # 0..793 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMembers (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMember (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" + - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 + - PragmaKeyword (Token): "pragma" # 32..38 + - Pragma (Rule): # 38..54 " solidity ^0.8.0" + - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" + - SolidityKeyword (Token): "solidity" # 39..47 + - VersionPragmaExpressions (Rule): # 47..54 " ^0.8.0" + - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" + - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" + - Caret (Token): "^" # 48..49 + - VersionPragmaExpression (Rule): # 49..54 "0.8.0" + - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" + - VersionPragmaValue (Token): "0" # 49..50 + - Period (Token): "." # 50..51 + - VersionPragmaValue (Token): "8" # 51..52 + - Period (Token): "." # 52..53 + - VersionPragmaValue (Token): "0" # 53..54 + - Semicolon (Token): ";" # 54..55 + - SKIPPED (Token): "\nusing EnvelopeUtils for Envelope global;\nusing Tr..." # 56..793 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.7.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.7.4-failure.yml new file mode 100644 index 0000000000..d8fff2998c --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.7.4-failure.yml @@ -0,0 +1,63 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ // SPDX-License-Identifier: MIT │ 0..31 + 2 │ pragma solidity ^0.8.0; │ 32..55 + 3 │ │ 56..56 + 4 │ using EnvelopeUtils for Envelope global; │ 57..97 + 5 │ using TransactionUtils for Transaction global; │ 98..144 + 6 │ │ 145..145 + 7 │ /** │ 146..149 + 8 │ * @notice Object with the necessary information to define a unique envelope │ 150..226 + 9 │ * @param nonce sequential (unique) numeric indicator of the Envelope creation │ 227..305 + 10 │ * @param origin address that originated the bridging of a message │ 306..372 + 11 │ * @param destination address where the message needs to be sent │ 373..437 + 12 │ * @param originChainId id of the chain where the message originated │ 438..506 + 13 │ * @param destinationChainId id of the chain where the message needs to be bridged │ 507..589 + 14 │ * @param message bytes that needs to be bridged │ 590..638 + 15 │ */ │ 639..642 + 16 │ struct Envelope { │ 643..660 + 17 │ uint256 nonce; │ 661..677 + 18 │ address origin; │ 678..695 + 19 │ address destination; │ 696..718 + 20 │ uint256 originChainId; │ 719..743 + 21 │ uint256 destinationChainId; │ 744..773 + 22 │ bytes message; │ 774..790 + 23 │ } │ 791..792 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or BytesKeyword or ContractKeyword or EnumKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/input.sol:3:1] + │ + 3 │ ╭─▶ + ┆ ┆ + 23 │ ├─▶ } + │ │ + │ ╰─────── Error occurred here. + ────╯ + +Tree: + - SourceUnit (Rule): # 0..793 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMembers (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMember (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" + - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 + - PragmaKeyword (Token): "pragma" # 32..38 + - Pragma (Rule): # 38..54 " solidity ^0.8.0" + - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" + - SolidityKeyword (Token): "solidity" # 39..47 + - VersionPragmaExpressions (Rule): # 47..54 " ^0.8.0" + - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" + - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" + - Caret (Token): "^" # 48..49 + - VersionPragmaExpression (Rule): # 49..54 "0.8.0" + - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" + - VersionPragmaValue (Token): "0" # 49..50 + - Period (Token): "." # 50..51 + - VersionPragmaValue (Token): "8" # 51..52 + - Period (Token): "." # 52..53 + - VersionPragmaValue (Token): "0" # 53..54 + - Semicolon (Token): ";" # 54..55 + - SKIPPED (Token): "\nusing EnvelopeUtils for Envelope global;\nusing Tr..." # 56..793 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.0-failure.yml new file mode 100644 index 0000000000..d4cf7d964b --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.0-failure.yml @@ -0,0 +1,63 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ // SPDX-License-Identifier: MIT │ 0..31 + 2 │ pragma solidity ^0.8.0; │ 32..55 + 3 │ │ 56..56 + 4 │ using EnvelopeUtils for Envelope global; │ 57..97 + 5 │ using TransactionUtils for Transaction global; │ 98..144 + 6 │ │ 145..145 + 7 │ /** │ 146..149 + 8 │ * @notice Object with the necessary information to define a unique envelope │ 150..226 + 9 │ * @param nonce sequential (unique) numeric indicator of the Envelope creation │ 227..305 + 10 │ * @param origin address that originated the bridging of a message │ 306..372 + 11 │ * @param destination address where the message needs to be sent │ 373..437 + 12 │ * @param originChainId id of the chain where the message originated │ 438..506 + 13 │ * @param destinationChainId id of the chain where the message needs to be bridged │ 507..589 + 14 │ * @param message bytes that needs to be bridged │ 590..638 + 15 │ */ │ 639..642 + 16 │ struct Envelope { │ 643..660 + 17 │ uint256 nonce; │ 661..677 + 18 │ address origin; │ 678..695 + 19 │ address destination; │ 696..718 + 20 │ uint256 originChainId; │ 719..743 + 21 │ uint256 destinationChainId; │ 744..773 + 22 │ bytes message; │ 774..790 + 23 │ } │ 791..792 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/input.sol:3:1] + │ + 3 │ ╭─▶ + ┆ ┆ + 23 │ ├─▶ } + │ │ + │ ╰─────── Error occurred here. + ────╯ + +Tree: + - SourceUnit (Rule): # 0..793 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMembers (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMember (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" + - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 + - PragmaKeyword (Token): "pragma" # 32..38 + - Pragma (Rule): # 38..54 " solidity ^0.8.0" + - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" + - SolidityKeyword (Token): "solidity" # 39..47 + - VersionPragmaExpressions (Rule): # 47..54 " ^0.8.0" + - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" + - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" + - Caret (Token): "^" # 48..49 + - VersionPragmaExpression (Rule): # 49..54 "0.8.0" + - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" + - VersionPragmaValue (Token): "0" # 49..50 + - Period (Token): "." # 50..51 + - VersionPragmaValue (Token): "8" # 51..52 + - Period (Token): "." # 52..53 + - VersionPragmaValue (Token): "0" # 53..54 + - Semicolon (Token): ";" # 54..55 + - SKIPPED (Token): "\nusing EnvelopeUtils for Envelope global;\nusing Tr..." # 56..793 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.13-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.13-success.yml index 29a05d2130..0d7d58fd39 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.13-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.13-success.yml @@ -29,85 +29,97 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..793 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." - - SourceUnitMembersList (Rule): # 0..793 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." - - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." - - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" - - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 - - PragmaKeyword (Token): "pragma" # 32..38 - - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" - - SolidityKeyword (Token): "solidity" # 39..47 - - VersionPragmaExpressionsList (Rule): # 47..54 " ^0.8.0" - - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" - - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" - - Caret (Token): "^" # 48..49 - - VersionPragmaExpression (Rule): # 49..54 "0.8.0" - - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" - - VersionPragmaValue (Token): "0" # 49..50 - - Period (Token): "." # 50..51 - - VersionPragmaValue (Token): "8" # 51..52 - - Period (Token): "." # 52..53 - - VersionPragmaValue (Token): "0" # 53..54 - - Semicolon (Token): ";" # 54..55 - - UsingDirective (Rule): # 56..98 "\nusing EnvelopeUtils for Envelope global;\n" - - UsingKeyword (Token): "using" # 57..62 - - UsingDirectivePath (Rule): # 62..76 " EnvelopeUtils" - - IdentifierPath (Rule): # 62..76 " EnvelopeUtils" - - Identifier (Token): "EnvelopeUtils" # 63..76 - - ForKeyword (Token): "for" # 77..80 - - TypeName (Rule): # 80..89 " Envelope" - - IdentifierPath (Rule): # 80..89 " Envelope" - - Identifier (Token): "Envelope" # 81..89 - - GlobalKeyword (Token): "global" # 90..96 - - Semicolon (Token): ";" # 96..97 - - UsingDirective (Rule): # 98..145 "using TransactionUtils for Transaction global;\n" - - UsingKeyword (Token): "using" # 98..103 - - UsingDirectivePath (Rule): # 103..120 " TransactionUtils" - - IdentifierPath (Rule): # 103..120 " TransactionUtils" - - Identifier (Token): "TransactionUtils" # 104..120 - - ForKeyword (Token): "for" # 121..124 - - TypeName (Rule): # 124..136 " Transaction" - - IdentifierPath (Rule): # 124..136 " Transaction" - - Identifier (Token): "Transaction" # 125..136 - - GlobalKeyword (Token): "global" # 137..143 - - Semicolon (Token): ";" # 143..144 - - StructDefinition (Rule): # 145..793 "\n/**\n * @notice Object with the necessary informat..." - - LeadingTrivia (Rule): # 145..643 "\n/**\n * @notice Object with the necessary informat..." - - MultilineComment (Trivia): "/**\n * @notice Object with the necessary informati..." # 146..642 - - StructKeyword (Token): "struct" # 643..649 - - Identifier (Token): "Envelope" # 650..658 - - OpenBrace (Token): "{" # 659..660 - - StructMembersList (Rule): # 661..791 " uint256 nonce;\n address origin;\n address desti..." - - StructMember (Rule): # 661..678 " uint256 nonce;\n" - - TypeName (Rule): # 661..670 " uint256" - - UnsignedIntegerType (Token): "uint256" # 663..670 - - Identifier (Token): "nonce" # 671..676 - - Semicolon (Token): ";" # 676..677 - - StructMember (Rule): # 678..696 " address origin;\n" - - TypeName (Rule): # 678..687 " address" - - AddressType (Rule): # 678..687 " address" - - AddressKeyword (Token): "address" # 680..687 - - Identifier (Token): "origin" # 688..694 - - Semicolon (Token): ";" # 694..695 - - StructMember (Rule): # 696..719 " address destination;\n" - - TypeName (Rule): # 696..705 " address" - - AddressType (Rule): # 696..705 " address" - - AddressKeyword (Token): "address" # 698..705 - - Identifier (Token): "destination" # 706..717 - - Semicolon (Token): ";" # 717..718 - - StructMember (Rule): # 719..744 " uint256 originChainId;\n" - - TypeName (Rule): # 719..728 " uint256" - - UnsignedIntegerType (Token): "uint256" # 721..728 - - Identifier (Token): "originChainId" # 729..742 - - Semicolon (Token): ";" # 742..743 - - StructMember (Rule): # 744..774 " uint256 destinationChainId;\n" - - TypeName (Rule): # 744..753 " uint256" - - UnsignedIntegerType (Token): "uint256" # 746..753 - - Identifier (Token): "destinationChainId" # 754..772 - - Semicolon (Token): ";" # 772..773 - - StructMember (Rule): # 774..791 " bytes message;\n" - - TypeName (Rule): # 774..781 " bytes" - - IdentifierPath (Rule): # 774..781 " bytes" - - Identifier (Token): "bytes" # 776..781 - - Identifier (Token): "message" # 782..789 - - Semicolon (Token): ";" # 789..790 - - CloseBrace (Token): "}" # 791..792 + - SourceUnitMembers (Rule): # 0..793 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMember (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" + - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 + - PragmaKeyword (Token): "pragma" # 32..38 + - Pragma (Rule): # 38..54 " solidity ^0.8.0" + - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" + - SolidityKeyword (Token): "solidity" # 39..47 + - VersionPragmaExpressions (Rule): # 47..54 " ^0.8.0" + - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" + - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" + - Caret (Token): "^" # 48..49 + - VersionPragmaExpression (Rule): # 49..54 "0.8.0" + - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" + - VersionPragmaValue (Token): "0" # 49..50 + - Period (Token): "." # 50..51 + - VersionPragmaValue (Token): "8" # 51..52 + - Period (Token): "." # 52..53 + - VersionPragmaValue (Token): "0" # 53..54 + - Semicolon (Token): ";" # 54..55 + - SourceUnitMember (Rule): # 56..98 "\nusing EnvelopeUtils for Envelope global;\n" + - UsingDirective (Rule): # 56..98 "\nusing EnvelopeUtils for Envelope global;\n" + - UsingKeyword (Token): "using" # 57..62 + - UsingSymbol (Rule): # 62..76 " EnvelopeUtils" + - IdentifierPath (Rule): # 62..76 " EnvelopeUtils" + - Identifier (Token): "EnvelopeUtils" # 63..76 + - ForKeyword (Token): "for" # 77..80 + - UsingTarget (Rule): # 80..89 " Envelope" + - TypeName (Rule): # 80..89 " Envelope" + - IdentifierPath (Rule): # 80..89 " Envelope" + - Identifier (Token): "Envelope" # 81..89 + - GlobalKeyword (Token): "global" # 90..96 + - Semicolon (Token): ";" # 96..97 + - SourceUnitMember (Rule): # 98..145 "using TransactionUtils for Transaction global;\n" + - UsingDirective (Rule): # 98..145 "using TransactionUtils for Transaction global;\n" + - UsingKeyword (Token): "using" # 98..103 + - UsingSymbol (Rule): # 103..120 " TransactionUtils" + - IdentifierPath (Rule): # 103..120 " TransactionUtils" + - Identifier (Token): "TransactionUtils" # 104..120 + - ForKeyword (Token): "for" # 121..124 + - UsingTarget (Rule): # 124..136 " Transaction" + - TypeName (Rule): # 124..136 " Transaction" + - IdentifierPath (Rule): # 124..136 " Transaction" + - Identifier (Token): "Transaction" # 125..136 + - GlobalKeyword (Token): "global" # 137..143 + - Semicolon (Token): ";" # 143..144 + - SourceUnitMember (Rule): # 145..793 "\n/**\n * @notice Object with the necessary informat..." + - StructDefinition (Rule): # 145..793 "\n/**\n * @notice Object with the necessary informat..." + - LeadingTrivia (Rule): # 145..643 "\n/**\n * @notice Object with the necessary informat..." + - MultilineComment (Trivia): "/**\n * @notice Object with the necessary informati..." # 146..642 + - StructKeyword (Token): "struct" # 643..649 + - Identifier (Token): "Envelope" # 650..658 + - OpenBrace (Token): "{" # 659..660 + - StructMembers (Rule): # 661..791 " uint256 nonce;\n address origin;\n address desti..." + - StructMember (Rule): # 661..678 " uint256 nonce;\n" + - TypeName (Rule): # 661..670 " uint256" + - ElementaryType (Rule): # 661..670 " uint256" + - UintKeyword (Token): "uint256" # 663..670 + - Identifier (Token): "nonce" # 671..676 + - Semicolon (Token): ";" # 676..677 + - StructMember (Rule): # 678..696 " address origin;\n" + - TypeName (Rule): # 678..687 " address" + - ElementaryType (Rule): # 678..687 " address" + - AddressType (Rule): # 678..687 " address" + - AddressKeyword (Token): "address" # 680..687 + - Identifier (Token): "origin" # 688..694 + - Semicolon (Token): ";" # 694..695 + - StructMember (Rule): # 696..719 " address destination;\n" + - TypeName (Rule): # 696..705 " address" + - ElementaryType (Rule): # 696..705 " address" + - AddressType (Rule): # 696..705 " address" + - AddressKeyword (Token): "address" # 698..705 + - Identifier (Token): "destination" # 706..717 + - Semicolon (Token): ";" # 717..718 + - StructMember (Rule): # 719..744 " uint256 originChainId;\n" + - TypeName (Rule): # 719..728 " uint256" + - ElementaryType (Rule): # 719..728 " uint256" + - UintKeyword (Token): "uint256" # 721..728 + - Identifier (Token): "originChainId" # 729..742 + - Semicolon (Token): ";" # 742..743 + - StructMember (Rule): # 744..774 " uint256 destinationChainId;\n" + - TypeName (Rule): # 744..753 " uint256" + - ElementaryType (Rule): # 744..753 " uint256" + - UintKeyword (Token): "uint256" # 746..753 + - Identifier (Token): "destinationChainId" # 754..772 + - Semicolon (Token): ";" # 772..773 + - StructMember (Rule): # 774..791 " bytes message;\n" + - TypeName (Rule): # 774..781 " bytes" + - IdentifierPath (Rule): # 774..781 " bytes" + - Identifier (Token): "bytes" # 776..781 + - Identifier (Token): "message" # 782..789 + - Semicolon (Token): ";" # 789..790 + - CloseBrace (Token): "}" # 791..792 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.4-failure.yml new file mode 100644 index 0000000000..ed2d2e63f1 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.4-failure.yml @@ -0,0 +1,63 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ // SPDX-License-Identifier: MIT │ 0..31 + 2 │ pragma solidity ^0.8.0; │ 32..55 + 3 │ │ 56..56 + 4 │ using EnvelopeUtils for Envelope global; │ 57..97 + 5 │ using TransactionUtils for Transaction global; │ 98..144 + 6 │ │ 145..145 + 7 │ /** │ 146..149 + 8 │ * @notice Object with the necessary information to define a unique envelope │ 150..226 + 9 │ * @param nonce sequential (unique) numeric indicator of the Envelope creation │ 227..305 + 10 │ * @param origin address that originated the bridging of a message │ 306..372 + 11 │ * @param destination address where the message needs to be sent │ 373..437 + 12 │ * @param originChainId id of the chain where the message originated │ 438..506 + 13 │ * @param destinationChainId id of the chain where the message needs to be bridged │ 507..589 + 14 │ * @param message bytes that needs to be bridged │ 590..638 + 15 │ */ │ 639..642 + 16 │ struct Envelope { │ 643..660 + 17 │ uint256 nonce; │ 661..677 + 18 │ address origin; │ 678..695 + 19 │ address destination; │ 696..718 + 20 │ uint256 originChainId; │ 719..743 + 21 │ uint256 destinationChainId; │ 744..773 + 22 │ bytes message; │ 774..790 + 23 │ } │ 791..792 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or ErrorKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/input.sol:3:1] + │ + 3 │ ╭─▶ + ┆ ┆ + 23 │ ├─▶ } + │ │ + │ ╰─────── Error occurred here. + ────╯ + +Tree: + - SourceUnit (Rule): # 0..793 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMembers (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMember (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" + - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 + - PragmaKeyword (Token): "pragma" # 32..38 + - Pragma (Rule): # 38..54 " solidity ^0.8.0" + - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" + - SolidityKeyword (Token): "solidity" # 39..47 + - VersionPragmaExpressions (Rule): # 47..54 " ^0.8.0" + - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" + - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" + - Caret (Token): "^" # 48..49 + - VersionPragmaExpression (Rule): # 49..54 "0.8.0" + - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" + - VersionPragmaValue (Token): "0" # 49..50 + - Period (Token): "." # 50..51 + - VersionPragmaValue (Token): "8" # 51..52 + - Period (Token): "." # 52..53 + - VersionPragmaValue (Token): "0" # 53..54 + - Semicolon (Token): ";" # 54..55 + - SKIPPED (Token): "\nusing EnvelopeUtils for Envelope global;\nusing Tr..." # 56..793 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.8-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.8-failure.yml new file mode 100644 index 0000000000..639285f79b --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.8-failure.yml @@ -0,0 +1,63 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ // SPDX-License-Identifier: MIT │ 0..31 + 2 │ pragma solidity ^0.8.0; │ 32..55 + 3 │ │ 56..56 + 4 │ using EnvelopeUtils for Envelope global; │ 57..97 + 5 │ using TransactionUtils for Transaction global; │ 98..144 + 6 │ │ 145..145 + 7 │ /** │ 146..149 + 8 │ * @notice Object with the necessary information to define a unique envelope │ 150..226 + 9 │ * @param nonce sequential (unique) numeric indicator of the Envelope creation │ 227..305 + 10 │ * @param origin address that originated the bridging of a message │ 306..372 + 11 │ * @param destination address where the message needs to be sent │ 373..437 + 12 │ * @param originChainId id of the chain where the message originated │ 438..506 + 13 │ * @param destinationChainId id of the chain where the message needs to be bridged │ 507..589 + 14 │ * @param message bytes that needs to be bridged │ 590..638 + 15 │ */ │ 639..642 + 16 │ struct Envelope { │ 643..660 + 17 │ uint256 nonce; │ 661..677 + 18 │ address origin; │ 678..695 + 19 │ address destination; │ 696..718 + 20 │ uint256 originChainId; │ 719..743 + 21 │ uint256 destinationChainId; │ 744..773 + 22 │ bytes message; │ 774..790 + 23 │ } │ 791..792 + +Errors: # 1 total + - > + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or ContractKeyword or EnumKeyword or ErrorKeyword or FixedKeyword or FunctionKeyword or Identifier or ImportKeyword or IntKeyword or InterfaceKeyword or LibraryKeyword or MappingKeyword or PayableKeyword or PragmaKeyword or StringKeyword or StructKeyword or TypeKeyword or UfixedKeyword or UintKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/input.sol:3:1] + │ + 3 │ ╭─▶ + ┆ ┆ + 23 │ ├─▶ } + │ │ + │ ╰─────── Error occurred here. + ────╯ + +Tree: + - SourceUnit (Rule): # 0..793 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMembers (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - SourceUnitMember (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" + - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 + - PragmaKeyword (Token): "pragma" # 32..38 + - Pragma (Rule): # 38..54 " solidity ^0.8.0" + - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" + - SolidityKeyword (Token): "solidity" # 39..47 + - VersionPragmaExpressions (Rule): # 47..54 " ^0.8.0" + - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" + - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" + - Caret (Token): "^" # 48..49 + - VersionPragmaExpression (Rule): # 49..54 "0.8.0" + - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" + - VersionPragmaValue (Token): "0" # 49..50 + - Period (Token): "." # 50..51 + - VersionPragmaValue (Token): "8" # 51..52 + - Period (Token): "." # 52..53 + - VersionPragmaValue (Token): "0" # 53..54 + - Semicolon (Token): ";" # 54..55 + - SKIPPED (Token): "\nusing EnvelopeUtils for Envelope global;\nusing Tr..." # 56..793 diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.0-failure.yml index e4823e05c0..8af4e448e5 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/throw/input.sol:1:1] │ 1 │ throw; diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.3-failure.yml index bf79d5d864..4ea6ed5c4f 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.5.3-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/throw/input.sol:1:1] │ 1 │ throw; diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.6.0-failure.yml index 4f682bf08a..28ed2e2869 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.6.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/throw/input.sol:1:1] │ 1 │ throw; diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.7.0-failure.yml index 022ddc0b29..547fcaf5d9 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.7.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/throw/input.sol:1:1] │ 1 │ throw; diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.8.0-failure.yml index d4980c6f25..96c8a884c7 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.8.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UncheckedKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UncheckedKeyword or UnicodeStringLiteral or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/throw/input.sol:1:1] │ 1 │ throw; diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.8.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.8.4-failure.yml index 29a0d7262f..dd32bcfa7e 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.8.4-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/throw/generated/0.8.4-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UncheckedKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UncheckedKeyword or UnicodeStringLiteral or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/throw/input.sol:1:1] │ 1 │ throw; diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.11-failure.yml index 473895d262..4c063065b4 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.11-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or ThrowKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or VarKeyword or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or ThrowKeyword or TrueKeyword or UfixedKeyword or UintKeyword or VarKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/try_catch/input.sol:1:1] │ 1 │ try a.b() {} catch {} diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.21-failure.yml b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.21-failure.yml index d434e4f119..0f7d43141c 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.21-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.21-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or ThrowKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or VarKeyword or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or ThrowKeyword or TrueKeyword or UfixedKeyword or UintKeyword or VarKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/try_catch/input.sol:1:1] │ 1 │ try a.b() {} catch {} diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.0-failure.yml index 116e446a66..17ad38224d 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/try_catch/input.sol:1:1] │ 1 │ try a.b() {} catch {} diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.3-failure.yml index 2aa9d55889..d740149c20 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.5.3-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/Statement/try_catch/input.sol:1:1] │ 1 │ try a.b() {} catch {} diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.6.0-success.yml index 6f71905779..39037dc33b 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.6.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.6.0-success.yml @@ -18,14 +18,18 @@ Tree: - Period (Token): "." # 5..6 - Identifier (Token): "b" # 6..7 - ArgumentsDeclaration (Rule): # 7..9 "()" - - OpenParen (Token): "(" # 7..8 - - CloseParen (Token): ")" # 8..9 + - PositionalArgumentsDeclaration (Rule): # 7..9 "()" + - OpenParen (Token): "(" # 7..8 + - PositionalArguments (Rule): [] # 8..8 + - CloseParen (Token): ")" # 8..9 - Block (Rule): # 9..12 " {}" - OpenBrace (Token): "{" # 10..11 + - Statements (Rule): [] # 11..11 - CloseBrace (Token): "}" # 11..12 - - CatchClausesList (Rule): # 12..21 " catch {}" + - CatchClauses (Rule): # 12..21 " catch {}" - CatchClause (Rule): # 12..21 " catch {}" - CatchKeyword (Token): "catch" # 13..18 - Block (Rule): # 18..21 " {}" - OpenBrace (Token): "{" # 19..20 + - Statements (Rule): [] # 20..20 - CloseBrace (Token): "}" # 20..21 diff --git a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.4.11-failure.yml index 413fafd184..16b03a4af9 100644 --- a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.4.11-failure.yml @@ -33,17 +33,17 @@ Tree: - Statement (Rule): # 17..43 "{ 1 * 2; 3 * b invalid; }\n" - Block (Rule): # 17..43 "{ 1 * 2; 3 * b invalid; }\n" - OpenBrace (Token): "{" # 17..18 - - StatementsList (Rule): # 18..40 " 1 * 2; 3 * b invalid;" + - Statements (Rule): # 18..40 " 1 * 2; 3 * b invalid;" - Statement (Rule): # 18..25 " 1 * 2;" - ExpressionStatement (Rule): # 18..25 " 1 * 2;" - Expression (Rule): # 18..24 " 1 * 2" - BinaryExpression (Rule): # 18..24 " 1 * 2" - Expression (Rule): # 18..20 " 1" - - NumericExpression (Rule): # 18..20 " 1" + - DecimalNumberExpression (Rule): # 18..20 " 1" - DecimalLiteral (Token): "1" # 19..20 - Asterisk (Token): "*" # 21..22 - Expression (Rule): # 22..24 " 2" - - NumericExpression (Rule): # 22..24 " 2" + - DecimalNumberExpression (Rule): # 22..24 " 2" - DecimalLiteral (Token): "2" # 23..24 - Semicolon (Token): ";" # 24..25 - Statement (Rule): # 25..40 " 3 * b invalid;" @@ -51,7 +51,7 @@ Tree: - Expression (Rule): # 25..31 " 3 * b" - BinaryExpression (Rule): # 25..31 " 3 * b" - Expression (Rule): # 25..27 " 3" - - NumericExpression (Rule): # 25..27 " 3" + - DecimalNumberExpression (Rule): # 25..27 " 3" - DecimalLiteral (Token): "3" # 26..27 - Asterisk (Token): "*" # 28..29 - Expression (Rule): # 29..31 " b" diff --git a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.5.0-failure.yml index d72fc195d9..21a5b5cf6c 100644 --- a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.5.0-failure.yml @@ -7,7 +7,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/input.sol:1:1] │ 1 │ ╭─▶ diff --git a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.5.3-failure.yml index 436b161b09..82b8b1d279 100644 --- a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.5.3-failure.yml @@ -7,7 +7,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TypeKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/input.sol:1:1] │ 1 │ ╭─▶ diff --git a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.6.0-failure.yml index aaba004eb5..595743fafc 100644 --- a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.6.0-failure.yml @@ -7,7 +7,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/input.sol:1:1] │ 1 │ ╭─▶ diff --git a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.7.0-failure.yml index 49eb0859f7..5b1076de8a 100644 --- a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.7.0-failure.yml @@ -7,7 +7,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UnicodeStringLiteral or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/input.sol:1:1] │ 1 │ ╭─▶ diff --git a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.8.0-failure.yml index 6b2868ad1b..32b75964d5 100644 --- a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.8.0-failure.yml @@ -7,7 +7,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UncheckedKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UncheckedKeyword or UnicodeStringLiteral or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/input.sol:1:1] │ 1 │ ╭─▶ diff --git a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.8.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.8.4-failure.yml index 7e1c46db26..2617009066 100644 --- a/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.8.4-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/generated/0.8.4-failure.yml @@ -7,7 +7,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UncheckedKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword. + Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or BytesKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedKeyword or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or IntKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UfixedKeyword or UintKeyword or UncheckedKeyword or UnicodeStringLiteral or WhileKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/StatementsList/invalid_termination/input.sol:1:1] │ 1 │ ╭─▶ diff --git a/crates/solidity/testing/snapshots/cst_output/StructDefinition/no_members/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/StructDefinition/no_members/generated/0.4.11-success.yml index 3261a358c9..0d8c649fd7 100644 --- a/crates/solidity/testing/snapshots/cst_output/StructDefinition/no_members/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/StructDefinition/no_members/generated/0.4.11-success.yml @@ -10,4 +10,5 @@ Tree: - StructKeyword (Token): "struct" # 0..6 - Identifier (Token): "S" # 7..8 - OpenBrace (Token): "{" # 9..10 + - StructMembers (Rule): [] # 10..10 - CloseBrace (Token): "}" # 11..12 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_array_type/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_array_type/generated/0.4.11-success.yml index 6d1bc827c5..b14f10772b 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_array_type/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_array_type/generated/0.4.11-success.yml @@ -8,21 +8,28 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..69 "(uint32 a, uint32[] memory b) = abi.decode(data, (..." - OpenParen (Token): "(" # 0..1 - - TupleMembersList (Rule): # 1..28 "uint32 a, uint32[] memory b" - - TupleMember (Rule): # 1..9 "uint32 a" - - TypeName (Rule): # 1..7 "uint32" - - UnsignedIntegerType (Token): "uint32" # 1..7 - - Identifier (Token): "a" # 8..9 + - TupleMembersDeconstruction (Rule): # 1..28 "uint32 a, uint32[] memory b" + - TupleMemberDeconstruction (Rule): # 1..9 "uint32 a" + - TupleMember (Rule): # 1..9 "uint32 a" + - TypedTupleMember (Rule): # 1..9 "uint32 a" + - TypeName (Rule): # 1..7 "uint32" + - ElementaryType (Rule): # 1..7 "uint32" + - UintKeyword (Token): "uint32" # 1..7 + - Identifier (Token): "a" # 8..9 - Comma (Token): "," # 9..10 - - TupleMember (Rule): # 10..28 " uint32[] memory b" - - TypeName (Rule): # 10..19 " uint32[]" - - ArrayTypeName (Rule): # 10..19 " uint32[]" - - TypeName (Rule): # 10..17 " uint32" - - UnsignedIntegerType (Token): "uint32" # 11..17 - - OpenBracket (Token): "[" # 17..18 - - CloseBracket (Token): "]" # 18..19 - - MemoryKeyword (Token): "memory" # 20..26 - - Identifier (Token): "b" # 27..28 + - TupleMemberDeconstruction (Rule): # 10..28 " uint32[] memory b" + - TupleMember (Rule): # 10..28 " uint32[] memory b" + - TypedTupleMember (Rule): # 10..28 " uint32[] memory b" + - TypeName (Rule): # 10..19 " uint32[]" + - ArrayTypeName (Rule): # 10..19 " uint32[]" + - TypeName (Rule): # 10..17 " uint32" + - ElementaryType (Rule): # 10..17 " uint32" + - UintKeyword (Token): "uint32" # 11..17 + - OpenBracket (Token): "[" # 17..18 + - CloseBracket (Token): "]" # 18..19 + - StorageLocation (Rule): # 19..26 " memory" + - MemoryKeyword (Token): "memory" # 20..26 + - Identifier (Token): "b" # 27..28 - CloseParen (Token): ")" # 28..29 - Equal (Token): "=" # 30..31 - Expression (Rule): # 31..68 " abi.decode(data, (uint32, uint32[]))" @@ -34,24 +41,29 @@ Tree: - Period (Token): "." # 35..36 - Identifier (Token): "decode" # 36..42 - ArgumentsDeclaration (Rule): # 42..68 "(data, (uint32, uint32[]))" - - OpenParen (Token): "(" # 42..43 - - PositionalArgumentsList (Rule): # 43..67 "data, (uint32, uint32[])" - - Expression (Rule): # 43..47 "data" - - Identifier (Token): "data" # 43..47 - - Comma (Token): "," # 47..48 - - Expression (Rule): # 48..67 " (uint32, uint32[])" - - TupleExpression (Rule): # 48..67 " (uint32, uint32[])" - - OpenParen (Token): "(" # 49..50 - - TupleValuesList (Rule): # 50..66 "uint32, uint32[]" - - Expression (Rule): # 50..56 "uint32" - - UnsignedIntegerType (Token): "uint32" # 50..56 - - Comma (Token): "," # 56..57 - - Expression (Rule): # 57..66 " uint32[]" - - IndexAccessExpression (Rule): # 57..66 " uint32[]" - - Expression (Rule): # 57..64 " uint32" - - UnsignedIntegerType (Token): "uint32" # 58..64 - - OpenBracket (Token): "[" # 64..65 - - CloseBracket (Token): "]" # 65..66 - - CloseParen (Token): ")" # 66..67 - - CloseParen (Token): ")" # 67..68 + - PositionalArgumentsDeclaration (Rule): # 42..68 "(data, (uint32, uint32[]))" + - OpenParen (Token): "(" # 42..43 + - PositionalArguments (Rule): # 43..67 "data, (uint32, uint32[])" + - Expression (Rule): # 43..47 "data" + - Identifier (Token): "data" # 43..47 + - Comma (Token): "," # 47..48 + - Expression (Rule): # 48..67 " (uint32, uint32[])" + - TupleExpression (Rule): # 48..67 " (uint32, uint32[])" + - OpenParen (Token): "(" # 49..50 + - TupleValues (Rule): # 50..66 "uint32, uint32[]" + - TupleValue (Rule): # 50..56 "uint32" + - Expression (Rule): # 50..56 "uint32" + - ElementaryType (Rule): # 50..56 "uint32" + - UintKeyword (Token): "uint32" # 50..56 + - Comma (Token): "," # 56..57 + - TupleValue (Rule): # 57..66 " uint32[]" + - Expression (Rule): # 57..66 " uint32[]" + - IndexAccessExpression (Rule): # 57..66 " uint32[]" + - Expression (Rule): # 57..64 " uint32" + - ElementaryType (Rule): # 57..64 " uint32" + - UintKeyword (Token): "uint32" # 58..64 + - OpenBracket (Token): "[" # 64..65 + - CloseBracket (Token): "]" # 65..66 + - CloseParen (Token): ")" # 66..67 + - CloseParen (Token): ")" # 67..68 - Semicolon (Token): ";" # 68..69 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_singleton_type/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_singleton_type/generated/0.4.11-success.yml index e806954ebc..150f80d89a 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_singleton_type/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_singleton_type/generated/0.4.11-success.yml @@ -8,16 +8,22 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..58 "(uint32 a, uint32 b) = abi.decode(data, (uint32, u..." - OpenParen (Token): "(" # 0..1 - - TupleMembersList (Rule): # 1..19 "uint32 a, uint32 b" - - TupleMember (Rule): # 1..9 "uint32 a" - - TypeName (Rule): # 1..7 "uint32" - - UnsignedIntegerType (Token): "uint32" # 1..7 - - Identifier (Token): "a" # 8..9 + - TupleMembersDeconstruction (Rule): # 1..19 "uint32 a, uint32 b" + - TupleMemberDeconstruction (Rule): # 1..9 "uint32 a" + - TupleMember (Rule): # 1..9 "uint32 a" + - TypedTupleMember (Rule): # 1..9 "uint32 a" + - TypeName (Rule): # 1..7 "uint32" + - ElementaryType (Rule): # 1..7 "uint32" + - UintKeyword (Token): "uint32" # 1..7 + - Identifier (Token): "a" # 8..9 - Comma (Token): "," # 9..10 - - TupleMember (Rule): # 10..19 " uint32 b" - - TypeName (Rule): # 10..17 " uint32" - - UnsignedIntegerType (Token): "uint32" # 11..17 - - Identifier (Token): "b" # 18..19 + - TupleMemberDeconstruction (Rule): # 10..19 " uint32 b" + - TupleMember (Rule): # 10..19 " uint32 b" + - TypedTupleMember (Rule): # 10..19 " uint32 b" + - TypeName (Rule): # 10..17 " uint32" + - ElementaryType (Rule): # 10..17 " uint32" + - UintKeyword (Token): "uint32" # 11..17 + - Identifier (Token): "b" # 18..19 - CloseParen (Token): ")" # 19..20 - Equal (Token): "=" # 21..22 - Expression (Rule): # 22..57 " abi.decode(data, (uint32, uint32))" @@ -29,20 +35,25 @@ Tree: - Period (Token): "." # 26..27 - Identifier (Token): "decode" # 27..33 - ArgumentsDeclaration (Rule): # 33..57 "(data, (uint32, uint32))" - - OpenParen (Token): "(" # 33..34 - - PositionalArgumentsList (Rule): # 34..56 "data, (uint32, uint32)" - - Expression (Rule): # 34..38 "data" - - Identifier (Token): "data" # 34..38 - - Comma (Token): "," # 38..39 - - Expression (Rule): # 39..56 " (uint32, uint32)" - - TupleExpression (Rule): # 39..56 " (uint32, uint32)" - - OpenParen (Token): "(" # 40..41 - - TupleValuesList (Rule): # 41..55 "uint32, uint32" - - Expression (Rule): # 41..47 "uint32" - - UnsignedIntegerType (Token): "uint32" # 41..47 - - Comma (Token): "," # 47..48 - - Expression (Rule): # 48..55 " uint32" - - UnsignedIntegerType (Token): "uint32" # 49..55 - - CloseParen (Token): ")" # 55..56 - - CloseParen (Token): ")" # 56..57 + - PositionalArgumentsDeclaration (Rule): # 33..57 "(data, (uint32, uint32))" + - OpenParen (Token): "(" # 33..34 + - PositionalArguments (Rule): # 34..56 "data, (uint32, uint32)" + - Expression (Rule): # 34..38 "data" + - Identifier (Token): "data" # 34..38 + - Comma (Token): "," # 38..39 + - Expression (Rule): # 39..56 " (uint32, uint32)" + - TupleExpression (Rule): # 39..56 " (uint32, uint32)" + - OpenParen (Token): "(" # 40..41 + - TupleValues (Rule): # 41..55 "uint32, uint32" + - TupleValue (Rule): # 41..47 "uint32" + - Expression (Rule): # 41..47 "uint32" + - ElementaryType (Rule): # 41..47 "uint32" + - UintKeyword (Token): "uint32" # 41..47 + - Comma (Token): "," # 47..48 + - TupleValue (Rule): # 48..55 " uint32" + - Expression (Rule): # 48..55 " uint32" + - ElementaryType (Rule): # 48..55 " uint32" + - UintKeyword (Token): "uint32" # 49..55 + - CloseParen (Token): ")" # 55..56 + - CloseParen (Token): ")" # 56..57 - Semicolon (Token): ";" # 57..58 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/ignored_members/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/ignored_members/generated/0.4.11-success.yml index 0ff86ba9a6..7533fd422f 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/ignored_members/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/ignored_members/generated/0.4.11-success.yml @@ -8,16 +8,20 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..27 "(, second, , fourth) = rhs;" - OpenParen (Token): "(" # 0..1 - - TupleMembersList (Rule): # 1..19 ", second, , fourth" - - TupleMember (Rule): [] # 1..1 + - TupleMembersDeconstruction (Rule): # 1..19 ", second, , fourth" + - TupleMemberDeconstruction (Rule): [] # 1..1 - Comma (Token): "," # 1..2 - - TupleMember (Rule): # 2..9 " second" - - Identifier (Token): "second" # 3..9 + - TupleMemberDeconstruction (Rule): # 2..9 " second" + - TupleMember (Rule): # 2..9 " second" + - UntypedTupleMember (Rule): # 2..9 " second" + - Identifier (Token): "second" # 3..9 - Comma (Token): "," # 9..10 - - TupleMember (Rule): [] # 10..10 + - TupleMemberDeconstruction (Rule): [] # 10..10 - Comma (Token): "," # 11..12 - - TupleMember (Rule): # 12..19 " fourth" - - Identifier (Token): "fourth" # 13..19 + - TupleMemberDeconstruction (Rule): # 12..19 " fourth" + - TupleMember (Rule): # 12..19 " fourth" + - UntypedTupleMember (Rule): # 12..19 " fourth" + - Identifier (Token): "fourth" # 13..19 - CloseParen (Token): ")" # 19..20 - Equal (Token): "=" # 21..22 - Expression (Rule): # 22..26 " rhs" diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.4.11-failure.yml index f620690ffc..f38342e094 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.4.11-failure.yml @@ -19,24 +19,30 @@ Errors: # 1 total Tree: - TupleDeconstructionStatement (Rule): # 0..35 "(a, b) = (123, 135)\n/**/\n{ throw; \n" - OpenParen (Token): "(" # 0..1 - - TupleMembersList (Rule): # 1..5 "a, b" - - TupleMember (Rule): # 1..2 "a" - - Identifier (Token): "a" # 1..2 + - TupleMembersDeconstruction (Rule): # 1..5 "a, b" + - TupleMemberDeconstruction (Rule): # 1..2 "a" + - TupleMember (Rule): # 1..2 "a" + - UntypedTupleMember (Rule): # 1..2 "a" + - Identifier (Token): "a" # 1..2 - Comma (Token): "," # 2..3 - - TupleMember (Rule): # 3..5 " b" - - Identifier (Token): "b" # 4..5 + - TupleMemberDeconstruction (Rule): # 3..5 " b" + - TupleMember (Rule): # 3..5 " b" + - UntypedTupleMember (Rule): # 3..5 " b" + - Identifier (Token): "b" # 4..5 - CloseParen (Token): ")" # 5..6 - Equal (Token): "=" # 7..8 - Expression (Rule): # 8..20 " (123, 135)\n" - TupleExpression (Rule): # 8..20 " (123, 135)\n" - OpenParen (Token): "(" # 9..10 - - TupleValuesList (Rule): # 10..18 "123, 135" - - Expression (Rule): # 10..13 "123" - - NumericExpression (Rule): # 10..13 "123" - - DecimalLiteral (Token): "123" # 10..13 + - TupleValues (Rule): # 10..18 "123, 135" + - TupleValue (Rule): # 10..13 "123" + - Expression (Rule): # 10..13 "123" + - DecimalNumberExpression (Rule): # 10..13 "123" + - DecimalLiteral (Token): "123" # 10..13 - Comma (Token): "," # 13..14 - - Expression (Rule): # 14..18 " 135" - - NumericExpression (Rule): # 14..18 " 135" - - DecimalLiteral (Token): "135" # 15..18 + - TupleValue (Rule): # 14..18 " 135" + - Expression (Rule): # 14..18 " 135" + - DecimalNumberExpression (Rule): # 14..18 " 135" + - DecimalLiteral (Token): "135" # 15..18 - CloseParen (Token): ")" # 18..19 - SKIPPED (Token): "/**/\n{ throw; \n" # 20..35 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.6.2-failure.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.6.2-failure.yml index 4752e75952..fb7b9f735d 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.6.2-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.6.2-failure.yml @@ -18,30 +18,38 @@ Errors: # 1 total Tree: - TupleDeconstructionStatement (Rule): # 0..35 "(a, b) = (123, 135)\n/**/\n{ throw; \n" - OpenParen (Token): "(" # 0..1 - - TupleMembersList (Rule): # 1..5 "a, b" - - TupleMember (Rule): # 1..2 "a" - - Identifier (Token): "a" # 1..2 + - TupleMembersDeconstruction (Rule): # 1..5 "a, b" + - TupleMemberDeconstruction (Rule): # 1..2 "a" + - TupleMember (Rule): # 1..2 "a" + - UntypedTupleMember (Rule): # 1..2 "a" + - Identifier (Token): "a" # 1..2 - Comma (Token): "," # 2..3 - - TupleMember (Rule): # 3..5 " b" - - Identifier (Token): "b" # 4..5 + - TupleMemberDeconstruction (Rule): # 3..5 " b" + - TupleMember (Rule): # 3..5 " b" + - UntypedTupleMember (Rule): # 3..5 " b" + - Identifier (Token): "b" # 4..5 - CloseParen (Token): ")" # 5..6 - Equal (Token): "=" # 7..8 - Expression (Rule): # 8..26 " (123, 135)\n/**/\n{" - TupleExpression (Rule): # 8..20 " (123, 135)\n" - OpenParen (Token): "(" # 9..10 - - TupleValuesList (Rule): # 10..18 "123, 135" - - Expression (Rule): # 10..13 "123" - - NumericExpression (Rule): # 10..13 "123" - - DecimalLiteral (Token): "123" # 10..13 + - TupleValues (Rule): # 10..18 "123, 135" + - TupleValue (Rule): # 10..13 "123" + - Expression (Rule): # 10..13 "123" + - DecimalNumberExpression (Rule): # 10..13 "123" + - DecimalLiteral (Token): "123" # 10..13 - Comma (Token): "," # 13..14 - - Expression (Rule): # 14..18 " 135" - - NumericExpression (Rule): # 14..18 " 135" - - DecimalLiteral (Token): "135" # 15..18 + - TupleValue (Rule): # 14..18 " 135" + - Expression (Rule): # 14..18 " 135" + - DecimalNumberExpression (Rule): # 14..18 " 135" + - DecimalLiteral (Token): "135" # 15..18 - CloseParen (Token): ")" # 18..19 - FunctionCallOptions (Rule): # 20..26 "/**/\n{" - - NamedArgumentsDeclaration (Rule): # 20..26 "/**/\n{" - - LeadingTrivia (Rule): # 20..25 "/**/\n" - - MultilineComment (Trivia): "/**/" # 20..24 - - OpenBrace (Token): "{" # 25..26 + - NamedArgumentGroups (Rule): # 20..26 "/**/\n{" + - NamedArgumentGroup (Rule): # 20..26 "/**/\n{" + - LeadingTrivia (Rule): # 20..25 "/**/\n" + - MultilineComment (Trivia): "/**/" # 20..24 + - OpenBrace (Token): "{" # 25..26 + - NamedArguments (Rule): [] # 26..26 - SKIPPED (Token): "throw" # 27..32 - Semicolon (Token): ";" # 32..33 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.8.0-failure.yml new file mode 100644 index 0000000000..f1aad739f3 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.8.0-failure.yml @@ -0,0 +1,54 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ (a, b) = (123, 135) │ 0..19 + 2 │ /**/ │ 20..24 + 3 │ { throw; │ 25..34 + +Errors: # 1 total + - > + Error: Expected CloseBrace or Identifier. + ╭─[crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/input.sol:3:3] + │ + 3 │ { throw; + │ ──┬── + │ ╰──── Error occurred here. + ───╯ + +Tree: + - TupleDeconstructionStatement (Rule): # 0..35 "(a, b) = (123, 135)\n/**/\n{ throw; \n" + - OpenParen (Token): "(" # 0..1 + - TupleMembersDeconstruction (Rule): # 1..5 "a, b" + - TupleMemberDeconstruction (Rule): # 1..2 "a" + - TupleMember (Rule): # 1..2 "a" + - UntypedTupleMember (Rule): # 1..2 "a" + - Identifier (Token): "a" # 1..2 + - Comma (Token): "," # 2..3 + - TupleMemberDeconstruction (Rule): # 3..5 " b" + - TupleMember (Rule): # 3..5 " b" + - UntypedTupleMember (Rule): # 3..5 " b" + - Identifier (Token): "b" # 4..5 + - CloseParen (Token): ")" # 5..6 + - Equal (Token): "=" # 7..8 + - Expression (Rule): # 8..26 " (123, 135)\n/**/\n{" + - TupleExpression (Rule): # 8..20 " (123, 135)\n" + - OpenParen (Token): "(" # 9..10 + - TupleValues (Rule): # 10..18 "123, 135" + - TupleValue (Rule): # 10..13 "123" + - Expression (Rule): # 10..13 "123" + - DecimalNumberExpression (Rule): # 10..13 "123" + - DecimalLiteral (Token): "123" # 10..13 + - Comma (Token): "," # 13..14 + - TupleValue (Rule): # 14..18 " 135" + - Expression (Rule): # 14..18 " 135" + - DecimalNumberExpression (Rule): # 14..18 " 135" + - DecimalLiteral (Token): "135" # 15..18 + - CloseParen (Token): ")" # 18..19 + - FunctionCallOptions (Rule): # 20..26 "/**/\n{" + - NamedArgumentGroup (Rule): # 20..26 "/**/\n{" + - LeadingTrivia (Rule): # 20..25 "/**/\n" + - MultilineComment (Trivia): "/**/" # 20..24 + - OpenBrace (Token): "{" # 25..26 + - NamedArguments (Rule): [] # 26..26 + - SKIPPED (Token): "throw" # 27..32 + - Semicolon (Token): ";" # 32..33 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_location/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_location/generated/0.4.11-success.yml index 710b79fc6d..872e24de82 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_location/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_location/generated/0.4.11-success.yml @@ -8,13 +8,18 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..47 "(memory with_location, without_location) = rhs;" - OpenParen (Token): "(" # 0..1 - - TupleMembersList (Rule): # 1..39 "memory with_location, without_location" - - TupleMember (Rule): # 1..21 "memory with_location" - - MemoryKeyword (Token): "memory" # 1..7 - - Identifier (Token): "with_location" # 8..21 + - TupleMembersDeconstruction (Rule): # 1..39 "memory with_location, without_location" + - TupleMemberDeconstruction (Rule): # 1..21 "memory with_location" + - TupleMember (Rule): # 1..21 "memory with_location" + - UntypedTupleMember (Rule): # 1..21 "memory with_location" + - StorageLocation (Rule): # 1..7 "memory" + - MemoryKeyword (Token): "memory" # 1..7 + - Identifier (Token): "with_location" # 8..21 - Comma (Token): "," # 21..22 - - TupleMember (Rule): # 22..39 " without_location" - - Identifier (Token): "without_location" # 23..39 + - TupleMemberDeconstruction (Rule): # 22..39 " without_location" + - TupleMember (Rule): # 22..39 " without_location" + - UntypedTupleMember (Rule): # 22..39 " without_location" + - Identifier (Token): "without_location" # 23..39 - CloseParen (Token): ")" # 39..40 - Equal (Token): "=" # 41..42 - Expression (Rule): # 42..46 " rhs" diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type/generated/0.4.11-success.yml index 1d0e120d45..b9e172306a 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type/generated/0.4.11-success.yml @@ -8,14 +8,19 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..37 "(bool with_type, without_type) = rhs;" - OpenParen (Token): "(" # 0..1 - - TupleMembersList (Rule): # 1..29 "bool with_type, without_type" - - TupleMember (Rule): # 1..15 "bool with_type" - - TypeName (Rule): # 1..5 "bool" - - BoolKeyword (Token): "bool" # 1..5 - - Identifier (Token): "with_type" # 6..15 + - TupleMembersDeconstruction (Rule): # 1..29 "bool with_type, without_type" + - TupleMemberDeconstruction (Rule): # 1..15 "bool with_type" + - TupleMember (Rule): # 1..15 "bool with_type" + - TypedTupleMember (Rule): # 1..15 "bool with_type" + - TypeName (Rule): # 1..5 "bool" + - ElementaryType (Rule): # 1..5 "bool" + - BoolKeyword (Token): "bool" # 1..5 + - Identifier (Token): "with_type" # 6..15 - Comma (Token): "," # 15..16 - - TupleMember (Rule): # 16..29 " without_type" - - Identifier (Token): "without_type" # 17..29 + - TupleMemberDeconstruction (Rule): # 16..29 " without_type" + - TupleMember (Rule): # 16..29 " without_type" + - UntypedTupleMember (Rule): # 16..29 " without_type" + - Identifier (Token): "without_type" # 17..29 - CloseParen (Token): ")" # 29..30 - Equal (Token): "=" # 31..32 - Expression (Rule): # 32..36 " rhs" diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type_and_location/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type_and_location/generated/0.4.11-success.yml index 475926b369..5618c2636f 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type_and_location/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type_and_location/generated/0.4.11-success.yml @@ -8,18 +8,26 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..38 "(bool memory x, bool storage y) = rhs;" - OpenParen (Token): "(" # 0..1 - - TupleMembersList (Rule): # 1..30 "bool memory x, bool storage y" - - TupleMember (Rule): # 1..14 "bool memory x" - - TypeName (Rule): # 1..5 "bool" - - BoolKeyword (Token): "bool" # 1..5 - - MemoryKeyword (Token): "memory" # 6..12 - - Identifier (Token): "x" # 13..14 + - TupleMembersDeconstruction (Rule): # 1..30 "bool memory x, bool storage y" + - TupleMemberDeconstruction (Rule): # 1..14 "bool memory x" + - TupleMember (Rule): # 1..14 "bool memory x" + - TypedTupleMember (Rule): # 1..14 "bool memory x" + - TypeName (Rule): # 1..5 "bool" + - ElementaryType (Rule): # 1..5 "bool" + - BoolKeyword (Token): "bool" # 1..5 + - StorageLocation (Rule): # 5..12 " memory" + - MemoryKeyword (Token): "memory" # 6..12 + - Identifier (Token): "x" # 13..14 - Comma (Token): "," # 14..15 - - TupleMember (Rule): # 15..30 " bool storage y" - - TypeName (Rule): # 15..20 " bool" - - BoolKeyword (Token): "bool" # 16..20 - - StorageKeyword (Token): "storage" # 21..28 - - Identifier (Token): "y" # 29..30 + - TupleMemberDeconstruction (Rule): # 15..30 " bool storage y" + - TupleMember (Rule): # 15..30 " bool storage y" + - TypedTupleMember (Rule): # 15..30 " bool storage y" + - TypeName (Rule): # 15..20 " bool" + - ElementaryType (Rule): # 15..20 " bool" + - BoolKeyword (Token): "bool" # 16..20 + - StorageLocation (Rule): # 20..28 " storage" + - StorageKeyword (Token): "storage" # 21..28 + - Identifier (Token): "y" # 29..30 - CloseParen (Token): ")" # 30..31 - Equal (Token): "=" # 32..33 - Expression (Rule): # 33..37 " rhs" diff --git a/crates/solidity/testing/snapshots/cst_output/TupleExpression/empty/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleExpression/empty/generated/0.4.11-success.yml index a03a765449..a9be6e508c 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleExpression/empty/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleExpression/empty/generated/0.4.11-success.yml @@ -8,5 +8,6 @@ Errors: [] Tree: - TupleExpression (Rule): # 0..3 "( )" - OpenParen (Token): "(" # 0..1 - - TupleValuesList (Rule): [] # 1..1 + - TupleValues (Rule): [] # 1..1 + - TupleValue (Rule): [] # 1..1 - CloseParen (Token): ")" # 2..3 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleExpression/full/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleExpression/full/generated/0.4.11-success.yml index 98b6f7f194..0c378e46f5 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleExpression/full/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleExpression/full/generated/0.4.11-success.yml @@ -8,16 +8,20 @@ Errors: [] Tree: - TupleExpression (Rule): # 0..30 "(first, second, third, fourth)" - OpenParen (Token): "(" # 0..1 - - TupleValuesList (Rule): # 1..29 "first, second, third, fourth" - - Expression (Rule): # 1..6 "first" - - Identifier (Token): "first" # 1..6 + - TupleValues (Rule): # 1..29 "first, second, third, fourth" + - TupleValue (Rule): # 1..6 "first" + - Expression (Rule): # 1..6 "first" + - Identifier (Token): "first" # 1..6 - Comma (Token): "," # 6..7 - - Expression (Rule): # 7..14 " second" - - Identifier (Token): "second" # 8..14 + - TupleValue (Rule): # 7..14 " second" + - Expression (Rule): # 7..14 " second" + - Identifier (Token): "second" # 8..14 - Comma (Token): "," # 14..15 - - Expression (Rule): # 15..21 " third" - - Identifier (Token): "third" # 16..21 + - TupleValue (Rule): # 15..21 " third" + - Expression (Rule): # 15..21 " third" + - Identifier (Token): "third" # 16..21 - Comma (Token): "," # 21..22 - - Expression (Rule): # 22..29 " fourth" - - Identifier (Token): "fourth" # 23..29 + - TupleValue (Rule): # 22..29 " fourth" + - Expression (Rule): # 22..29 " fourth" + - Identifier (Token): "fourth" # 23..29 - CloseParen (Token): ")" # 29..30 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleExpression/missing_elements/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleExpression/missing_elements/generated/0.4.11-success.yml index dc78569463..4073f1c648 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleExpression/missing_elements/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleExpression/missing_elements/generated/0.4.11-success.yml @@ -8,12 +8,16 @@ Errors: [] Tree: - TupleExpression (Rule): # 0..20 "(, second, , fourth)" - OpenParen (Token): "(" # 0..1 - - TupleValuesList (Rule): # 1..19 ", second, , fourth" + - TupleValues (Rule): # 1..19 ", second, , fourth" + - TupleValue (Rule): [] # 1..1 - Comma (Token): "," # 1..2 - - Expression (Rule): # 2..9 " second" - - Identifier (Token): "second" # 3..9 + - TupleValue (Rule): # 2..9 " second" + - Expression (Rule): # 2..9 " second" + - Identifier (Token): "second" # 3..9 - Comma (Token): "," # 9..10 + - TupleValue (Rule): [] # 10..10 - Comma (Token): "," # 11..12 - - Expression (Rule): # 12..19 " fourth" - - Identifier (Token): "fourth" # 13..19 + - TupleValue (Rule): # 12..19 " fourth" + - Expression (Rule): # 12..19 " fourth" + - Identifier (Token): "fourth" # 13..19 - CloseParen (Token): ")" # 19..20 diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/byte/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/byte/generated/0.4.11-success.yml index 349896152d..4d54514645 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/byte/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/byte/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - TypeName (Rule): # 0..4 "byte" - - ByteKeyword (Token): "byte" # 0..4 + - ElementaryType (Rule): # 0..4 "byte" + - ByteKeyword (Token): "byte" # 0..4 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 f832a8136d..da957e6b04 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or PayableKeyword or StringKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/TypeName/byte/input.sol:1:1] │ 1 │ byte diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/bytes_valid_size/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/bytes_valid_size/generated/0.4.11-success.yml index e7bdf83e74..15e8ad46af 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/bytes_valid_size/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/bytes_valid_size/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - TypeName (Rule): # 0..7 "bytes32" - - FixedBytesType (Token): "bytes32" # 0..7 + - ElementaryType (Rule): # 0..7 "bytes32" + - BytesKeyword (Token): "bytes32" # 0..7 diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/int_no_size/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/int_no_size/generated/0.4.11-success.yml index 5c0f7b40b2..71a6c6e371 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/int_no_size/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/int_no_size/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - TypeName (Rule): # 0..3 "int" - - SignedIntegerType (Token): "int" # 0..3 + - ElementaryType (Rule): # 0..3 "int" + - IntKeyword (Token): "int" # 0..3 diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/int_valid_size/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/int_valid_size/generated/0.4.11-success.yml index 4bb35a0ece..e004f89e6c 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/int_valid_size/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/int_valid_size/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - TypeName (Rule): # 0..5 "int32" - - SignedIntegerType (Token): "int32" # 0..5 + - ElementaryType (Rule): # 0..5 "int32" + - IntKeyword (Token): "int32" # 0..5 diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/uint_no_size/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/uint_no_size/generated/0.4.11-success.yml index 4f1c772970..bb46c78ef2 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/uint_no_size/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/uint_no_size/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - TypeName (Rule): # 0..4 "uint" - - UnsignedIntegerType (Token): "uint" # 0..4 + - ElementaryType (Rule): # 0..4 "uint" + - UintKeyword (Token): "uint" # 0..4 diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/uint_valid_size/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/uint_valid_size/generated/0.4.11-success.yml index 9b0cbe9015..aa0d6c91c6 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/uint_valid_size/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/uint_valid_size/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - TypeName (Rule): # 0..6 "uint32" - - UnsignedIntegerType (Token): "uint32" # 0..6 + - ElementaryType (Rule): # 0..6 "uint32" + - UintKeyword (Token): "uint32" # 0..6 diff --git a/crates/solidity/testing/snapshots/cst_output/UserDefinedValueTypeDefinition/bool/generated/0.8.8-success.yml b/crates/solidity/testing/snapshots/cst_output/UserDefinedValueTypeDefinition/bool/generated/0.8.8-success.yml index 64bc7a0ee4..ac07956a3b 100644 --- a/crates/solidity/testing/snapshots/cst_output/UserDefinedValueTypeDefinition/bool/generated/0.8.8-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UserDefinedValueTypeDefinition/bool/generated/0.8.8-success.yml @@ -10,5 +10,6 @@ Tree: - TypeKeyword (Token): "type" # 0..4 - Identifier (Token): "Foo" # 5..8 - IsKeyword (Token): "is" # 9..11 - - BoolKeyword (Token): "bool" # 12..16 + - ElementaryType (Rule): # 11..16 " bool" + - BoolKeyword (Token): "bool" # 12..16 - Semicolon (Token): ";" # 16..17 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.13-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.13-failure.yml index ce5ecd3db2..e20917eeda 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.13-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.13-failure.yml @@ -16,17 +16,19 @@ Errors: # 1 total Tree: - UsingDirective (Rule): # 0..52 "using {add as +, sub, mul, div as /} for Int globa..." - UsingKeyword (Token): "using" # 0..5 - - UsingDirectiveDeconstruction (Rule): # 5..36 " {add as +, sub, mul, div as /}" - - OpenBrace (Token): "{" # 6..7 - - UsingDirectiveSymbolsList (Rule): # 7..10 "add" - - UsingDirectiveSymbol (Rule): # 7..10 "add" - - IdentifierPath (Rule): # 7..10 "add" - - Identifier (Token): "add" # 7..10 - - SKIPPED (Token): "as +, sub, mul, div as /" # 11..35 - - CloseBrace (Token): "}" # 35..36 + - UsingSymbol (Rule): # 5..36 " {add as +, sub, mul, div as /}" + - UsingSymbolDeconstruction (Rule): # 5..36 " {add as +, sub, mul, div as /}" + - OpenBrace (Token): "{" # 6..7 + - UsingDeconstructionFields (Rule): # 7..10 "add" + - UsingDeconstructionField (Rule): # 7..10 "add" + - IdentifierPath (Rule): # 7..10 "add" + - Identifier (Token): "add" # 7..10 + - SKIPPED (Token): "as +, sub, mul, div as /" # 11..35 + - CloseBrace (Token): "}" # 35..36 - ForKeyword (Token): "for" # 37..40 - - TypeName (Rule): # 40..44 " Int" - - IdentifierPath (Rule): # 40..44 " Int" - - Identifier (Token): "Int" # 41..44 + - UsingTarget (Rule): # 40..44 " Int" + - TypeName (Rule): # 40..44 " Int" + - IdentifierPath (Rule): # 40..44 " Int" + - Identifier (Token): "Int" # 41..44 - GlobalKeyword (Token): "global" # 45..51 - Semicolon (Token): ";" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.19-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.19-success.yml index d0a2f4dcdc..d0f17ced73 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.19-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.19-success.yml @@ -8,32 +8,36 @@ Errors: [] Tree: - UsingDirective (Rule): # 0..52 "using {add as +, sub, mul, div as /} for Int globa..." - UsingKeyword (Token): "using" # 0..5 - - UsingDirectiveDeconstruction (Rule): # 5..36 " {add as +, sub, mul, div as /}" - - OpenBrace (Token): "{" # 6..7 - - UsingDirectiveSymbolsList (Rule): # 7..35 "add as +, sub, mul, div as /" - - UsingDirectiveSymbol (Rule): # 7..15 "add as +" - - IdentifierPath (Rule): # 7..10 "add" - - Identifier (Token): "add" # 7..10 - - AsKeyword (Token): "as" # 11..13 - - Plus (Token): "+" # 14..15 - - Comma (Token): "," # 15..16 - - UsingDirectiveSymbol (Rule): # 16..20 " sub" - - IdentifierPath (Rule): # 16..20 " sub" - - Identifier (Token): "sub" # 17..20 - - Comma (Token): "," # 20..21 - - UsingDirectiveSymbol (Rule): # 21..25 " mul" - - IdentifierPath (Rule): # 21..25 " mul" - - Identifier (Token): "mul" # 22..25 - - Comma (Token): "," # 25..26 - - UsingDirectiveSymbol (Rule): # 26..35 " div as /" - - IdentifierPath (Rule): # 26..30 " div" - - Identifier (Token): "div" # 27..30 - - AsKeyword (Token): "as" # 31..33 - - Slash (Token): "/" # 34..35 - - CloseBrace (Token): "}" # 35..36 + - UsingSymbol (Rule): # 5..36 " {add as +, sub, mul, div as /}" + - UsingSymbolDeconstruction (Rule): # 5..36 " {add as +, sub, mul, div as /}" + - OpenBrace (Token): "{" # 6..7 + - UsingDeconstructionFields (Rule): # 7..35 "add as +, sub, mul, div as /" + - UsingDeconstructionField (Rule): # 7..15 "add as +" + - IdentifierPath (Rule): # 7..10 "add" + - Identifier (Token): "add" # 7..10 + - UsingAlias (Rule): # 10..15 " as +" + - AsKeyword (Token): "as" # 11..13 + - Plus (Token): "+" # 14..15 + - Comma (Token): "," # 15..16 + - UsingDeconstructionField (Rule): # 16..20 " sub" + - IdentifierPath (Rule): # 16..20 " sub" + - Identifier (Token): "sub" # 17..20 + - Comma (Token): "," # 20..21 + - UsingDeconstructionField (Rule): # 21..25 " mul" + - IdentifierPath (Rule): # 21..25 " mul" + - Identifier (Token): "mul" # 22..25 + - Comma (Token): "," # 25..26 + - UsingDeconstructionField (Rule): # 26..35 " div as /" + - IdentifierPath (Rule): # 26..30 " div" + - Identifier (Token): "div" # 27..30 + - UsingAlias (Rule): # 30..35 " as /" + - AsKeyword (Token): "as" # 31..33 + - Slash (Token): "/" # 34..35 + - CloseBrace (Token): "}" # 35..36 - ForKeyword (Token): "for" # 37..40 - - TypeName (Rule): # 40..44 " Int" - - IdentifierPath (Rule): # 40..44 " Int" - - Identifier (Token): "Int" # 41..44 + - UsingTarget (Rule): # 40..44 " Int" + - TypeName (Rule): # 40..44 " Int" + - IdentifierPath (Rule): # 40..44 " Int" + - Identifier (Token): "Int" # 41..44 - GlobalKeyword (Token): "global" # 45..51 - Semicolon (Token): ";" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.8.13-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.8.13-success.yml index c56e4f7774..4b2f44f74b 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.8.13-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.8.13-success.yml @@ -8,16 +8,18 @@ Errors: [] Tree: - UsingDirective (Rule): # 0..27 "using {add} for Int global;" - UsingKeyword (Token): "using" # 0..5 - - UsingDirectiveDeconstruction (Rule): # 5..11 " {add}" - - OpenBrace (Token): "{" # 6..7 - - UsingDirectiveSymbolsList (Rule): # 7..10 "add" - - UsingDirectiveSymbol (Rule): # 7..10 "add" - - IdentifierPath (Rule): # 7..10 "add" - - Identifier (Token): "add" # 7..10 - - CloseBrace (Token): "}" # 10..11 + - UsingSymbol (Rule): # 5..11 " {add}" + - UsingSymbolDeconstruction (Rule): # 5..11 " {add}" + - OpenBrace (Token): "{" # 6..7 + - UsingDeconstructionFields (Rule): # 7..10 "add" + - UsingDeconstructionField (Rule): # 7..10 "add" + - IdentifierPath (Rule): # 7..10 "add" + - Identifier (Token): "add" # 7..10 + - CloseBrace (Token): "}" # 10..11 - ForKeyword (Token): "for" # 12..15 - - TypeName (Rule): # 15..19 " Int" - - IdentifierPath (Rule): # 15..19 " Int" - - Identifier (Token): "Int" # 16..19 + - UsingTarget (Rule): # 15..19 " Int" + - TypeName (Rule): # 15..19 " Int" + - IdentifierPath (Rule): # 15..19 " Int" + - Identifier (Token): "Int" # 16..19 - GlobalKeyword (Token): "global" # 20..26 - Semicolon (Token): ";" # 26..27 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.4.11-failure.yml index d4a79bcd2d..4e609085f3 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.4.11-failure.yml @@ -16,12 +16,13 @@ Errors: # 1 total Tree: - UsingDirective (Rule): # 0..25 "using foo for bar global;" - UsingKeyword (Token): "using" # 0..5 - - UsingDirectivePath (Rule): # 5..9 " foo" + - UsingSymbol (Rule): # 5..9 " foo" - IdentifierPath (Rule): # 5..9 " foo" - Identifier (Token): "foo" # 6..9 - ForKeyword (Token): "for" # 10..13 - - TypeName (Rule): # 13..17 " bar" - - IdentifierPath (Rule): # 13..17 " bar" - - Identifier (Token): "bar" # 14..17 + - UsingTarget (Rule): # 13..17 " bar" + - TypeName (Rule): # 13..17 " bar" + - IdentifierPath (Rule): # 13..17 " bar" + - Identifier (Token): "bar" # 14..17 - SKIPPED (Token): "global" # 18..24 - Semicolon (Token): ";" # 24..25 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.8.13-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.8.13-success.yml index 2bfac291a4..c36b93d0bb 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.8.13-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.8.13-success.yml @@ -8,12 +8,13 @@ Errors: [] Tree: - UsingDirective (Rule): # 0..25 "using foo for bar global;" - UsingKeyword (Token): "using" # 0..5 - - UsingDirectivePath (Rule): # 5..9 " foo" + - UsingSymbol (Rule): # 5..9 " foo" - IdentifierPath (Rule): # 5..9 " foo" - Identifier (Token): "foo" # 6..9 - ForKeyword (Token): "for" # 10..13 - - TypeName (Rule): # 13..17 " bar" - - IdentifierPath (Rule): # 13..17 " bar" - - Identifier (Token): "bar" # 14..17 + - UsingTarget (Rule): # 13..17 " bar" + - TypeName (Rule): # 13..17 " bar" + - IdentifierPath (Rule): # 13..17 " bar" + - Identifier (Token): "bar" # 14..17 - GlobalKeyword (Token): "global" # 18..24 - Semicolon (Token): ";" # 24..25 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/generated/0.4.11-success.yml index c94ba36a51..54181e80e3 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/generated/0.4.11-success.yml @@ -8,9 +8,10 @@ Errors: [] Tree: - UsingDirective (Rule): # 0..16 "using foo for *;" - UsingKeyword (Token): "using" # 0..5 - - UsingDirectivePath (Rule): # 5..9 " foo" + - UsingSymbol (Rule): # 5..9 " foo" - IdentifierPath (Rule): # 5..9 " foo" - Identifier (Token): "foo" # 6..9 - ForKeyword (Token): "for" # 10..13 - - Asterisk (Token): "*" # 14..15 + - UsingTarget (Rule): # 13..15 " *" + - Asterisk (Token): "*" # 14..15 - Semicolon (Token): ";" # 15..16 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.13-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.13-failure.yml index bc1b7ac2a0..be59521414 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.13-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.13-failure.yml @@ -16,17 +16,19 @@ Errors: # 1 total Tree: - UsingDirective (Rule): # 0..32 "using {div as /} for Int global;" - UsingKeyword (Token): "using" # 0..5 - - UsingDirectiveDeconstruction (Rule): # 5..16 " {div as /}" - - OpenBrace (Token): "{" # 6..7 - - UsingDirectiveSymbolsList (Rule): # 7..10 "div" - - UsingDirectiveSymbol (Rule): # 7..10 "div" - - IdentifierPath (Rule): # 7..10 "div" - - Identifier (Token): "div" # 7..10 - - SKIPPED (Token): "as /" # 11..15 - - CloseBrace (Token): "}" # 15..16 + - UsingSymbol (Rule): # 5..16 " {div as /}" + - UsingSymbolDeconstruction (Rule): # 5..16 " {div as /}" + - OpenBrace (Token): "{" # 6..7 + - UsingDeconstructionFields (Rule): # 7..10 "div" + - UsingDeconstructionField (Rule): # 7..10 "div" + - IdentifierPath (Rule): # 7..10 "div" + - Identifier (Token): "div" # 7..10 + - SKIPPED (Token): "as /" # 11..15 + - CloseBrace (Token): "}" # 15..16 - ForKeyword (Token): "for" # 17..20 - - TypeName (Rule): # 20..24 " Int" - - IdentifierPath (Rule): # 20..24 " Int" - - Identifier (Token): "Int" # 21..24 + - UsingTarget (Rule): # 20..24 " Int" + - TypeName (Rule): # 20..24 " Int" + - IdentifierPath (Rule): # 20..24 " Int" + - Identifier (Token): "Int" # 21..24 - GlobalKeyword (Token): "global" # 25..31 - Semicolon (Token): ";" # 31..32 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.19-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.19-success.yml index 3250979b5d..34f0d04727 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.19-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.19-success.yml @@ -8,18 +8,21 @@ Errors: [] Tree: - UsingDirective (Rule): # 0..32 "using {div as /} for Int global;" - UsingKeyword (Token): "using" # 0..5 - - UsingDirectiveDeconstruction (Rule): # 5..16 " {div as /}" - - OpenBrace (Token): "{" # 6..7 - - UsingDirectiveSymbolsList (Rule): # 7..15 "div as /" - - UsingDirectiveSymbol (Rule): # 7..15 "div as /" - - IdentifierPath (Rule): # 7..10 "div" - - Identifier (Token): "div" # 7..10 - - AsKeyword (Token): "as" # 11..13 - - Slash (Token): "/" # 14..15 - - CloseBrace (Token): "}" # 15..16 + - UsingSymbol (Rule): # 5..16 " {div as /}" + - UsingSymbolDeconstruction (Rule): # 5..16 " {div as /}" + - OpenBrace (Token): "{" # 6..7 + - UsingDeconstructionFields (Rule): # 7..15 "div as /" + - UsingDeconstructionField (Rule): # 7..15 "div as /" + - IdentifierPath (Rule): # 7..10 "div" + - Identifier (Token): "div" # 7..10 + - UsingAlias (Rule): # 10..15 " as /" + - AsKeyword (Token): "as" # 11..13 + - Slash (Token): "/" # 14..15 + - CloseBrace (Token): "}" # 15..16 - ForKeyword (Token): "for" # 17..20 - - TypeName (Rule): # 20..24 " Int" - - IdentifierPath (Rule): # 20..24 " Int" - - Identifier (Token): "Int" # 21..24 + - UsingTarget (Rule): # 20..24 " Int" + - TypeName (Rule): # 20..24 " Int" + - IdentifierPath (Rule): # 20..24 " Int" + - Identifier (Token): "Int" # 21..24 - GlobalKeyword (Token): "global" # 25..31 - Semicolon (Token): ";" # 31..32 diff --git a/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.4.11-success.yml index 8df297a50b..616357ba3f 100644 --- a/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.4.11-success.yml @@ -7,11 +7,12 @@ Errors: [] Tree: - VariableDeclarationStatement (Rule): # 0..10 "var z = 0;" - - VariableDeclaration (Rule): # 0..5 "var z" + - VariableDeclarationType (Rule): # 0..3 "var" - VarKeyword (Token): "var" # 0..3 - - Identifier (Token): "z" # 4..5 - - Equal (Token): "=" # 6..7 - - Expression (Rule): # 7..9 " 0" - - NumericExpression (Rule): # 7..9 " 0" - - DecimalLiteral (Token): "0" # 8..9 + - Identifier (Token): "z" # 4..5 + - VariableDeclarationValue (Rule): # 5..9 " = 0" + - Equal (Token): "=" # 6..7 + - Expression (Rule): # 7..9 " 0" + - DecimalNumberExpression (Rule): # 7..9 " 0" + - DecimalLiteral (Token): "0" # 8..9 - Semicolon (Token): ";" # 9..10 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 35871716b9..f155e6c629 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or BoolKeyword or ByteKeyword or BytesKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or PayableKeyword or StringKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/input.sol:1:1] │ 1 │ var z = 0; 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 fb2eea50cc..3b920c4d9a 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AddressKeyword or BoolKeyword or FixedBytesType or FunctionKeyword or Identifier or MappingKeyword or PayableKeyword or SignedFixedType or SignedIntegerType or StringKeyword or UnsignedFixedType or UnsignedIntegerType. + Error: Expected AddressKeyword or BoolKeyword or BytesKeyword or FixedKeyword or FunctionKeyword or Identifier or IntKeyword or MappingKeyword or PayableKeyword or StringKeyword or UfixedKeyword or UintKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/input.sol:1:1] │ 1 │ var z = 0; diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/alternatives/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/alternatives/generated/0.4.11-success.yml index df9669607c..85def026b9 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/alternatives/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/alternatives/generated/0.4.11-success.yml @@ -8,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..33 "solidity 0.5.0 || 0.6.0 || ^0.7.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionsList (Rule): # 8..33 " 0.5.0 || 0.6.0 || ^0.7.0" + - VersionPragmaExpressions (Rule): # 8..33 " 0.5.0 || 0.6.0 || ^0.7.0" - VersionPragmaExpression (Rule): # 8..33 " 0.5.0 || 0.6.0 || ^0.7.0" - VersionPragmaBinaryExpression (Rule): # 8..33 " 0.5.0 || 0.6.0 || ^0.7.0" - VersionPragmaExpression (Rule): # 8..23 " 0.5.0 || 0.6.0" diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/equal_operator/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/equal_operator/generated/0.4.11-success.yml index 7ea4b46a33..32b8a78c30 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/equal_operator/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/equal_operator/generated/0.4.11-success.yml @@ -8,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..15 "solidity =0.8.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionsList (Rule): # 8..15 " =0.8.0" + - VersionPragmaExpressions (Rule): # 8..15 " =0.8.0" - VersionPragmaExpression (Rule): # 8..15 " =0.8.0" - VersionPragmaUnaryExpression (Rule): # 8..15 " =0.8.0" - Equal (Token): "=" # 9..10 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/exact_version/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/exact_version/generated/0.4.11-success.yml index 3c3c7a0984..6e0a391583 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/exact_version/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/exact_version/generated/0.4.11-success.yml @@ -8,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..14 "solidity 0.8.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionsList (Rule): # 8..14 " 0.8.0" + - VersionPragmaExpressions (Rule): # 8..14 " 0.8.0" - VersionPragmaExpression (Rule): # 8..14 " 0.8.0" - VersionPragmaSpecifier (Rule): # 8..14 " 0.8.0" - VersionPragmaValue (Token): "0" # 9..10 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/less_than_operator/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/less_than_operator/generated/0.4.11-success.yml index ddc5c10fac..5029c2e26d 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/less_than_operator/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/less_than_operator/generated/0.4.11-success.yml @@ -8,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..15 "solidity <1.0.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionsList (Rule): # 8..15 " <1.0.0" + - VersionPragmaExpressions (Rule): # 8..15 " <1.0.0" - VersionPragmaExpression (Rule): # 8..15 " <1.0.0" - VersionPragmaUnaryExpression (Rule): # 8..15 " <1.0.0" - LessThan (Token): "<" # 9..10 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/multiple_exact_versions/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/multiple_exact_versions/generated/0.4.11-success.yml index 942d923267..f206f9517f 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/multiple_exact_versions/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/multiple_exact_versions/generated/0.4.11-success.yml @@ -8,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..20 "solidity 0.7.0 0.8.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionsList (Rule): # 8..20 " 0.7.0 0.8.0" + - VersionPragmaExpressions (Rule): # 8..20 " 0.7.0 0.8.0" - VersionPragmaExpression (Rule): # 8..14 " 0.7.0" - VersionPragmaSpecifier (Rule): # 8..14 " 0.7.0" - VersionPragmaValue (Token): "0" # 9..10 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/nested_expressions/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/nested_expressions/generated/0.4.11-success.yml index 22340701ee..f2ac65f9d2 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/nested_expressions/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/nested_expressions/generated/0.4.11-success.yml @@ -8,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..30 "solidity ^1.0.0 || 2.0.0-3.0.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionsList (Rule): # 8..30 " ^1.0.0 || 2.0.0-3.0.0" + - VersionPragmaExpressions (Rule): # 8..30 " ^1.0.0 || 2.0.0-3.0.0" - VersionPragmaExpression (Rule): # 8..30 " ^1.0.0 || 2.0.0-3.0.0" - VersionPragmaBinaryExpression (Rule): # 8..30 " ^1.0.0 || 2.0.0-3.0.0" - VersionPragmaExpression (Rule): # 8..15 " ^1.0.0" diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/ranges/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/ranges/generated/0.4.11-success.yml index 41f1d30a10..2d3f769d55 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/ranges/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/ranges/generated/0.4.11-success.yml @@ -8,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..22 "solidity 0.6.0 - 0.7.0" - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionsList (Rule): # 8..22 " 0.6.0 - 0.7.0" + - VersionPragmaExpressions (Rule): # 8..22 " 0.6.0 - 0.7.0" - VersionPragmaExpression (Rule): # 8..22 " 0.6.0 - 0.7.0" - VersionPragmaBinaryExpression (Rule): # 8..22 " 0.6.0 - 0.7.0" - VersionPragmaExpression (Rule): # 8..14 " 0.6.0" diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/with_trivia/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/with_trivia/generated/0.4.11-success.yml index 7abf2182b5..a2bdf337a2 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/with_trivia/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/with_trivia/generated/0.4.11-success.yml @@ -8,7 +8,7 @@ Errors: [] Tree: - VersionPragma (Rule): # 0..68 "solidity /* comments */ 0 /* are */ . /* allowed *..." - SolidityKeyword (Token): "solidity" # 0..8 - - VersionPragmaExpressionsList (Rule): # 8..68 " /* comments */ 0 /* are */ . /* allowed */ 0 . /*..." + - VersionPragmaExpressions (Rule): # 8..68 " /* comments */ 0 /* are */ . /* allowed */ 0 . /*..." - VersionPragmaExpression (Rule): # 8..68 " /* comments */ 0 /* are */ . /* allowed */ 0 . /*..." - VersionPragmaSpecifier (Rule): # 8..68 " /* comments */ 0 /* are */ . /* allowed */ 0 . /*..." - LeadingTrivia (Rule): # 8..24 " /* comments */ " diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/function_def/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/function_def/generated/0.4.11-success.yml index fe9a3141f3..662d3692dc 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/function_def/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/function_def/generated/0.4.11-success.yml @@ -12,28 +12,28 @@ Errors: [] Tree: - YulBlock (Rule): # 0..62 "{\n\tfunction mult(a, b) -> result {\n\t\tresult := mul..." - OpenBrace (Token): "{" # 0..1 - - YulStatementsList (Rule): # 2..60 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." + - YulStatements (Rule): # 2..60 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - YulStatement (Rule): # 2..60 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - YulFunctionDefinition (Rule): # 2..60 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - - FunctionKeyword (Token): "function" # 3..11 + - YulFunctionKeyword (Token): "function" # 3..11 - YulIdentifier (Token): "mult" # 12..16 - YulParametersDeclaration (Rule): # 16..22 "(a, b)" - OpenParen (Token): "(" # 16..17 - - YulIdentifiersList (Rule): # 17..21 "a, b" + - YulParameters (Rule): # 17..21 "a, b" - YulIdentifier (Token): "a" # 17..18 - Comma (Token): "," # 18..19 - YulIdentifier (Token): "b" # 20..21 - CloseParen (Token): ")" # 21..22 - YulReturnsDeclaration (Rule): # 22..32 " -> result" - MinusGreaterThan (Token): "->" # 23..25 - - YulIdentifiersList (Rule): # 25..32 " result" + - YulReturnVariables (Rule): # 25..32 " result" - YulIdentifier (Token): "result" # 26..32 - YulBlock (Rule): # 32..60 " {\n\t\tresult := mul(a, b)\n\t}\n" - OpenBrace (Token): "{" # 33..34 - - YulStatementsList (Rule): # 35..57 "\t\tresult := mul(a, b)\n" + - YulStatements (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - YulStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - YulAssignmentStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - - YulIdentifierPathsList (Rule): # 35..43 "\t\tresult" + - YulIdentifierPaths (Rule): # 35..43 "\t\tresult" - YulIdentifierPath (Rule): # 35..43 "\t\tresult" - YulIdentifier (Token): "result" # 37..43 - ColonEqual (Token): ":=" # 44..46 @@ -43,7 +43,7 @@ Tree: - YulIdentifierPath (Rule): # 46..50 " mul" - YulIdentifier (Token): "mul" # 47..50 - OpenParen (Token): "(" # 50..51 - - YulExpressionsList (Rule): # 51..55 "a, b" + - YulArguments (Rule): # 51..55 "a, b" - YulExpression (Rule): # 51..52 "a" - YulIdentifierPath (Rule): # 51..52 "a" - YulIdentifier (Token): "a" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.11-failure.yml index c500e1419c..0665c54004 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.11-failure.yml @@ -10,7 +10,7 @@ Source: > Errors: # 1 total - > - Error: Expected AsciiStringLiteral or BreakKeyword or CloseBrace or ContinueKeyword or FalseKeyword or ForKeyword or FunctionKeyword or HexStringLiteral or IfKeyword or LetKeyword or OpenBrace or SwitchKeyword or TrueKeyword or YulDecimalLiteral or YulHexLiteral or YulIdentifier. + Error: Expected AsciiStringLiteral or CloseBrace or HexStringLiteral or OpenBrace or YulBreakKeyword or YulContinueKeyword or YulDecimalLiteral or YulFalseKeyword or YulForKeyword or YulFunctionKeyword or YulHexLiteral or YulIdentifier or YulIfKeyword or YulLetKeyword or YulSwitchKeyword or YulTrueKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/input.sol:4:10] │ 4 │ ╭─▶ result := [mul(a, b) @@ -22,28 +22,28 @@ Errors: # 1 total Tree: - YulBlock (Rule): # 0..85 "{\n\tfunction mult(a, b) -> result {\n\t\tresult := mul..." - OpenBrace (Token): "{" # 0..1 - - YulStatementsList (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." + - YulStatements (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - YulStatement (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - YulFunctionDefinition (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - - FunctionKeyword (Token): "function" # 3..11 + - YulFunctionKeyword (Token): "function" # 3..11 - YulIdentifier (Token): "mult" # 12..16 - YulParametersDeclaration (Rule): # 16..22 "(a, b)" - OpenParen (Token): "(" # 16..17 - - YulIdentifiersList (Rule): # 17..21 "a, b" + - YulParameters (Rule): # 17..21 "a, b" - YulIdentifier (Token): "a" # 17..18 - Comma (Token): "," # 18..19 - YulIdentifier (Token): "b" # 20..21 - CloseParen (Token): ")" # 21..22 - YulReturnsDeclaration (Rule): # 22..32 " -> result" - MinusGreaterThan (Token): "->" # 23..25 - - YulIdentifiersList (Rule): # 25..32 " result" + - YulReturnVariables (Rule): # 25..32 " result" - YulIdentifier (Token): "result" # 26..32 - YulBlock (Rule): # 32..83 " {\n\t\tresult := mul(a, b)\n\t\tresult := [mul(a, b)\n\t}..." - OpenBrace (Token): "{" # 33..34 - - YulStatementsList (Rule): # 35..65 "\t\tresult := mul(a, b)\n\t\tresult" + - YulStatements (Rule): # 35..65 "\t\tresult := mul(a, b)\n\t\tresult" - YulStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - YulAssignmentStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - - YulIdentifierPathsList (Rule): # 35..43 "\t\tresult" + - YulIdentifierPaths (Rule): # 35..43 "\t\tresult" - YulIdentifierPath (Rule): # 35..43 "\t\tresult" - YulIdentifier (Token): "result" # 37..43 - ColonEqual (Token): ":=" # 44..46 @@ -53,7 +53,7 @@ Tree: - YulIdentifierPath (Rule): # 46..50 " mul" - YulIdentifier (Token): "mul" # 47..50 - OpenParen (Token): "(" # 50..51 - - YulExpressionsList (Rule): # 51..55 "a, b" + - YulArguments (Rule): # 51..55 "a, b" - YulExpression (Rule): # 51..52 "a" - YulIdentifierPath (Rule): # 51..52 "a" - YulIdentifier (Token): "a" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.6.0-failure.yml index 39dab865c2..06cf8c300b 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.6.0-failure.yml @@ -10,7 +10,7 @@ Source: > Errors: # 1 total - > - Error: Expected AsciiStringLiteral or BreakKeyword or CloseBrace or ContinueKeyword or FalseKeyword or ForKeyword or FunctionKeyword or HexStringLiteral or IfKeyword or LeaveKeyword or LetKeyword or OpenBrace or SwitchKeyword or TrueKeyword or YulDecimalLiteral or YulHexLiteral or YulIdentifier. + Error: Expected AsciiStringLiteral or CloseBrace or HexStringLiteral or OpenBrace or YulBreakKeyword or YulContinueKeyword or YulDecimalLiteral or YulFalseKeyword or YulForKeyword or YulFunctionKeyword or YulHexLiteral or YulIdentifier or YulIfKeyword or YulLeaveKeyword or YulLetKeyword or YulSwitchKeyword or YulTrueKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/input.sol:4:10] │ 4 │ ╭─▶ result := [mul(a, b) @@ -22,28 +22,28 @@ Errors: # 1 total Tree: - YulBlock (Rule): # 0..85 "{\n\tfunction mult(a, b) -> result {\n\t\tresult := mul..." - OpenBrace (Token): "{" # 0..1 - - YulStatementsList (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." + - YulStatements (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - YulStatement (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - YulFunctionDefinition (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - - FunctionKeyword (Token): "function" # 3..11 + - YulFunctionKeyword (Token): "function" # 3..11 - YulIdentifier (Token): "mult" # 12..16 - YulParametersDeclaration (Rule): # 16..22 "(a, b)" - OpenParen (Token): "(" # 16..17 - - YulIdentifiersList (Rule): # 17..21 "a, b" + - YulParameters (Rule): # 17..21 "a, b" - YulIdentifier (Token): "a" # 17..18 - Comma (Token): "," # 18..19 - YulIdentifier (Token): "b" # 20..21 - CloseParen (Token): ")" # 21..22 - YulReturnsDeclaration (Rule): # 22..32 " -> result" - MinusGreaterThan (Token): "->" # 23..25 - - YulIdentifiersList (Rule): # 25..32 " result" + - YulReturnVariables (Rule): # 25..32 " result" - YulIdentifier (Token): "result" # 26..32 - YulBlock (Rule): # 32..83 " {\n\t\tresult := mul(a, b)\n\t\tresult := [mul(a, b)\n\t}..." - OpenBrace (Token): "{" # 33..34 - - YulStatementsList (Rule): # 35..65 "\t\tresult := mul(a, b)\n\t\tresult" + - YulStatements (Rule): # 35..65 "\t\tresult := mul(a, b)\n\t\tresult" - YulStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - YulAssignmentStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - - YulIdentifierPathsList (Rule): # 35..43 "\t\tresult" + - YulIdentifierPaths (Rule): # 35..43 "\t\tresult" - YulIdentifierPath (Rule): # 35..43 "\t\tresult" - YulIdentifier (Token): "result" # 37..43 - ColonEqual (Token): ":=" # 44..46 @@ -53,7 +53,7 @@ Tree: - YulIdentifierPath (Rule): # 46..50 " mul" - YulIdentifier (Token): "mul" # 47..50 - OpenParen (Token): "(" # 50..51 - - YulExpressionsList (Rule): # 51..55 "a, b" + - YulArguments (Rule): # 51..55 "a, b" - YulExpression (Rule): # 51..52 "a" - YulIdentifierPath (Rule): # 51..52 "a" - YulIdentifier (Token): "a" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_literal/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_literal/generated/0.4.11-success.yml index 8ee9e709b6..c4f3af5ae1 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_literal/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_literal/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - YulExpression (Rule): # 0..3 "123" - - YulDecimalLiteral (Token): "123" # 0..3 + - YulLiteral (Rule): # 0..3 "123" + - YulDecimalLiteral (Token): "123" # 0..3 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 5ef6e83d6d..49dfe38937 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AsciiStringLiteral or FalseKeyword or HexStringLiteral or TrueKeyword or YulDecimalLiteral or YulHexLiteral or YulIdentifier. + Error: Expected AsciiStringLiteral or HexStringLiteral or YulDecimalLiteral or YulFalseKeyword or YulHexLiteral or YulIdentifier or YulTrueKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_trailing_ident_start/input.sol:1:1] │ 1 │ 1a diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/function_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/function_call/generated/0.4.11-success.yml index ee557c1d15..6a2d7aa0a2 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/function_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/function_call/generated/0.4.11-success.yml @@ -12,7 +12,8 @@ Tree: - YulIdentifierPath (Rule): # 0..3 "foo" - YulIdentifier (Token): "foo" # 0..3 - OpenParen (Token): "(" # 3..4 - - YulExpressionsList (Rule): # 4..5 "1" + - YulArguments (Rule): # 4..5 "1" - YulExpression (Rule): # 4..5 "1" - - YulDecimalLiteral (Token): "1" # 4..5 + - YulLiteral (Rule): # 4..5 "1" + - YulDecimalLiteral (Token): "1" # 4..5 - CloseParen (Token): ")" # 5..6 diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_literal/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_literal/generated/0.4.11-success.yml index 83d6f442e8..ed01ee87f1 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_literal/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_literal/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - YulExpression (Rule): # 0..5 "0x123" - - YulHexLiteral (Token): "0x123" # 0..5 + - YulLiteral (Rule): # 0..5 "0x123" + - YulHexLiteral (Token): "0x123" # 0..5 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 a3f3ae7d13..5ac4586226 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected AsciiStringLiteral or FalseKeyword or HexStringLiteral or TrueKeyword or YulDecimalLiteral or YulHexLiteral or YulIdentifier. + Error: Expected AsciiStringLiteral or HexStringLiteral or YulDecimalLiteral or YulFalseKeyword or YulHexLiteral or YulIdentifier or YulTrueKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/YulExpression/hex_trailing_ident_start/input.sol:1:1] │ 1 │ 0x1$ diff --git a/crates/solidity/testing/snapshots/cst_output/YulStatement/leave/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/YulStatement/leave/generated/0.7.1-success.yml similarity index 85% rename from crates/solidity/testing/snapshots/cst_output/YulStatement/leave/generated/0.6.0-success.yml rename to crates/solidity/testing/snapshots/cst_output/YulStatement/leave/generated/0.7.1-success.yml index c8bb0d30e7..c0aab82168 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulStatement/leave/generated/0.6.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulStatement/leave/generated/0.7.1-success.yml @@ -8,4 +8,4 @@ Errors: [] Tree: - YulStatement (Rule): # 0..5 "leave" - YulLeaveStatement (Rule): # 0..5 "leave" - - LeaveKeyword (Token): "leave" # 0..5 + - YulLeaveKeyword (Token): "leave" # 0..5