diff --git a/.gitattributes b/.gitattributes index d7d5267dea..610c6b39ba 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,5 +8,7 @@ crates/ruff_linter/resources/test/fixtures/pycodestyle/W391_3.py text eol=crlf crates/ruff_python_formatter/resources/test/fixtures/ruff/docstring_code_examples_crlf.py text eol=crlf crates/ruff_python_formatter/tests/snapshots/format@docstring_code_examples_crlf.py.snap text eol=crlf +crates/ruff_python_parser/resources/inline linguist-generated=true + ruff.schema.json linguist-generated=true text=auto eol=lf *.md.snap linguist-language=Markdown diff --git a/Cargo.lock b/Cargo.lock index c008395ec8..35710b6dbd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,15 +143,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "ascii-canvas" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" -dependencies = [ - "term", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -173,21 +164,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bitflags" version = "1.3.2" @@ -640,16 +616,6 @@ dependencies = [ "dirs-sys 0.4.1", ] -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - [[package]] name = "dirs-sys" version = "0.3.7" @@ -673,17 +639,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "drop_bomb" version = "0.1.5" @@ -702,15 +657,6 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" -[[package]] -name = "ena" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" -dependencies = [ - "log", -] - [[package]] name = "encode_unicode" version = "0.3.6" @@ -783,12 +729,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - [[package]] name = "flate2" version = "1.0.28" @@ -1147,15 +1087,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.12.1" @@ -1206,33 +1137,6 @@ dependencies = [ "libc", ] -[[package]] -name = "lalrpop" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" -dependencies = [ - "ascii-canvas", - "bit-set", - "ena", - "itertools 0.11.0", - "lalrpop-util", - "petgraph", - "regex", - "regex-syntax 0.8.2", - "string_cache", - "term", - "tiny-keccak", - "unicode-xid", - "walkdir", -] - -[[package]] -name = "lalrpop-util" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" - [[package]] name = "lazy_static" version = "1.4.0" @@ -1333,16 +1237,6 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" -[[package]] -name = "lock_api" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "log" version = "0.4.21" @@ -1437,12 +1331,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308d96db8debc727c3fd9744aac51751243420e46edf401010908da7f8d5e57c" -[[package]] -name = "new_debug_unreachable" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" - [[package]] name = "nix" version = "0.28.0" @@ -1561,29 +1449,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.48.5", -] - [[package]] name = "paste" version = "1.0.14" @@ -1687,23 +1552,13 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap", -] - [[package]] name = "phf" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ - "phf_shared 0.11.2", + "phf_shared", ] [[package]] @@ -1713,7 +1568,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" dependencies = [ "phf_generator", - "phf_shared 0.11.2", + "phf_shared", ] [[package]] @@ -1722,19 +1577,10 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ - "phf_shared 0.11.2", + "phf_shared", "rand", ] -[[package]] -name = "phf_shared" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", -] - [[package]] name = "phf_shared" version = "0.11.2" @@ -1773,12 +1619,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - [[package]] name = "pretty_assertions" version = "1.4.0" @@ -2336,22 +2176,24 @@ dependencies = [ name = "ruff_python_parser" version = "0.0.0" dependencies = [ + "annotate-snippets 0.9.2", "anyhow", + "bitflags 2.5.0", "bstr", + "drop_bomb", "insta", "is-macro", "itertools 0.12.1", - "lalrpop", - "lalrpop-util", "memchr", "ruff_python_ast", + "ruff_source_file", "ruff_text_size", "rustc-hash", "static_assertions", - "tiny-keccak", "unicode-ident", "unicode-normalization", "unicode_names2", + "walkdir", ] [[package]] @@ -2632,12 +2474,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "seahash" version = "4.1.0" @@ -2803,19 +2639,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "string_cache" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot", - "phf_shared 0.10.0", - "precomputed-hash", -] - [[package]] name = "strip-ansi-escapes" version = "0.2.0" @@ -2899,17 +2722,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", -] - [[package]] name = "terminal_size" version = "0.3.0" @@ -3016,15 +2828,6 @@ dependencies = [ "tikv-jemalloc-sys", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "tinytemplate" version = "1.2.1" @@ -3245,12 +3048,6 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - [[package]] name = "unicode_names2" version = "1.2.2" diff --git a/Cargo.toml b/Cargo.toml index dafd031f04..2910ac0ec2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,7 +52,6 @@ is-wsl = { version = "0.4.0" } itertools = { version = "0.12.1" } js-sys = { version = "0.3.69" } jod-thread = { version = "0.1.2" } -lalrpop-util = { version = "0.20.0", default-features = false } lexical-parse-float = { version = "0.8.0", features = ["format"] } libc = { version = "0.2.153" } libcst = { version = "1.1.0", default-features = false } diff --git a/_typos.toml b/_typos.toml index f239540e3a..8fb4dcfeb0 100644 --- a/_typos.toml +++ b/_typos.toml @@ -11,3 +11,9 @@ ned = "ned" pn = "pn" # `import panel as pd` is a thing poit = "poit" BA = "BA" # acronym for "Bad Allowed", used in testing. + +[default] +extend-ignore-re = [ + # Line ignore with trailing "spellchecker:disable-line" + "(?Rm)^.*#\\s*spellchecker:disable-line$" +] diff --git a/crates/ruff/tests/format.rs b/crates/ruff/tests/format.rs index f4a9808a5d..eab8b8380e 100644 --- a/crates/ruff/tests/format.rs +++ b/crates/ruff/tests/format.rs @@ -523,7 +523,7 @@ from module import = ----- stdout ----- ----- stderr ----- - error: Failed to parse main.py:2:20: Unexpected token '=' + error: Failed to parse main.py:2:20: Expected an import name "###); Ok(()) diff --git a/crates/ruff/tests/integration_test.rs b/crates/ruff/tests/integration_test.rs index e496a51a1e..8892dcfcb7 100644 --- a/crates/ruff/tests/integration_test.rs +++ b/crates/ruff/tests/integration_test.rs @@ -731,11 +731,11 @@ fn stdin_parse_error() { success: false exit_code: 1 ----- stdout ----- - -:1:17: E999 SyntaxError: Unexpected token '=' + -:1:17: E999 SyntaxError: Expected an import name Found 1 error. ----- stderr ----- - error: Failed to parse at 1:17: Unexpected token '=' + error: Failed to parse at 1:17: Expected an import name "###); } diff --git a/crates/ruff/tests/snapshots/show_settings__display_default_settings.snap b/crates/ruff/tests/snapshots/show_settings__display_default_settings.snap index 5ca066723f..d5ab3417f1 100644 --- a/crates/ruff/tests/snapshots/show_settings__display_default_settings.snap +++ b/crates/ruff/tests/snapshots/show_settings__display_default_settings.snap @@ -53,6 +53,7 @@ file_resolver.extend_exclude = [ "crates/ruff/resources/", "crates/ruff_linter/resources/", "crates/ruff_python_formatter/resources/", + "crates/ruff_python_parser/resources/", ] file_resolver.force_exclude = false file_resolver.include = [ diff --git a/crates/ruff_linter/src/checkers/ast/analyze/expression.rs b/crates/ruff_linter/src/checkers/ast/analyze/expression.rs index 72a293d3ac..11555d6ae3 100644 --- a/crates/ruff_linter/src/checkers/ast/analyze/expression.rs +++ b/crates/ruff_linter/src/checkers/ast/analyze/expression.rs @@ -247,7 +247,7 @@ pub(crate) fn expression(expr: &Expr, checker: &mut Checker) { } } } - ExprContext::Del => {} + _ => {} } if checker.enabled(Rule::SixPY3) { flake8_2020::rules::name_or_attribute(checker, expr); diff --git a/crates/ruff_linter/src/checkers/ast/mod.rs b/crates/ruff_linter/src/checkers/ast/mod.rs index f5de090296..da9b595f40 100644 --- a/crates/ruff_linter/src/checkers/ast/mod.rs +++ b/crates/ruff_linter/src/checkers/ast/mod.rs @@ -998,6 +998,7 @@ impl<'a> Visitor<'a> for Checker<'a> { ExprContext::Load => self.handle_node_load(expr), ExprContext::Store => self.handle_node_store(id, expr), ExprContext::Del => self.handle_node_delete(expr), + ExprContext::Invalid => {} }, _ => {} } diff --git a/crates/ruff_linter/src/logging.rs b/crates/ruff_linter/src/logging.rs index 2a64cde01c..81c733eed2 100644 --- a/crates/ruff_linter/src/logging.rs +++ b/crates/ruff_linter/src/logging.rs @@ -194,7 +194,7 @@ impl DisplayParseError { // Translate the byte offset to a location in the originating source. let location = if let Some(jupyter_index) = source_kind.as_ipy_notebook().map(Notebook::index) { - let source_location = source_code.source_location(error.offset); + let source_location = source_code.source_location(error.location.start()); ErrorLocation::Cell( jupyter_index @@ -208,7 +208,7 @@ impl DisplayParseError { }, ) } else { - ErrorLocation::File(source_code.source_location(error.offset)) + ErrorLocation::File(source_code.source_location(error.location.start())) }; Self { @@ -275,27 +275,7 @@ impl<'a> DisplayParseErrorType<'a> { impl Display for DisplayParseErrorType<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self.0 { - ParseErrorType::Eof => write!(f, "Expected token but reached end of file."), - ParseErrorType::ExtraToken(ref tok) => write!( - f, - "Got extraneous token: {tok}", - tok = TruncateAtNewline(&tok) - ), - ParseErrorType::InvalidToken => write!(f, "Got invalid token"), - ParseErrorType::UnrecognizedToken(ref tok, ref expected) => { - if let Some(expected) = expected.as_ref() { - write!( - f, - "Expected '{expected}', but got {tok}", - tok = TruncateAtNewline(&tok) - ) - } else { - write!(f, "Unexpected token {tok}", tok = TruncateAtNewline(&tok)) - } - } - ParseErrorType::Lexical(ref error) => write!(f, "{error}"), - } + write!(f, "{}", TruncateAtNewline(&self.0)) } } diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/rules/function_uses_loop_variable.rs b/crates/ruff_linter/src/rules/flake8_bugbear/rules/function_uses_loop_variable.rs index 6e52d1710b..852a4d5098 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/rules/function_uses_loop_variable.rs +++ b/crates/ruff_linter/src/rules/flake8_bugbear/rules/function_uses_loop_variable.rs @@ -67,7 +67,7 @@ impl<'a> Visitor<'a> for LoadedNamesVisitor<'a> { Expr::Name(name) => match &name.ctx { ExprContext::Load => self.loaded.push(name), ExprContext::Store => self.stored.push(name), - ExprContext::Del => {} + _ => {} }, _ => visitor::walk_expr(self, expr), } diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__bom_unsorted.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__bom_unsorted.py.snap index 4cff110aff..d9c75d398f 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__bom_unsorted.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__bom_unsorted.py.snap @@ -14,5 +14,3 @@ bom_unsorted.py:1:1: I001 [*] Import block is un-sorted or un-formatted 2 |-import bar 1 |+import bar 2 |+import foo - - diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/errors.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/errors.rs index da02f458a8..5ca8e790b0 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/errors.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/errors.rs @@ -81,7 +81,7 @@ pub(crate) fn syntax_error( parse_error: &ParseError, locator: &Locator, ) { - let rest = locator.after(parse_error.offset); + let rest = locator.after(parse_error.location.start()); // Try to create a non-empty range so that the diagnostic can print a caret at the // right position. This requires that we retrieve the next character, if any, and take its length @@ -95,6 +95,6 @@ pub(crate) fn syntax_error( SyntaxError { message: format!("{}", DisplayParseErrorType::new(&parse_error.error)), }, - TextRange::at(parse_error.offset, len), + TextRange::at(parse_error.location.start(), len), )); } diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E999_E999.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E999_E999.py.snap index 767f6e4a0a..ac712ec6c2 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E999_E999.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E999_E999.py.snap @@ -1,12 +1,9 @@ --- source: crates/ruff_linter/src/rules/pycodestyle/mod.rs --- -E999.py:3:1: E999 SyntaxError: unindent does not match any outer indentation level +E999.py:2:9: E999 SyntaxError: Expected an indented block after function definition | 2 | def x(): + | ^ E999 3 | - | ^ E999 -4 | | - - diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP027.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP027.py.snap index 4d4a97f89a..c177a26b81 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP027.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP027.py.snap @@ -110,5 +110,3 @@ UP027.py:10:17: UP027 [*] Replace unpacked list comprehension with a generator e 14 14 | 15 15 | # Should not change 16 16 | foo = [fn(x) for x in items] - - diff --git a/crates/ruff_python_ast/src/helpers.rs b/crates/ruff_python_ast/src/helpers.rs index 72592b9356..91186e8f7a 100644 --- a/crates/ruff_python_ast/src/helpers.rs +++ b/crates/ruff_python_ast/src/helpers.rs @@ -1600,7 +1600,7 @@ mod tests { fn any_over_stmt_type_alias() { let seen = RefCell::new(Vec::new()); let name = Expr::Name(ExprName { - id: "x".to_string(), + id: "x".into(), range: TextRange::default(), ctx: ExprContext::Load, }); diff --git a/crates/ruff_python_ast/src/nodes.rs b/crates/ruff_python_ast/src/nodes.rs index 09de037850..cbd140c6c3 100644 --- a/crates/ruff_python_ast/src/nodes.rs +++ b/crates/ruff_python_ast/src/nodes.rs @@ -1,6 +1,7 @@ #![allow(clippy::derive_partial_eq_without_eq)] use std::cell::OnceCell; + use std::fmt; use std::fmt::Debug; use std::ops::Deref; @@ -947,12 +948,19 @@ impl Ranged for FStringExpressionElement { } } +/// An `FStringLiteralElement` with an empty `value` is an invalid f-string element. #[derive(Clone, Debug, PartialEq)] pub struct FStringLiteralElement { pub range: TextRange, pub value: Box, } +impl FStringLiteralElement { + pub fn is_valid(&self) -> bool { + !self.value.is_empty() + } +} + impl Ranged for FStringLiteralElement { fn range(&self) -> TextRange { self.range @@ -1571,6 +1579,9 @@ bitflags! { /// for why we track the casing of the `r` prefix, /// but not for any other prefix const R_PREFIX_UPPER = 1 << 4; + + /// The string was deemed invalid by the parser. + const INVALID = 1 << 5; } } @@ -1621,6 +1632,12 @@ impl StringLiteralFlags { } } + #[must_use] + pub fn with_invalid(mut self) -> Self { + self.0 |= StringLiteralFlagsInner::INVALID; + self + } + pub const fn prefix(self) -> StringLiteralPrefix { if self.0.contains(StringLiteralFlagsInner::U_PREFIX) { debug_assert!(!self.0.intersects( @@ -1737,6 +1754,15 @@ impl StringLiteral { pub fn as_str(&self) -> &str { self } + + /// Creates an invalid string literal with the given range. + pub fn invalid(range: TextRange) -> Self { + Self { + range, + value: "".into(), + flags: StringLiteralFlags::default().with_invalid(), + } + } } impl From for Expr { @@ -1952,6 +1978,9 @@ bitflags! { /// See https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#r-strings-and-r-strings /// for why we track the casing of the `r` prefix, but not for any other prefix const R_PREFIX_UPPER = 1 << 3; + + /// The bytestring was deemed invalid by the parser. + const INVALID = 1 << 4; } } @@ -2025,6 +2054,12 @@ impl BytesLiteralFlags { self } + #[must_use] + pub fn with_invalid(mut self) -> Self { + self.0 |= BytesLiteralFlagsInner::INVALID; + self + } + pub const fn prefix(self) -> ByteStringPrefix { if self.0.contains(BytesLiteralFlagsInner::R_PREFIX_LOWER) { debug_assert!(!self.0.contains(BytesLiteralFlagsInner::R_PREFIX_UPPER)); @@ -2094,6 +2129,15 @@ impl BytesLiteral { pub fn as_slice(&self) -> &[u8] { self } + + /// Creates a new invalid bytes literal with the given range. + pub fn invalid(range: TextRange) -> Self { + Self { + range, + value: Box::new([]), + flags: BytesLiteralFlags::default().with_invalid(), + } + } } impl From for Expr { @@ -2726,6 +2770,7 @@ pub enum ExprContext { Load, Store, Del, + Invalid, } /// See also [boolop](https://docs.python.org/3/library/ast.html#ast.BoolOp) @@ -3506,10 +3551,17 @@ impl IpyEscapeKind { } } +/// An `Identifier` with an empty `id` is invalid. +/// +/// For example, in the following code `id` will be empty. +/// ```python +/// def 1(): +/// ... +/// ``` #[derive(Clone, Debug, PartialEq, Eq, Hash)] pub struct Identifier { - id: String, - range: TextRange, + pub id: String, + pub range: TextRange, } impl Identifier { @@ -3520,6 +3572,10 @@ impl Identifier { range, } } + + pub fn is_valid(&self) -> bool { + !self.id.is_empty() + } } impl Identifier { diff --git a/crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/named_expr.py b/crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/named_expr.py index 0d9b8e366c..28c340ee7a 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/named_expr.py +++ b/crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/named_expr.py @@ -71,8 +71,6 @@ for x in (y := [1, 2, 3]): async for x in (y := [1, 2, 3]): pass -del (x := 1) - try: pass except (e := Exception): diff --git a/crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/slice.py b/crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/slice.py index 30e436943a..f041bb10ff 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/slice.py +++ b/crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/slice.py @@ -110,3 +110,14 @@ self.assertEqual( suite._tests[0].id().split(".")[0], os.path.basename(os.getcwd()), ) + +# PEP 646 introduced starred expression in indexes +# https://peps.python.org/pep-0646/#change-1-star-expressions-in-indexes +data[*x] +data[*x,] +data[ + *x, +] +data[ # comment 1 + *x, # comment 2 +] # comment 3 diff --git a/crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/function.py b/crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/function.py index 83284168b6..1630668e33 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/function.py +++ b/crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/function.py @@ -427,3 +427,9 @@ def function_with_one_argument_and_a_keyword_separator( *, argument: str ) -> ReallyReallyReallyReallyReallyReallyReallyReallyLongName: pass + + +# PEP 646 introduced type var tuple in parameter annotation +# https://peps.python.org/pep-0646/#change-2-args-as-a-typevartuple +def function_with_variadic_generics(*args: *tuple[int]): ... +def function_with_variadic_generics(*args: *tuple[int],): ... diff --git a/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__only_comments.snap b/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__only_comments.snap index 49f7ca154b..8f5f96bd72 100644 --- a/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__only_comments.snap +++ b/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__only_comments.snap @@ -5,8 +5,8 @@ expression: comments.debug(test_case.source_code) { Node { kind: ModModule, - range: 0..0, - source: ``, + range: 0..35, + source: `⏎`, }: { "leading": [ SourceComment { diff --git a/crates/ruff_python_formatter/src/expression/expr_tuple.rs b/crates/ruff_python_formatter/src/expression/expr_tuple.rs index 536a03b45d..a5efa1cee1 100644 --- a/crates/ruff_python_formatter/src/expression/expr_tuple.rs +++ b/crates/ruff_python_formatter/src/expression/expr_tuple.rs @@ -1,13 +1,14 @@ -use ruff_formatter::{format_args, write, FormatRuleWithOptions}; +use ruff_formatter::{format_args, FormatRuleWithOptions}; use ruff_python_ast::AnyNodeRef; use ruff_python_ast::ExprTuple; -use ruff_text_size::Ranged; +use ruff_text_size::{Ranged, TextRange}; use crate::builders::parenthesize_if_expands; use crate::comments::SourceComment; use crate::expression::parentheses::{ empty_parenthesized, optional_parentheses, parenthesized, NeedsParentheses, OptionalParentheses, }; +use crate::other::commas::has_trailing_comma; use crate::prelude::*; #[derive(Debug, Clone, Copy, Eq, PartialEq, Default)] @@ -138,7 +139,27 @@ impl FormatNodeRule for FormatExprTuple { } [single] => match self.parentheses { TupleParentheses::Preserve if !is_parenthesized => { - write!(f, [single.format(), token(",")]) + single.format().fmt(f)?; + // The `TupleParentheses::Preserve` is only set by subscript expression + // formatting. With PEP 646, a single element starred expression in the slice + // position of a subscript expression is actually a tuple expression. For + // example: + // + // ```python + // data[*x] + // # ^^ single element tuple expression without a trailing comma + // + // data[*x,] + // # ^^^ single element tuple expression with a trailing comma + // ``` + // + // + // This means that the formatter should only add a trailing comma if there is + // one already. + if has_trailing_comma(TextRange::new(single.end(), item.end()), f.context()) { + token(",").fmt(f)?; + } + Ok(()) } _ => // A single element tuple always needs parentheses and a trailing comma, except when inside of a subscript diff --git a/crates/ruff_python_formatter/src/lib.rs b/crates/ruff_python_formatter/src/lib.rs index c4cf4a16c3..d2736084aa 100644 --- a/crates/ruff_python_formatter/src/lib.rs +++ b/crates/ruff_python_formatter/src/lib.rs @@ -135,7 +135,7 @@ pub fn format_module_source( let source_type = options.source_type(); let (tokens, comment_ranges) = tokens_and_ranges(source, source_type).map_err(|err| ParseError { - offset: err.location(), + location: err.location(), error: ParseErrorType::Lexical(err.into_error()), })?; let module = parse_tokens(tokens, source, source_type.as_mode())?; diff --git a/crates/ruff_python_formatter/src/module/mod_module.rs b/crates/ruff_python_formatter/src/module/mod_module.rs index c42f79a1c1..e27e7415e5 100644 --- a/crates/ruff_python_formatter/src/module/mod_module.rs +++ b/crates/ruff_python_formatter/src/module/mod_module.rs @@ -17,7 +17,7 @@ impl FormatNodeRule for FormatModModule { if body.is_empty() { // Only preserve an empty line if the source contains an empty line too. if !f.context().comments().has_leading(item) - && lines_after(range.end(), f.context().source()) != 0 + && lines_after(range.start(), f.context().source()) != 0 { empty_line().fmt(f) } else { diff --git a/crates/ruff_python_formatter/src/other/commas.rs b/crates/ruff_python_formatter/src/other/commas.rs index a102e0d59e..50a0fff111 100644 --- a/crates/ruff_python_formatter/src/other/commas.rs +++ b/crates/ruff_python_formatter/src/other/commas.rs @@ -9,20 +9,23 @@ use crate::MagicTrailingComma; /// should be respected). pub(crate) fn has_magic_trailing_comma(range: TextRange, context: &PyFormatContext) -> bool { match context.options().magic_trailing_comma() { - MagicTrailingComma::Respect => { - let first_token = SimpleTokenizer::new(context.source(), range) - .skip_trivia() - // Skip over any closing parentheses belonging to the expression - .find(|token| token.kind() != SimpleTokenKind::RParen); - - matches!( - first_token, - Some(SimpleToken { - kind: SimpleTokenKind::Comma, - .. - }) - ) - } + MagicTrailingComma::Respect => has_trailing_comma(range, context), MagicTrailingComma::Ignore => false, } } + +/// Returns `true` if the range ends with a trailing comma. +pub(crate) fn has_trailing_comma(range: TextRange, context: &PyFormatContext) -> bool { + let first_token = SimpleTokenizer::new(context.source(), range) + .skip_trivia() + // Skip over any closing parentheses belonging to the expression + .find(|token| token.kind() != SimpleTokenKind::RParen); + + matches!( + first_token, + Some(SimpleToken { + kind: SimpleTokenKind::Comma, + .. + }) + ) +} diff --git a/crates/ruff_python_formatter/src/range.rs b/crates/ruff_python_formatter/src/range.rs index 2997526671..58ea00117c 100644 --- a/crates/ruff_python_formatter/src/range.rs +++ b/crates/ruff_python_formatter/src/range.rs @@ -73,7 +73,7 @@ pub fn format_range( let (tokens, comment_ranges) = tokens_and_ranges(source, options.source_type()).map_err(|err| ParseError { - offset: err.location(), + location: err.location(), error: ParseErrorType::Lexical(err.into_error()), })?; diff --git a/crates/ruff_python_formatter/tests/snapshots/format@empty_multiple_trailing_newlines.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@empty_multiple_trailing_newlines.py.snap index 5582da34d9..3346623b73 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@empty_multiple_trailing_newlines.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@empty_multiple_trailing_newlines.py.snap @@ -13,6 +13,3 @@ input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/empty_mult ```python ``` - - - diff --git a/crates/ruff_python_formatter/tests/snapshots/format@empty_trailing_newline.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@empty_trailing_newline.py.snap index 516325c9df..6caaf01e0e 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@empty_trailing_newline.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@empty_trailing_newline.py.snap @@ -11,6 +11,3 @@ input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/empty_trai ```python ``` - - - diff --git a/crates/ruff_python_formatter/tests/snapshots/format@expression__named_expr.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@expression__named_expr.py.snap index 8221398aa9..0425268563 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@expression__named_expr.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@expression__named_expr.py.snap @@ -77,8 +77,6 @@ for x in (y := [1, 2, 3]): async for x in (y := [1, 2, 3]): pass -del (x := 1) - try: pass except (e := Exception): @@ -180,8 +178,6 @@ for x in (y := [1, 2, 3]): async for x in (y := [1, 2, 3]): pass -del (x := 1) - try: pass except (e := Exception): @@ -207,6 +203,3 @@ def f(): async def f(): await (x := 1) ``` - - - diff --git a/crates/ruff_python_formatter/tests/snapshots/format@expression__slice.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@expression__slice.py.snap index 3063466678..7e12e24474 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@expression__slice.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@expression__slice.py.snap @@ -116,6 +116,17 @@ self.assertEqual( suite._tests[0].id().split(".")[0], os.path.basename(os.getcwd()), ) + +# PEP 646 introduced starred expression in indexes +# https://peps.python.org/pep-0646/#change-1-star-expressions-in-indexes +data[*x] +data[*x,] +data[ + *x, +] +data[ # comment 1 + *x, # comment 2 +] # comment 3 ``` ## Output @@ -231,7 +242,13 @@ self.assertEqual( suite._tests[0].id().split(".")[0], os.path.basename(os.getcwd()), ) + +# PEP 646 introduced starred expression in indexes +# https://peps.python.org/pep-0646/#change-1-star-expressions-in-indexes +data[*x] +data[*x,] +data[*x,] +data[ # comment 1 + *x, # comment 2 +] # comment 3 ``` - - - diff --git a/crates/ruff_python_formatter/tests/snapshots/format@statement__function.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@statement__function.py.snap index c87ac155a8..32afd9a9d8 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@statement__function.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@statement__function.py.snap @@ -433,6 +433,12 @@ def function_with_one_argument_and_a_keyword_separator( *, argument: str ) -> ReallyReallyReallyReallyReallyReallyReallyReallyLongName: pass + + +# PEP 646 introduced type var tuple in parameter annotation +# https://peps.python.org/pep-0646/#change-2-args-as-a-typevartuple +def function_with_variadic_generics(*args: *tuple[int]): ... +def function_with_variadic_generics(*args: *tuple[int],): ... ``` ## Output @@ -1014,4 +1020,12 @@ def function_with_one_argument_and_a_keyword_separator( *, argument: str ) -> ReallyReallyReallyReallyReallyReallyReallyReallyLongName: pass + + +# PEP 646 introduced type var tuple in parameter annotation +# https://peps.python.org/pep-0646/#change-2-args-as-a-typevartuple +def function_with_variadic_generics(*args: *tuple[int]): ... +def function_with_variadic_generics( + *args: *tuple[int], +): ... ``` diff --git a/crates/ruff_python_parser/CONTRIBUTING.md b/crates/ruff_python_parser/CONTRIBUTING.md new file mode 100644 index 0000000000..ec8c0ccfdd --- /dev/null +++ b/crates/ruff_python_parser/CONTRIBUTING.md @@ -0,0 +1,54 @@ +# Contributing to the Python Parser + +## Development + +### Inline tests + +The parser crate supports writing inline tests. These are tests that are written +in the source code itself, and are extracted to a separate file and run with the +test suite. They are written in the form of comments with a specific format. There +are two forms of inline tests: + +Test that the parser successfully parses the input with no syntax errors. They're +written in the following format: + +```rs +// test_ok this_is_the_test_name +// def foo(): +// pass +println!("some rust code"); +``` + +Test that the parser fails to parse the input with a syntax error. They're written +in the following format: + +```rs +// test_err this_is_the_test_name +// [1, 2 +println!("some rust code"); +``` + +Note that the difference between the two is the `test_ok` and `test_err` keywords. +The comment block must be independent of any other comment blocks. For example, the +following is not extracted: + +```rs +// Some random comment +// +// test_ok this_is_the_test_name +// def foo(): +// pass +println!("some rust code"); +``` + +To generate the corresponding Python files for the inline tests, run the following command: + +```sh +cargo test --package ruff_python_parser --test generate_inline_tests +``` + +Then, run the Parser test suite with the following command: + +```sh +cargo test --package ruff_python_parser +``` diff --git a/crates/ruff_python_parser/Cargo.toml b/crates/ruff_python_parser/Cargo.toml index 425537b75e..319df3eb0e 100644 --- a/crates/ruff_python_parser/Cargo.toml +++ b/crates/ruff_python_parser/Cargo.toml @@ -9,7 +9,6 @@ homepage = { workspace = true } documentation = { workspace = true } repository = { workspace = true } license = { workspace = true } -build = "build.rs" [lib] @@ -18,10 +17,11 @@ ruff_python_ast = { path = "../ruff_python_ast" } ruff_text_size = { path = "../ruff_text_size" } anyhow = { workspace = true } +bitflags = { workspace = true } +drop_bomb = { workspace = true } bstr = { workspace = true } is-macro = { workspace = true } itertools = { workspace = true } -lalrpop-util = { workspace = true, default-features = false } memchr = { workspace = true } rustc-hash = { workspace = true } static_assertions = { workspace = true } @@ -30,12 +30,11 @@ unicode_names2 = { workspace = true } unicode-normalization = { workspace = true } [dev-dependencies] -insta = { workspace = true } +ruff_source_file = { path = "../ruff_source_file" } -[build-dependencies] -anyhow = { workspace = true } -lalrpop = { version = "0.20.0", default-features = false, optional = true } -tiny-keccak = { version = "2", features = ["sha3"] } +annotate-snippets = { workspace = true } +insta = { workspace = true, features = ["glob"] } +walkdir = { workspace = true } [lints] workspace = true diff --git a/crates/ruff_python_parser/build.rs b/crates/ruff_python_parser/build.rs deleted file mode 100644 index 8544bd88db..0000000000 --- a/crates/ruff_python_parser/build.rs +++ /dev/null @@ -1,112 +0,0 @@ -use std::fmt::Write as _; -use std::fs::File; -use std::io::{BufRead, BufReader}; -use std::path::{Path, PathBuf}; -use tiny_keccak::{Hasher, Sha3}; - -fn main() { - const SOURCE: &str = "src/python.lalrpop"; - println!("cargo:rerun-if-changed={SOURCE}"); - - let target; - let error; - - #[cfg(feature = "lalrpop")] - { - let out_dir = PathBuf::from(std::env::var_os("OUT_DIR").unwrap()); - target = out_dir.join("src/python.rs"); - } - #[cfg(not(feature = "lalrpop"))] - { - target = PathBuf::from("src/python.rs"); - error = "python.lalrpop and src/python.rs doesn't match. This is a ruff_python_parser bug. Please report it unless you are editing ruff_python_parser. Run `lalrpop src/python.lalrpop` to build ruff_python_parser again."; - } - - let Some(message) = requires_lalrpop(SOURCE, &target) else { - return; - }; - - #[cfg(feature = "lalrpop")] - { - let Err(e) = try_lalrpop() else { - return; - }; - error = e; - } - - println!("cargo:warning={message}"); - panic!("running lalrpop failed. {error:?}"); -} - -fn requires_lalrpop(source: &str, target: &Path) -> Option { - let Ok(target) = File::open(target) else { - return Some("python.rs doesn't exist. regenerate.".to_owned()); - }; - - let sha_prefix = "// sha3: "; - let Some(sha3_line) = BufReader::with_capacity(128, target) - .lines() - .find_map(|line| { - let line = line.unwrap(); - line.starts_with(sha_prefix).then_some(line) - }) - else { - // no sha3 line - maybe old version of lalrpop installed - return Some("python.rs doesn't include sha3 hash. regenerate.".to_owned()); - }; - let expected_sha3_str = sha3_line.strip_prefix(sha_prefix).unwrap(); - - let actual_sha3 = { - let mut hasher = Sha3::v256(); - let mut f = BufReader::new(File::open(source).unwrap()); - let mut line = String::new(); - while f.read_line(&mut line).unwrap() != 0 { - if line.ends_with('\n') { - line.pop(); - if line.ends_with('\r') { - line.pop(); - } - } - hasher.update(line.as_bytes()); - hasher.update(b"\n"); - line.clear(); - } - let mut hash = [0u8; 32]; - hasher.finalize(&mut hash); - hash - }; - let eq = sha_equal(expected_sha3_str, &actual_sha3); - if !eq { - let mut actual_sha3_str = String::new(); - for byte in actual_sha3 { - write!(actual_sha3_str, "{byte:02x}").unwrap(); - } - return Some(format!( - "python.rs hash expected: {expected_sha3_str} but actual: {actual_sha3_str}" - )); - } - None -} - -#[cfg(feature = "lalrpop")] -fn try_lalrpop() -> Result<(), Box> { - // We are not using lalrpop::process_root() or Configuration::process_current_dir() - // because of https://github.com/lalrpop/lalrpop/issues/699. - lalrpop::Configuration::new() - .use_cargo_dir_conventions() - .set_in_dir(Path::new(".")) - .process() -} - -fn sha_equal(expected_sha3_str: &str, actual_sha3: &[u8; 32]) -> bool { - assert!( - expected_sha3_str.len() == 64, - "lalrpop version? hash bug is fixed in 0.19.8" - ); - - let mut expected_sha3 = [0u8; 32]; - for (i, b) in expected_sha3.iter_mut().enumerate() { - *b = u8::from_str_radix(&expected_sha3_str[i * 2..][..2], 16).unwrap(); - } - *actual_sha3 == expected_sha3 -} diff --git a/crates/ruff_python_parser/resources/.editorconfig b/crates/ruff_python_parser/resources/.editorconfig new file mode 100644 index 0000000000..8a311dc037 --- /dev/null +++ b/crates/ruff_python_parser/resources/.editorconfig @@ -0,0 +1,6 @@ +# Check http://editorconfig.org for more information +# This is the main config file for this project: +root = true + +[*.py] +insert_final_newline = false diff --git a/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_invalid_annotation.py b/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_invalid_annotation.py new file mode 100644 index 0000000000..898f026301 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_invalid_annotation.py @@ -0,0 +1,4 @@ +x: *int = 1 +x: yield a = 1 +x: yield from b = 1 +x: y := int = 1 diff --git a/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_invalid_target.py b/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_invalid_target.py new file mode 100644 index 0000000000..977ec6a23a --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_invalid_target.py @@ -0,0 +1,10 @@ +"abc": str = "def" +call(): str = "no" +*x: int = 1, 2 +# Tuple assignment +x,: int = 1 +x, y: int = 1, 2 +(x, y): int = 1, 2 +# List assignment +[x]: int = 1 +[x, y]: int = 1, 2 diff --git a/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_invalid_value.py b/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_invalid_value.py new file mode 100644 index 0000000000..c9db78ae11 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_invalid_value.py @@ -0,0 +1,3 @@ +x: Any = *a and b +x: Any = x := 1 +x: list = [x, *a | b, *a or b] diff --git a/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_missing_rhs.py b/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_missing_rhs.py new file mode 100644 index 0000000000..dd39bce616 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_missing_rhs.py @@ -0,0 +1 @@ +x: int = diff --git a/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_type_alias_annotation.py b/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_type_alias_annotation.py new file mode 100644 index 0000000000..56d06da2da --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_type_alias_annotation.py @@ -0,0 +1,2 @@ +a: type X = int +lambda: type X = int diff --git a/crates/ruff_python_parser/resources/inline/err/assert_empty_msg.py b/crates/ruff_python_parser/resources/inline/err/assert_empty_msg.py new file mode 100644 index 0000000000..f4095c02a2 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/assert_empty_msg.py @@ -0,0 +1 @@ +assert x, diff --git a/crates/ruff_python_parser/resources/inline/err/assert_empty_test.py b/crates/ruff_python_parser/resources/inline/err/assert_empty_test.py new file mode 100644 index 0000000000..60190201b0 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/assert_empty_test.py @@ -0,0 +1 @@ +assert diff --git a/crates/ruff_python_parser/resources/inline/err/assert_invalid_msg_expr.py b/crates/ruff_python_parser/resources/inline/err/assert_invalid_msg_expr.py new file mode 100644 index 0000000000..3b68e8cbf0 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/assert_invalid_msg_expr.py @@ -0,0 +1,4 @@ +assert False, *x +assert False, assert x +assert False, yield x +assert False, x := 1 diff --git a/crates/ruff_python_parser/resources/inline/err/assert_invalid_test_expr.py b/crates/ruff_python_parser/resources/inline/err/assert_invalid_test_expr.py new file mode 100644 index 0000000000..467549f050 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/assert_invalid_test_expr.py @@ -0,0 +1,4 @@ +assert *x +assert assert x +assert yield x +assert x := 1 diff --git a/crates/ruff_python_parser/resources/inline/err/assign_stmt_invalid_target.py b/crates/ruff_python_parser/resources/inline/err/assign_stmt_invalid_target.py new file mode 100644 index 0000000000..76a15dcb29 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/assign_stmt_invalid_target.py @@ -0,0 +1,4 @@ +1 = 1 +x = 1 = 2 +x = 1 = y = 2 = z +["a", "b"] = ["a", "b"] diff --git a/crates/ruff_python_parser/resources/inline/err/assign_stmt_invalid_value_expr.py b/crates/ruff_python_parser/resources/inline/err/assign_stmt_invalid_value_expr.py new file mode 100644 index 0000000000..c8cf8e64ee --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/assign_stmt_invalid_value_expr.py @@ -0,0 +1,5 @@ +x = *a and b +x = *yield x +x = *yield from x +x = *lambda x: x +x = x := 1 diff --git a/crates/ruff_python_parser/resources/inline/err/assign_stmt_keyword_target.py b/crates/ruff_python_parser/resources/inline/err/assign_stmt_keyword_target.py new file mode 100644 index 0000000000..26ff3f533a --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/assign_stmt_keyword_target.py @@ -0,0 +1,4 @@ +a = pass = c +a + b +a = b = pass = c +a + b diff --git a/crates/ruff_python_parser/resources/inline/err/assign_stmt_missing_rhs.py b/crates/ruff_python_parser/resources/inline/err/assign_stmt_missing_rhs.py new file mode 100644 index 0000000000..b361b37f37 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/assign_stmt_missing_rhs.py @@ -0,0 +1,6 @@ +x = +1 + 1 +x = y = +2 + 2 +x = = y +3 + 3 diff --git a/crates/ruff_python_parser/resources/inline/err/async_unexpected_token.py b/crates/ruff_python_parser/resources/inline/err/async_unexpected_token.py new file mode 100644 index 0000000000..0641706d52 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/async_unexpected_token.py @@ -0,0 +1,8 @@ +async class Foo: ... +async while test: ... +async x = 1 +async async def foo(): ... +# TODO(dhruvmanila): Here, `match` is actually a Name token because +# of the soft keyword # transformer +async match test: + case _: ... diff --git a/crates/ruff_python_parser/resources/inline/err/aug_assign_stmt_invalid_target.py b/crates/ruff_python_parser/resources/inline/err/aug_assign_stmt_invalid_target.py new file mode 100644 index 0000000000..77fc15d4f8 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/aug_assign_stmt_invalid_target.py @@ -0,0 +1,6 @@ +1 += 1 +"a" += "b" +*x += 1 +pass += 1 +x += pass +(x + y) += 1 diff --git a/crates/ruff_python_parser/resources/inline/err/aug_assign_stmt_invalid_value.py b/crates/ruff_python_parser/resources/inline/err/aug_assign_stmt_invalid_value.py new file mode 100644 index 0000000000..9db762d223 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/aug_assign_stmt_invalid_value.py @@ -0,0 +1,5 @@ +x += *a and b +x += *yield x +x += *yield from x +x += *lambda x: x +x += y := 1 diff --git a/crates/ruff_python_parser/resources/inline/err/aug_assign_stmt_missing_rhs.py b/crates/ruff_python_parser/resources/inline/err/aug_assign_stmt_missing_rhs.py new file mode 100644 index 0000000000..6e46c14688 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/aug_assign_stmt_missing_rhs.py @@ -0,0 +1,4 @@ +x += +1 + 1 +x += y += +2 + 2 diff --git a/crates/ruff_python_parser/resources/inline/err/class_def_empty_body.py b/crates/ruff_python_parser/resources/inline/err/class_def_empty_body.py new file mode 100644 index 0000000000..27ada0f31b --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/class_def_empty_body.py @@ -0,0 +1,3 @@ +class Foo: +class Foo(): +x = 42 diff --git a/crates/ruff_python_parser/resources/inline/err/class_def_missing_name.py b/crates/ruff_python_parser/resources/inline/err/class_def_missing_name.py new file mode 100644 index 0000000000..1dbb799ce3 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/class_def_missing_name.py @@ -0,0 +1,3 @@ +class : ... +class (): ... +class (metaclass=ABC): ... diff --git a/crates/ruff_python_parser/resources/inline/err/class_def_unclosed_type_param_list.py b/crates/ruff_python_parser/resources/inline/err/class_def_unclosed_type_param_list.py new file mode 100644 index 0000000000..da72bd103c --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/class_def_unclosed_type_param_list.py @@ -0,0 +1,3 @@ +class Foo[T1, *T2(a, b): + pass +x = 10 diff --git a/crates/ruff_python_parser/resources/inline/err/clause_expect_indented_block.py b/crates/ruff_python_parser/resources/inline/err/clause_expect_indented_block.py new file mode 100644 index 0000000000..179a01af4d --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/clause_expect_indented_block.py @@ -0,0 +1,6 @@ +# Here, the error is highlighted at the `pass` token +if True: +pass +# The parser is at the end of the program, so let's highlight +# at the newline token after `:` +if True: diff --git a/crates/ruff_python_parser/resources/inline/err/clause_expect_single_statement.py b/crates/ruff_python_parser/resources/inline/err/clause_expect_single_statement.py new file mode 100644 index 0000000000..23393d4c25 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/clause_expect_single_statement.py @@ -0,0 +1 @@ +if True: if True: pass diff --git a/crates/ruff_python_parser/resources/inline/err/comprehension_missing_for_after_async.py b/crates/ruff_python_parser/resources/inline/err/comprehension_missing_for_after_async.py new file mode 100644 index 0000000000..3c5be71bbd --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/comprehension_missing_for_after_async.py @@ -0,0 +1,2 @@ +(async) +(x async x in iter) diff --git a/crates/ruff_python_parser/resources/inline/err/decorator_invalid_expression.py b/crates/ruff_python_parser/resources/inline/err/decorator_invalid_expression.py new file mode 100644 index 0000000000..251d1eb32d --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/decorator_invalid_expression.py @@ -0,0 +1,6 @@ +@*x +@(*x) +@((*x)) +@yield x +@yield from x +def foo(): ... diff --git a/crates/ruff_python_parser/resources/inline/err/decorator_missing_expression.py b/crates/ruff_python_parser/resources/inline/err/decorator_missing_expression.py new file mode 100644 index 0000000000..d12890eddc --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/decorator_missing_expression.py @@ -0,0 +1,5 @@ +@def foo(): ... +@ +def foo(): ... +@@ +def foo(): ... diff --git a/crates/ruff_python_parser/resources/inline/err/decorator_missing_newline.py b/crates/ruff_python_parser/resources/inline/err/decorator_missing_newline.py new file mode 100644 index 0000000000..ce1aedf17a --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/decorator_missing_newline.py @@ -0,0 +1,3 @@ +@x def foo(): ... +@x async def foo(): ... +@x class Foo: ... diff --git a/crates/ruff_python_parser/resources/inline/err/decorator_unexpected_token.py b/crates/ruff_python_parser/resources/inline/err/decorator_unexpected_token.py new file mode 100644 index 0000000000..fbb194f6b9 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/decorator_unexpected_token.py @@ -0,0 +1,4 @@ +@foo +async with x: ... +@foo +x = 1 diff --git a/crates/ruff_python_parser/resources/inline/err/del_incomplete_target.py b/crates/ruff_python_parser/resources/inline/err/del_incomplete_target.py new file mode 100644 index 0000000000..5f8915dc86 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/del_incomplete_target.py @@ -0,0 +1,4 @@ +del x, y. +z +del x, y[ +z diff --git a/crates/ruff_python_parser/resources/inline/err/del_stmt_empty.py b/crates/ruff_python_parser/resources/inline/err/del_stmt_empty.py new file mode 100644 index 0000000000..abaddc0b9e --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/del_stmt_empty.py @@ -0,0 +1 @@ +del diff --git a/crates/ruff_python_parser/resources/inline/err/dotted_name_multiple_dots.py b/crates/ruff_python_parser/resources/inline/err/dotted_name_multiple_dots.py new file mode 100644 index 0000000000..e99b294393 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/dotted_name_multiple_dots.py @@ -0,0 +1,2 @@ +import a..b +import a...b diff --git a/crates/ruff_python_parser/resources/inline/err/except_stmt_invalid_expression.py b/crates/ruff_python_parser/resources/inline/err/except_stmt_invalid_expression.py new file mode 100644 index 0000000000..d7785f10d1 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/except_stmt_invalid_expression.py @@ -0,0 +1,8 @@ +try: + pass +except yield x: + pass +try: + pass +except* *x: + pass diff --git a/crates/ruff_python_parser/resources/inline/err/except_stmt_missing_as_name.py b/crates/ruff_python_parser/resources/inline/err/except_stmt_missing_as_name.py new file mode 100644 index 0000000000..315635b75f --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/except_stmt_missing_as_name.py @@ -0,0 +1,6 @@ +try: + pass +except Exception as: + pass +except Exception as + pass diff --git a/crates/ruff_python_parser/resources/inline/err/except_stmt_missing_exception.py b/crates/ruff_python_parser/resources/inline/err/except_stmt_missing_exception.py new file mode 100644 index 0000000000..f9f4da8186 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/except_stmt_missing_exception.py @@ -0,0 +1,13 @@ +try: + pass +except as exc: + pass +# If a '*' is present then exception type is required +try: + pass +except*: + pass +except* + pass +except* as exc: + pass diff --git a/crates/ruff_python_parser/resources/inline/err/except_stmt_missing_exception_and_as_name.py b/crates/ruff_python_parser/resources/inline/err/except_stmt_missing_exception_and_as_name.py new file mode 100644 index 0000000000..3cd59cc615 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/except_stmt_missing_exception_and_as_name.py @@ -0,0 +1,4 @@ +try: + pass +except as: + pass diff --git a/crates/ruff_python_parser/resources/inline/err/except_stmt_unparenthesized_tuple.py b/crates/ruff_python_parser/resources/inline/err/except_stmt_unparenthesized_tuple.py new file mode 100644 index 0000000000..e1ca280b76 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/except_stmt_unparenthesized_tuple.py @@ -0,0 +1,12 @@ +try: + pass +except x, y: + pass +except x, y as exc: + pass +try: + pass +except* x, y: + pass +except* x, y as eg: + pass diff --git a/crates/ruff_python_parser/resources/inline/err/f_string_empty_expression.py b/crates/ruff_python_parser/resources/inline/err/f_string_empty_expression.py new file mode 100644 index 0000000000..e7a8ba287c --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/f_string_empty_expression.py @@ -0,0 +1,2 @@ +f"{}" +f"{ }" diff --git a/crates/ruff_python_parser/resources/inline/err/f_string_invalid_conversion_flag_name_tok.py b/crates/ruff_python_parser/resources/inline/err/f_string_invalid_conversion_flag_name_tok.py new file mode 100644 index 0000000000..ded0afb8d5 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/f_string_invalid_conversion_flag_name_tok.py @@ -0,0 +1 @@ +f"{x!z}" diff --git a/crates/ruff_python_parser/resources/inline/err/f_string_invalid_conversion_flag_other_tok.py b/crates/ruff_python_parser/resources/inline/err/f_string_invalid_conversion_flag_other_tok.py new file mode 100644 index 0000000000..8fce71113a --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/f_string_invalid_conversion_flag_other_tok.py @@ -0,0 +1,2 @@ +f"{x!123}" +f"{x!'a'}" diff --git a/crates/ruff_python_parser/resources/inline/err/f_string_invalid_starred_expr.py b/crates/ruff_python_parser/resources/inline/err/f_string_invalid_starred_expr.py new file mode 100644 index 0000000000..d326674151 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/f_string_invalid_starred_expr.py @@ -0,0 +1,4 @@ +# Starred expression inside f-string has a minimum precedence of bitwise or. +f"{*}" +f"{*x and y}" +f"{*yield x}" diff --git a/crates/ruff_python_parser/resources/inline/err/f_string_lambda_without_parentheses.py b/crates/ruff_python_parser/resources/inline/err/f_string_lambda_without_parentheses.py new file mode 100644 index 0000000000..b7052c3345 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/f_string_lambda_without_parentheses.py @@ -0,0 +1 @@ +f"{lambda x: x}" diff --git a/crates/ruff_python_parser/resources/inline/err/f_string_unclosed_lbrace.py b/crates/ruff_python_parser/resources/inline/err/f_string_unclosed_lbrace.py new file mode 100644 index 0000000000..5db095c20f --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/f_string_unclosed_lbrace.py @@ -0,0 +1,5 @@ +f"{" +f"{foo!r" +f"{foo=" +f"{" +f"""{""" diff --git a/crates/ruff_python_parser/resources/inline/err/f_string_unclosed_lbrace_in_format_spec.py b/crates/ruff_python_parser/resources/inline/err/f_string_unclosed_lbrace_in_format_spec.py new file mode 100644 index 0000000000..7a584cc215 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/f_string_unclosed_lbrace_in_format_spec.py @@ -0,0 +1,2 @@ +f"hello {x:" +f"hello {x:.3f" diff --git a/crates/ruff_python_parser/resources/inline/err/for_stmt_invalid_iter_expr.py b/crates/ruff_python_parser/resources/inline/err/for_stmt_invalid_iter_expr.py new file mode 100644 index 0000000000..96f09c2fb5 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/for_stmt_invalid_iter_expr.py @@ -0,0 +1,3 @@ +for x in *a and b: ... +for x in yield a: ... +for target in x := 1: ... diff --git a/crates/ruff_python_parser/resources/inline/err/for_stmt_invalid_target.py b/crates/ruff_python_parser/resources/inline/err/for_stmt_invalid_target.py new file mode 100644 index 0000000000..d6de1bdc06 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/for_stmt_invalid_target.py @@ -0,0 +1,6 @@ +for 1 in x: ... +for "a" in x: ... +for *x and y in z: ... +for *x | y in z: ... +for await x in z: ... +for [x, 1, y, *["a"]] in z: ... diff --git a/crates/ruff_python_parser/resources/inline/err/for_stmt_missing_in_keyword.py b/crates/ruff_python_parser/resources/inline/err/for_stmt_missing_in_keyword.py new file mode 100644 index 0000000000..60148444ea --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/for_stmt_missing_in_keyword.py @@ -0,0 +1,2 @@ +for a b: ... +for a: ... diff --git a/crates/ruff_python_parser/resources/inline/err/for_stmt_missing_iter.py b/crates/ruff_python_parser/resources/inline/err/for_stmt_missing_iter.py new file mode 100644 index 0000000000..2a568b65ef --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/for_stmt_missing_iter.py @@ -0,0 +1,2 @@ +for x in: + a = 1 diff --git a/crates/ruff_python_parser/resources/inline/err/for_stmt_missing_target.py b/crates/ruff_python_parser/resources/inline/err/for_stmt_missing_target.py new file mode 100644 index 0000000000..90a780c381 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/for_stmt_missing_target.py @@ -0,0 +1 @@ +for in x: ... diff --git a/crates/ruff_python_parser/resources/inline/err/from_import_dotted_names.py b/crates/ruff_python_parser/resources/inline/err/from_import_dotted_names.py new file mode 100644 index 0000000000..863adc52e1 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/from_import_dotted_names.py @@ -0,0 +1,3 @@ +from x import a. +from x import a.b +from x import a, b.c, d, e.f, g diff --git a/crates/ruff_python_parser/resources/inline/err/from_import_empty_names.py b/crates/ruff_python_parser/resources/inline/err/from_import_empty_names.py new file mode 100644 index 0000000000..a43684da16 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/from_import_empty_names.py @@ -0,0 +1,3 @@ +from x import +from x import () +from x import ,, diff --git a/crates/ruff_python_parser/resources/inline/err/from_import_missing_module.py b/crates/ruff_python_parser/resources/inline/err/from_import_missing_module.py new file mode 100644 index 0000000000..8c15fcf3eb --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/from_import_missing_module.py @@ -0,0 +1,2 @@ +from +from import x diff --git a/crates/ruff_python_parser/resources/inline/err/from_import_missing_rpar.py b/crates/ruff_python_parser/resources/inline/err/from_import_missing_rpar.py new file mode 100644 index 0000000000..88513d6ff8 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/from_import_missing_rpar.py @@ -0,0 +1,4 @@ +from x import (a, b +1 + 1 +from x import (a, b, +2 + 2 diff --git a/crates/ruff_python_parser/resources/inline/err/from_import_star_with_other_names.py b/crates/ruff_python_parser/resources/inline/err/from_import_star_with_other_names.py new file mode 100644 index 0000000000..d40f1c6b0b --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/from_import_star_with_other_names.py @@ -0,0 +1,4 @@ +from x import *, a +from x import a, *, b +from x import *, a as b +from x import *, *, a diff --git a/crates/ruff_python_parser/resources/inline/err/from_import_unparenthesized_trailing_comma.py b/crates/ruff_python_parser/resources/inline/err/from_import_unparenthesized_trailing_comma.py new file mode 100644 index 0000000000..a77535e2dc --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/from_import_unparenthesized_trailing_comma.py @@ -0,0 +1,3 @@ +from a import b, +from a import b as c, +from a import b, c, diff --git a/crates/ruff_python_parser/resources/inline/err/function_def_empty_body.py b/crates/ruff_python_parser/resources/inline/err/function_def_empty_body.py new file mode 100644 index 0000000000..5e40afd04b --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/function_def_empty_body.py @@ -0,0 +1,3 @@ +def foo(): +def foo() -> int: +x = 42 diff --git a/crates/ruff_python_parser/resources/inline/err/function_def_invalid_return_expr.py b/crates/ruff_python_parser/resources/inline/err/function_def_invalid_return_expr.py new file mode 100644 index 0000000000..28da5c4846 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/function_def_invalid_return_expr.py @@ -0,0 +1,3 @@ +def foo() -> *int: ... +def foo() -> (*int): ... +def foo() -> yield x: ... diff --git a/crates/ruff_python_parser/resources/inline/err/function_def_missing_identifier.py b/crates/ruff_python_parser/resources/inline/err/function_def_missing_identifier.py new file mode 100644 index 0000000000..dec8284caf --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/function_def_missing_identifier.py @@ -0,0 +1,2 @@ +def (): ... +def () -> int: ... diff --git a/crates/ruff_python_parser/resources/inline/err/function_def_missing_return_type.py b/crates/ruff_python_parser/resources/inline/err/function_def_missing_return_type.py new file mode 100644 index 0000000000..661d52be35 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/function_def_missing_return_type.py @@ -0,0 +1 @@ +def foo() -> : ... diff --git a/crates/ruff_python_parser/resources/inline/err/function_def_unclosed_parameter_list.py b/crates/ruff_python_parser/resources/inline/err/function_def_unclosed_parameter_list.py new file mode 100644 index 0000000000..d483c4b4ce --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/function_def_unclosed_parameter_list.py @@ -0,0 +1,5 @@ +def foo(a: int, b: +def foo(): + return 42 +def foo(a: int, b: str +x = 10 diff --git a/crates/ruff_python_parser/resources/inline/err/function_def_unclosed_type_param_list.py b/crates/ruff_python_parser/resources/inline/err/function_def_unclosed_type_param_list.py new file mode 100644 index 0000000000..b16f4a3ded --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/function_def_unclosed_type_param_list.py @@ -0,0 +1,3 @@ +def foo[T1, *T2(a, b): + return a + b +x = 10 diff --git a/crates/ruff_python_parser/resources/inline/err/function_def_unparenthesized_return_types.py b/crates/ruff_python_parser/resources/inline/err/function_def_unparenthesized_return_types.py new file mode 100644 index 0000000000..9eed3656f6 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/function_def_unparenthesized_return_types.py @@ -0,0 +1,2 @@ +def foo() -> int,: ... +def foo() -> int, str: ... diff --git a/crates/ruff_python_parser/resources/inline/err/global_stmt_empty.py b/crates/ruff_python_parser/resources/inline/err/global_stmt_empty.py new file mode 100644 index 0000000000..b47d0eb84b --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/global_stmt_empty.py @@ -0,0 +1 @@ +global diff --git a/crates/ruff_python_parser/resources/inline/err/global_stmt_expression.py b/crates/ruff_python_parser/resources/inline/err/global_stmt_expression.py new file mode 100644 index 0000000000..4bf4c5d772 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/global_stmt_expression.py @@ -0,0 +1 @@ +global x + 1 diff --git a/crates/ruff_python_parser/resources/inline/err/global_stmt_trailing_comma.py b/crates/ruff_python_parser/resources/inline/err/global_stmt_trailing_comma.py new file mode 100644 index 0000000000..f7933acfb9 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/global_stmt_trailing_comma.py @@ -0,0 +1,3 @@ +global , +global x, +global x, y, diff --git a/crates/ruff_python_parser/resources/inline/err/if_stmt_elif_missing_colon.py b/crates/ruff_python_parser/resources/inline/err/if_stmt_elif_missing_colon.py new file mode 100644 index 0000000000..2ace71e891 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/if_stmt_elif_missing_colon.py @@ -0,0 +1,6 @@ +if x: + pass +elif y + pass +else: + pass diff --git a/crates/ruff_python_parser/resources/inline/err/if_stmt_empty_body.py b/crates/ruff_python_parser/resources/inline/err/if_stmt_empty_body.py new file mode 100644 index 0000000000..0274821277 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/if_stmt_empty_body.py @@ -0,0 +1,2 @@ +if True: +1 + 1 diff --git a/crates/ruff_python_parser/resources/inline/err/if_stmt_invalid_elif_test_expr.py b/crates/ruff_python_parser/resources/inline/err/if_stmt_invalid_elif_test_expr.py new file mode 100644 index 0000000000..5d1b32225d --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/if_stmt_invalid_elif_test_expr.py @@ -0,0 +1,6 @@ +if x: + pass +elif *x: + pass +elif yield x: + pass diff --git a/crates/ruff_python_parser/resources/inline/err/if_stmt_invalid_test_expr.py b/crates/ruff_python_parser/resources/inline/err/if_stmt_invalid_test_expr.py new file mode 100644 index 0000000000..79b091f32a --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/if_stmt_invalid_test_expr.py @@ -0,0 +1,3 @@ +if *x: ... +if yield x: ... +if yield from x: ... diff --git a/crates/ruff_python_parser/resources/inline/err/if_stmt_missing_colon.py b/crates/ruff_python_parser/resources/inline/err/if_stmt_missing_colon.py new file mode 100644 index 0000000000..d230f4275f --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/if_stmt_missing_colon.py @@ -0,0 +1,4 @@ +if x +if x + pass +a = 1 diff --git a/crates/ruff_python_parser/resources/inline/err/if_stmt_missing_test.py b/crates/ruff_python_parser/resources/inline/err/if_stmt_missing_test.py new file mode 100644 index 0000000000..12e24d9d72 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/if_stmt_missing_test.py @@ -0,0 +1 @@ +if : ... diff --git a/crates/ruff_python_parser/resources/inline/err/if_stmt_misspelled_elif.py b/crates/ruff_python_parser/resources/inline/err/if_stmt_misspelled_elif.py new file mode 100644 index 0000000000..65456d7123 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/if_stmt_misspelled_elif.py @@ -0,0 +1,6 @@ +if True: + pass +elf: + pass +else: + pass diff --git a/crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string.py b/crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string.py new file mode 100644 index 0000000000..76814311f6 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string.py @@ -0,0 +1,4 @@ +'hello' 'world +1 + 1 +'hello' f'world {x} +2 + 2 diff --git a/crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string_multiline.py b/crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string_multiline.py new file mode 100644 index 0000000000..4a65290ba7 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string_multiline.py @@ -0,0 +1,11 @@ +( + 'hello' + f'world {x} +) +1 + 1 +( + 'first' + 'second + f'third' +) +2 + 2 diff --git a/crates/ruff_python_parser/resources/inline/err/import_alias_missing_asname.py b/crates/ruff_python_parser/resources/inline/err/import_alias_missing_asname.py new file mode 100644 index 0000000000..fae4bc7aa7 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/import_alias_missing_asname.py @@ -0,0 +1 @@ +import x as diff --git a/crates/ruff_python_parser/resources/inline/err/import_stmt_empty.py b/crates/ruff_python_parser/resources/inline/err/import_stmt_empty.py new file mode 100644 index 0000000000..621a1cb246 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/import_stmt_empty.py @@ -0,0 +1 @@ +import diff --git a/crates/ruff_python_parser/resources/inline/err/import_stmt_parenthesized_names.py b/crates/ruff_python_parser/resources/inline/err/import_stmt_parenthesized_names.py new file mode 100644 index 0000000000..217f09deb2 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/import_stmt_parenthesized_names.py @@ -0,0 +1,2 @@ +import (a) +import (a, b) diff --git a/crates/ruff_python_parser/resources/inline/err/import_stmt_star_import.py b/crates/ruff_python_parser/resources/inline/err/import_stmt_star_import.py new file mode 100644 index 0000000000..86e466f9c9 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/import_stmt_star_import.py @@ -0,0 +1,2 @@ +import * +import x, *, y diff --git a/crates/ruff_python_parser/resources/inline/err/import_stmt_trailing_comma.py b/crates/ruff_python_parser/resources/inline/err/import_stmt_trailing_comma.py new file mode 100644 index 0000000000..0669b9b51e --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/import_stmt_trailing_comma.py @@ -0,0 +1,2 @@ +import , +import x, y, diff --git a/crates/ruff_python_parser/resources/inline/err/invalid_byte_literal.py b/crates/ruff_python_parser/resources/inline/err/invalid_byte_literal.py new file mode 100644 index 0000000000..af87a11043 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/invalid_byte_literal.py @@ -0,0 +1,3 @@ +b'123a𝐁c' +rb"a𝐁c123" +b"""123a𝐁c""" diff --git a/crates/ruff_python_parser/resources/inline/err/invalid_del_target.py b/crates/ruff_python_parser/resources/inline/err/invalid_del_target.py new file mode 100644 index 0000000000..d829403a62 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/invalid_del_target.py @@ -0,0 +1,4 @@ +del x + 1 +del {'x': 1} +del {'x', 'y'} +del None, True, False, 1, 1.0, "abc" diff --git a/crates/ruff_python_parser/resources/inline/err/invalid_fstring_literal_element.py b/crates/ruff_python_parser/resources/inline/err/invalid_fstring_literal_element.py new file mode 100644 index 0000000000..7de19e61da --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/invalid_fstring_literal_element.py @@ -0,0 +1,2 @@ +f'hello \N{INVALID} world' +f"""hello \N{INVALID} world""" diff --git a/crates/ruff_python_parser/resources/inline/err/invalid_string_literal.py b/crates/ruff_python_parser/resources/inline/err/invalid_string_literal.py new file mode 100644 index 0000000000..7dd2b926a8 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/invalid_string_literal.py @@ -0,0 +1,2 @@ +'hello \N{INVALID} world' +"""hello \N{INVALID} world""" diff --git a/crates/ruff_python_parser/resources/inline/err/lambda_body_with_starred_expr.py b/crates/ruff_python_parser/resources/inline/err/lambda_body_with_starred_expr.py new file mode 100644 index 0000000000..f91470be27 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/lambda_body_with_starred_expr.py @@ -0,0 +1,4 @@ +lambda x: *y +lambda x: *y, +lambda x: *y, z +lambda x: *y and z diff --git a/crates/ruff_python_parser/resources/inline/err/lambda_body_with_yield_expr.py b/crates/ruff_python_parser/resources/inline/err/lambda_body_with_yield_expr.py new file mode 100644 index 0000000000..9031a9847d --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/lambda_body_with_yield_expr.py @@ -0,0 +1,2 @@ +lambda x: yield y +lambda x: yield from y diff --git a/crates/ruff_python_parser/resources/inline/err/match_stmt_expect_indented_block.py b/crates/ruff_python_parser/resources/inline/err/match_stmt_expect_indented_block.py new file mode 100644 index 0000000000..1f71d6dc25 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/match_stmt_expect_indented_block.py @@ -0,0 +1,2 @@ +match foo: +case _: ... diff --git a/crates/ruff_python_parser/resources/inline/err/match_stmt_expected_case_block.py b/crates/ruff_python_parser/resources/inline/err/match_stmt_expected_case_block.py new file mode 100644 index 0000000000..7fbf3d0653 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/match_stmt_expected_case_block.py @@ -0,0 +1,5 @@ +match x: + x = 1 +match x: + match y: + case _: ... diff --git a/crates/ruff_python_parser/resources/inline/err/match_stmt_invalid_guard_expr.py b/crates/ruff_python_parser/resources/inline/err/match_stmt_invalid_guard_expr.py new file mode 100644 index 0000000000..1441b8dfdf --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/match_stmt_invalid_guard_expr.py @@ -0,0 +1,6 @@ +match x: + case y if *a: ... +match x: + case y if (*a): ... +match x: + case y if yield x: ... diff --git a/crates/ruff_python_parser/resources/inline/err/match_stmt_invalid_subject_expr.py b/crates/ruff_python_parser/resources/inline/err/match_stmt_invalid_subject_expr.py new file mode 100644 index 0000000000..46c868771e --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/match_stmt_invalid_subject_expr.py @@ -0,0 +1,7 @@ +match (*x): + case _: ... +# Starred expression precedence test +match *x and y, z: + case _: ... +match yield x: + case _: ... diff --git a/crates/ruff_python_parser/resources/inline/err/match_stmt_missing_guard_expr.py b/crates/ruff_python_parser/resources/inline/err/match_stmt_missing_guard_expr.py new file mode 100644 index 0000000000..3945152257 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/match_stmt_missing_guard_expr.py @@ -0,0 +1,2 @@ +match x: + case y if: ... diff --git a/crates/ruff_python_parser/resources/inline/err/match_stmt_missing_pattern.py b/crates/ruff_python_parser/resources/inline/err/match_stmt_missing_pattern.py new file mode 100644 index 0000000000..14a32f10e1 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/match_stmt_missing_pattern.py @@ -0,0 +1,3 @@ +# TODO(dhruvmanila): Here, `case` is a name token because of soft keyword transformer +match x: + case : ... diff --git a/crates/ruff_python_parser/resources/inline/err/match_stmt_no_newline_before_case.py b/crates/ruff_python_parser/resources/inline/err/match_stmt_no_newline_before_case.py new file mode 100644 index 0000000000..ecff8fd2af --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/match_stmt_no_newline_before_case.py @@ -0,0 +1 @@ +match foo: case _: ... diff --git a/crates/ruff_python_parser/resources/inline/err/match_stmt_single_starred_subject.py b/crates/ruff_python_parser/resources/inline/err/match_stmt_single_starred_subject.py new file mode 100644 index 0000000000..4fac77038e --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/match_stmt_single_starred_subject.py @@ -0,0 +1,2 @@ +match *foo: + case _: ... diff --git a/crates/ruff_python_parser/resources/inline/err/mixed_bytes_and_non_bytes_literals.py b/crates/ruff_python_parser/resources/inline/err/mixed_bytes_and_non_bytes_literals.py new file mode 100644 index 0000000000..05e3ebcd8c --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/mixed_bytes_and_non_bytes_literals.py @@ -0,0 +1,3 @@ +'first' b'second' +f'first' b'second' +'first' f'second' b'third' diff --git a/crates/ruff_python_parser/resources/inline/err/multiple_clauses_on_same_line.py b/crates/ruff_python_parser/resources/inline/err/multiple_clauses_on_same_line.py new file mode 100644 index 0000000000..e10909449e --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/multiple_clauses_on_same_line.py @@ -0,0 +1,6 @@ +if True: pass elif False: pass else: pass +if True: pass; elif False: pass; else: pass +for x in iter: break else: pass +for x in iter: break; else: pass +try: pass except exc: pass else: pass finally: pass +try: pass; except exc: pass; else: pass; finally: pass diff --git a/crates/ruff_python_parser/resources/inline/err/nonlocal_stmt_empty.py b/crates/ruff_python_parser/resources/inline/err/nonlocal_stmt_empty.py new file mode 100644 index 0000000000..07127b5f05 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/nonlocal_stmt_empty.py @@ -0,0 +1 @@ +nonlocal diff --git a/crates/ruff_python_parser/resources/inline/err/nonlocal_stmt_expression.py b/crates/ruff_python_parser/resources/inline/err/nonlocal_stmt_expression.py new file mode 100644 index 0000000000..303cb88b61 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/nonlocal_stmt_expression.py @@ -0,0 +1 @@ +nonlocal x + 1 diff --git a/crates/ruff_python_parser/resources/inline/err/nonlocal_stmt_trailing_comma.py b/crates/ruff_python_parser/resources/inline/err/nonlocal_stmt_trailing_comma.py new file mode 100644 index 0000000000..24acf55245 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/nonlocal_stmt_trailing_comma.py @@ -0,0 +1,3 @@ +nonlocal , +nonlocal x, +nonlocal x, y, diff --git a/crates/ruff_python_parser/resources/inline/err/param_missing_annotation.py b/crates/ruff_python_parser/resources/inline/err/param_missing_annotation.py new file mode 100644 index 0000000000..f8b19685db --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/param_missing_annotation.py @@ -0,0 +1,2 @@ +def foo(x:): ... +def foo(x:,): ... diff --git a/crates/ruff_python_parser/resources/inline/err/param_missing_default.py b/crates/ruff_python_parser/resources/inline/err/param_missing_default.py new file mode 100644 index 0000000000..b2203374fa --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/param_missing_default.py @@ -0,0 +1,2 @@ +def foo(x=): ... +def foo(x: int = ): ... diff --git a/crates/ruff_python_parser/resources/inline/err/param_with_invalid_annotation.py b/crates/ruff_python_parser/resources/inline/err/param_with_invalid_annotation.py new file mode 100644 index 0000000000..d1a92018fd --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/param_with_invalid_annotation.py @@ -0,0 +1,3 @@ +def foo(arg: *int): ... +def foo(arg: yield int): ... +def foo(arg: x := int): ... diff --git a/crates/ruff_python_parser/resources/inline/err/param_with_invalid_default.py b/crates/ruff_python_parser/resources/inline/err/param_with_invalid_default.py new file mode 100644 index 0000000000..44ce1c29c6 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/param_with_invalid_default.py @@ -0,0 +1,3 @@ +def foo(x=*int): ... +def foo(x=(*int)): ... +def foo(x=yield y): ... diff --git a/crates/ruff_python_parser/resources/inline/err/param_with_invalid_star_annotation.py b/crates/ruff_python_parser/resources/inline/err/param_with_invalid_star_annotation.py new file mode 100644 index 0000000000..88b1e92f69 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/param_with_invalid_star_annotation.py @@ -0,0 +1,5 @@ +def foo(*args: *): ... +def foo(*args: (*tuple[int])): ... +def foo(*args: *int or str): ... +def foo(*args: *yield x): ... +# def foo(*args: **int): ... diff --git a/crates/ruff_python_parser/resources/inline/err/params_duplicate_names.py b/crates/ruff_python_parser/resources/inline/err/params_duplicate_names.py new file mode 100644 index 0000000000..95f44d68fc --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/params_duplicate_names.py @@ -0,0 +1 @@ +def foo(a, a=10, *a, a, a: str, **a): ... diff --git a/crates/ruff_python_parser/resources/inline/err/params_expected_after_star_separator.py b/crates/ruff_python_parser/resources/inline/err/params_expected_after_star_separator.py new file mode 100644 index 0000000000..36fd1b9939 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/params_expected_after_star_separator.py @@ -0,0 +1,5 @@ +def foo(*): ... +def foo(*,): ... +def foo(a, *): ... +def foo(a, *,): ... +def foo(*, **kwargs): ... diff --git a/crates/ruff_python_parser/resources/inline/err/params_kwarg_after_star_separator.py b/crates/ruff_python_parser/resources/inline/err/params_kwarg_after_star_separator.py new file mode 100644 index 0000000000..dc8a08cc4f --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/params_kwarg_after_star_separator.py @@ -0,0 +1 @@ +def foo(*, **kwargs): ... diff --git a/crates/ruff_python_parser/resources/inline/err/params_multiple_kwargs.py b/crates/ruff_python_parser/resources/inline/err/params_multiple_kwargs.py new file mode 100644 index 0000000000..aacc036628 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/params_multiple_kwargs.py @@ -0,0 +1 @@ +def foo(a, **kwargs1, **kwargs2): ... diff --git a/crates/ruff_python_parser/resources/inline/err/params_multiple_slash_separator.py b/crates/ruff_python_parser/resources/inline/err/params_multiple_slash_separator.py new file mode 100644 index 0000000000..b537d12d27 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/params_multiple_slash_separator.py @@ -0,0 +1,2 @@ +def foo(a, /, /, b): ... +def foo(a, /, b, c, /): ... diff --git a/crates/ruff_python_parser/resources/inline/err/params_multiple_star_separator.py b/crates/ruff_python_parser/resources/inline/err/params_multiple_star_separator.py new file mode 100644 index 0000000000..b466e326b7 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/params_multiple_star_separator.py @@ -0,0 +1,2 @@ +def foo(a, *, *, b): ... +def foo(a, *, b, c, *): ... diff --git a/crates/ruff_python_parser/resources/inline/err/params_multiple_varargs.py b/crates/ruff_python_parser/resources/inline/err/params_multiple_varargs.py new file mode 100644 index 0000000000..450bc0f502 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/params_multiple_varargs.py @@ -0,0 +1,4 @@ +def foo(a, *, *args, b): ... +# def foo(a, *, b, c, *args): ... +def foo(a, *args1, *args2, b): ... +def foo(a, *args1, b, c, *args2): ... diff --git a/crates/ruff_python_parser/resources/inline/err/params_no_arg_before_slash.py b/crates/ruff_python_parser/resources/inline/err/params_no_arg_before_slash.py new file mode 100644 index 0000000000..1d5e91260f --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/params_no_arg_before_slash.py @@ -0,0 +1,2 @@ +def foo(/): ... +def foo(/, a): ... diff --git a/crates/ruff_python_parser/resources/inline/err/params_non_default_after_default.py b/crates/ruff_python_parser/resources/inline/err/params_non_default_after_default.py new file mode 100644 index 0000000000..e2876ca75b --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/params_non_default_after_default.py @@ -0,0 +1 @@ +def foo(a=10, b, c: int): ... diff --git a/crates/ruff_python_parser/resources/inline/err/params_star_after_slash.py b/crates/ruff_python_parser/resources/inline/err/params_star_after_slash.py new file mode 100644 index 0000000000..30a1dfa6b0 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/params_star_after_slash.py @@ -0,0 +1,4 @@ +def foo(*a, /): ... +def foo(a, *args, b, /): ... +def foo(a, *, /, b): ... +def foo(a, *, b, c, /, d): ... diff --git a/crates/ruff_python_parser/resources/inline/err/params_star_separator_after_star_param.py b/crates/ruff_python_parser/resources/inline/err/params_star_separator_after_star_param.py new file mode 100644 index 0000000000..428c2d1885 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/params_star_separator_after_star_param.py @@ -0,0 +1,2 @@ +def foo(a, *args, *, b): ... +def foo(a, *args, b, c, *): ... diff --git a/crates/ruff_python_parser/resources/inline/err/params_var_keyword_with_default.py b/crates/ruff_python_parser/resources/inline/err/params_var_keyword_with_default.py new file mode 100644 index 0000000000..71b81965f2 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/params_var_keyword_with_default.py @@ -0,0 +1 @@ +def foo(a, **kwargs={'b': 1, 'c': 2}): ... diff --git a/crates/ruff_python_parser/resources/inline/err/params_var_positional_with_default.py b/crates/ruff_python_parser/resources/inline/err/params_var_positional_with_default.py new file mode 100644 index 0000000000..d37c1c4ac2 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/params_var_positional_with_default.py @@ -0,0 +1 @@ +def foo(a, *args=(1, 2)): ... diff --git a/crates/ruff_python_parser/resources/inline/err/parenthesized_compare_expr_in_for.py b/crates/ruff_python_parser/resources/inline/err/parenthesized_compare_expr_in_for.py new file mode 100644 index 0000000000..13d613dad9 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/parenthesized_compare_expr_in_for.py @@ -0,0 +1,2 @@ +for (x in y)() in iter: ... +for (x in y) in iter: ... diff --git a/crates/ruff_python_parser/resources/inline/err/raise_stmt_invalid_cause.py b/crates/ruff_python_parser/resources/inline/err/raise_stmt_invalid_cause.py new file mode 100644 index 0000000000..276480a2e5 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/raise_stmt_invalid_cause.py @@ -0,0 +1,3 @@ +raise x from *y +raise x from yield y +raise x from y := 1 diff --git a/crates/ruff_python_parser/resources/inline/err/raise_stmt_invalid_exc.py b/crates/ruff_python_parser/resources/inline/err/raise_stmt_invalid_exc.py new file mode 100644 index 0000000000..10ce3f9580 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/raise_stmt_invalid_exc.py @@ -0,0 +1,3 @@ +raise *x +raise yield x +raise x := 1 diff --git a/crates/ruff_python_parser/resources/inline/err/raise_stmt_unparenthesized_tuple_cause.py b/crates/ruff_python_parser/resources/inline/err/raise_stmt_unparenthesized_tuple_cause.py new file mode 100644 index 0000000000..3da4f3c070 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/raise_stmt_unparenthesized_tuple_cause.py @@ -0,0 +1,2 @@ +raise x from y, +raise x from y, z diff --git a/crates/ruff_python_parser/resources/inline/err/raise_stmt_unparenthesized_tuple_exc.py b/crates/ruff_python_parser/resources/inline/err/raise_stmt_unparenthesized_tuple_exc.py new file mode 100644 index 0000000000..a953aedbfe --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/raise_stmt_unparenthesized_tuple_exc.py @@ -0,0 +1,3 @@ +raise x, +raise x, y +raise x, y from z diff --git a/crates/ruff_python_parser/resources/inline/err/return_stmt_invalid_expr.py b/crates/ruff_python_parser/resources/inline/err/return_stmt_invalid_expr.py new file mode 100644 index 0000000000..001589c1de --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/return_stmt_invalid_expr.py @@ -0,0 +1,5 @@ +return * +return yield x +return yield from x +return x := 1 +return *x and y diff --git a/crates/ruff_python_parser/resources/inline/err/simple_and_compound_stmt_on_same_line.py b/crates/ruff_python_parser/resources/inline/err/simple_and_compound_stmt_on_same_line.py new file mode 100644 index 0000000000..06ca9d1d25 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/simple_and_compound_stmt_on_same_line.py @@ -0,0 +1 @@ +a; if b: pass; b diff --git a/crates/ruff_python_parser/resources/inline/err/simple_and_compound_stmt_on_same_line_in_block.py b/crates/ruff_python_parser/resources/inline/err/simple_and_compound_stmt_on_same_line_in_block.py new file mode 100644 index 0000000000..714c4d2a85 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/simple_and_compound_stmt_on_same_line_in_block.py @@ -0,0 +1,2 @@ +if True: pass if False: pass +if True: pass; if False: pass diff --git a/crates/ruff_python_parser/resources/inline/err/simple_stmts_on_same_line.py b/crates/ruff_python_parser/resources/inline/err/simple_stmts_on_same_line.py new file mode 100644 index 0000000000..95902b05ab --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/simple_stmts_on_same_line.py @@ -0,0 +1,3 @@ +a b +a + b c + d +break; continue pass; continue break diff --git a/crates/ruff_python_parser/resources/inline/err/simple_stmts_on_same_line_in_block.py b/crates/ruff_python_parser/resources/inline/err/simple_stmts_on_same_line_in_block.py new file mode 100644 index 0000000000..0344ce16df --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/simple_stmts_on_same_line_in_block.py @@ -0,0 +1 @@ +if True: break; continue pass; continue break diff --git a/crates/ruff_python_parser/resources/inline/err/try_stmt_invalid_order.py b/crates/ruff_python_parser/resources/inline/err/try_stmt_invalid_order.py new file mode 100644 index 0000000000..19a76746f9 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/try_stmt_invalid_order.py @@ -0,0 +1,6 @@ +try: + pass +finally: + pass +else: + pass diff --git a/crates/ruff_python_parser/resources/inline/err/try_stmt_missing_except_finally.py b/crates/ruff_python_parser/resources/inline/err/try_stmt_missing_except_finally.py new file mode 100644 index 0000000000..95b16fef9d --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/try_stmt_missing_except_finally.py @@ -0,0 +1,6 @@ +try: + pass +try: + pass +else: + pass diff --git a/crates/ruff_python_parser/resources/inline/err/try_stmt_misspelled_except.py b/crates/ruff_python_parser/resources/inline/err/try_stmt_misspelled_except.py new file mode 100644 index 0000000000..bd8506599a --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/try_stmt_misspelled_except.py @@ -0,0 +1,14 @@ +try: + pass +exept: # spellchecker:disable-line + pass +finally: + pass +a = 1 +try: + pass +except: + pass +exept: # spellchecker:disable-line + pass +b = 1 diff --git a/crates/ruff_python_parser/resources/inline/err/type_alias_incomplete_stmt.py b/crates/ruff_python_parser/resources/inline/err/type_alias_incomplete_stmt.py new file mode 100644 index 0000000000..04f6d6b44f --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/type_alias_incomplete_stmt.py @@ -0,0 +1,3 @@ +type +type x +type x = diff --git a/crates/ruff_python_parser/resources/inline/err/type_alias_invalid_value_expr.py b/crates/ruff_python_parser/resources/inline/err/type_alias_invalid_value_expr.py new file mode 100644 index 0000000000..9b82cfae94 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/type_alias_invalid_value_expr.py @@ -0,0 +1,4 @@ +type x = *y +type x = yield y +type x = yield from y +type x = x := 1 diff --git a/crates/ruff_python_parser/resources/inline/err/type_param_invalid_bound_expr.py b/crates/ruff_python_parser/resources/inline/err/type_param_invalid_bound_expr.py new file mode 100644 index 0000000000..e1fa5e3756 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/type_param_invalid_bound_expr.py @@ -0,0 +1,4 @@ +type X[T: *int] = int +type X[T: yield x] = int +type X[T: yield from x] = int +type X[T: x := int] = int diff --git a/crates/ruff_python_parser/resources/inline/err/type_param_missing_bound.py b/crates/ruff_python_parser/resources/inline/err/type_param_missing_bound.py new file mode 100644 index 0000000000..256ade3263 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/type_param_missing_bound.py @@ -0,0 +1,2 @@ +type X[T: ] = int +type X[T1: , T2] = int diff --git a/crates/ruff_python_parser/resources/inline/err/type_param_param_spec_bound.py b/crates/ruff_python_parser/resources/inline/err/type_param_param_spec_bound.py new file mode 100644 index 0000000000..63adae3251 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/type_param_param_spec_bound.py @@ -0,0 +1 @@ +type X[**T: int] = int diff --git a/crates/ruff_python_parser/resources/inline/err/type_param_type_var_tuple_bound.py b/crates/ruff_python_parser/resources/inline/err/type_param_type_var_tuple_bound.py new file mode 100644 index 0000000000..9e21b6f050 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/type_param_type_var_tuple_bound.py @@ -0,0 +1 @@ +type X[*T: int] = int diff --git a/crates/ruff_python_parser/resources/inline/err/unterminated_fstring_newline_recovery.py b/crates/ruff_python_parser/resources/inline/err/unterminated_fstring_newline_recovery.py new file mode 100644 index 0000000000..77affd2c57 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/unterminated_fstring_newline_recovery.py @@ -0,0 +1,8 @@ +f"hello +1 + 1 +f"hello {x +2 + 2 +f"hello {x: +3 + 3 +f"hello {x} +4 + 4 diff --git a/crates/ruff_python_parser/resources/inline/err/while_stmt_invalid_test_expr.py b/crates/ruff_python_parser/resources/inline/err/while_stmt_invalid_test_expr.py new file mode 100644 index 0000000000..a0c4dd67c7 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/while_stmt_invalid_test_expr.py @@ -0,0 +1,4 @@ +while *x: ... +while yield x: ... +while a, b: ... +while a := 1, b: ... diff --git a/crates/ruff_python_parser/resources/inline/err/while_stmt_missing_colon.py b/crates/ruff_python_parser/resources/inline/err/while_stmt_missing_colon.py new file mode 100644 index 0000000000..4879e08278 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/while_stmt_missing_colon.py @@ -0,0 +1,4 @@ +while ( + a < 30 # comment +) + pass diff --git a/crates/ruff_python_parser/resources/inline/err/while_stmt_missing_test.py b/crates/ruff_python_parser/resources/inline/err/while_stmt_missing_test.py new file mode 100644 index 0000000000..da56f0e9ce --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/while_stmt_missing_test.py @@ -0,0 +1,3 @@ +while : ... +while : + a = 1 diff --git a/crates/ruff_python_parser/resources/inline/err/with_items_parenthesized_missing_comma.py b/crates/ruff_python_parser/resources/inline/err/with_items_parenthesized_missing_comma.py new file mode 100644 index 0000000000..ea231b5507 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/err/with_items_parenthesized_missing_comma.py @@ -0,0 +1,5 @@ +with (item1 item2): ... +with (item1 as f1 item2): ... +with (item1, item2 item3, item4): ... +with (item1, item2 as f1 item3, item4): ... +with (item1, item2: ... diff --git a/crates/ruff_python_parser/resources/inline/ok/ann_assign_stmt_simple_target.py b/crates/ruff_python_parser/resources/inline/ok/ann_assign_stmt_simple_target.py new file mode 100644 index 0000000000..aec8c5a020 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/ann_assign_stmt_simple_target.py @@ -0,0 +1,4 @@ +a: int # simple +(a): int +a.b: int +a[0]: int diff --git a/crates/ruff_python_parser/resources/inline/ok/assign_targets_terminator.py b/crates/ruff_python_parser/resources/inline/ok/assign_targets_terminator.py new file mode 100644 index 0000000000..1c0bacde5e --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/assign_targets_terminator.py @@ -0,0 +1,3 @@ +x = y = z = 1; a, b +x = y = z = 1 +a, b diff --git a/crates/ruff_python_parser/resources/inline/ok/async_for_statement.py b/crates/ruff_python_parser/resources/inline/ok/async_for_statement.py new file mode 100644 index 0000000000..985296d827 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/async_for_statement.py @@ -0,0 +1 @@ +async for target in iter: ... diff --git a/crates/ruff_python_parser/resources/inline/ok/async_function_definition.py b/crates/ruff_python_parser/resources/inline/ok/async_function_definition.py new file mode 100644 index 0000000000..5a2a2b31d5 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/async_function_definition.py @@ -0,0 +1 @@ +async def foo(): ... diff --git a/crates/ruff_python_parser/resources/inline/ok/async_with_statement.py b/crates/ruff_python_parser/resources/inline/ok/async_with_statement.py new file mode 100644 index 0000000000..d821f01b26 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/async_with_statement.py @@ -0,0 +1 @@ +async with item: ... diff --git a/crates/ruff_python_parser/resources/inline/ok/class_def_arguments.py b/crates/ruff_python_parser/resources/inline/ok/class_def_arguments.py new file mode 100644 index 0000000000..dcd319db58 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/class_def_arguments.py @@ -0,0 +1,2 @@ +class Foo: ... +class Foo(): ... diff --git a/crates/ruff_python_parser/resources/inline/ok/decorator_async_function.py b/crates/ruff_python_parser/resources/inline/ok/decorator_async_function.py new file mode 100644 index 0000000000..0435e3a9fc --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/decorator_async_function.py @@ -0,0 +1,2 @@ +@decorator +async def foo(): ... diff --git a/crates/ruff_python_parser/resources/inline/ok/del_targets_terminator.py b/crates/ruff_python_parser/resources/inline/ok/del_targets_terminator.py new file mode 100644 index 0000000000..1f06eeb5b6 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/del_targets_terminator.py @@ -0,0 +1,3 @@ +del a, b; c, d +del a, b +c, d diff --git a/crates/ruff_python_parser/resources/inline/ok/dotted_name_normalized_spaces.py b/crates/ruff_python_parser/resources/inline/ok/dotted_name_normalized_spaces.py new file mode 100644 index 0000000000..9298a3fc3a --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/dotted_name_normalized_spaces.py @@ -0,0 +1,2 @@ +import a.b.c +import a . b . c diff --git a/crates/ruff_python_parser/resources/inline/ok/from_import_no_space.py b/crates/ruff_python_parser/resources/inline/ok/from_import_no_space.py new file mode 100644 index 0000000000..573015520a --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/from_import_no_space.py @@ -0,0 +1,2 @@ +from.import x +from...import x diff --git a/crates/ruff_python_parser/resources/inline/ok/from_import_stmt_terminator.py b/crates/ruff_python_parser/resources/inline/ok/from_import_stmt_terminator.py new file mode 100644 index 0000000000..f2e81b6c3d --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/from_import_stmt_terminator.py @@ -0,0 +1,5 @@ +from a import (b, c) +from a import (b, c); x, y +from a import b, c; x, y +from a import b, c +x, y diff --git a/crates/ruff_python_parser/resources/inline/ok/fstring_format_spec_terminator.py b/crates/ruff_python_parser/resources/inline/ok/fstring_format_spec_terminator.py new file mode 100644 index 0000000000..86a5f8ac3f --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/fstring_format_spec_terminator.py @@ -0,0 +1,2 @@ +f"hello {x:} world" +f"hello {x:.3f} world" diff --git a/crates/ruff_python_parser/resources/inline/ok/function_def_parameter_range.py b/crates/ruff_python_parser/resources/inline/ok/function_def_parameter_range.py new file mode 100644 index 0000000000..78fa16fe0f --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/function_def_parameter_range.py @@ -0,0 +1,4 @@ +def foo( + first: int, + second: int, +) -> int: ... diff --git a/crates/ruff_python_parser/resources/inline/ok/function_def_parenthesized_return_types.py b/crates/ruff_python_parser/resources/inline/ok/function_def_parenthesized_return_types.py new file mode 100644 index 0000000000..963f692d7d --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/function_def_parenthesized_return_types.py @@ -0,0 +1,2 @@ +def foo() -> (int,): ... +def foo() -> (int, str): ... diff --git a/crates/ruff_python_parser/resources/inline/ok/function_def_valid_return_expr.py b/crates/ruff_python_parser/resources/inline/ok/function_def_valid_return_expr.py new file mode 100644 index 0000000000..7fb5dadfeb --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/function_def_valid_return_expr.py @@ -0,0 +1,4 @@ +def foo() -> int | str: ... +def foo() -> lambda x: x: ... +def foo() -> (yield x): ... +def foo() -> int if True else str: ... diff --git a/crates/ruff_python_parser/resources/inline/ok/global_stmt.py b/crates/ruff_python_parser/resources/inline/ok/global_stmt.py new file mode 100644 index 0000000000..e6d11a7f50 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/global_stmt.py @@ -0,0 +1,2 @@ +global x +global x, y, z diff --git a/crates/ruff_python_parser/resources/inline/ok/import_stmt_terminator.py b/crates/ruff_python_parser/resources/inline/ok/import_stmt_terminator.py new file mode 100644 index 0000000000..6862331990 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/import_stmt_terminator.py @@ -0,0 +1,3 @@ +import a, b; import c, d +import a, b +c, d diff --git a/crates/ruff_python_parser/resources/inline/ok/lambda_with_no_parameters.py b/crates/ruff_python_parser/resources/inline/ok/lambda_with_no_parameters.py new file mode 100644 index 0000000000..44a58ae9b8 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/lambda_with_no_parameters.py @@ -0,0 +1 @@ +lambda: 1 diff --git a/crates/ruff_python_parser/resources/inline/ok/lambda_with_valid_body.py b/crates/ruff_python_parser/resources/inline/ok/lambda_with_valid_body.py new file mode 100644 index 0000000000..bbe3f175a9 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/lambda_with_valid_body.py @@ -0,0 +1,6 @@ +lambda x: x +lambda x: x if True else y +lambda x: await x +lambda x: lambda y: x + y +lambda x: (yield x) # Parenthesized `yield` is fine +lambda x: x, *y diff --git a/crates/ruff_python_parser/resources/inline/ok/match_as_pattern.py b/crates/ruff_python_parser/resources/inline/ok/match_as_pattern.py new file mode 100644 index 0000000000..378ec61b99 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/match_as_pattern.py @@ -0,0 +1,3 @@ +match foo: + case foo_bar: ... + case _: ... diff --git a/crates/ruff_python_parser/resources/inline/ok/match_sequence_pattern_parentheses_terminator.py b/crates/ruff_python_parser/resources/inline/ok/match_sequence_pattern_parentheses_terminator.py new file mode 100644 index 0000000000..53077f29d8 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/match_sequence_pattern_parentheses_terminator.py @@ -0,0 +1,3 @@ +match subject: + case [a, b]: ... + case (a, b): ... diff --git a/crates/ruff_python_parser/resources/inline/ok/match_sequence_pattern_terminator.py b/crates/ruff_python_parser/resources/inline/ok/match_sequence_pattern_terminator.py new file mode 100644 index 0000000000..8ee7b74d73 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/match_sequence_pattern_terminator.py @@ -0,0 +1,5 @@ +match subject: + case a: ... + case a if x: ... + case a, b: ... + case a, b if x: ... diff --git a/crates/ruff_python_parser/resources/inline/ok/match_stmt_subject_expr.py b/crates/ruff_python_parser/resources/inline/ok/match_stmt_subject_expr.py new file mode 100644 index 0000000000..c456ec9e97 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/match_stmt_subject_expr.py @@ -0,0 +1,9 @@ +match x := 1: + case _: ... +match (x := 1): + case _: ... +# Starred expressions are only allowed in tuple expression +match *x | y, z: + case _: ... +match await x: + case _: ... diff --git a/crates/ruff_python_parser/resources/inline/ok/match_stmt_valid_guard_expr.py b/crates/ruff_python_parser/resources/inline/ok/match_stmt_valid_guard_expr.py new file mode 100644 index 0000000000..9e39f572db --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/match_stmt_valid_guard_expr.py @@ -0,0 +1,8 @@ +match x: + case y if a := 1: ... +match x: + case y if a if True else b: ... +match x: + case y if lambda a: b: ... +match x: + case y if (yield x): ... diff --git a/crates/ruff_python_parser/resources/inline/ok/nonlocal_stmt.py b/crates/ruff_python_parser/resources/inline/ok/nonlocal_stmt.py new file mode 100644 index 0000000000..7f652bb0a6 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/nonlocal_stmt.py @@ -0,0 +1,2 @@ +nonlocal x +nonlocal x, y, z diff --git a/crates/ruff_python_parser/resources/inline/ok/param_with_annotation.py b/crates/ruff_python_parser/resources/inline/ok/param_with_annotation.py new file mode 100644 index 0000000000..404be13e78 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/param_with_annotation.py @@ -0,0 +1,4 @@ +def foo(arg: int): ... +def foo(arg: lambda x: x): ... +def foo(arg: (yield x)): ... +def foo(arg: (x := int)): ... diff --git a/crates/ruff_python_parser/resources/inline/ok/param_with_default.py b/crates/ruff_python_parser/resources/inline/ok/param_with_default.py new file mode 100644 index 0000000000..c1033c2987 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/param_with_default.py @@ -0,0 +1,4 @@ +def foo(x=lambda y: y): ... +def foo(x=1 if True else 2): ... +def foo(x=await y): ... +def foo(x=(yield y)): ... diff --git a/crates/ruff_python_parser/resources/inline/ok/param_with_star_annotation.py b/crates/ruff_python_parser/resources/inline/ok/param_with_star_annotation.py new file mode 100644 index 0000000000..01e2dd6bea --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/param_with_star_annotation.py @@ -0,0 +1,2 @@ +def foo(*args: *int | str): ... +def foo(*args: *(int or str)): ... diff --git a/crates/ruff_python_parser/resources/inline/ok/params_non_default_after_star.py b/crates/ruff_python_parser/resources/inline/ok/params_non_default_after_star.py new file mode 100644 index 0000000000..5590fc1b28 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/params_non_default_after_star.py @@ -0,0 +1,2 @@ +def foo(a=10, *, b, c=11, d): ... +def foo(a=10, *args, b, c=11, d): ... diff --git a/crates/ruff_python_parser/resources/inline/ok/params_seen_keyword_only_param_after_star.py b/crates/ruff_python_parser/resources/inline/ok/params_seen_keyword_only_param_after_star.py new file mode 100644 index 0000000000..c9496a6031 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/params_seen_keyword_only_param_after_star.py @@ -0,0 +1,2 @@ +def foo(*, a, **kwargs): ... +def foo(*, a=10, **kwargs): ... diff --git a/crates/ruff_python_parser/resources/inline/ok/parenthesized_compare_expr_in_for.py b/crates/ruff_python_parser/resources/inline/ok/parenthesized_compare_expr_in_for.py new file mode 100644 index 0000000000..ba2b3c2cfa --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/parenthesized_compare_expr_in_for.py @@ -0,0 +1,2 @@ +for (x in y)[0] in iter: ... +for (x in y).attr in iter: ... diff --git a/crates/ruff_python_parser/resources/inline/ok/simple_stmts_in_block.py b/crates/ruff_python_parser/resources/inline/ok/simple_stmts_in_block.py new file mode 100644 index 0000000000..751610052d --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/simple_stmts_in_block.py @@ -0,0 +1,5 @@ +if True: pass +if True: pass; +if True: pass; continue +if True: pass; continue; +x = 1 diff --git a/crates/ruff_python_parser/resources/inline/ok/simple_stmts_with_semicolons.py b/crates/ruff_python_parser/resources/inline/ok/simple_stmts_with_semicolons.py new file mode 100644 index 0000000000..180430e173 --- /dev/null +++ b/crates/ruff_python_parser/resources/inline/ok/simple_stmts_with_semicolons.py @@ -0,0 +1 @@ +return; import a; from x import y; z; type T = int diff --git a/crates/ruff_python_parser/resources/invalid/expressions/arguments/double_starred.py b/crates/ruff_python_parser/resources/invalid/expressions/arguments/double_starred.py new file mode 100644 index 0000000000..e063e1e025 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/arguments/double_starred.py @@ -0,0 +1,5 @@ +call(**yield x) +call(** *x) +call(***x) + +call(**x := 1) diff --git a/crates/ruff_python_parser/resources/invalid/expressions/arguments/duplicate_keyword_arguments.py b/crates/ruff_python_parser/resources/invalid/expressions/arguments/duplicate_keyword_arguments.py new file mode 100644 index 0000000000..5072f2845d --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/arguments/duplicate_keyword_arguments.py @@ -0,0 +1 @@ +foo(a=1, b=2, c=3, b=4, a=5) \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/arguments/invalid_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/arguments/invalid_expression.py new file mode 100644 index 0000000000..6c9732ea5b --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/arguments/invalid_expression.py @@ -0,0 +1,5 @@ +call(x + y = 1) +call(x := 1 = 1) + +call(yield x) +call(yield from x) diff --git a/crates/ruff_python_parser/resources/invalid/expressions/arguments/invalid_keyword_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/arguments/invalid_keyword_expression.py new file mode 100644 index 0000000000..c2872d2ed2 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/arguments/invalid_keyword_expression.py @@ -0,0 +1,4 @@ +call(x = yield y) +call(x = yield from y) +call(x = *y) +call(x = (*y)) diff --git a/crates/ruff_python_parser/resources/invalid/expressions/arguments/invalid_order.py b/crates/ruff_python_parser/resources/invalid/expressions/arguments/invalid_order.py new file mode 100644 index 0000000000..c8f785498e --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/arguments/invalid_order.py @@ -0,0 +1,5 @@ +call(**kwargs, x) +call(x=1, y) +call(x=1, **kwargs, y) +call(**kwargs, *args) +call(**kwargs, (*args)) diff --git a/crates/ruff_python_parser/resources/invalid/expressions/arguments/missing_argument.py b/crates/ruff_python_parser/resources/invalid/expressions/arguments/missing_argument.py new file mode 100644 index 0000000000..97323ea3ad --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/arguments/missing_argument.py @@ -0,0 +1 @@ +call(x,,y) \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/arguments/missing_comma.py b/crates/ruff_python_parser/resources/invalid/expressions/arguments/missing_comma.py new file mode 100644 index 0000000000..225f3cda97 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/arguments/missing_comma.py @@ -0,0 +1 @@ +call(x y) \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/arguments/missing_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/arguments/missing_expression.py new file mode 100644 index 0000000000..9ed8c7e0b9 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/arguments/missing_expression.py @@ -0,0 +1,5 @@ +call( = 1) +call(x = ) +call(*, y) + +foo diff --git a/crates/ruff_python_parser/resources/invalid/expressions/arguments/starred.py b/crates/ruff_python_parser/resources/invalid/expressions/arguments/starred.py new file mode 100644 index 0000000000..03cdf780c3 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/arguments/starred.py @@ -0,0 +1,3 @@ +call(*data for data in iter) +call(*yield x) +call(*yield from x) diff --git a/crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_0.py b/crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_0.py new file mode 100644 index 0000000000..0070d0d200 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_0.py @@ -0,0 +1,4 @@ +call( + +def foo(): + pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_1.py b/crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_1.py new file mode 100644 index 0000000000..c621f4bb7a --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_1.py @@ -0,0 +1,4 @@ +call(x + +def foo(): + pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_2.py b/crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_2.py new file mode 100644 index 0000000000..177357bd23 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_2.py @@ -0,0 +1,4 @@ +call(x, + +def foo(): + pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/attribute/invalid_member.py b/crates/ruff_python_parser/resources/invalid/expressions/attribute/invalid_member.py new file mode 100644 index 0000000000..ccd0de7546 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/attribute/invalid_member.py @@ -0,0 +1,3 @@ +x.1 +x.1.0 +x.[0] diff --git a/crates/ruff_python_parser/resources/invalid/expressions/attribute/multiple_dots.py b/crates/ruff_python_parser/resources/invalid/expressions/attribute/multiple_dots.py new file mode 100644 index 0000000000..9779061e82 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/attribute/multiple_dots.py @@ -0,0 +1,3 @@ +extra..dot +multiple....dots +multiple.....dots diff --git a/crates/ruff_python_parser/resources/invalid/expressions/attribute/no_member.py b/crates/ruff_python_parser/resources/invalid/expressions/attribute/no_member.py new file mode 100644 index 0000000000..20dacc3e5e --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/attribute/no_member.py @@ -0,0 +1,6 @@ +# The `second` is a variable on another line and not part of the attribute expression. +first. +second + +# No member access after the dot. +last. \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/await/no_expression_0.py b/crates/ruff_python_parser/resources/invalid/expressions/await/no_expression_0.py new file mode 100644 index 0000000000..64e6729847 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/await/no_expression_0.py @@ -0,0 +1,4 @@ +# No expression after `await`, an expression on another line +await + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/await/no_expression_1.py b/crates/ruff_python_parser/resources/invalid/expressions/await/no_expression_1.py new file mode 100644 index 0000000000..5e7077a0b1 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/await/no_expression_1.py @@ -0,0 +1,5 @@ +# No expression after `await`, a statement on another line +await + +def foo(): + pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/await/recover.py b/crates/ruff_python_parser/resources/invalid/expressions/await/recover.py new file mode 100644 index 0000000000..176e63dd47 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/await/recover.py @@ -0,0 +1,17 @@ +# The parser parses all of the following expressions but reports an error for +# invalid expressions. + +# Nested await +await await x + +# Starred expressions +await *x +await (*x) + +# Invalid expression as per precedence +await yield x +await lambda x: x +await +x +await -x +await ~x +await not x \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/bin_op/invalid_rhs_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/invalid_rhs_expression.py new file mode 100644 index 0000000000..518088fafe --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/invalid_rhs_expression.py @@ -0,0 +1,3 @@ +x + lambda y: y + +x - yield y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/bin_op/missing_lhs.py b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/missing_lhs.py new file mode 100644 index 0000000000..b244381fe3 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/missing_lhs.py @@ -0,0 +1,3 @@ +/ y + +1 + 2 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/bin_op/missing_rhs_0.py b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/missing_rhs_0.py new file mode 100644 index 0000000000..30ea3dab17 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/missing_rhs_0.py @@ -0,0 +1,3 @@ +0 + + +1 + 2 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/bin_op/missing_rhs_1.py b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/missing_rhs_1.py new file mode 100644 index 0000000000..690bbc920f --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/missing_rhs_1.py @@ -0,0 +1,3 @@ +1 + 2 - 3 * + +4 + 5 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/bin_op/multiple_ops.py b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/multiple_ops.py new file mode 100644 index 0000000000..76d5648924 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/multiple_ops.py @@ -0,0 +1,4 @@ +x++ +1 + 2 +x-- +1 - 2 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/bin_op/named_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/named_expression.py new file mode 100644 index 0000000000..11b9233618 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/named_expression.py @@ -0,0 +1,2 @@ +x - y := (1, 2) +x / y := 2 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/bin_op/starred_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/starred_expression.py new file mode 100644 index 0000000000..5b90b17ba6 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/bin_op/starred_expression.py @@ -0,0 +1,2 @@ +x + *y +x ** *y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/bool_op/invalid_rhs_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/bool_op/invalid_rhs_expression.py new file mode 100644 index 0000000000..8fb2518617 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/bool_op/invalid_rhs_expression.py @@ -0,0 +1,3 @@ +x and lambda y: y + +x or yield y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/bool_op/missing_lhs.py b/crates/ruff_python_parser/resources/invalid/expressions/bool_op/missing_lhs.py new file mode 100644 index 0000000000..4120409d54 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/bool_op/missing_lhs.py @@ -0,0 +1 @@ +and y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/bool_op/missing_rhs.py b/crates/ruff_python_parser/resources/invalid/expressions/bool_op/missing_rhs.py new file mode 100644 index 0000000000..23b96d2179 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/bool_op/missing_rhs.py @@ -0,0 +1,3 @@ +x and + +1 + 2 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/bool_op/named_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/bool_op/named_expression.py new file mode 100644 index 0000000000..a18abb3951 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/bool_op/named_expression.py @@ -0,0 +1,2 @@ +x and a := b +x or a := b \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/bool_op/starred_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/bool_op/starred_expression.py new file mode 100644 index 0000000000..b7f69f8fe5 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/bool_op/starred_expression.py @@ -0,0 +1,2 @@ +x and *y +x or *y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/compare/invalid_order.py b/crates/ruff_python_parser/resources/invalid/expressions/compare/invalid_order.py new file mode 100644 index 0000000000..c58f4725af --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/compare/invalid_order.py @@ -0,0 +1,7 @@ +x in not y + +# `=>` instead of `>=` +x => y + +# Same here as well, `not` without `in` is considered to be a unary operator +x not is y diff --git a/crates/ruff_python_parser/resources/invalid/expressions/compare/invalid_rhs_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/compare/invalid_rhs_expression.py new file mode 100644 index 0000000000..0ad5190763 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/compare/invalid_rhs_expression.py @@ -0,0 +1,3 @@ +x not in lambda y: y + +x == yield y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/compare/missing_lhs.py b/crates/ruff_python_parser/resources/invalid/expressions/compare/missing_lhs.py new file mode 100644 index 0000000000..7ded196074 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/compare/missing_lhs.py @@ -0,0 +1,3 @@ +> y + +1 + 2 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/compare/missing_rhs_0.py b/crates/ruff_python_parser/resources/invalid/expressions/compare/missing_rhs_0.py new file mode 100644 index 0000000000..607601f957 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/compare/missing_rhs_0.py @@ -0,0 +1,3 @@ +x > + +1 + 2 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/compare/missing_rhs_1.py b/crates/ruff_python_parser/resources/invalid/expressions/compare/missing_rhs_1.py new file mode 100644 index 0000000000..61c762c499 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/compare/missing_rhs_1.py @@ -0,0 +1,4 @@ +# Without the `in`, this is considered to be a unary `not` +x not + +1 + 2 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/compare/missing_rhs_2.py b/crates/ruff_python_parser/resources/invalid/expressions/compare/missing_rhs_2.py new file mode 100644 index 0000000000..2e805a108d --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/compare/missing_rhs_2.py @@ -0,0 +1,3 @@ +x is not + +1 + 2 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/compare/multiple_equals.py b/crates/ruff_python_parser/resources/invalid/expressions/compare/multiple_equals.py new file mode 100644 index 0000000000..a647f1c556 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/compare/multiple_equals.py @@ -0,0 +1,3 @@ +# This is not JavaScript +x === y +x !== y diff --git a/crates/ruff_python_parser/resources/invalid/expressions/compare/named_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/compare/named_expression.py new file mode 100644 index 0000000000..a5b68868e9 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/compare/named_expression.py @@ -0,0 +1,2 @@ +x not in y := (1, 2) +x > y := 2 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/compare/starred_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/compare/starred_expression.py new file mode 100644 index 0000000000..f16edf5e7a --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/compare/starred_expression.py @@ -0,0 +1,5 @@ +x >= *y +x not in *y + +*x < y +*x is not y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/dict/comprehension.py b/crates/ruff_python_parser/resources/invalid/expressions/dict/comprehension.py new file mode 100644 index 0000000000..71dac0c1d5 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/dict/comprehension.py @@ -0,0 +1,17 @@ +# Invalid target +{x: y for 1 in y} +{x: y for 'a' in y} +{x: y for call() in y} +{x: y for {a, b} in y} + +# Invalid iter +{x: y for x in *y} +{x: y for x in yield y} +{x: y for x in yield from y} +{x: y for x in lambda y: y} + +# Invalid if +{x: y for x in data if *y} +{x: y for x in data if yield y} +{x: y for x in data if yield from y} +{x: y for x in data if lambda y: y} \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/dict/double_star.py b/crates/ruff_python_parser/resources/invalid/expressions/dict/double_star.py new file mode 100644 index 0000000000..df2b1908e5 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/dict/double_star.py @@ -0,0 +1,12 @@ +# Double star expression starts with bitwise OR precedence. Make sure we don't parse +# the ones which are higher than that. + +{**x := 1} +{a: 1, **x if True else y} +{**lambda x: x, b: 2} +{a: 1, **x or y} +{**x and y, b: 2} +{a: 1, **not x, b: 2} +{**x in y} +{**x not in y} +{**x < y} diff --git a/crates/ruff_python_parser/resources/invalid/expressions/dict/double_star_comprehension.py b/crates/ruff_python_parser/resources/invalid/expressions/dict/double_star_comprehension.py new file mode 100644 index 0000000000..6557c0cf40 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/dict/double_star_comprehension.py @@ -0,0 +1,9 @@ +# Double star means that the parser will try to parse it as a dictionary expression but +# it's actually a comprehension. + +{**x: y for x, y in data} + +# TODO(dhruvmanila): This test case fails because there's no way to represent `**y` +# in the AST. The parser tries to parse it as a binary expression but the range isn't +# correct. +# {x: **y for x, y in data} diff --git a/crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_0.py b/crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_0.py new file mode 100644 index 0000000000..5e54fb1d8d --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_0.py @@ -0,0 +1,4 @@ +{x: + +def foo(): + pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_1.py b/crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_1.py new file mode 100644 index 0000000000..f9c4cbcea7 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_1.py @@ -0,0 +1,3 @@ +{x: + +1 + 2 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_2.py b/crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_2.py new file mode 100644 index 0000000000..27207a89f5 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_2.py @@ -0,0 +1,4 @@ +{x: 1, + +def foo(): + pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/dict/named_expression_0.py b/crates/ruff_python_parser/resources/invalid/expressions/dict/named_expression_0.py new file mode 100644 index 0000000000..fffb434562 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/dict/named_expression_0.py @@ -0,0 +1,5 @@ +# Unparenthesized named expression not allowed in key + +{x := 1: y, z := 2: a} + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/dict/named_expression_1.py b/crates/ruff_python_parser/resources/invalid/expressions/dict/named_expression_1.py new file mode 100644 index 0000000000..73cd465967 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/dict/named_expression_1.py @@ -0,0 +1,5 @@ +# Unparenthesized named expression not allowed in value + +{x: y := 1, z: a := 2} + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/dict/recover.py b/crates/ruff_python_parser/resources/invalid/expressions/dict/recover.py new file mode 100644 index 0000000000..b06967a5e6 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/dict/recover.py @@ -0,0 +1,24 @@ +# Test cases for dictionary expressions where the parser recovers from a syntax error. + +{,} + +{1: 2,,3: 4} + +{1: 2,,} + +# Missing comma +{1: 2 3: 4} + +# No value +{1: } + +# No value for double star unpacking +{**} +{x: y, **, a: b} + +# This is not a double star unpacking +# {* *data} + +# Star expression not allowed here +{*x: y, z: a, *b: c} +{x: *y, z: *a} diff --git a/crates/ruff_python_parser/resources/invalid/expressions/emoji_identifiers.py b/crates/ruff_python_parser/resources/invalid/expressions/emoji_identifiers.py new file mode 100644 index 0000000000..1a6f4e8119 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/emoji_identifiers.py @@ -0,0 +1,7 @@ +a = (🐶 + # comment 🐶 +) + +a = (🐶 + + # comment +🐶) diff --git a/crates/ruff_python_parser/resources/invalid/expressions/emoji_statement.py b/crates/ruff_python_parser/resources/invalid/expressions/emoji_statement.py new file mode 100644 index 0000000000..ace0b338cc --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/emoji_statement.py @@ -0,0 +1 @@ +👍 diff --git a/crates/ruff_python_parser/resources/invalid/expressions/if/missing_orelse_expr_0.py b/crates/ruff_python_parser/resources/invalid/expressions/if/missing_orelse_expr_0.py new file mode 100644 index 0000000000..8429a76a7d --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/if/missing_orelse_expr_0.py @@ -0,0 +1,5 @@ +# Missing orelse expression, followed by a statement +x if expr else + +def foo(): + pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/if/missing_orelse_expr_1.py b/crates/ruff_python_parser/resources/invalid/expressions/if/missing_orelse_expr_1.py new file mode 100644 index 0000000000..b45efa33ae --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/if/missing_orelse_expr_1.py @@ -0,0 +1,4 @@ +# Missing orelse expression, followed by an expression +x if expr else + +1 + 1 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/if/missing_test_expr_0.py b/crates/ruff_python_parser/resources/invalid/expressions/if/missing_test_expr_0.py new file mode 100644 index 0000000000..b1c4aa2794 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/if/missing_test_expr_0.py @@ -0,0 +1,5 @@ +# Missing test expression, followed by a statement +x if + +def foo(): + pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/if/missing_test_expr_1.py b/crates/ruff_python_parser/resources/invalid/expressions/if/missing_test_expr_1.py new file mode 100644 index 0000000000..45b2d0d36c --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/if/missing_test_expr_1.py @@ -0,0 +1,4 @@ +# Missing test expression, followed by an expression +x if + +1 + 1 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/if/recover.py b/crates/ruff_python_parser/resources/invalid/expressions/if/recover.py new file mode 100644 index 0000000000..1d494f320a --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/if/recover.py @@ -0,0 +1,10 @@ +# Invalid test expression +x if *expr else y +x if lambda x: x else y +x if yield x else y +x if yield from x else y + +# Invalid orelse expression +x if expr else *orelse +x if expr else yield y +x if expr else yield from y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/lambda_default_parameters.py b/crates/ruff_python_parser/resources/invalid/expressions/lambda_default_parameters.py new file mode 100644 index 0000000000..a9e7ed412a --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/lambda_default_parameters.py @@ -0,0 +1 @@ +lambda a, b=20, c: 1 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/lambda_duplicate_parameters.py b/crates/ruff_python_parser/resources/invalid/expressions/lambda_duplicate_parameters.py new file mode 100644 index 0000000000..4edd2de546 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/lambda_duplicate_parameters.py @@ -0,0 +1,9 @@ +lambda a, a: 1 + +lambda a, *, a: 1 + +lambda a, a=20: 1 + +lambda a, *a: 1 + +lambda a, *, **a: 1 diff --git a/crates/ruff_python_parser/resources/invalid/expressions/list/comprehension.py b/crates/ruff_python_parser/resources/invalid/expressions/list/comprehension.py new file mode 100644 index 0000000000..ee4d840bd4 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/list/comprehension.py @@ -0,0 +1,20 @@ +# Iterable unpacking not allowed +[*x for x in y] + +# Invalid target +[x for 1 in y] +[x for 'a' in y] +[x for call() in y] +[x for {a, b} in y] + +# Invalid iter +[x for x in *y] +[x for x in yield y] +[x for x in yield from y] +[x for x in lambda y: y] + +# Invalid if +[x for x in data if *y] +[x for x in data if yield y] +[x for x in data if yield from y] +[x for x in data if lambda y: y] \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_0.py b/crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_0.py new file mode 100644 index 0000000000..aec1ccc3a8 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_0.py @@ -0,0 +1,3 @@ +# Missing closing bracket 0: No elements + +[ \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_1.py b/crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_1.py new file mode 100644 index 0000000000..2366fdc978 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_1.py @@ -0,0 +1,6 @@ +# Missing closing bracket 1: No elements on the same line, the one on the next line +# is considered to be part of the list. + +[ + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_2.py b/crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_2.py new file mode 100644 index 0000000000..a0b20f2ec7 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_2.py @@ -0,0 +1,6 @@ +# Missing closing bracket 2: One element on the line, the other one on the next line +# will be considered to be part of the list. + +[1, + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_3.py b/crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_3.py new file mode 100644 index 0000000000..3d7d461571 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_3.py @@ -0,0 +1,7 @@ +# Missing closing bracket 3: Multiple elements without a trailing comma and the next +# token starts a statement. + +[1, 2 + +def foo(): + pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/list/recover.py b/crates/ruff_python_parser/resources/invalid/expressions/list/recover.py new file mode 100644 index 0000000000..b23d2e81f3 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/list/recover.py @@ -0,0 +1,20 @@ +# Test cases for list expressions where the parser recovers from a syntax error. + +[,] + +[1,,2] + +[1,,] + +# Missing comma +[1 2] + +# Dictionary element in a list +[1: 2] + +# Missing expression +[1, x + ] + +[1; 2] + +[*] diff --git a/crates/ruff_python_parser/resources/invalid/expressions/list/star_expression_precedence.py b/crates/ruff_python_parser/resources/invalid/expressions/list/star_expression_precedence.py new file mode 100644 index 0000000000..36c015d2d8 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/list/star_expression_precedence.py @@ -0,0 +1,10 @@ +# For list expression, the minimum binding power of star expression is bitwise or. + +[(*x), y] +[*x in y, z] +[*not x, z] +[*x and y, z] +[*x or y, z] +[*x if True else y, z] +[*lambda x: x, z] +[*x := 2, z] diff --git a/crates/ruff_python_parser/resources/invalid/expressions/named/invalid_target.py b/crates/ruff_python_parser/resources/invalid/expressions/named/invalid_target.py new file mode 100644 index 0000000000..bc567cc296 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/named/invalid_target.py @@ -0,0 +1,6 @@ +# Assignment expression target can only be an identifier + +(x.y := 1) +(x[y] := 1) +(*x := 1) +([x, y] := [1, 2]) \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_0.py b/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_0.py new file mode 100644 index 0000000000..940c64dcba --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_0.py @@ -0,0 +1,3 @@ +# There are no parentheses, so this isn't parsed as named expression. + +x := \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_1.py b/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_1.py new file mode 100644 index 0000000000..2faeff3ecd --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_1.py @@ -0,0 +1,3 @@ +# EOF after the `:=` token + +(x := \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_2.py b/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_2.py new file mode 100644 index 0000000000..ec0e1c5a70 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_2.py @@ -0,0 +1,6 @@ +# Missing expression, instead there's a function definition + +(x := + +def foo(): + pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_3.py b/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_3.py new file mode 100644 index 0000000000..b5f61b8345 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_3.py @@ -0,0 +1,6 @@ +# An expression is present, but it's most likely not what was intended for the +# assignment value. + +(x := + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_4.py b/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_4.py new file mode 100644 index 0000000000..5f6255c6d0 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_4.py @@ -0,0 +1,5 @@ +# No expression on the right side of the assignment expression + +(x := ) + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/generator.py b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/generator.py new file mode 100644 index 0000000000..3664e5069c --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/generator.py @@ -0,0 +1,2 @@ +(*x for x in y) +(x := 1, for x in y) \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_0.py b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_0.py new file mode 100644 index 0000000000..5cc24311a3 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_0.py @@ -0,0 +1,3 @@ +# Missing closing parentheses 0: No elements + +( \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_1.py b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_1.py new file mode 100644 index 0000000000..62238ba6d3 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_1.py @@ -0,0 +1,6 @@ +# Missing closing parentheses 1: No elements on the same line, the one on the next line +# is considered to be part of the list. + +( + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_2.py b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_2.py new file mode 100644 index 0000000000..0529ba2c8c --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_2.py @@ -0,0 +1,6 @@ +# Missing closing parentheses 2: One element on the line, the other one on the next line +# will be considered to be part of the tuple. + +(1, + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_3.py b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_3.py new file mode 100644 index 0000000000..b0ce2992d7 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_3.py @@ -0,0 +1,7 @@ +# Missing closing parentheses 3: Multiple elements without a trailing comma and the next +# token starts a statement. + +(1, 2 + +def foo(): + pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/parenthesized.py b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/parenthesized.py new file mode 100644 index 0000000000..2fb070f7ac --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/parenthesized.py @@ -0,0 +1,5 @@ +# Starred expression isn't allowed in a parenthesized expression. +(*x) + +# Unparenthesized named expression is allowed. +x := 1 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/tuple.py b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/tuple.py new file mode 100644 index 0000000000..73a45690ba --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/tuple.py @@ -0,0 +1,21 @@ +# Test cases for tuple expressions where the parser recovers from a syntax error. + +(,) + +(1,,2) + +(1,,) + +# Missing comma +(1 2) + +# Dictionary element in a list +(1: 2) + +# Missing expression +(1, x + ) + +(1; 2) + +# Unparenthesized named expression is not allowed +x, y := 2, z \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/tuple_starred_expr.py b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/tuple_starred_expr.py new file mode 100644 index 0000000000..1a87159f0a --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/parenthesized/tuple_starred_expr.py @@ -0,0 +1,20 @@ +# For tuple expression, the minimum binding power of star expression is bitwise or. +# Test the first and any other element as the there are two separate calls. + +(*x in y, z, *x in y) +(*not x, z, *not x) +(*x and y, z, *x and y) +(*x or y, z, *x or y) +(*x if True else y, z, *x if True else y) +(*lambda x: x, z, *lambda x: x) +(*x := 2, z, *x := 2) + + +# Non-parenthesized +*x in y, z, *x in y +*not x, z, *not x +*x and y, z, *x and y +*x or y, z, *x or y +*x if True else y, z, *x if True else y +*lambda x: x, z, *lambda x: x +*x := 2, z, *x := 2 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/set/comprehension.py b/crates/ruff_python_parser/resources/invalid/expressions/set/comprehension.py new file mode 100644 index 0000000000..3ee17a02ad --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/set/comprehension.py @@ -0,0 +1,20 @@ +# Iterable unpacking not allowed +{*x for x in y} + +# Invalid target +{x for 1 in y} +{x for 'a' in y} +{x for call() in y} +{x for {a, b} in y} + +# Invalid iter +{x for x in *y} +{x for x in yield y} +{x for x in yield from y} +{x for x in lambda y: y} + +# Invalid if +{x for x in data if *y} +{x for x in data if yield y} +{x for x in data if yield from y} +{x for x in data if lambda y: y} diff --git a/crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_0.py b/crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_0.py new file mode 100644 index 0000000000..4f7bd1d62f --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_0.py @@ -0,0 +1,3 @@ +# Missing closing curly brace 0: No elements + +{ \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_1.py b/crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_1.py new file mode 100644 index 0000000000..3313ea1a6e --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_1.py @@ -0,0 +1,6 @@ +# Missing closing curly brace 1: No elements on the same line, the one on the next line +# is considered to be part of the set. + +{ + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_2.py b/crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_2.py new file mode 100644 index 0000000000..90587939dc --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_2.py @@ -0,0 +1,6 @@ +# Missing closing curly brace 2: One element on the line, the other one on the next line +# will be considered to be part of the set. + +{1, + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_3.py b/crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_3.py new file mode 100644 index 0000000000..09229fbd26 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_3.py @@ -0,0 +1,7 @@ +# Missing closing curly brace 3: Multiple elements without a trailing comma and the next +# token starts a statement. + +{1, 2 + +def foo(): + pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/set/recover.py b/crates/ruff_python_parser/resources/invalid/expressions/set/recover.py new file mode 100644 index 0000000000..1b10357c3c --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/set/recover.py @@ -0,0 +1,22 @@ +# Test cases for set expressions where the parser recovers from a syntax error. +# There are valid expressions in between invalid ones to verify that. +# These are same as for the list expressions. + +{,} + +{1,,2} + +{1,,} + +# Missing comma +{1 2} + +# Dictionary element in a list +{1: 2} + +# Missing expression +{1, x + } + +{1; 2} + +[*] diff --git a/crates/ruff_python_parser/resources/invalid/expressions/set/star_expression_precedence.py b/crates/ruff_python_parser/resources/invalid/expressions/set/star_expression_precedence.py new file mode 100644 index 0000000000..557948340d --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/set/star_expression_precedence.py @@ -0,0 +1,10 @@ +# For set expression, the minimum binding power of star expression is bitwise or. + +{(*x), y} +{*x in y, z} +{*not x, z} +{*x and y, z} +{*x or y, z} +{*x if True else y, z} +{*lambda x: x, z} +{*x := 2, z} \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/subscript/invalid_slice_element.py b/crates/ruff_python_parser/resources/invalid/expressions/subscript/invalid_slice_element.py new file mode 100644 index 0000000000..4d5603fafc --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/subscript/invalid_slice_element.py @@ -0,0 +1,12 @@ +x[x := 1:] + +# Starred expression +x[*x:] +x[:*x] +x[::*x] + +# Empty slice +x[] + +# Mixed starred expression and named expression +x[*x := 1] \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_0.py b/crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_0.py new file mode 100644 index 0000000000..ba5c6c6aec --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_0.py @@ -0,0 +1,3 @@ +x[: + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_1.py b/crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_1.py new file mode 100644 index 0000000000..47c3acdfc9 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_1.py @@ -0,0 +1,4 @@ +x[:: + +def foo(): + pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/unary.py b/crates/ruff_python_parser/resources/invalid/expressions/unary.py new file mode 100644 index 0000000000..4d614dbcea --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/unary.py @@ -0,0 +1 @@ +not x := 1 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/unary/named_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/unary/named_expression.py new file mode 100644 index 0000000000..755182f92a --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/unary/named_expression.py @@ -0,0 +1,2 @@ +-x := 1 +not x := 1 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/unary/no_expression_0.py b/crates/ruff_python_parser/resources/invalid/expressions/unary/no_expression_0.py new file mode 100644 index 0000000000..f00375bb1d --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/unary/no_expression_0.py @@ -0,0 +1,3 @@ +not + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/unary/no_expression_1.py b/crates/ruff_python_parser/resources/invalid/expressions/unary/no_expression_1.py new file mode 100644 index 0000000000..e91fa78fbc --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/unary/no_expression_1.py @@ -0,0 +1,3 @@ ++ + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/yield/named_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/yield/named_expression.py new file mode 100644 index 0000000000..2a25f0fb4a --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/yield/named_expression.py @@ -0,0 +1,4 @@ +# Unparenthesized named expressions are not allowed +yield x := 1 + +yield 1, x := 2, 3 diff --git a/crates/ruff_python_parser/resources/invalid/expressions/yield/star_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/yield/star_expression.py new file mode 100644 index 0000000000..4de2eab8fe --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/yield/star_expression.py @@ -0,0 +1,4 @@ +# Cannot use starred expression here +yield (*x) + +yield *x and y, z diff --git a/crates/ruff_python_parser/resources/invalid/expressions/yield_from/starred_expression.py b/crates/ruff_python_parser/resources/invalid/expressions/yield_from/starred_expression.py new file mode 100644 index 0000000000..d8359cfed0 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/yield_from/starred_expression.py @@ -0,0 +1,4 @@ +# Yield from doesn't allow top-level starred expression unlike yield + +yield from *x +yield from *x, y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/expressions/yield_from/unparenthesized.py b/crates/ruff_python_parser/resources/invalid/expressions/yield_from/unparenthesized.py new file mode 100644 index 0000000000..7806e4b5a7 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/expressions/yield_from/unparenthesized.py @@ -0,0 +1,9 @@ +# Unparenthesized named expression +yield from x := 1 + +# Unparenthesized tuple expression +yield from x, y + +# This is a tuple expression parsing +# vvvvvvvvvvvvv +yield from (x, *x and y) \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/statements/function_type_parameters.py b/crates/ruff_python_parser/resources/invalid/statements/function_type_parameters.py new file mode 100644 index 0000000000..d2ed2f5dae --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/function_type_parameters.py @@ -0,0 +1,19 @@ +# FIXME: The type param related error message and the parser recovery are looking pretty good **except** +# that the lexer never recovers from the unclosed `[`, resulting in it lexing `NonLogicalNewline` tokens instead of `Newline` tokens. +# That's because the parser has no way of feeding the error recovery back to the lexer, +# so they don't agree on the state of the world which can lead to all kind of errors further down in the file. +# This is not just a problem with parentheses but also with the transformation made by the +# `SoftKeywordTransformer` because the `Parser` and `Transfomer` may not agree if they're +# currently in a position where the `type` keyword is allowed or not. +# That roughly means that any kind of recovery can lead to unrelated syntax errors +# on following lines. + +def keyword[A, await](): ... + +def not_a_type_param[A, |, B](): ... + +def multiple_commas[A,,B](): ... + +def multiple_trailing_commas[A,,](): ... + +def multiple_commas_and_recovery[A,,100](): ... \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/statements/if_extra_closing_parentheses.py b/crates/ruff_python_parser/resources/invalid/statements/if_extra_closing_parentheses.py new file mode 100644 index 0000000000..12596d31a7 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/if_extra_closing_parentheses.py @@ -0,0 +1,3 @@ +# FIXME(micha): This creates two syntax errors instead of just one (and overlapping ones) +if True)): + pass diff --git a/crates/ruff_python_parser/resources/invalid/statements/if_extra_indent.py b/crates/ruff_python_parser/resources/invalid/statements/if_extra_indent.py new file mode 100644 index 0000000000..647626cb5d --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/if_extra_indent.py @@ -0,0 +1,8 @@ +# Improving the recovery would require changing the lexer to emit an extra dedent token after `a + b`. +if True: + pass + a + b + + pass + +a = 10 diff --git a/crates/ruff_python_parser/resources/invalid/statements/invalid_assignment_targets.py b/crates/ruff_python_parser/resources/invalid/statements/invalid_assignment_targets.py new file mode 100644 index 0000000000..a08e6d0ab7 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/invalid_assignment_targets.py @@ -0,0 +1,42 @@ +# Regression test: https://github.com/astral-sh/ruff/issues/6895 +# First we test, broadly, that various kinds of assignments are now +# rejected by the parser. e.g., `5 = 3`, `5 += 3`, `(5): int = 3`. + +5 = 3 + +5 += 3 + +(5): int = 3 + +# Now we exhaustively test all possible cases where assignment can fail. +x or y = 42 +(x := 5) = 42 +x + y = 42 +-x = 42 +(lambda _: 1) = 42 +a if b else c = 42 +{"a": 5} = 42 +{a} = 42 +[x for x in xs] = 42 +{x for x in xs} = 42 +{x: x * 2 for x in xs} = 42 +(x for x in xs) = 42 +await x = 42 +(yield x) = 42 +(yield from xs) = 42 +a < b < c = 42 +foo() = 42 + +f"{quux}" = 42 +f"{foo} and {bar}" = 42 + +"foo" = 42 +b"foo" = 42 +123 = 42 +True = 42 +None = 42 +... = 42 +*foo() = 42 +[x, foo(), y] = [42, 42, 42] +[[a, b], [[42]], d] = [[1, 2], [[3]], 4] +(x, foo(), y) = (42, 42, 42) diff --git a/crates/ruff_python_parser/resources/invalid/statements/invalid_augmented_assignment_target.py b/crates/ruff_python_parser/resources/invalid/statements/invalid_augmented_assignment_target.py new file mode 100644 index 0000000000..b2ceb7c488 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/invalid_augmented_assignment_target.py @@ -0,0 +1,34 @@ +# This is similar to `./invalid_assignment_targets.py`, but for augmented +# assignment targets. + +x or y += 42 +(x := 5) += 42 +x + y += 42 +-x += 42 +(lambda _: 1) += 42 +a if b else c += 42 +{"a": 5} += 42 +{a} += 42 +[x for x in xs] += 42 +{x for x in xs} += 42 +{x: x * 2 for x in xs} += 42 +(x for x in xs) += 42 +await x += 42 +(yield x) += 42 +(yield from xs) += 42 +a < b < c += 42 +foo() += 42 + +f"{quux}" += 42 +f"{foo} and {bar}" += 42 + +"foo" += 42 +b"foo" += 42 +123 += 42 +True += 42 +None += 42 +... += 42 +*foo() += 42 +[x, foo(), y] += [42, 42, 42] +[[a, b], [[42]], d] += [[1, 2], [[3]], 4] +(x, foo(), y) += (42, 42, 42) diff --git a/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_0.py b/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_0.py new file mode 100644 index 0000000000..88868d2996 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_0.py @@ -0,0 +1,8 @@ +match subject: + # Parser shouldn't confuse this as being a + # class pattern + # v + case (x as y)(a, b): + # ^^^^^^ + # as-pattern + pass diff --git a/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_1.py b/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_1.py new file mode 100644 index 0000000000..49bb4166db --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_1.py @@ -0,0 +1,8 @@ +match subject: + # Parser shouldn't confuse this as being a + # complex literal pattern + # v + case (x as y) + 1j: + # ^^^^^^ + # as-pattern + pass diff --git a/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_2.py b/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_2.py new file mode 100644 index 0000000000..55b09e7bcd --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_2.py @@ -0,0 +1,5 @@ +match subject: + # This `as` pattern is unparenthesied so the parser never takes the path + # where it might be confused as a complex literal pattern. + case x as y + 1j: + pass diff --git a/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_3.py b/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_3.py new file mode 100644 index 0000000000..7233520929 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_3.py @@ -0,0 +1,5 @@ +match subject: + # Not in the mapping start token set, so the list parsing bails + # v + case {(x as y): 1}: + pass diff --git a/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_4.py b/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_4.py new file mode 100644 index 0000000000..4fed7e829c --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_4.py @@ -0,0 +1,5 @@ +match subject: + # This `as` pattern is unparenthesized so the parser never takes the path + # where it might be confused as a mapping key pattern. + case {x as y: 1}: + pass diff --git a/crates/ruff_python_parser/resources/invalid/statements/match/invalid_class_pattern.py b/crates/ruff_python_parser/resources/invalid/statements/match/invalid_class_pattern.py new file mode 100644 index 0000000000..6f9398d985 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/match/invalid_class_pattern.py @@ -0,0 +1,17 @@ +# Invalid keyword pattern in class argument +match subject: + case Foo(x as y = 1): + pass + case Foo(x | y = 1): + pass + case Foo([x, y] = 1): + pass + case Foo({False: 0} = 1): + pass + case Foo(1=1): + pass + case Foo(Bar()=1): + pass + # Positional pattern cannot follow keyword pattern + # case Foo(x, y=1, z): + # pass diff --git a/crates/ruff_python_parser/resources/invalid/statements/match/invalid_lhs_or_rhs_pattern.py b/crates/ruff_python_parser/resources/invalid/statements/match/invalid_lhs_or_rhs_pattern.py new file mode 100644 index 0000000000..61d090b0d6 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/match/invalid_lhs_or_rhs_pattern.py @@ -0,0 +1,41 @@ +match invalid_lhs_pattern: + case Foo() + 1j: + pass + case x + 2j: + pass + case _ + 3j: + pass + case (1 | 2) + 4j: + pass + case [1, 2] + 5j: + pass + case {True: 1} + 6j: + pass + case 1j + 2j: + pass + case -1j + 2j: + pass + case Foo(a as b) + 1j: + pass + +match invalid_rhs_pattern: + case 1 + Foo(): + pass + case 2 + x: + pass + case 3 + _: + pass + case 4 + (1 | 2): + pass + case 5 + [1, 2]: + pass + case 6 + {True: 1}: + pass + case 1 + 2: + pass + case 1 + Foo(a as b): + pass + +match invalid_lhs_rhs_pattern: + case Foo() + Bar(): + pass diff --git a/crates/ruff_python_parser/resources/invalid/statements/match/invalid_mapping_pattern.py b/crates/ruff_python_parser/resources/invalid/statements/match/invalid_mapping_pattern.py new file mode 100644 index 0000000000..4d80119dd2 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/match/invalid_mapping_pattern.py @@ -0,0 +1,23 @@ +# Starred expression is not allowed as a mapping pattern key +match subject: + case {*key}: + pass + case {*key: 1}: + pass + case {*key 1}: + pass + case {*key, None: 1}: + pass + +# Pattern cannot follow a double star pattern +# Multiple double star patterns are not allowed +match subject: + case {**rest, None: 1}: + pass + case {**rest1, **rest2, None: 1}: + pass + case {**rest1, None: 1, **rest2}: + pass + +match subject: + case {Foo(a as b): 1}: ... \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/statements/match/star_pattern_usage.py b/crates/ruff_python_parser/resources/invalid/statements/match/star_pattern_usage.py new file mode 100644 index 0000000000..9555a33946 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/match/star_pattern_usage.py @@ -0,0 +1,24 @@ +# Star pattern is only allowed inside a sequence pattern +match subject: + case *_: + pass + case *_ as x: + pass + case *foo: + pass + case *foo | 1: + pass + case 1 | *foo: + pass + case Foo(*_): + pass + case Foo(x=*_): + pass + case {*_}: + pass + case {*_: 1}: + pass + case {None: *_}: + pass + case 1 + *_: + pass diff --git a/crates/ruff_python_parser/resources/invalid/statements/match/unary_add_usage.py b/crates/ruff_python_parser/resources/invalid/statements/match/unary_add_usage.py new file mode 100644 index 0000000000..293e4b4b81 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/match/unary_add_usage.py @@ -0,0 +1,12 @@ +# Unary addition isn't allowed but we parse it for better error recovery. +match subject: + case +1: + pass + case 1 | +2 | -3: + pass + case [1, +2, -3]: + pass + case Foo(x=+1, y=-2): + pass + case {True: +1, False: -2}: + pass diff --git a/crates/ruff_python_parser/resources/invalid/statements/with/ambiguous_lpar_with_items.py b/crates/ruff_python_parser/resources/invalid/statements/with/ambiguous_lpar_with_items.py new file mode 100644 index 0000000000..49845c15c0 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/with/ambiguous_lpar_with_items.py @@ -0,0 +1,32 @@ +# This file contains test cases where the with items has an ambiguous left parenthesis. +# These cases should raise the correct syntax error and recover properly. + +with (item1, item2),: ... +with (item1, item2), as f: ... +with (item1, item2), item3,: ... +with (*item): ... +with (*item) as f: ... +with (item := 10 as f): ... +with (item1, item2 := 10 as f): ... +with (x for x in range(10), item): ... +with (item, x for x in range(10)): ... + +# Make sure the parser doesn't report the same error twice +with ((*item)): ... + +with (*x for x in iter, item): ... +with (item1, *x for x in iter, item2): ... +with (x as f, *y): ... +with (*x, y as f): ... +with (x, yield y): ... +with (x, yield y, z): ... +with (x, yield from y): ... +with (x as f, y) as f: ... +with (x for x in iter as y): ... + +# The inner `(...)` is parsed as parenthesized expression +with ((item as f)): ... + +with (item as f), x: ... +with (item as f1) as f2: ... +with (item1 as f, item2 := 0): ... \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/statements/with/empty_with_items.py b/crates/ruff_python_parser/resources/invalid/statements/with/empty_with_items.py new file mode 100644 index 0000000000..97a32fd03e --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/with/empty_with_items.py @@ -0,0 +1,6 @@ +# There are no with items present. +# The parser should recover from this syntax error. + +with : ... + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar.py b/crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar.py new file mode 100644 index 0000000000..ba0183222d --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar.py @@ -0,0 +1,3 @@ +with (: + +x + y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar_eof.py b/crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar_eof.py new file mode 100644 index 0000000000..d45f9c6c34 --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar_eof.py @@ -0,0 +1 @@ +with ( \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/invalid/statements/with/unparenthesized_with_items.py b/crates/ruff_python_parser/resources/invalid/statements/with/unparenthesized_with_items.py new file mode 100644 index 0000000000..dbe3f5229a --- /dev/null +++ b/crates/ruff_python_parser/resources/invalid/statements/with/unparenthesized_with_items.py @@ -0,0 +1,9 @@ +# For parenthesized with items test cases, refer to `./ambiguous_lpar_with_items.py` + +with item,: pass +with item as x,: pass +with *item: pass +with *item as x: pass +with *item1, item2 as f: pass +with item1 as f, *item2: pass +with item := 0 as f: pass \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/expressions/arguments.py b/crates/ruff_python_parser/resources/valid/expressions/arguments.py new file mode 100644 index 0000000000..012db5016c --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/arguments.py @@ -0,0 +1,50 @@ +# This only tests the call arguments and not the expression before the opening parenthesis. + +# Simple +call() +call(x, y) +call(x, y,) # Trailing comma +call(x=1, y=2) +call(*x) +call(**x) + +# Order +call(x, y=1) +call(x, *y) +call(x, **y) +call(x=1, *y) +call(x=1, **y) +call(*x, **y) +call(*x, y, z) +call(**x, y=1, z=2) +call(*x1, *x2, **y1, **y2) +call(x=1, **y, z=1) + +# Keyword expression +call(x=1 if True else 2) +call(x=await y) +call(x=lambda y: y) +call(x=(y := 1)) + +# Yield expression +call((yield x)) +call((yield from x)) + +# Named expression +call(x := 1) +call(x := 1 for x in iter) + +# Starred expressions +call(*x and y) +call(*x | y) +call(*await x) +call(*lambda x: x) +call(*x if True else y) + +# Double starred +call(**x) +call(**x and y) +call(**await x) +call(**x if True else y) +call(**(yield x)) +call(**lambda x: x) diff --git a/crates/ruff_python_parser/resources/valid/expressions/attribute.py b/crates/ruff_python_parser/resources/valid/expressions/attribute.py new file mode 100644 index 0000000000..7e8217ada9 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/attribute.py @@ -0,0 +1,6 @@ +value.attr +value.attr() +value().attr +value().attr().foo +value.attr.foo +(value).attr().foo diff --git a/crates/ruff_python_parser/resources/valid/expressions/await.py b/crates/ruff_python_parser/resources/valid/expressions/await.py new file mode 100644 index 0000000000..37f63d936d --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/await.py @@ -0,0 +1,15 @@ +await x +await x + 1 +await a and b +await f() +await [1, 2] +await {3, 4} +await {i: 5} +await 7, 8 +await (9, 10) +await 1 == 1 +await x if True else None +await (*x,) +await (lambda x: x) +await x ** -x +await x ** await y \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/expressions/bin_op.py b/crates/ruff_python_parser/resources/valid/expressions/bin_op.py new file mode 100644 index 0000000000..a93315db3e --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/bin_op.py @@ -0,0 +1,33 @@ +# Simple +1 + 2 +1 - 2 +1 * 2 +1 / 2 +1 // 2 +1 % 2 +1 ** 2 +1 | 2 +1 ^ 2 +1 & 2 +1 >> 2 +1 << 2 +1 @ 2 + +# Same precedence +1 + 2 - 3 + 4 +1 * 2 / 3 // 4 @ 5 % 6 +1 << 2 >> 3 >> 4 << 5 + +# Different precedence +1 + 2 * 3 +1 * 2 + 3 +1 ** 2 * 3 - 4 @ 5 + 6 - 7 // 8 +# With bitwise operators +1 | 2 & 3 ^ 4 + 5 @ 6 << 7 // 8 >> 9 + +# Associativity +1 + (2 + 3) + 4 +1 + 2 + (3 + 4 + 5) + +# Addition with a unary plus +x ++ y diff --git a/crates/ruff_python_parser/resources/valid/expressions/bool_op.py b/crates/ruff_python_parser/resources/valid/expressions/bool_op.py new file mode 100644 index 0000000000..0ee5cb01f6 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/bool_op.py @@ -0,0 +1,9 @@ +a and b +a and b and c +a or b +a or b or c +a and b or c +a and b and c or d or e and f or g +a and not b or c +yield a and b or c +not a and b or c diff --git a/crates/ruff_python_parser/resources/valid/expressions/call.py b/crates/ruff_python_parser/resources/valid/expressions/call.py new file mode 100644 index 0000000000..07e115cb24 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/call.py @@ -0,0 +1,21 @@ +# This only tests the expression before the opening parenthesis for the call expression +# and not the arguments. + +call() +attr.expr() +subscript[1, 2]() +slice[:1]() +[1, 2, 3]() +(1, 2, 3)() +(x for x in iter)() +{1, 2, 3}() +{1: 2, 3: 4}() +(yield x)() + +# These are `TypeError`, so make sure it parses correctly. +True() +False() +None() +"string"() +1() +1.0() diff --git a/crates/ruff_python_parser/resources/valid/expressions/compare.py b/crates/ruff_python_parser/resources/valid/expressions/compare.py new file mode 100644 index 0000000000..e5947b4c26 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/compare.py @@ -0,0 +1,30 @@ +# Simple +a == b +b < a +b > a +a >= b +a <= b +a != b +a is c +a in b +a not in c +a is not b + +# Double operator mixed +a not in b is not c not in d not in e is not f + +# Precedence check +a | b < c | d not in e & f +# ^ ^^^^^^ +# Higher precedence than bitwise operators + +# unary `not` is higher precedence, but is allowed at the start of the expression +# but not anywhere else +not x not in y + +x or y not in z and a +x == await y +x is not await y + +# All operators have the same precedence +a < b == c > d is e not in f is not g <= h >= i != j diff --git a/crates/ruff_python_parser/resources/valid/expressions/dictionary.py b/crates/ruff_python_parser/resources/valid/expressions/dictionary.py new file mode 100644 index 0000000000..8e783757af --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/dictionary.py @@ -0,0 +1,41 @@ +# Simple +{} +{1: 2} +{1: 2, a: 1, b: 'hello'} + +# Mixed indentations +{ +} +{ + 1: + 2, + 3 + :4 +} + +# Nested +{{1: 2}: {3: {4: 5}}} + +# Lambda expressions +{lambda x: x: 1} +{'A': lambda p: None, 'B': C,} + +# Named expressions +{(x := 1): y} +{(x := 1): (y := 2)} + +# Double star unpacking +{**d} +{a: b, **d} +{**a, **b} +{"a": "b", **c, "d": "e"} +{1: 2, **{'nested': 'dict'}} +{x * 1: y ** 2, **call()} +# Here, `not` isn't allowed but parentheses resets the precedence +{**(not x)} + +# Random expressions +{1: x if True else y} +{x if True else y: y for x in range(10) for y in range(10)} +{{1, 2}: 3, x: {1: 2,},} +{(x): (y), (z): (a)} diff --git a/crates/ruff_python_parser/resources/valid/expressions/dictionary_comprehension.py b/crates/ruff_python_parser/resources/valid/expressions/dictionary_comprehension.py new file mode 100644 index 0000000000..90886bb7e6 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/dictionary_comprehension.py @@ -0,0 +1,16 @@ +{y for y in (1, 2, 3)} +{x1: x2 for y in z} +{x + 1: 'x' for i in range(5)} +{b: c * 2 for c in d if x in w if y and yy if z} +{a: a ** 2 for b in c if d and e for f in j if k > h} +{a: b for b in c if d and e async for f in j if k > h} +{a: a for b, c in d} + +# Non-parenthesized iter/if for the following expressions aren't allowed, so make sure +# it parses correctly for the parenthesized cases +{x: y for x in (yield y)} +{x: y for x in (yield from y)} +{x: y for x in (lambda y: y)} +{x: y for x in data if (yield y)} +{x: y for x in data if (yield from y)} +{x: y for x in data if (lambda y: y)} diff --git a/crates/ruff_python_parser/resources/valid/expressions/f_string.py b/crates/ruff_python_parser/resources/valid/expressions/f_string.py new file mode 100644 index 0000000000..6ac0d81517 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/f_string.py @@ -0,0 +1,64 @@ +# Empty f-strings +f"" +F"" +f'' +f"""""" +f'''''' + +f"{" f"}" +f"{foo!s}" +f"{3,}" +f"{3!=4:}" +f'{3:{"}"}>10}' +f'{3:{"{"}>10}' +f"{ foo = }" +f"{ foo = :.3f }" +f"{ foo = !s }" +f"{ 1, 2 = }" +f'{f"{3.1415=:.1f}":*^20}' + +{"foo " f"bar {x + y} " "baz": 10} +match foo: + case "one": + pass + case "implicitly " "concatenated": + pass + +f"\{foo}\{bar:\}" +f"\\{{foo\\}}" +f"""{ + foo:x + y + z +}""" +f"{ ( foo ) = }" + +f"normal {foo} {{another}} {bar} {{{three}}}" +f"normal {foo!a} {bar!s} {baz!r} {foobar}" +f"normal {x:y + 2}" +f"{x:{{1}.pop()}}" +f"{(lambda x:{x})}" +f"{x =}" +f"{ x = }" +f"{x=!a}" +f"{x:.3f!r =}" +f"{x = !r :.3f}" +f"{x:.3f=!r}" +"hello" f"{x}" +f"{x}" f"{y}" +f"{x}" "world" +f"Invalid args in command: {command, *args}" +"foo" f"{x}" "bar" +( + f"a" + F"b" + "c" + rf"d" + fr"e" +) + +# With unicode strings +u"foo" f"{bar}" "baz" " some" +"foo" f"{bar}" u"baz" " some" +"foo" f"{bar}" "baz" u" some" +u"foo" f"bar {baz} really" u"bar" "no" diff --git a/crates/ruff_python_parser/resources/valid/expressions/generator.py b/crates/ruff_python_parser/resources/valid/expressions/generator.py new file mode 100644 index 0000000000..3944184462 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/generator.py @@ -0,0 +1,20 @@ +(x for target in iter) +(x async for target in iter) +(x for target in iter if x in y if a and b if c) +(x for target1 in iter1 if x and y for target2 in iter2 if a > b) +(x for target1 in iter1 if x and y async for target2 in iter2 if a > b) + +# Named expression +(x := y + 1 for y in z) + +# If expression +(x if y else y for y in z) + +# Arguments +" ".join( + sql + for sql in ( + "LIMIT %d" % limit if limit else None, + ("OFFSET %d" % offset) if offset else None, + ) +) diff --git a/crates/ruff_python_parser/resources/valid/expressions/if.py b/crates/ruff_python_parser/resources/valid/expressions/if.py new file mode 100644 index 0000000000..b3aede2a69 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/if.py @@ -0,0 +1,21 @@ +a if True else b +f() if x else None +a if b else c if d else e +1 + x if 1 < 0 else -1 +a and b if x else False +x <= y if y else x +True if a and b else False +1, 1 if a else c + +# Lambda is allowed in orelse expression +x if True else lambda y: y + +# These test expression are only allowed when parenthesized +x if (yield x) else y +x if (yield from x) else y +x if (lambda x: x) else y + +# Split across multiple lines +(x +if y +else z) \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/expressions/lambda.py b/crates/ruff_python_parser/resources/valid/expressions/lambda.py new file mode 100644 index 0000000000..4f4da98ffc --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/lambda.py @@ -0,0 +1,24 @@ +lambda: a +lambda: 1 +lambda x: 1 +lambda x, y: ... +lambda a, b, c: 1 +lambda a, b=20, c=30: 1 +lambda x, y: x * y +lambda y, z=1: z * y +lambda *a: a +lambda *a, z, x=0: ... +lambda *, a, b, c: 1 +lambda *, a, b=20, c=30: 1 +lambda a, b, c, *, d, e: 0 +lambda **kwargs: f() +lambda *args, **kwargs: f() + 1 +lambda *args, a, b=1, **kwargs: f() + 1 +lambda a, /: ... +lambda a, /, b: ... +lambda a=1, /,: ... +lambda a, b, /, *, c: ... +lambda kw=1, *, a: ... +lambda a, b=20, /, c=30: 1 +lambda a, b, /, c, *, d, e: 0 +lambda a, b, /, c, *d, e, **f: 0 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/expressions/list.py b/crates/ruff_python_parser/resources/valid/expressions/list.py new file mode 100644 index 0000000000..5cb72facc2 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/list.py @@ -0,0 +1,34 @@ +# Simple lists +[] +[1] +[1,] +[1, 2, 3] +[1, 2, 3,] + +# Mixed with indentations +[ +] +[ + 1 +] +[ + 1, + 2, +] + +# Nested +[[[1]]] +[[1, 2], [3, 4]] + +# Named expression +[x := 2] +[x := 2,] +[1, x := 2, 3] + +# Star expression +[1, *x, 3] +[1, *x | y, 3] + +# Random expressions +[1 + 2, [1, 2, 3, 4], (a, b + c, d), {a, b, c}, {a: 1}, x := 2] +[call1(call2(value.attr()) for element in iter)] diff --git a/crates/ruff_python_parser/resources/valid/expressions/list_comprehension.py b/crates/ruff_python_parser/resources/valid/expressions/list_comprehension.py new file mode 100644 index 0000000000..0ee4f0001c --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/list_comprehension.py @@ -0,0 +1,25 @@ +x = [y for y in (1, 2, 3)] + +[x for i in range(5)] +[b for c in d if x in w if y and yy if z] +[a for b in c if d and e for f in j if k > h] +[a for b in c if d and e async for f in j if k > h] +[1 for i in x in a] +[a for a, b in G] +[ + await x for a, b in C +] +[i for i in await x if entity is not None] +[x for x in (l if True else L) if T] +[i for i in (await x if True else X) if F] +[i for i in await (x if True else X) if F] +[f for f in c(x if True else [])] + +# Non-parenthesized iter/if for the following expressions aren't allowed, so make sure +# it parses correctly for the parenthesized cases +[x for x in (yield y)] +[x for x in (yield from y)] +[x for x in (lambda y: y)] +[x for x in data if (yield y)] +[x for x in data if (yield from y)] +[x for x in data if (lambda y: y)] diff --git a/crates/ruff_python_parser/resources/valid/expressions/name.py b/crates/ruff_python_parser/resources/valid/expressions/name.py new file mode 100644 index 0000000000..231d94a6f6 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/name.py @@ -0,0 +1,11 @@ +_ +(_) +__ +__init__ +name +(name) + +# Soft keywords used as name +match +case +type diff --git a/crates/ruff_python_parser/resources/valid/expressions/named.py b/crates/ruff_python_parser/resources/valid/expressions/named.py new file mode 100644 index 0000000000..f4f4e3c63a --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/named.py @@ -0,0 +1,8 @@ +(name := 0) +(name := (x * y)) +(name := 1 + 1) +(name := (*x, y)) +(name := x if True else y) +(name := lambda x: x) +(name := (yield x)) +(name := (yield from x)) \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/expressions/number_literal.py b/crates/ruff_python_parser/resources/valid/expressions/number_literal.py new file mode 100644 index 0000000000..07b5ac53cd --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/number_literal.py @@ -0,0 +1,40 @@ +x = 123456789 +x = 123456 +x = .1 +x = 1. +x = 1E+1 +x = 1E-1 +x = 1.000_000_01 +x = 123456789.123456789 +x = 123456789.123456789E123456789 +x = 123456789E123456789 +x = 123456789J +x = 123456789.123456789J +x = 0XB1ACC +x = 0B1011 +x = 0O777 +x = 0.000000006 +x = 10000 +x = 133333 + +# Attribute access +x = 1. .imag +x = 1E+1.imag +x = 1E-1.real +x = 123456789.123456789.hex() +x = 123456789.123456789E123456789 .real +x = 123456789E123456789 .conjugate() +x = 123456789J.real +x = 123456789.123456789J.__add__(0b1011.bit_length()) +x = 0XB1ACC.conjugate() +x = 0B1011 .conjugate() +x = 0O777 .real +x = 0.000000006 .hex() +x = -100.0000J + +if 10 .real: + ... + +# This is a type error, not a syntax error +y = 100[no] +y = 100(no) \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/expressions/parenthesized.py b/crates/ruff_python_parser/resources/valid/expressions/parenthesized.py new file mode 100644 index 0000000000..f01915d38c --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/parenthesized.py @@ -0,0 +1,9 @@ +(expr) +(expr)() +(expr)()()() + +(a and b or c) +(lambda x: x) +(x := 2) +(yield x) +(yield from x) \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/expressions/set.py b/crates/ruff_python_parser/resources/valid/expressions/set.py new file mode 100644 index 0000000000..7b1a4e2bb0 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/set.py @@ -0,0 +1,33 @@ +# Simple sets +{} +{1} +{1,} +{1, 2, 3} +{1, 2, 3,} + +# Mixed with indentations +{ +} +{ + 1 +} +{ + 1, + 2, +} + +# Nested +{{1}} +{{1, 2}, {3, 4}} + +# Named expression +{x := 2} +{1, x := 2, 3} +{1, (x := 2),} + +# Star expression +{1, *x, 3} +{1, *x | y, 3} + +# Random expressions +{1 + 2, (a, b), {1, 2, 3}, {a: b, **d}} diff --git a/crates/ruff_python_parser/resources/valid/expressions/set_comprehension.py b/crates/ruff_python_parser/resources/valid/expressions/set_comprehension.py new file mode 100644 index 0000000000..235ca0adf2 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/set_comprehension.py @@ -0,0 +1,14 @@ +{x for i in ll} +{b for c in d if x in w if y and yy if z} +{a for b in c if d and e for f in j if k > h} +{a for b in c if d and e async for f in j if k > h} +{a for a, b in G} + +# Non-parenthesized iter/if for the following expressions aren't allowed, so make sure +# it parses correctly for the parenthesized cases +{x for x in (yield y)} +{x for x in (yield from y)} +{x for x in (lambda y: y)} +{x for x in data if (yield y)} +{x for x in data if (yield from y)} +{x for x in data if (lambda y: y)} diff --git a/crates/ruff_python_parser/resources/valid/expressions/slice.py b/crates/ruff_python_parser/resources/valid/expressions/slice.py new file mode 100644 index 0000000000..cc0bc79e7e --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/slice.py @@ -0,0 +1,21 @@ +# Various combinations +x[:] +x[1:] +x[:2] +x[1:2] +x[::] +x[1::] +x[:2:] +x[1:2:] +x[::3] +x[1::3] +x[:2:3] +x[1:2:3] + +# Named expression +x[y := 2] +x[(y := 2):] +x[y := 2,] + +# These are two separate slice elements +x[1,:2,] diff --git a/crates/ruff_python_parser/resources/valid/expressions/starred.py b/crates/ruff_python_parser/resources/valid/expressions/starred.py new file mode 100644 index 0000000000..3c1fe633fa --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/starred.py @@ -0,0 +1,8 @@ +*a +*(a + 1) +*x.attr + +array_slice = array[0, *indexes, -1] +array[0, *indexes, -1] = array_slice +array[*indexes_to_select, *indexes_to_select] +array[3:5, *indexes_to_select] diff --git a/crates/ruff_python_parser/resources/valid/expressions/string.py b/crates/ruff_python_parser/resources/valid/expressions/string.py new file mode 100644 index 0000000000..0e2f5da592 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/string.py @@ -0,0 +1,17 @@ +'Hello World' +"😎" +'Foo' 'Bar' +( + 'A' + 'B' + 'C' +) +'''Olá, Mundo!''' +"""ABCDE""" +( + '''aB''' + '''cD''' +) +b'hello world' +b'bytes' b'concatenated' + diff --git a/crates/ruff_python_parser/resources/valid/expressions/subscript.py b/crates/ruff_python_parser/resources/valid/expressions/subscript.py new file mode 100644 index 0000000000..869f0dcc12 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/subscript.py @@ -0,0 +1,17 @@ +data[0][0] +data[0, 1] +data[0:,] +data[0:, 1] +data[0:1, 2] +data[0:1:2, 3, a:b + 1] +data[a := b] +data[:, :11] +data[1, 2, 3] +data[~flag] +data[(a := 0):] +data[(a := 0):y] + +# This is a single element tuple with a starred expression +data[*x] +data[*x and y] +data[*(x := y)] diff --git a/crates/ruff_python_parser/resources/valid/expressions/tuple.py b/crates/ruff_python_parser/resources/valid/expressions/tuple.py new file mode 100644 index 0000000000..7a62c2aa9e --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/tuple.py @@ -0,0 +1,27 @@ +# With parentheses +() +(()) +((()), ()) +(a,) +(a, b) +(a, b,) +((a, b)) + +# Without parentheses +a, +a, b +a, b, + +# Starred expression +*a, +a, *b +*a | b, *await x, (), *() +(*a,) +(a, *b) +(*a | b, *await x, (), *()) + +# Named expression +(x := 1,) +(x, y := 2) +(x, y := 2, z) +x, (y := 2), z diff --git a/crates/ruff_python_parser/resources/valid/expressions/unary_op.py b/crates/ruff_python_parser/resources/valid/expressions/unary_op.py new file mode 100644 index 0000000000..5fcd9feab1 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/unary_op.py @@ -0,0 +1,22 @@ +# Simple +-1 ++1 +~1 +not x + +# Multiple +---1 +-+~1 +not-+~1 +not not x + +# Precedence check +- await 1 ++ await 1 ** -2 +~(1, 2) +-1 + 2 + +# Precedence check for `not` operator because it is higher than other unary operators +not a and b or not c | d and not e +not (x := 1) +not a | (not b) diff --git a/crates/ruff_python_parser/resources/valid/expressions/yield.py b/crates/ruff_python_parser/resources/valid/expressions/yield.py new file mode 100644 index 0000000000..331662a88d --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/yield.py @@ -0,0 +1,16 @@ +yield +yield x +yield x + 1 +yield x and y +yield call() +yield [1, 2] +yield {3, 4} +yield {x: 5} +yield x, y +yield (x, y) +yield x == y +yield (x := 1) +yield *y +yield x, *y +yield *x, +yield *x | y diff --git a/crates/ruff_python_parser/resources/valid/expressions/yield_from.py b/crates/ruff_python_parser/resources/valid/expressions/yield_from.py new file mode 100644 index 0000000000..7c6c050421 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/expressions/yield_from.py @@ -0,0 +1,11 @@ +yield from x +yield from x + 1 +yield from x and y +yield from call() +yield from [1, 2] +yield from {3, 4} +yield from {x: 5} +yield from (x, y) +yield from x == y +yield from (x := 1) +yield from (x, *x | y) \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/other/atom.py b/crates/ruff_python_parser/resources/valid/other/atom.py new file mode 100644 index 0000000000..07266e2c16 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/other/atom.py @@ -0,0 +1,6 @@ +... +True +False +None + +# Other atoms are tested in their respective files. diff --git a/crates/ruff_python_parser/resources/valid/other/decorator.py b/crates/ruff_python_parser/resources/valid/other/decorator.py new file mode 100644 index 0000000000..d42de1e8c6 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/other/decorator.py @@ -0,0 +1,50 @@ +@function_decorator +def test(): + pass + + +@class_decorator +class Test: + pass + + +@decorator +def f(): ... + + +@a.b.c +def f(): ... + + +@a +@a.b.c +def f(): ... + + +@a +@1 | 2 +@a.b.c +class T: ... + + +@x := 1 +@x if True else y +@lambda x: x +@x and y +@(yield x) +@(*x, *y) +def f(): ... + + +# This is not multiple decorators on the same line but rather a binary (`@`) expression +@x @y +def foo(): ... + + +@x + + +@y + + +def foo(): ... \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/statement/ambiguous_lpar_with_items.py b/crates/ruff_python_parser/resources/valid/statement/ambiguous_lpar_with_items.py new file mode 100644 index 0000000000..784e7b65c7 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/ambiguous_lpar_with_items.py @@ -0,0 +1,105 @@ +# These test cases specifically tests out parsing a list of with items that start with a +# left parenthesis. This makes parsing ambiguous as to whether the left parenthesis is to +# parenthesize the with items or part of a parenthesized expression. It's not to test the +# with statement itself. + +# The following sections basically separates between which node does the +# start parenthesis belongs to. + +# Parenthesized with items +# ------------------------ +# +# - The opening parenthesis belongs to the with statement. +# - The range of the first with item shouldn't include the parenthesis. +with (item): ... +with (item,): ... # with a trailing comma +with (((item))): ... +with (item1, item2): ... +with (item1, item2,): ... # with a trailing comma +with ((item1), (item2), item3 as f, (item4)): ... +with ((item1, item2), item3): ... +with ((x, y) as f): ... +with (item1 as f1, item2 as f2): ... +with (item1 as f1, item2 as f2,): ... # with a trailing comma +with (item == 10,): ... +with ((item := 10)): ... +with ((item := 10,)): ... +with ((*item,)): ... +with ((item1 := 10), item2): ... +with (item1 as f, (item2 := 10)): ... +with (foo()): ... +with (foo(),): ... +with (foo() as f): ... +with (f"{item := 42}"): ... +with (f"{(item := 42)}"): ... +with ((x for x in range(10)), item): ... +with (item, (x for x in range(10))): ... +with (item, (x for x in range(10)), item): ... +with (data[1:2]): ... +with (data[1:2] as f): ... +with ((x for x in iter) as y): ... + +# Parenthesized expression +# ------------------------ +# +# - The opening parenthesis belongs to the context expression of the first with item. +# - The range of the first with item should include the parenthesis. +with (item) as f: ... +with (item := 10): ... +with (item := 10) as f: ... +with ( item := 1 ): ... +with (item1 := 42), item2: ... +with (root + filename).read(): ... # Postfix expression +with (root + filename).read() as f: ... # Postfix expression +with (foo)(): ... # Postfix expression +with (foo)() as f: ... # Postfix expression +with (foo()) as f: ... +with (data[1:2]) as f: ... +with (1, 2, 3)[0]: ... # Postfix expression +with (1, 2, 3)[0] as f: ... # Postfix expression +with (item1), (item2): ... +with (open('a.py')), (open('b.py')): ... +with (yield x): ... +with ((yield x)): ... +with (yield from x): ... +with ((yield from x)): ... +with (yield x) as f: ... +with (yield x,) as f: ... + + +# Tuple expression +# ---------------- +# +# - This is a sub-case of the parenthesized expression and requires transforming the list of +# with items from the speculative parsing to a single with item containing a tuple expression. +# - The opening parenthesis belongs to the tuple expression of the first with item. +# - The range of the first with item should include the parenthesis. +with (): ... +with () as f: ... +with (item := 42,): ... +with (1, item := 2): ... +with (item1 := 10, item2): ... +with (item1, item2 := 2, item3) as f: ... +with (item,) as f: ... +with (*item,): ... +with (*item,) as f: ... +with (item1, item2) as f: ... +with (item1, item2,) as f: ... +with (item1, item2), item3: ... +with ((item1, item2), item3) as f: ... +with (item1,), item2, (item3, item4) as f: ... +with (item1, item2) as f1, item3 as f2: ... +with (item1, *item2): ... +with (item1, *item2) as f: ... +with (item1 := 10, *item2): ... +with ((item1 := 10), *item2): ... + + +# Parenthesized generator expression +# ---------------------------------- +# +# - The opening parenthesis belongs to the generator expression +# - The range of the with item should include the parenthesis +with (x for x in range(10)): ... +with (x async for x in range(10)): ... +with (x for x in range(10)), item: ... \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/statement/annotated_assignment.py b/crates/ruff_python_parser/resources/valid/statement/annotated_assignment.py new file mode 100644 index 0000000000..8fc4a88c9c --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/annotated_assignment.py @@ -0,0 +1,6 @@ +x: int +x: int = 1 +(x): 1 + 2 +x: tuple[int] | int = (1,) +x: int if True else str = 1 +x: lambda x: y = 1 diff --git a/crates/ruff_python_parser/resources/valid/statement/assert.py b/crates/ruff_python_parser/resources/valid/statement/assert.py new file mode 100644 index 0000000000..4d22c8adc4 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/assert.py @@ -0,0 +1,11 @@ +assert 1 < 2 +assert call() +assert a and b +assert lambda x: y +assert await x +assert x if True else y + +assert x, "error" +assert x, lambda x: y +assert x, await x +assert x, x if True else y diff --git a/crates/ruff_python_parser/resources/valid/statement/assignment.py b/crates/ruff_python_parser/resources/valid/statement/assignment.py new file mode 100644 index 0000000000..b987f1c3dc --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/assignment.py @@ -0,0 +1,45 @@ +x = (1, 2, 3) + +(x, y) = (1, 2, 3) + +[x, y] = (1, 2, 3) + +x.y = (1, 2, 3) + +x[y] = (1, 2, 3) + +(x, *y) = (1, 2, 3) + + +# This last group of tests checks that assignments we expect to be parsed +# (including some interesting ones) continue to be parsed successfully. + +*foo = 42 + +[x, y, z] = [1, 2, 3] + +(x, y, z) = (1, 2, 3) +x[0] = 42 + +# This is actually a type error, not a syntax error. So check that it +# doesn't fail parsing. + +5[0] = 42 +x[1:2] = [42] + +# This is actually a type error, not a syntax error. So check that it +# doesn't fail parsing. +5[1:2] = [42] + +foo.bar = 42 + +# This is actually an attribute error, not a syntax error. So check that +# it doesn't fail parsing. +"foo".y = 42 + +foo = 42 + +[] = *data +() = *data +a, b = ab +a = b = c \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/statement/augmented_assignment.py b/crates/ruff_python_parser/resources/valid/statement/augmented_assignment.py new file mode 100644 index 0000000000..e5fca49c99 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/augmented_assignment.py @@ -0,0 +1,21 @@ +x += 1 +x.y += (1, 2, 3) +x[y] += (1, 2, 3) + +# All possible augmented assignment tokens +x += 1 +x -= 1 +x *= 1 +x /= 1 +x //= 1 +x %= 1 +x **= 1 +x &= 1 +x |= 1 +x ^= 1 +x <<= 1 +x >>= 1 +x @= 1 + +# Mixed +a //= (a + b) - c ** 2 \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/statement/class.py b/crates/ruff_python_parser/resources/valid/statement/class.py new file mode 100644 index 0000000000..470805ff91 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/class.py @@ -0,0 +1,52 @@ +class Test: + ... + + +class Test(): + def __init__(self): + pass + + +class Test(a=1, *A, **k): + ... + + +class Test: + def method(): + a, b = data + + +class Test(A, B): + def __init__(self): + pass + + def method_with_default(self, arg='default'): + pass + + +# Class with generic types: + +# TypeVar +class Test[T](): ... + +# TypeVar with bound +class Test[T: str](): ... + +# TypeVar with tuple bound +class Test[T: (str, bytes)](): ... + +# Multiple TypeVar +class Test[T, U](): ... + +# Trailing comma +class Test[T, U,](): ... + +# TypeVarTuple +class Test[*Ts](): ... + +# ParamSpec +class Test[**P](): ... + +# Mixed types +class Test[X, Y: str, *U, **P](): + pass diff --git a/crates/ruff_python_parser/resources/valid/statement/delete.py b/crates/ruff_python_parser/resources/valid/statement/delete.py new file mode 100644 index 0000000000..e32a3ce570 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/delete.py @@ -0,0 +1,13 @@ +del x +del (x) +del a, b, +del a, (b, c), d +del [a, b] +del [a, [b, c], d] +del x.y +del x[y] +del ( + x, + x.y, + x[y], +) diff --git a/crates/ruff_python_parser/resources/valid/statement/for.py b/crates/ruff_python_parser/resources/valid/statement/for.py new file mode 100644 index 0000000000..fa0c07252e --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/for.py @@ -0,0 +1,47 @@ +for target in iter: + pass + +for target in (1, 2, 3): + pass + +for target.attr in call(): + pass + +for target[0] in x.attr: + pass + +for target in x <= y: + pass + +for target in a and b: + pass + +for a, b, c, in iter: + pass + +for (a, b) in iter: + pass + +for target in *x.attr: + pass + +for target in [1, 2]: + pass + +for *target in a, b, c,: + pass +else: + pass + +for target in *x | y: ... +for target in *await x: ... +for target in await x: ... +for target in lambda x: x: ... +for target in x if True else y: ... + +if x: + for target in iter: + pass +# This `else` is not part of the `try` statement, so don't raise an error +else: + pass diff --git a/crates/ruff_python_parser/resources/valid/statement/from_import.py b/crates/ruff_python_parser/resources/valid/statement/from_import.py new file mode 100644 index 0000000000..dbf4763e87 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/from_import.py @@ -0,0 +1,9 @@ +from a import b # comment +from . import a +from foo.bar import baz as b, FooBar as fb +from .a import b +from ... import c +from .......................... import d +from ..........................a.b.c import d +from module import (a, b as B, c,) +from a import * diff --git a/crates/ruff_python_parser/resources/valid/statement/function.py b/crates/ruff_python_parser/resources/valid/statement/function.py new file mode 100644 index 0000000000..2059fc866d --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/function.py @@ -0,0 +1,162 @@ +def no_parameters(): + pass + + +def positional_parameters(a, b, c): + pass + + +def positional_parameters_with_default_values(a, b=20, c=30): + pass + + +def positional_parameters_with_default_values2(a, b=20, /, c=30): + pass + + +def positional_only_and_positional_parameters(a, /, b, c): + pass + + +def pos_args_with_defaults_and_varargs_and_kwargs(a, b=20, /, c=30, *args, **kwargs): + pass + + +def keyword_only_parameters(*, a, b, c): + pass + + +def keyword_only_parameters_with_defaults(*, a, b=20, c=30): + pass + + +def kw_only_args_with_defaults_and_varargs(*args, a, b=20, c=30): + pass + + +def kw_only_args_with_defaults_and_kwargs(*, a, b=20, c=30, **kwargs): + pass + + +def kw_only_args_with_defaults_and_varargs_and_kwargs(*args, a, b=20, c=30, **kwargs): + pass + + +def pos_and_kw_only_args(a, b, /, c, *, d, e, f): + pass + + +def pos_and_kw_only_args_with_defaults(a, b, /, c, *, d, e=20, f=30): + pass + + +def pos_and_kw_only_args_with_defaults_and_varargs(a, b, /, c, *args, d, e=20, f=30): + pass + + +def pos_and_kw_only_args_with_defaults_and_kwargs( + a, b, /, c, *, d, e=20, f=30, **kwargs +): + pass + + +def pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs( + a, b, /, c, *args, d, e=20, f=30, **kwargs +): + pass + + +def positional_and_keyword_parameters(a, b, c, *, d, e, f): + pass + + +def positional_and_keyword_parameters_with_defaults(a, b, c, *, d, e=20, f=30): + pass + + +def positional_and_keyword_parameters_with_defaults_and_varargs( + a, b, c, *args, d, e=20, f=30 +): + pass + + +def positional_and_keyword_parameters_with_defaults_and_varargs_and_kwargs( + a, b, c, *args, d, e=20, f=30, **kwargs +): + pass + + +# Function definitions with type parameters + + +def func[T](a: T) -> T: + pass + + +def func[T: str](a: T) -> T: + pass + + +def func[T: (str, bytes)](a: T) -> T: + pass + + +def func[*Ts](*a: *Ts) -> Tuple[*Ts]: + pass + + +def func[**P](*args: P.args, **kwargs: P.kwargs): + pass + + +def func[T, U: str, *Ts, **P](): + pass + + +def ellipsis(): ... + + +def multiple_statements() -> int: + call() + pass + ... + + +def foo(*args): + pass + + +def foo(**kwargs): + pass + + +def foo(*args, **kwargs): + pass + + +def foo(a, /): + pass + + +def foo(a, /, b): + pass + + +def foo(a=1, /,): + pass + + +def foo(a, b, /, *, c): + pass + + +def foo(kw=1, *, a): + pass + + +def foo(x: int, y: "str", z: 1 + 2): + pass + + +def foo(self, a=1, b=2, c=3): + pass diff --git a/crates/ruff_python_parser/resources/valid/statement/if.py b/crates/ruff_python_parser/resources/valid/statement/if.py new file mode 100644 index 0000000000..d853589912 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/if.py @@ -0,0 +1,37 @@ +if 1: 10 +elif 2: 20 +else: 30 + +if True: + 1 + ... +if x < 1: + ... +else: + pass + +if a: + pass +elif b: + ... + +if a and b: + ... +elif True: + ... +elif c: + ... +elif d: + ... +else: + f() + +# Valid test expression +if a := b: ... +elif a := b: ... +if lambda x: x: ... +elif lambda x: x: ... +if await x: ... +elif await x: ... +if (yield x): ... +elif (yield x): ... diff --git a/crates/ruff_python_parser/resources/valid/statement/import.py b/crates/ruff_python_parser/resources/valid/statement/import.py new file mode 100644 index 0000000000..04969281fa --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/import.py @@ -0,0 +1,5 @@ +import a +import a.b.c +import a.b.c as d +import a, b, c +import foo.bar as a, a.b.c.d as abcd diff --git a/crates/ruff_python_parser/resources/valid/statement/match.py b/crates/ruff_python_parser/resources/valid/statement/match.py new file mode 100644 index 0000000000..c230b3734c --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/match.py @@ -0,0 +1,337 @@ +# Cases sampled from Lib/test/test_patma.py + +# case test_patma_098 +match x: + case -0j: + y = 0 +# case test_patma_142 +match x: + case bytes(z): + y = 0 +# case test_patma_073 +match x: + case 0 if 0: + y = 0 + case 0 if 1: + y = 1 +# case test_patma_006 +match 3: + case 0 | 1 | 2 | 3: + x = True +# case test_patma_049 +match x: + case [0, 1] | [1, 0]: + y = 0 +# case black_check_sequence_then_mapping +match x: + case [*_]: + return "seq" + case {}: + return "map" +# case test_patma_035 +match x: + case {0: [1, 2, {}]}: + y = 0 + case {0: [1, 2, {}] | True} | {1: [[]]} | {0: [1, 2, {}]} | [] | "X" | {}: + y = 1 + case []: + y = 2 +# case test_patma_107 +match x: + case 0.25 + 1.75j: + y = 0 +# case test_patma_097 +match x: + case -0j: + y = 0 +# case test_patma_007 +match 4: + case 0 | 1 | 2 | 3: + x = True +# case test_patma_154 +match x: + case 0 if x: + y = 0 +# case test_patma_134 +match x: + case {1: 0}: + y = 0 + case {0: 0}: + y = 1 + case {**z}: + y = 2 +# case test_patma_185 +match Seq(): + case [*_]: + y = 0 +# case test_patma_063 +match x: + case 1: + y = 0 + case 1: + y = 1 +# case test_patma_248 +match x: + case {"foo": bar}: + y = bar +# case test_patma_019 +match (0, 1, 2): + case [0, 1, *x, 2]: + y = 0 +# case test_patma_052 +match x: + case [0]: + y = 0 + case [1, 0] if (x := x[:0]): + y = 1 + case [1, 0]: + y = 2 +# case test_patma_191 +match w: + case [x, y, *_]: + z = 0 +# case test_patma_110 +match x: + case -0.25 - 1.75j: + y = 0 +# case test_patma_151 +match (x,): + case [y]: + z = 0 +# case test_patma_114 +match x: + case A.B.C.D: + y = 0 +# case test_patma_232 +match x: + case None: + y = 0 +# case test_patma_058 +match x: + case 0: + y = 0 +# case test_patma_233 +match x: + case False: + y = 0 +# case test_patma_078 +match x: + case []: + y = 0 + case [""]: + y = 1 + case "": + y = 2 +# case test_patma_156 +match x: + case z: + y = 0 +# case test_patma_189 +match w: + case [x, y, *rest]: + z = 0 +# case test_patma_042 +match x: + case (0 as z) | (1 as z) | (2 as z) if z == x % 2: + y = 0 +# case test_patma_034 +match x: + case {0: [1, 2, {}]}: + y = 0 + case {0: [1, 2, {}] | False} | {1: [[]]} | {0: [1, 2, {}]} | [] | "X" | {}: + y = 1 + case []: + y = 2 +# case test_patma_123 +match (0, 1, 2): + case 0, *x: + y = 0 +# case test_patma_126 +match (0, 1, 2): + case *x, 2,: + y = 0 +# case test_patma_151 +match x,: + case y,: + z = 0 +# case test_patma_152 +match w, x: + case y, z: + v = 0 +# case test_patma_153 +match w := x,: + case y as v,: + z = 0 + +match x: + # F-strings aren't allowed as patterns but it's a soft syntax error in Python. + case f"{y}": + pass +match {"test": 1}: + case { + **rest, + }: + print(rest) +match {"label": "test"}: + case { + "label": str() | None as label, + }: + print(label) +match x: + case [0, 1,]: + y = 0 +match x: + case (0, 1,): + y = 0 +match x: + case (0,): + y = 0 +match x,: + case z: + pass +match x, y: + case z: + pass +match x, y,: + case z: + pass + +# PatternMatchSingleton +match x: + case None: + ... + case True: + ... + case False: + ... + +# PatternMatchValue +match x: + case a.b: + ... + case a.b.c: + ... + case '': + ... + case b'': + ... + case 1: + ... + case 1.0: + ... + case 1.0J: + ... + case 1 + 1j: + ... + case -1: + ... + case -1.: + ... + case -0b01: + ... + case (1): + ... + +# PatternMatchOr +match x: + case 1 | 2: + ... + case '' | 1.1 | -1 | 1 + 1j | a.b: + ... + +# PatternMatchAs +match x: + case a: + ... + case a as b: + ... + case 1 | 2 as two: + ... + case 1 + 3j as sum: + ... + case a.b as ab: + ... + case _: + ... + case _ as x: + ... + +# PatternMatchSequence +match x: + case 1, 2, 3: + ... + case (1, 2, 3,): + ... + case (1 + 2j, a, None, a.b): + ... + case (1 as X, b) as S: + ... + case [1, 2, 3 + 1j]: + ... + case ([1,2], 3): + ... + case [1]: + ... + +# PatternMatchStar +match x: + case *a,: + ... + case *_,: + ... + case [1, 2, *rest]: + ... + case (*_, 1, 2): + ... + +# PatternMatchClass +match x: + case Point(): + ... + case a.b.Point(): + ... + case Point2D(x=0): + ... + case Point2D(x=0, y=0,): + ... + case Point2D(0, 1): + ... + case Point2D([0, 1], y=1): + ... + case Point2D(x=[0, 1], y=1): + ... + +# PatternMatchMapping +match x := b: + case {1: _}: + ... + case {'': a, None: (1, 2), **rest}: + ... + +# Pattern guard +match y: + case a if b := c: ... + case e if 1 < 2: ... + +# `match` as an identifier +match *a + b, c # ((match * a) + b), c +match *(a + b), c # (match * (a + b)), c +match (*a + b, c) # match ((*(a + b)), c) +match -a * b + c # (match - (a * b)) + c +match -(a * b) + c # (match - (a * b)) + c +match (-a) * b + c # (match (-(a * b))) + c +match ().a # (match()).a +match (()).a # (match(())).a +match ((),).a # (match(())).a +match [a].b # (match[a]).b +match [a,].b # (match[(a,)]).b (not (match[a]).b) +match [(a,)].b # (match[(a,)]).b +match()[a: + b] # (match())[a: b] +if match := 1: pass +match match: + case 1: pass + case 2: + pass +match = lambda query: query == event +print(match(12)) diff --git a/crates/ruff_python_parser/resources/valid/statement/raise.py b/crates/ruff_python_parser/resources/valid/statement/raise.py new file mode 100644 index 0000000000..2078beb012 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/raise.py @@ -0,0 +1,18 @@ +# raise +raise +raise a +raise (a, b) +raise 1 < 2 +raise a and b +raise lambda x: y +raise await x +raise x if True else y + +# raise ... from ... +raise x from a +raise x from (a, b) +raise x from 1 < 2 +raise x from a and b +raise x from lambda x: y +raise x from await x +raise x from x if True else y diff --git a/crates/ruff_python_parser/resources/valid/statement/return.py b/crates/ruff_python_parser/resources/valid/statement/return.py new file mode 100644 index 0000000000..78d865112a --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/return.py @@ -0,0 +1,14 @@ +return +return x +return *x +return *x | y +return *x, *y +return (x := 1) +return None +return x and y +return 1 < 2 +return 1, 2, +return call() +return attr.value() +return await x +return lambda x: y diff --git a/crates/ruff_python_parser/resources/valid/statement/simple.py b/crates/ruff_python_parser/resources/valid/statement/simple.py new file mode 100644 index 0000000000..ef4a6d0ea2 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/simple.py @@ -0,0 +1,13 @@ +# Other simple statements are contained in their own files. + +continue +break + +if x: ... +if True: pass +1; 2; pass +1; ...; a if b else c + +if c: B; del A +else: C +if x: yield x; \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/statement/try.py b/crates/ruff_python_parser/resources/valid/statement/try.py new file mode 100644 index 0000000000..06a7ca1300 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/try.py @@ -0,0 +1,99 @@ +try: + ... +except: + ... + +try: + ... +except Exception1 as e: + ... +except Exception2 as e: + ... + +try: + ... +except Exception as e: + ... +except: + ... +finally: + ... + +try: + ... +except: + ... +else: + ... + +try: + ... +except: + ... +else: + ... +finally: + ... + +try: + ... +finally: + ... + +try: + ... +else: + ... +finally: + ... + +try: + ... +except* GroupA as eg: + ... +except* ExceptionGroup: + ... + +try: + raise ValueError(1) +except TypeError as e: + print(f"caught {type(e)}") +except OSError as e: + print(f"caught {type(e)}") + +try: + raise ExceptionGroup("eg", [ValueError(1), TypeError(2), OSError(3), OSError(4)]) +except* TypeError as e: + print(f"caught {type(e)} with nested {e.exceptions}") +except* OSError as e: + print(f"caught {type(e)} with nested {e.exceptions}") + +try: + pass +except "exception": + pass +except 1: + pass +except True: + pass +except 1 + 1: + pass +except a | b: + pass +except x and y: + pass +except await x: + pass +except lambda x: x: + pass +except x if True else y: + pass + +if True: + try: + pass + finally: + pass +# This `else` is not part of the `try` statement, so don't raise an error +else: + pass diff --git a/crates/ruff_python_parser/resources/valid/statement/type.py b/crates/ruff_python_parser/resources/valid/statement/type.py new file mode 100644 index 0000000000..0b74785ed0 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/type.py @@ -0,0 +1,80 @@ +type X = int +type X = int | str +type X = int | "ForwardRefY" +type X[T] = T | list[X[T]] # recursive +type X[T] = int +type X[T] = list[T] | set[T] +type X[T, *Ts, **P] = (T, Ts, P) +type X[T: int, *Ts, **P] = (T, Ts, P) +type X[T: (int, str), *Ts, **P] = (T, Ts, P) + +# Soft keyword as alias name +type type = int +type match = int +type case = int + +# Soft keyword as value +type foo = type +type foo = match +type foo = case + +# Multine definitions +type \ + X = int +type X \ + = int +type X = \ + int +type X = ( + int +) +type \ + X[T] = T +type X \ + [T] = T +type X[T] \ + = T + +# Simple statements +type X = int; type X = str; type X = type +class X: type X = int + +type Point = tuple[float, float] +type Point[T] = tuple[T, T] +type IntFunc[**P] = Callable[P, int] # ParamSpec +type LabeledTuple[*Ts] = tuple[str, *Ts] # TypeVarTuple +type HashableSequence[T: Hashable] = Sequence[T] # TypeVar with bound +type IntOrStrSequence[T: (int, str)] = Sequence[T] # TypeVar with constraints + +# Type as an identifier +type *a + b, c # ((type * a) + b), c +type *(a + b), c # (type * (a + b)), c +type (*a + b, c) # type ((*(a + b)), c) +type -a * b + c # (type - (a * b)) + c +type -(a * b) + c # (type - (a * b)) + c +type (-a) * b + c # (type (-(a * b))) + c +type ().a # (type()).a +type (()).a # (type(())).a +type ((),).a # (type(())).a +type [a].b # (type[a]).b +type [a,].b # (type[(a,)]).b (not (type[a]).b) +type [(a,)].b # (type[(a,)]).b +type()[a: + b] # (type())[a: b] +if type := 1: pass +type = lambda query: query == event +print(type(12)) +type(type) +a = ( + type in C +) +a = ( + type(b) +) +type ( + X = int +) +type = 1 +type = x = 1 +x = type = 1 +lambda x: type \ No newline at end of file diff --git a/crates/ruff_python_parser/resources/valid/statement/while.py b/crates/ruff_python_parser/resources/valid/statement/while.py new file mode 100644 index 0000000000..49450c4a59 --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/while.py @@ -0,0 +1,28 @@ +while x: + ... + +while (x > 1) and y: + pass +else: + ... + +while x and y: + ... + print('Hello World!') + +else: + print('Olá, Mundo!') + ... + +while a := b: ... +while (a := b) and c: ... +while lambda x: x: ... +while await x: ... + +if True: + while x: + pass + else: + pass +else: + pass diff --git a/crates/ruff_python_parser/resources/valid/statement/with.py b/crates/ruff_python_parser/resources/valid/statement/with.py new file mode 100644 index 0000000000..7603c8539b --- /dev/null +++ b/crates/ruff_python_parser/resources/valid/statement/with.py @@ -0,0 +1,14 @@ +# This file only contains unparenthesized with items. Refer to ./ambiguous_lpar_with_items.py +# for parenthesized with items test cases + +with item: ... +with item as f: ... +with item1, item2: ... +with item1 as f1, item2 as f2: ... + +with x if True else y: ... +with x if True else y as f: ... + +# Postfix expressions +with open() as f: ... +with open() as f.attr: ... \ No newline at end of file diff --git a/crates/ruff_python_parser/src/context.rs b/crates/ruff_python_parser/src/context.rs deleted file mode 100644 index fa30b1d842..0000000000 --- a/crates/ruff_python_parser/src/context.rs +++ /dev/null @@ -1,185 +0,0 @@ -use ruff_python_ast::{self as ast, Expr, ExprContext}; - -pub(crate) fn set_context(expr: Expr, ctx: ExprContext) -> Expr { - match expr { - Expr::Name(ast::ExprName { id, range, .. }) => ast::ExprName { range, id, ctx }.into(), - Expr::Tuple(ast::ExprTuple { - elts, - range, - parenthesized: is_parenthesized, - ctx: _, - }) => ast::ExprTuple { - elts: elts.into_iter().map(|elt| set_context(elt, ctx)).collect(), - range, - ctx, - parenthesized: is_parenthesized, - } - .into(), - - Expr::List(ast::ExprList { elts, range, .. }) => ast::ExprList { - elts: elts.into_iter().map(|elt| set_context(elt, ctx)).collect(), - range, - ctx, - } - .into(), - Expr::Attribute(ast::ExprAttribute { - value, attr, range, .. - }) => ast::ExprAttribute { - range, - value, - attr, - ctx, - } - .into(), - Expr::Subscript(ast::ExprSubscript { - value, - slice, - range, - .. - }) => ast::ExprSubscript { - range, - value, - slice, - ctx, - } - .into(), - Expr::Starred(ast::ExprStarred { value, range, .. }) => ast::ExprStarred { - value: Box::new(set_context(*value, ctx)), - range, - ctx, - } - .into(), - _ => expr, - } -} - -#[cfg(test)] -mod tests { - use crate::parser::parse_suite; - - #[test] - fn test_assign_name() { - let source = "x = (1, 2, 3)"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_assign_tuple() { - let source = "(x, y) = (1, 2, 3)"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_assign_list() { - let source = "[x, y] = (1, 2, 3)"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_assign_attribute() { - let source = "x.y = (1, 2, 3)"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_assign_subscript() { - let source = "x[y] = (1, 2, 3)"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_assign_starred() { - let source = "(x, *y) = (1, 2, 3)"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_assign_for() { - let source = "for x in (1, 2, 3): pass"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_assign_list_comp() { - let source = "x = [y for y in (1, 2, 3)]"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_assign_set_comp() { - let source = "x = {y for y in (1, 2, 3)}"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_assign_with() { - let source = "with 1 as x: pass"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_assign_named_expr() { - let source = "if x:= 1: pass"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_ann_assign_name() { - let source = "x: int = 1"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_aug_assign_name() { - let source = "x += 1"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_aug_assign_attribute() { - let source = "x.y += (1, 2, 3)"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_aug_assign_subscript() { - let source = "x[y] += (1, 2, 3)"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_del_name() { - let source = "del x"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_del_attribute() { - let source = "del x.y"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_del_subscript() { - let source = "del x[y]"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } -} diff --git a/crates/ruff_python_parser/src/error.rs b/crates/ruff_python_parser/src/error.rs new file mode 100644 index 0000000000..08aa223403 --- /dev/null +++ b/crates/ruff_python_parser/src/error.rs @@ -0,0 +1,297 @@ +use std::fmt; + +use ruff_text_size::TextRange; + +use crate::lexer::{LexicalError, LexicalErrorType}; +use crate::TokenKind; + +/// Represents represent errors that occur during parsing and are +/// returned by the `parse_*` functions. +#[derive(Debug, PartialEq)] +pub struct ParseError { + pub error: ParseErrorType, + pub location: TextRange, +} + +impl std::ops::Deref for ParseError { + type Target = ParseErrorType; + + fn deref(&self) -> &Self::Target { + &self.error + } +} + +impl std::error::Error for ParseError { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + Some(&self.error) + } +} + +impl fmt::Display for ParseError { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "{} at byte range {:?}", &self.error, self.location) + } +} + +impl From for ParseError { + fn from(error: LexicalError) -> Self { + ParseError { + location: error.location(), + error: ParseErrorType::Lexical(error.into_error()), + } + } +} + +impl ParseError { + pub fn error(self) -> ParseErrorType { + self.error + } +} + +/// Represents the different types of errors that can occur during parsing of an f-string. +#[derive(Debug, Clone, PartialEq)] +pub enum FStringErrorType { + /// Expected a right brace after an opened left brace. + UnclosedLbrace, + /// An invalid conversion flag was encountered. + InvalidConversionFlag, + /// A single right brace was encountered. + SingleRbrace, + /// Unterminated string. + UnterminatedString, + /// Unterminated triple-quoted string. + UnterminatedTripleQuotedString, + /// A lambda expression without parentheses was encountered. + LambdaWithoutParentheses, +} + +impl std::fmt::Display for FStringErrorType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + use FStringErrorType::{ + InvalidConversionFlag, LambdaWithoutParentheses, SingleRbrace, UnclosedLbrace, + UnterminatedString, UnterminatedTripleQuotedString, + }; + match self { + UnclosedLbrace => write!(f, "expecting '}}'"), + InvalidConversionFlag => write!(f, "invalid conversion character"), + SingleRbrace => write!(f, "single '}}' is not allowed"), + UnterminatedString => write!(f, "unterminated string"), + UnterminatedTripleQuotedString => write!(f, "unterminated triple-quoted string"), + LambdaWithoutParentheses => { + write!(f, "lambda expressions are not allowed without parentheses") + } + } + } +} + +/// Represents the different types of errors that can occur during parsing. +#[derive(Debug, PartialEq)] +pub enum ParseErrorType { + /// An unexpected error occurred. + OtherError(String), + + /// An empty slice was found during parsing, e.g `data[]`. + EmptySlice, + /// An empty global names list was found during parsing. + EmptyGlobalNames, + /// An empty nonlocal names list was found during parsing. + EmptyNonlocalNames, + /// An empty delete targets list was found during parsing. + EmptyDeleteTargets, + /// An empty import names list was found during parsing. + EmptyImportNames, + + /// An unparenthesized named expression was found where it is not allowed. + UnparenthesizedNamedExpression, + /// An unparenthesized tuple expression was found where it is not allowed. + UnparenthesizedTupleExpression, + + /// An invalid usage of a lambda expression was found. + InvalidLambdaExpressionUsage, + /// An invalid usage of a yield expression was found. + InvalidYieldExpressionUsage, + /// An invalid usage of a starred expression was found. + InvalidStarredExpressionUsage, + /// A star pattern was found outside a sequence pattern. + InvalidStarPatternUsage, + + /// A parameter was found after a vararg. + ParamAfterVarKeywordParam, + /// A non-default parameter follows a default parameter. + NonDefaultParamAfterDefaultParam, + /// A default value was found for a `*` or `**` parameter. + VarParameterWithDefault, + + /// A duplicate parameter was found in a function definition or lambda expression. + DuplicateParameter(String), + /// A keyword argument was repeated. + DuplicateKeywordArgumentError(String), + + /// An invalid expression was found in the assignment target. + InvalidAssignmentTarget, + /// An invalid expression was found in the named assignment target. + InvalidNamedAssignmentTarget, + /// An invalid expression was found in the annotated assignment target. + InvalidAnnotatedAssignmentTarget, + /// An invalid expression was found in the augmented assignment target. + InvalidAugmentedAssignmentTarget, + /// An invalid expression was found in the delete target. + InvalidDeleteTarget, + + /// A positional argument was found after a keyword argument. + PositionalAfterKeywordArgument, + /// A positional argument was found after a keyword argument unpacking. + PositionalAfterKeywordUnpacking, + /// An iterable argument unpacking was found after keyword argument unpacking. + InvalidArgumentUnpackingOrder, + /// An invalid usage of iterable unpacking in a comprehension was found. + IterableUnpackingInComprehension, + + /// Multiple simple statements were found in the same line without a `;` separating them. + SimpleStatementsOnSameLine, + /// A simple statement and a compound statement was found in the same line. + SimpleAndCompoundStatementOnSameLine, + + /// Expected one or more keyword parameter after `*` separator. + ExpectedKeywordParam, + /// Expected a real number for a complex literal pattern. + ExpectedRealNumber, + /// Expected an imaginary number for a complex literal pattern. + ExpectedImaginaryNumber, + /// Expected an expression at the current parser location. + ExpectedExpression, + /// The parser expected a specific token that was not found. + ExpectedToken { + expected: TokenKind, + found: TokenKind, + }, + + /// An unexpected indentation was found during parsing. + UnexpectedIndentation, + /// The statement being parsed cannot be `async`. + UnexpectedTokenAfterAsync(TokenKind), + /// Ipython escape command was found + UnexpectedIpythonEscapeCommand, + /// An unexpected token was found at the end of an expression parsing + UnexpectedExpressionToken, + + /// An f-string error containing the [`FStringErrorType`]. + FStringError(FStringErrorType), + /// Parser encountered an error during lexing. + Lexical(LexicalErrorType), +} + +impl std::error::Error for ParseErrorType {} + +impl std::fmt::Display for ParseErrorType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + ParseErrorType::OtherError(msg) => write!(f, "{msg}"), + ParseErrorType::ExpectedToken { found, expected } => { + write!(f, "Expected {expected}, found {found}",) + } + ParseErrorType::Lexical(ref lex_error) => write!(f, "{lex_error}"), + ParseErrorType::SimpleStatementsOnSameLine => { + f.write_str("Simple statements must be separated by newlines or semicolons") + } + ParseErrorType::SimpleAndCompoundStatementOnSameLine => f.write_str( + "Compound statements are not allowed on the same line as simple statements", + ), + ParseErrorType::UnexpectedTokenAfterAsync(kind) => { + write!( + f, + "Expected 'def', 'with' or 'for' to follow 'async', found {kind}", + ) + } + ParseErrorType::InvalidArgumentUnpackingOrder => { + f.write_str("Iterable argument unpacking cannot follow keyword argument unpacking") + } + ParseErrorType::IterableUnpackingInComprehension => { + f.write_str("Iterable unpacking cannot be used in a comprehension") + } + ParseErrorType::UnparenthesizedNamedExpression => { + f.write_str("Unparenthesized named expression cannot be used here") + } + ParseErrorType::UnparenthesizedTupleExpression => { + f.write_str("Unparenthesized tuple expression cannot be used here") + } + ParseErrorType::InvalidYieldExpressionUsage => { + f.write_str("Yield expression cannot be used here") + } + ParseErrorType::InvalidLambdaExpressionUsage => { + f.write_str("Lambda expression cannot be used here") + } + ParseErrorType::InvalidStarredExpressionUsage => { + f.write_str("Starred expression cannot be used here") + } + ParseErrorType::PositionalAfterKeywordArgument => { + f.write_str("Positional argument cannot follow keyword argument") + } + ParseErrorType::PositionalAfterKeywordUnpacking => { + f.write_str("Positional argument cannot follow keyword argument unpacking") + } + ParseErrorType::EmptySlice => f.write_str("Expected index or slice expression"), + ParseErrorType::EmptyGlobalNames => { + f.write_str("Global statement must have at least one name") + } + ParseErrorType::EmptyNonlocalNames => { + f.write_str("Nonlocal statement must have at least one name") + } + ParseErrorType::EmptyDeleteTargets => { + f.write_str("Delete statement must have at least one target") + } + ParseErrorType::EmptyImportNames => { + f.write_str("Expected one or more symbol names after import") + } + ParseErrorType::ParamAfterVarKeywordParam => { + f.write_str("Parameter cannot follow var-keyword parameter") + } + ParseErrorType::NonDefaultParamAfterDefaultParam => { + f.write_str("Parameter without a default cannot follow a parameter with a default") + } + ParseErrorType::ExpectedKeywordParam => { + f.write_str("Expected one or more keyword parameter after '*' separator") + } + ParseErrorType::VarParameterWithDefault => { + f.write_str("Parameter with '*' or '**' cannot have default value") + } + ParseErrorType::InvalidStarPatternUsage => { + f.write_str("Star pattern cannot be used here") + } + ParseErrorType::ExpectedRealNumber => { + f.write_str("Expected a real number in complex literal pattern") + } + ParseErrorType::ExpectedImaginaryNumber => { + f.write_str("Expected an imaginary number in complex literal pattern") + } + ParseErrorType::ExpectedExpression => f.write_str("Expected an expression"), + ParseErrorType::UnexpectedIndentation => f.write_str("Unexpected indentation"), + ParseErrorType::InvalidAssignmentTarget => f.write_str("Invalid assignment target"), + ParseErrorType::InvalidAnnotatedAssignmentTarget => { + f.write_str("Invalid annotated assignment target") + } + ParseErrorType::InvalidNamedAssignmentTarget => { + f.write_str("Assignment expression target must be an identifier") + } + ParseErrorType::InvalidAugmentedAssignmentTarget => { + f.write_str("Invalid augmented assignment target") + } + ParseErrorType::InvalidDeleteTarget => f.write_str("Invalid delete target"), + ParseErrorType::DuplicateParameter(arg_name) => { + write!(f, "Duplicate parameter {arg_name:?}") + } + ParseErrorType::DuplicateKeywordArgumentError(arg_name) => { + write!(f, "Duplicate keyword argument {arg_name:?}") + } + ParseErrorType::UnexpectedIpythonEscapeCommand => { + f.write_str("IPython escape commands are only allowed in `Mode::Ipython`") + } + ParseErrorType::FStringError(ref fstring_error) => { + write!(f, "f-string: {fstring_error}") + } + ParseErrorType::UnexpectedExpressionToken => { + write!(f, "Unexpected token at the end of an expression") + } + } + } +} diff --git a/crates/ruff_python_parser/src/function.rs b/crates/ruff_python_parser/src/function.rs deleted file mode 100644 index 3137983d28..0000000000 --- a/crates/ruff_python_parser/src/function.rs +++ /dev/null @@ -1,246 +0,0 @@ -use std::hash::BuildHasherDefault; -// Contains functions that perform validation and parsing of arguments and parameters. -// Checks apply both to functions and to lambdas. -use crate::lexer::{LexicalError, LexicalErrorType}; -use ruff_python_ast::{self as ast}; -use ruff_text_size::{Ranged, TextRange, TextSize}; -use rustc_hash::FxHashSet; - -pub(crate) struct ArgumentList { - pub(crate) args: Vec, - pub(crate) keywords: Vec, -} - -// Perform validation of function/lambda arguments in a function definition. -pub(crate) fn validate_arguments(arguments: &ast::Parameters) -> Result<(), LexicalError> { - let mut all_arg_names = FxHashSet::with_capacity_and_hasher( - arguments.posonlyargs.len() - + arguments.args.len() - + usize::from(arguments.vararg.is_some()) - + arguments.kwonlyargs.len() - + usize::from(arguments.kwarg.is_some()), - BuildHasherDefault::default(), - ); - - let posonlyargs = arguments.posonlyargs.iter(); - let args = arguments.args.iter(); - let kwonlyargs = arguments.kwonlyargs.iter(); - - let vararg: Option<&ast::Parameter> = arguments.vararg.as_deref(); - let kwarg: Option<&ast::Parameter> = arguments.kwarg.as_deref(); - - for arg in posonlyargs - .chain(args) - .chain(kwonlyargs) - .map(|arg| &arg.parameter) - .chain(vararg) - .chain(kwarg) - { - let range = arg.range; - let arg_name = arg.name.as_str(); - if !all_arg_names.insert(arg_name) { - return Err(LexicalError::new( - LexicalErrorType::DuplicateArgumentError(arg_name.to_string().into_boxed_str()), - range.start(), - )); - } - } - - Ok(()) -} - -pub(crate) fn validate_pos_params( - args: &( - Vec, - Vec, - ), -) -> Result<(), LexicalError> { - let (posonlyargs, args) = args; - #[allow(clippy::skip_while_next)] - let first_invalid = posonlyargs - .iter() - .chain(args.iter()) // for all args - .skip_while(|arg| arg.default.is_none()) // starting with args without default - .skip_while(|arg| arg.default.is_some()) // and then args with default - .next(); // there must not be any more args without default - if let Some(invalid) = first_invalid { - return Err(LexicalError::new( - LexicalErrorType::DefaultArgumentError, - invalid.parameter.start(), - )); - } - Ok(()) -} - -type FunctionArgument = ( - Option<(TextSize, TextSize, Option)>, - ast::Expr, -); - -// Parse arguments as supplied during a function/lambda *call*. -pub(crate) fn parse_arguments( - function_arguments: Vec, -) -> Result { - // First, run through the comments to determine the number of positional and keyword arguments. - let mut keyword_names = FxHashSet::with_capacity_and_hasher( - function_arguments.len(), - BuildHasherDefault::default(), - ); - let mut double_starred = false; - let mut num_args = 0; - let mut num_keywords = 0; - for (name, value) in &function_arguments { - if let Some((start, _end, name)) = name { - // Check for duplicate keyword arguments in the call. - if let Some(keyword_name) = &name { - if !keyword_names.insert(keyword_name.to_string()) { - return Err(LexicalError::new( - LexicalErrorType::DuplicateKeywordArgumentError( - keyword_name.to_string().into_boxed_str(), - ), - *start, - )); - } - } else { - double_starred = true; - } - - num_keywords += 1; - } else { - // Positional arguments mustn't follow keyword arguments. - if num_keywords > 0 && !is_starred(value) { - return Err(LexicalError::new( - LexicalErrorType::PositionalArgumentError, - value.start(), - )); - // Allow starred arguments after keyword arguments but - // not after double-starred arguments. - } else if double_starred { - return Err(LexicalError::new( - LexicalErrorType::UnpackedArgumentError, - value.start(), - )); - } - - num_args += 1; - } - } - - // Second, push the arguments into vectors of exact capacity. This avoids a vector resize later - // on when these vectors are boxed into slices. - let mut args = Vec::with_capacity(num_args); - let mut keywords = Vec::with_capacity(num_keywords); - for (name, value) in function_arguments { - if let Some((start, end, name)) = name { - keywords.push(ast::Keyword { - arg: name, - value, - range: TextRange::new(start, end), - }); - } else { - args.push(value); - } - } - - Ok(ArgumentList { args, keywords }) -} - -// Check if an expression is a starred expression. -const fn is_starred(exp: &ast::Expr) -> bool { - exp.is_starred_expr() -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::parser::parse_suite; - use crate::ParseErrorType; - - macro_rules! function_and_lambda { - ($($name:ident: $code:expr,)*) => { - $( - #[test] - fn $name() { - let parse_ast = crate::parser::parse_suite($code, ); - insta::assert_debug_snapshot!(parse_ast); - } - )* - } - } - - function_and_lambda! { - test_function_no_args_with_ranges: "def f(): pass", - test_function_pos_args_with_ranges: "def f(a, b, c): pass", - } - - function_and_lambda! { - test_function_no_args: "def f(): pass", - test_function_pos_args: "def f(a, b, c): pass", - test_function_posonly_and_pos_args: "def f(a, /, b, c): pass", - test_function_pos_args_with_defaults: "def f(a, b=20, /, c=30): pass", - test_function_pos_args_with_defaults_and_varargs_and_kwargs: "def f(a, b=20, /, c=30, *args, **kwargs): pass", - test_function_kw_only_args: "def f(*, a, b, c): pass", - test_function_kw_only_args_with_defaults: "def f(*, a, b=20, c=30): pass", - test_function_kw_only_args_with_defaults_and_varargs: "def f(*args, a, b=20, c=30): pass", - test_function_kw_only_args_with_defaults_and_kwargs: "def f(*, a, b=20, c=30, **kwargs): pass", - test_function_kw_only_args_with_defaults_and_varargs_and_kwargs: "def f(*args, a, b=20, c=30, **kwargs): pass", - test_function_pos_and_kw_only_args: "def f(a, b, /, c, *, d, e, f): pass", - test_function_pos_and_kw_only_args_with_defaults: "def f(a, b, /, c, *, d, e=20, f=30): pass", - test_function_pos_and_kw_only_args_with_defaults_and_varargs: "def f(a, b, /, c, *args, d, e=20, f=30): pass", - test_function_pos_and_kw_only_args_with_defaults_and_kwargs: "def f(a, b, /, c, *, d, e=20, f=30, **kwargs): pass", - test_function_pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs: "def f(a, b, /, c, *args, d, e=20, f=30, **kwargs): pass", - test_lambda_no_args: "lambda: 1", - test_lambda_pos_args: "lambda a, b, c: 1", - test_lambda_posonly_args: "lambda a, b, /, c: 1", - test_lambda_pos_args_with_defaults: "lambda a, b=20, /, c=30: 1", - test_lambda_kw_only_args: "lambda *, a, b, c: 1", - test_lambda_kw_only_args_with_defaults: "lambda *, a, b=20, c=30: 1", - test_lambda_pos_and_kw_only_args: "lambda a, b, /, c, *, d, e: 0", - test_lambda_pos_and_kw_only_args_and_vararg_and_kwarg: "lambda a, b, /, c, *d, e, **f: 0", - } - - fn function_parse_error(src: &str) -> LexicalErrorType { - let parse_ast = parse_suite(src); - parse_ast - .map_err(|e| match e.error { - ParseErrorType::Lexical(e) => e, - _ => panic!("Expected LexicalError"), - }) - .expect_err("Expected error") - } - - macro_rules! function_and_lambda_error { - ($($name:ident: $code:expr, $error:expr,)*) => { - $( - #[test] - fn $name() { - let error = function_parse_error($code); - assert_eq!(error, $error); - } - )* - } - } - - function_and_lambda_error! { - // Check definitions - test_duplicates_f1: "def f(a, a): pass", LexicalErrorType::DuplicateArgumentError("a".to_string().into_boxed_str()), - test_duplicates_f2: "def f(a, *, a): pass", LexicalErrorType::DuplicateArgumentError("a".to_string().into_boxed_str()), - test_duplicates_f3: "def f(a, a=20): pass", LexicalErrorType::DuplicateArgumentError("a".to_string().into_boxed_str()), - test_duplicates_f4: "def f(a, *a): pass", LexicalErrorType::DuplicateArgumentError("a".to_string().into_boxed_str()), - test_duplicates_f5: "def f(a, *, b, **a): pass", LexicalErrorType::DuplicateArgumentError("a".to_string().into_boxed_str()), - test_duplicates_l1: "lambda a, a: 1", LexicalErrorType::DuplicateArgumentError("a".to_string().into_boxed_str()), - test_duplicates_l2: "lambda a, *, a: 1", LexicalErrorType::DuplicateArgumentError("a".to_string().into_boxed_str()), - test_duplicates_l3: "lambda a, a=20: 1", LexicalErrorType::DuplicateArgumentError("a".to_string().into_boxed_str()), - test_duplicates_l4: "lambda a, *a: 1", LexicalErrorType::DuplicateArgumentError("a".to_string().into_boxed_str()), - test_duplicates_l5: "lambda a, *, b, **a: 1", LexicalErrorType::DuplicateArgumentError("a".to_string().into_boxed_str()), - test_default_arg_error_f: "def f(a, b=20, c): pass", LexicalErrorType::DefaultArgumentError, - test_default_arg_error_l: "lambda a, b=20, c: 1", LexicalErrorType::DefaultArgumentError, - test_named_arguments_follow_bare_star_1: "def f(*): pass", LexicalErrorType::OtherError("named arguments must follow bare *".to_string().into_boxed_str()), - test_named_arguments_follow_bare_star_2: "def f(*, **kwargs): pass", LexicalErrorType::OtherError("named arguments must follow bare *".to_string().into_boxed_str()), - - // Check some calls. - test_positional_arg_error_f: "f(b=20, c)", LexicalErrorType::PositionalArgumentError, - test_unpacked_arg_error_f: "f(**b, *c)", LexicalErrorType::UnpackedArgumentError, - test_duplicate_kw_f1: "f(a=20, a=30)", LexicalErrorType::DuplicateKeywordArgumentError("a".to_string().into_boxed_str()), - } -} diff --git a/crates/ruff_python_parser/src/invalid.rs b/crates/ruff_python_parser/src/invalid.rs deleted file mode 100644 index 551af3db55..0000000000 --- a/crates/ruff_python_parser/src/invalid.rs +++ /dev/null @@ -1,699 +0,0 @@ -/*! -Defines some helper routines for rejecting invalid Python programs. - -These routines are named in a way that supports qualified use. For example, -`invalid::assignment_targets`. -*/ - -use {ruff_python_ast::Expr, ruff_text_size::TextSize}; - -use crate::lexer::{LexicalError, LexicalErrorType}; - -/// Returns an error for invalid assignment targets. -/// -/// # Errors -/// -/// This returns an error when any of the given expressions are themselves -/// or contain an expression that is invalid on the left hand side of an -/// assignment. For example, all literal expressions are invalid assignment -/// targets. -pub(crate) fn assignment_targets(targets: &[Expr]) -> Result<(), LexicalError> { - for t in targets { - assignment_target(t)?; - } - Ok(()) -} - -/// Returns an error if the given target is invalid for the left hand side of -/// an assignment. -/// -/// # Errors -/// -/// This returns an error when the given expression is itself or contains an -/// expression that is invalid on the left hand side of an assignment. For -/// example, all literal expressions are invalid assignment targets. -pub(crate) fn assignment_target(target: &Expr) -> Result<(), LexicalError> { - // Allowing a glob import here because of its limited scope. - #[allow(clippy::enum_glob_use)] - use self::Expr::*; - - let err = |location: TextSize| -> LexicalError { - let error = LexicalErrorType::AssignmentError; - LexicalError::new(error, location) - }; - match *target { - BoolOp(ref e) => Err(err(e.range.start())), - Named(ref e) => Err(err(e.range.start())), - BinOp(ref e) => Err(err(e.range.start())), - UnaryOp(ref e) => Err(err(e.range.start())), - Lambda(ref e) => Err(err(e.range.start())), - If(ref e) => Err(err(e.range.start())), - Dict(ref e) => Err(err(e.range.start())), - Set(ref e) => Err(err(e.range.start())), - ListComp(ref e) => Err(err(e.range.start())), - SetComp(ref e) => Err(err(e.range.start())), - DictComp(ref e) => Err(err(e.range.start())), - Generator(ref e) => Err(err(e.range.start())), - Await(ref e) => Err(err(e.range.start())), - Yield(ref e) => Err(err(e.range.start())), - YieldFrom(ref e) => Err(err(e.range.start())), - Compare(ref e) => Err(err(e.range.start())), - Call(ref e) => Err(err(e.range.start())), - // FString is recursive, but all its forms are invalid as an - // assignment target, so we can reject it without exploring it. - FString(ref e) => Err(err(e.range.start())), - StringLiteral(ref e) => Err(err(e.range.start())), - BytesLiteral(ref e) => Err(err(e.range.start())), - NumberLiteral(ref e) => Err(err(e.range.start())), - BooleanLiteral(ref e) => Err(err(e.range.start())), - NoneLiteral(ref e) => Err(err(e.range.start())), - EllipsisLiteral(ref e) => Err(err(e.range.start())), - // This isn't in the Python grammar but is Jupyter notebook specific. - // It seems like this should be an error. It does also seem like the - // parser prevents this from ever appearing as an assignment target - // anyway. ---AG - IpyEscapeCommand(ref e) => Err(err(e.range.start())), - // The only nested expressions allowed as an assignment target - // are star exprs, lists and tuples. - Starred(ref e) => assignment_target(&e.value), - List(ref e) => assignment_targets(&e.elts), - Tuple(ref e) => assignment_targets(&e.elts), - // Subscript is recursive and can be invalid, but aren't syntax errors. - // For example, `5[1] = 42` is a type error. - Subscript(_) => Ok(()), - // Similar to Subscript, e.g., `5[1:2] = [42]` is a type error. - Slice(_) => Ok(()), - // Similar to Subscript, e.g., `"foo".y = 42` is an attribute error. - Attribute(_) => Ok(()), - // These are always valid as assignment targets. - Name(_) => Ok(()), - } -} - -#[cfg(test)] -mod tests { - use crate::parse_suite; - - // First we test, broadly, that various kinds of assignments are now - // rejected by the parser. e.g., `5 = 3`, `5 += 3`, `(5): int = 3`. - - // Regression test: https://github.com/astral-sh/ruff/issues/6895 - #[test] - fn err_literal_assignment() { - let ast = parse_suite(r"5 = 3"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - // This test previously passed before the assignment operator checking - // above, but we include it here for good measure. - #[test] - fn err_assignment_expr() { - let ast = parse_suite(r"(5 := 3)"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: UnrecognizedToken( - ColonEqual, - None, - ), - offset: 3, - }, - ) - "###); - } - - #[test] - fn err_literal_augment_assignment() { - let ast = parse_suite(r"5 += 3"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_literal_annotation_assignment() { - let ast = parse_suite(r"(5): int = 3"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 1, - }, - ) - "###); - } - - // Now we exhaustively test all possible cases where assignment can fail. - - #[test] - fn err_bool_op() { - let ast = parse_suite(r"x or y = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_named_expr() { - let ast = parse_suite(r"(x := 5) = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 1, - }, - ) - "###); - } - - #[test] - fn err_bin_op() { - let ast = parse_suite(r"x + y = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_unary_op() { - let ast = parse_suite(r"-x = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_lambda() { - let ast = parse_suite(r"(lambda _: 1) = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 1, - }, - ) - "###); - } - - #[test] - fn err_if_exp() { - let ast = parse_suite(r"a if b else c = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_dict() { - let ast = parse_suite(r"{'a':5} = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_set() { - let ast = parse_suite(r"{a} = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_list_comp() { - let ast = parse_suite(r"[x for x in xs] = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_set_comp() { - let ast = parse_suite(r"{x for x in xs} = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_dict_comp() { - let ast = parse_suite(r"{x: x*2 for x in xs} = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_generator_exp() { - let ast = parse_suite(r"(x for x in xs) = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_await() { - let ast = parse_suite(r"await x = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_yield() { - let ast = parse_suite(r"(yield x) = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 1, - }, - ) - "###); - } - - #[test] - fn err_yield_from() { - let ast = parse_suite(r"(yield from xs) = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 1, - }, - ) - "###); - } - - #[test] - fn err_compare() { - let ast = parse_suite(r"a < b < c = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_call() { - let ast = parse_suite(r"foo() = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_formatted_value() { - // N.B. It looks like the parser can't generate a top-level - // FormattedValue, where as the official Python AST permits - // representing a single f-string containing just a variable as a - // FormattedValue directly. - // - // Bottom line is that because of this, this test is (at present) - // duplicative with the `fstring` test. That is, in theory these tests - // could fail independently, but in practice their failure or success - // is coupled. - // - // See: https://docs.python.org/3/library/ast.html#ast.FormattedValue - let ast = parse_suite(r#"f"{quux}" = 42"#); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_fstring() { - let ast = parse_suite(r#"f"{foo} and {bar}" = 42"#); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_string_literal() { - let ast = parse_suite(r#""foo" = 42"#); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_bytes_literal() { - let ast = parse_suite(r#"b"foo" = 42"#); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_number_literal() { - let ast = parse_suite(r"123 = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_boolean_literal() { - let ast = parse_suite(r"True = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_none_literal() { - let ast = parse_suite(r"None = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_ellipsis_literal() { - let ast = parse_suite(r"... = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 0, - }, - ) - "###); - } - - #[test] - fn err_starred() { - let ast = parse_suite(r"*foo() = 42"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 1, - }, - ) - "###); - } - - #[test] - fn err_list() { - let ast = parse_suite(r"[x, foo(), y] = [42, 42, 42]"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 4, - }, - ) - "###); - } - - #[test] - fn err_list_nested() { - let ast = parse_suite(r"[[a, b], [[42]], d] = [[1, 2], [[3]], 4]"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 11, - }, - ) - "###); - } - - #[test] - fn err_tuple() { - let ast = parse_suite(r"(x, foo(), y) = (42, 42, 42)"); - insta::assert_debug_snapshot!(ast, @r###" - Err( - ParseError { - error: Lexical( - AssignmentError, - ), - offset: 4, - }, - ) - "###); - } - - // This last group of tests checks that assignments we expect to be parsed - // (including some interesting ones) continue to be parsed successfully. - - #[test] - fn ok_starred() { - let ast = parse_suite(r"*foo = 42"); - insta::assert_debug_snapshot!(ast); - } - - #[test] - fn ok_list() { - let ast = parse_suite(r"[x, y, z] = [1, 2, 3]"); - insta::assert_debug_snapshot!(ast); - } - - #[test] - fn ok_tuple() { - let ast = parse_suite(r"(x, y, z) = (1, 2, 3)"); - insta::assert_debug_snapshot!(ast); - } - - #[test] - fn ok_subscript_normal() { - let ast = parse_suite(r"x[0] = 42"); - insta::assert_debug_snapshot!(ast); - } - - // This is actually a type error, not a syntax error. So check that it - // doesn't fail parsing. - #[test] - fn ok_subscript_weird() { - let ast = parse_suite(r"5[0] = 42"); - insta::assert_debug_snapshot!(ast); - } - - #[test] - fn ok_slice_normal() { - let ast = parse_suite(r"x[1:2] = [42]"); - insta::assert_debug_snapshot!(ast); - } - - // This is actually a type error, not a syntax error. So check that it - // doesn't fail parsing. - #[test] - fn ok_slice_weird() { - let ast = parse_suite(r"5[1:2] = [42]"); - insta::assert_debug_snapshot!(ast); - } - - #[test] - fn ok_attribute_normal() { - let ast = parse_suite(r"foo.bar = 42"); - insta::assert_debug_snapshot!(ast); - } - - // This is actually an attribute error, not a syntax error. So check that - // it doesn't fail parsing. - #[test] - fn ok_attribute_weird() { - let ast = parse_suite(r#""foo".y = 42"#); - insta::assert_debug_snapshot!(ast); - } - - #[test] - fn ok_name() { - let ast = parse_suite(r"foo = 42"); - insta::assert_debug_snapshot!(ast); - } - - // This is a sanity test for what looks like an ipython directive being - // assigned to. Although this doesn't actually parse as an assignment - // statement, but rather, a directive whose value is `foo = 42`. - #[test] - fn ok_ipy_escape_command() { - use crate::Mode; - - let src = r"!foo = 42"; - let tokens = crate::lexer::lex(src, Mode::Ipython); - let ast = crate::parse_tokens(tokens.collect(), src, Mode::Ipython); - insta::assert_debug_snapshot!(ast); - } - - #[test] - fn ok_assignment_expr() { - let ast = parse_suite(r"(x := 5)"); - insta::assert_debug_snapshot!(ast); - } -} diff --git a/crates/ruff_python_parser/src/lexer.rs b/crates/ruff_python_parser/src/lexer.rs index 14a5f9d7f1..92ef14b56d 100644 --- a/crates/ruff_python_parser/src/lexer.rs +++ b/crates/ruff_python_parser/src/lexer.rs @@ -39,10 +39,13 @@ use ruff_python_ast::{ }; use ruff_text_size::{TextLen, TextRange, TextSize}; +use crate::error::FStringErrorType; use crate::lexer::cursor::{Cursor, EOF_CHAR}; use crate::lexer::fstring::{FStringContext, FStrings}; use crate::lexer::indentation::{Indentation, Indentations}; -use crate::{soft_keywords::SoftKeywordTransformer, string::FStringErrorType, token::Tok, Mode}; +use crate::soft_keywords::SoftKeywordTransformer; +use crate::token::Tok; +use crate::Mode; mod cursor; mod fstring; @@ -304,7 +307,7 @@ impl<'source> Lexer<'source> { Err(err) => { return Err(LexicalError::new( LexicalErrorType::OtherError(format!("{err:?}").into_boxed_str()), - self.token_range().start(), + self.token_range(), )); } }; @@ -329,7 +332,7 @@ impl<'source> Lexer<'source> { if self.cursor.eat_char('_') { return Err(LexicalError::new( LexicalErrorType::OtherError("Invalid Syntax".to_string().into_boxed_str()), - self.offset() - TextSize::new(1), + TextRange::new(self.offset() - TextSize::new(1), self.offset()), )); } @@ -363,7 +366,7 @@ impl<'source> Lexer<'source> { LexicalErrorType::OtherError( "Invalid decimal literal".to_string().into_boxed_str(), ), - self.token_start(), + self.token_range(), ) })?; @@ -388,9 +391,11 @@ impl<'source> Lexer<'source> { // Leading zeros in decimal integer literals are not permitted. return Err(LexicalError::new( LexicalErrorType::OtherError( - "Invalid Token".to_string().into_boxed_str(), + "Invalid decimal integer literal" + .to_string() + .into_boxed_str(), ), - self.token_range().start(), + self.token_range(), )); } value @@ -398,7 +403,7 @@ impl<'source> Lexer<'source> { Err(err) => { return Err(LexicalError::new( LexicalErrorType::OtherError(format!("{err:?}").into_boxed_str()), - self.token_range().start(), + self.token_range(), )) } }; @@ -614,7 +619,7 @@ impl<'source> Lexer<'source> { }; return Err(LexicalError::new( LexicalErrorType::FStringError(error), - self.offset(), + self.token_range(), )); } '\n' | '\r' if !fstring.is_triple_quoted() => { @@ -627,7 +632,7 @@ impl<'source> Lexer<'source> { } return Err(LexicalError::new( LexicalErrorType::FStringError(FStringErrorType::UnterminatedString), - self.offset(), + self.token_range(), )); } '\\' => { @@ -735,22 +740,9 @@ impl<'source> Lexer<'source> { let Some(index) = memchr::memchr(quote_byte, self.cursor.rest().as_bytes()) else { self.cursor.skip_to_end(); - if let Some(fstring) = self.fstrings.current() { - // When we are in an f-string, check whether the initial quote - // matches with f-strings quotes and if it is, then this must be a - // missing '}' token so raise the proper error. - if fstring.quote_char() == quote - && fstring.is_triple_quoted() == kind.is_triple_quoted() - { - return Err(LexicalError::new( - LexicalErrorType::FStringError(FStringErrorType::UnclosedLbrace), - self.cursor.text_len(), - )); - } - } return Err(LexicalError::new( - LexicalErrorType::Eof, - self.cursor.text_len(), + LexicalErrorType::UnclosedStringError, + self.token_range(), )); }; @@ -784,22 +776,9 @@ impl<'source> Lexer<'source> { else { self.cursor.skip_to_end(); - if let Some(fstring) = self.fstrings.current() { - // When we are in an f-string, check whether the initial quote - // matches with f-strings quotes and if it is, then this must be a - // missing '}' token so raise the proper error. - if fstring.quote_char() == quote - && fstring.is_triple_quoted() == kind.is_triple_quoted() - { - return Err(LexicalError::new( - LexicalErrorType::FStringError(FStringErrorType::UnclosedLbrace), - self.offset(), - )); - } - } return Err(LexicalError::new( LexicalErrorType::StringError, - self.offset(), + self.token_range(), )); }; @@ -825,26 +804,9 @@ impl<'source> Lexer<'source> { match ch { Some('\r' | '\n') => { - if let Some(fstring) = self.fstrings.current() { - // When we are in an f-string, check whether the initial quote - // matches with f-strings quotes and if it is, then this must be a - // missing '}' token so raise the proper error. - if fstring.quote_char() == quote && !fstring.is_triple_quoted() { - return Err(LexicalError::new( - LexicalErrorType::FStringError( - FStringErrorType::UnclosedLbrace, - ), - self.offset() - TextSize::new(1), - )); - } - } return Err(LexicalError::new( - LexicalErrorType::OtherError( - "EOL while scanning string literal" - .to_string() - .into_boxed_str(), - ), - self.offset() - TextSize::new(1), + LexicalErrorType::UnclosedStringError, + self.token_range(), )); } Some(ch) if ch == quote => { @@ -893,7 +855,7 @@ impl<'source> Lexer<'source> { self.pending_indentation = Some(indentation); let offset = self.offset(); self.indentations.dedent_one(indentation).map_err(|_| { - LexicalError::new(LexicalErrorType::IndentationError, offset) + LexicalError::new(LexicalErrorType::IndentationError, self.token_range()) })?; return Ok((Tok::Dedent, TextRange::empty(offset))); } @@ -901,7 +863,7 @@ impl<'source> Lexer<'source> { Err(_) => { return Err(LexicalError::new( LexicalErrorType::IndentationError, - self.offset(), + self.token_range(), )); } } @@ -927,7 +889,7 @@ impl<'source> Lexer<'source> { } else { Err(LexicalError::new( LexicalErrorType::UnrecognizedToken { tok: c }, - self.token_start(), + self.token_range(), )) } } else { @@ -951,11 +913,11 @@ impl<'source> Lexer<'source> { if self.cursor.eat_char('\r') { self.cursor.eat_char('\n'); } else if self.cursor.is_eof() { - return Err(LexicalError::new(LexicalErrorType::Eof, self.token_start())); + return Err(LexicalError::new(LexicalErrorType::Eof, self.token_range())); } else if !self.cursor.eat_char('\n') { return Err(LexicalError::new( LexicalErrorType::LineContinuationError, - self.token_start(), + self.token_range(), )); } } @@ -989,11 +951,11 @@ impl<'source> Lexer<'source> { if self.cursor.eat_char('\r') { self.cursor.eat_char('\n'); } else if self.cursor.is_eof() { - return Err(LexicalError::new(LexicalErrorType::Eof, self.token_start())); + return Err(LexicalError::new(LexicalErrorType::Eof, self.token_range())); } else if !self.cursor.eat_char('\n') { return Err(LexicalError::new( LexicalErrorType::LineContinuationError, - self.token_start(), + self.token_range(), )); } indentation = Indentation::root(); @@ -1031,7 +993,7 @@ impl<'source> Lexer<'source> { self.pending_indentation = Some(indentation); self.indentations.dedent_one(indentation).map_err(|_| { - LexicalError::new(LexicalErrorType::IndentationError, self.offset()) + LexicalError::new(LexicalErrorType::IndentationError, self.token_range()) })?; Some((Tok::Dedent, TextRange::empty(self.offset()))) @@ -1047,7 +1009,7 @@ impl<'source> Lexer<'source> { Err(_) => { return Err(LexicalError::new( LexicalErrorType::IndentationError, - self.offset(), + self.token_range(), )); } }; @@ -1061,7 +1023,7 @@ impl<'source> Lexer<'source> { if self.nesting > 0 { // Reset the nesting to avoid going into infinite loop. self.nesting = 0; - return Err(LexicalError::new(LexicalErrorType::Eof, self.offset())); + return Err(LexicalError::new(LexicalErrorType::Eof, self.token_range())); } // Next, insert a trailing newline, if required. @@ -1228,7 +1190,7 @@ impl<'source> Lexer<'source> { if fstring.nesting() == self.nesting { return Err(LexicalError::new( LexicalErrorType::FStringError(FStringErrorType::SingleRbrace), - self.token_start(), + self.token_range(), )); } fstring.try_end_format_spec(self.nesting); @@ -1322,7 +1284,7 @@ impl<'source> Lexer<'source> { return Err(LexicalError::new( LexicalErrorType::UnrecognizedToken { tok: c }, - self.token_start(), + self.token_range(), )); } }; @@ -1386,12 +1348,12 @@ pub struct LexicalError { /// The type of error that occurred. error: LexicalErrorType, /// The location of the error. - location: TextSize, + location: TextRange, } impl LexicalError { /// Creates a new `LexicalError` with the given error type and location. - pub fn new(error: LexicalErrorType, location: TextSize) -> Self { + pub fn new(error: LexicalErrorType, location: TextRange) -> Self { Self { error, location } } @@ -1403,7 +1365,7 @@ impl LexicalError { self.error } - pub fn location(&self) -> TextSize { + pub fn location(&self) -> TextRange { self.location } } @@ -1428,7 +1390,7 @@ impl std::fmt::Display for LexicalError { f, "{} at byte offset {}", self.error(), - u32::from(self.location()) + u32::from(self.location().start()) ) } } @@ -1443,9 +1405,14 @@ pub enum LexicalErrorType { // to use the `UnicodeError` variant instead. #[doc(hidden)] StringError, - // TODO: Should take a start/end position to report. + /// A string literal without the closing quote. + UnclosedStringError, /// Decoding of a unicode escape sequence in a string literal failed. UnicodeError, + /// Missing the `{` for unicode escape sequence. + MissingUnicodeLbrace, + /// Missing the `}` for unicode escape sequence. + MissingUnicodeRbrace, /// The nesting of brackets/braces/parentheses is not balanced. NestingError, /// The indentation is not consistent. @@ -1467,6 +1434,8 @@ pub enum LexicalErrorType { UnrecognizedToken { tok: char }, /// An f-string error containing the [`FStringErrorType`]. FStringError(FStringErrorType), + /// Invalid character encountered in a byte literal. + InvalidByteLiteral, /// An unexpected character was encountered after a line continuation. LineContinuationError, /// An unexpected end of file was encountered. @@ -1484,6 +1453,9 @@ impl std::fmt::Display for LexicalErrorType { match self { LexicalErrorType::StringError => write!(f, "Got unexpected string"), LexicalErrorType::FStringError(error) => write!(f, "f-string: {error}"), + LexicalErrorType::InvalidByteLiteral => { + write!(f, "bytes can only contain ASCII literal characters") + } LexicalErrorType::UnicodeError => write!(f, "Got unexpected unicode"), LexicalErrorType::NestingError => write!(f, "Got unexpected nesting"), LexicalErrorType::IndentationError => { @@ -1522,6 +1494,15 @@ impl std::fmt::Display for LexicalErrorType { LexicalErrorType::Eof => write!(f, "unexpected EOF while parsing"), LexicalErrorType::AssignmentError => write!(f, "invalid assignment target"), LexicalErrorType::OtherError(msg) => write!(f, "{msg}"), + LexicalErrorType::UnclosedStringError => { + write!(f, "missing closing quote in string literal") + } + LexicalErrorType::MissingUnicodeLbrace => { + write!(f, "Missing `{{` in Unicode escape sequence") + } + LexicalErrorType::MissingUnicodeRbrace => { + write!(f, "Missing `}}` in Unicode escape sequence") + } } } } @@ -2332,9 +2313,7 @@ f"{(lambda x:{x})}" #[test] fn test_fstring_error() { - use FStringErrorType::{ - SingleRbrace, UnclosedLbrace, UnterminatedString, UnterminatedTripleQuotedString, - }; + use FStringErrorType::{SingleRbrace, UnterminatedString, UnterminatedTripleQuotedString}; assert_eq!(lex_fstring_error("f'}'"), SingleRbrace); assert_eq!(lex_fstring_error("f'{{}'"), SingleRbrace); @@ -2345,18 +2324,6 @@ f"{(lambda x:{x})}" assert_eq!(lex_fstring_error("f'{3:}}>10}'"), SingleRbrace); assert_eq!(lex_fstring_error(r"f'\{foo}\}'"), SingleRbrace); - assert_eq!(lex_fstring_error("f'{'"), UnclosedLbrace); - assert_eq!(lex_fstring_error("f'{foo!r'"), UnclosedLbrace); - assert_eq!(lex_fstring_error("f'{foo='"), UnclosedLbrace); - assert_eq!( - lex_fstring_error( - r#"f"{" -"# - ), - UnclosedLbrace - ); - assert_eq!(lex_fstring_error(r#"f"""{""""#), UnclosedLbrace); - assert_eq!(lex_fstring_error(r#"f""#), UnterminatedString); assert_eq!(lex_fstring_error(r"f'"), UnterminatedString); @@ -2371,25 +2338,4 @@ f"{(lambda x:{x})}" UnterminatedTripleQuotedString ); } - - #[test] - fn test_fstring_error_location() { - assert_debug_snapshot!(lex_error("f'{'"), @r###" - LexicalError { - error: FStringError( - UnclosedLbrace, - ), - location: 4, - } - "###); - - assert_debug_snapshot!(lex_error("f'{'α"), @r###" - LexicalError { - error: FStringError( - UnclosedLbrace, - ), - location: 6, - } - "###); - } } diff --git a/crates/ruff_python_parser/src/lib.rs b/crates/ruff_python_parser/src/lib.rs index 6521cef105..ce915b04d4 100644 --- a/crates/ruff_python_parser/src/lib.rs +++ b/crates/ruff_python_parser/src/lib.rs @@ -109,28 +109,210 @@ //! [parsing]: https://en.wikipedia.org/wiki/Parsing //! [lexer]: crate::lexer -pub use parser::{ - parse, parse_expression, parse_expression_starts_at, parse_program, parse_starts_at, - parse_suite, parse_tokens, ParseError, ParseErrorType, -}; -use ruff_python_ast::{Mod, PySourceType, Suite}; -pub use string::FStringErrorType; -pub use token::{Tok, TokenKind}; +use crate::lexer::{lex, lex_starts_at, LexResult}; -use crate::lexer::LexResult; +pub use crate::error::{FStringErrorType, ParseError, ParseErrorType}; +pub use crate::parser::Program; +pub use crate::token::{Tok, TokenKind}; -mod context; -mod function; -mod invalid; -// Skip flattening lexer to distinguish from full ruff_python_parser +use ruff_python_ast::{Expr, Mod, ModModule, PySourceType, Suite}; +use ruff_text_size::TextSize; + +mod error; pub mod lexer; mod parser; mod soft_keywords; mod string; mod token; +mod token_set; mod token_source; pub mod typing; +/// Parse a full Python program usually consisting of multiple lines. +/// +/// This is a convenience function that can be used to parse a full Python program without having to +/// specify the [`Mode`] or the location. It is probably what you want to use most of the time. +/// +/// # Example +/// +/// For example, parsing a simple function definition and a call to that function: +/// +/// ``` +/// use ruff_python_parser as parser; +/// let source = r#" +/// def foo(): +/// return 42 +/// +/// print(foo()) +/// "#; +/// let program = parser::parse_program(source); +/// assert!(program.is_ok()); +/// ``` +pub fn parse_program(source: &str) -> Result { + let lexer = lex(source, Mode::Module); + match parse_tokens(lexer.collect(), source, Mode::Module)? { + Mod::Module(m) => Ok(m), + Mod::Expression(_) => unreachable!("Mode::Module doesn't return other variant"), + } +} + +pub fn parse_suite(source: &str) -> Result { + parse_program(source).map(|m| m.body) +} + +/// Parses a single Python expression. +/// +/// This convenience function can be used to parse a single expression without having to +/// specify the Mode or the location. +/// +/// # Example +/// +/// For example, parsing a single expression denoting the addition of two numbers: +/// +/// ``` +/// use ruff_python_parser as parser; +/// let expr = parser::parse_expression("1 + 2"); +/// +/// assert!(expr.is_ok()); +/// +/// ``` +pub fn parse_expression(source: &str) -> Result { + let lexer = lex(source, Mode::Expression).collect(); + match parse_tokens(lexer, source, Mode::Expression)? { + Mod::Expression(expression) => Ok(*expression.body), + Mod::Module(_m) => unreachable!("Mode::Expression doesn't return other variant"), + } +} + +/// Parses a Python expression from a given location. +/// +/// This function allows to specify the location of the expression in the source code, other than +/// that, it behaves exactly like [`parse_expression`]. +/// +/// # Example +/// +/// Parsing a single expression denoting the addition of two numbers, but this time specifying a different, +/// somewhat silly, location: +/// +/// ``` +/// use ruff_python_parser::{parse_expression_starts_at}; +/// # use ruff_text_size::TextSize; +/// +/// let expr = parse_expression_starts_at("1 + 2", TextSize::from(400)); +/// assert!(expr.is_ok()); +/// ``` +pub fn parse_expression_starts_at(source: &str, offset: TextSize) -> Result { + let lexer = lex_starts_at(source, Mode::Module, offset).collect(); + match parse_tokens(lexer, source, Mode::Expression)? { + Mod::Expression(expression) => Ok(*expression.body), + Mod::Module(_m) => unreachable!("Mode::Expression doesn't return other variant"), + } +} + +/// Parse the given Python source code using the specified [`Mode`]. +/// +/// This function is the most general function to parse Python code. Based on the [`Mode`] supplied, +/// it can be used to parse a single expression, a full Python program, an interactive expression +/// or a Python program containing IPython escape commands. +/// +/// # Example +/// +/// If we want to parse a simple expression, we can use the [`Mode::Expression`] mode during +/// parsing: +/// +/// ``` +/// use ruff_python_parser::{Mode, parse}; +/// +/// let expr = parse("1 + 2", Mode::Expression); +/// assert!(expr.is_ok()); +/// ``` +/// +/// Alternatively, we can parse a full Python program consisting of multiple lines: +/// +/// ``` +/// use ruff_python_parser::{Mode, parse}; +/// +/// let source = r#" +/// class Greeter: +/// +/// def greet(self): +/// print("Hello, world!") +/// "#; +/// let program = parse(source, Mode::Module); +/// assert!(program.is_ok()); +/// ``` +/// +/// Additionally, we can parse a Python program containing IPython escapes: +/// +/// ``` +/// use ruff_python_parser::{Mode, parse}; +/// +/// let source = r#" +/// %timeit 1 + 2 +/// ?str.replace +/// !ls +/// "#; +/// let program = parse(source, Mode::Ipython); +/// assert!(program.is_ok()); +/// ``` +pub fn parse(source: &str, mode: Mode) -> Result { + let lxr = lexer::lex(source, mode); + parse_tokens(lxr.collect(), source, mode) +} + +/// Parse the given Python source code using the specified [`Mode`] and [`TextSize`]. +/// +/// This function allows to specify the location of the the source code, other than +/// that, it behaves exactly like [`parse`]. +/// +/// # Example +/// +/// ``` +/// # use ruff_text_size::TextSize; +/// use ruff_python_parser::{Mode, parse_starts_at}; +/// +/// let source = r#" +/// def fib(i): +/// a, b = 0, 1 +/// for _ in range(i): +/// a, b = b, a + b +/// return a +/// +/// print(fib(42)) +/// "#; +/// let program = parse_starts_at(source, Mode::Module, TextSize::from(0)); +/// assert!(program.is_ok()); +/// ``` +pub fn parse_starts_at(source: &str, mode: Mode, offset: TextSize) -> Result { + let lxr = lexer::lex_starts_at(source, mode, offset); + parse_tokens(lxr.collect(), source, mode) +} + +/// Parse an iterator of [`LexResult`]s using the specified [`Mode`]. +/// +/// This could allow you to perform some preprocessing on the tokens before parsing them. +/// +/// # Example +/// +/// As an example, instead of parsing a string, we can parse a list of tokens after we generate +/// them using the [`lexer::lex`] function: +/// +/// ``` +/// use ruff_python_parser::{lexer::lex, Mode, parse_tokens}; +/// +/// let source = "1 + 2"; +/// let expr = parse_tokens(lex(source, Mode::Expression).collect(), source, Mode::Expression); +/// assert!(expr.is_ok()); +/// ``` +pub fn parse_tokens(tokens: Vec, source: &str, mode: Mode) -> Result { + let program = Program::parse_tokens(source, tokens, mode); + if program.is_valid() { + Ok(program.into_ast()) + } else { + Err(program.into_errors().into_iter().next().unwrap()) + } +} + /// Collect tokens up to and including the first error. pub fn tokenize(contents: &str, mode: Mode) -> Vec { let mut tokens: Vec = allocate_tokens_vec(contents); @@ -248,28 +430,3 @@ impl std::fmt::Display for ModeParseError { write!(f, r#"mode must be "exec", "eval", "ipython", or "single""#) } } - -#[rustfmt::skip] -#[allow(unreachable_pub)] -#[allow(clippy::type_complexity)] -#[allow(clippy::extra_unused_lifetimes)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::unused_self)] -#[allow(clippy::cast_sign_loss)] -#[allow(clippy::default_trait_access)] -#[allow(clippy::let_unit_value)] -#[allow(clippy::just_underscores_and_digits)] -#[allow(clippy::no_effect_underscore_binding)] -#[allow(clippy::trivially_copy_pass_by_ref)] -#[allow(clippy::option_option)] -#[allow(clippy::unnecessary_wraps)] -#[allow(clippy::uninlined_format_args)] -#[allow(clippy::cloned_instead_of_copied)] -mod python { - - #[cfg(feature = "lalrpop")] - include!(concat!(env!("OUT_DIR"), "/src/python.rs")); - - #[cfg(not(feature = "lalrpop"))] - include!("python.rs"); -} diff --git a/crates/ruff_python_parser/src/parser.rs b/crates/ruff_python_parser/src/parser.rs deleted file mode 100644 index 659fac0b4a..0000000000 --- a/crates/ruff_python_parser/src/parser.rs +++ /dev/null @@ -1,1524 +0,0 @@ -//! Contains the interface to the Python `ruff_python_parser`. -//! -//! Functions in this module can be used to parse Python code into an [Abstract Syntax Tree] -//! (AST) that is then transformed into bytecode. -//! -//! There are three ways to parse Python code corresponding to the different [`Mode`]s -//! defined in the [`mode`] module. -//! -//! All functions return a [`Result`](std::result::Result) containing the parsed AST or -//! a [`ParseError`] if parsing failed. -//! -//! [Abstract Syntax Tree]: https://en.wikipedia.org/wiki/Abstract_syntax_tree -//! [`Mode`]: crate::mode - -use itertools::Itertools; -pub(super) use lalrpop_util::ParseError as LalrpopError; - -use ruff_python_ast::{ - Expr, ExprAttribute, ExprAwait, ExprBinOp, ExprBoolOp, ExprBooleanLiteral, ExprBytesLiteral, - ExprCall, ExprCompare, ExprDict, ExprDictComp, ExprEllipsisLiteral, ExprFString, ExprGenerator, - ExprIf, ExprIpyEscapeCommand, ExprLambda, ExprList, ExprListComp, ExprName, ExprNamed, - ExprNoneLiteral, ExprNumberLiteral, ExprSet, ExprSetComp, ExprSlice, ExprStarred, - ExprStringLiteral, ExprSubscript, ExprTuple, ExprUnaryOp, ExprYield, ExprYieldFrom, Mod, - ModModule, Suite, -}; -use ruff_text_size::{Ranged, TextRange, TextSize}; - -use crate::lexer::{lex, lex_starts_at, LexResult}; -use crate::token_source::TokenSource; -use crate::{ - lexer::{self, LexicalError, LexicalErrorType}, - python, - token::Tok, - tokenize_all, Mode, -}; - -/// Parse a full Python program usually consisting of multiple lines. -/// -/// This is a convenience function that can be used to parse a full Python program without having to -/// specify the [`Mode`] or the location. It is probably what you want to use most of the time. -/// -/// # Example -/// -/// For example, parsing a simple function definition and a call to that function: -/// -/// ``` -/// use ruff_python_parser as parser; -/// let source = r#" -/// def foo(): -/// return 42 -/// -/// print(foo()) -/// "#; -/// let program = parser::parse_program(source); -/// assert!(program.is_ok()); -/// ``` -pub fn parse_program(source: &str) -> Result { - match parse_tokens(tokenize_all(source, Mode::Module), source, Mode::Module)? { - Mod::Module(m) => Ok(m), - Mod::Expression(_) => unreachable!("Mode::Module doesn't return other variant"), - } -} - -pub fn parse_suite(source: &str) -> Result { - parse_program(source).map(|m| m.body) -} - -/// Parses a single Python expression. -/// -/// This convenience function can be used to parse a single expression without having to -/// specify the Mode or the location. -/// -/// # Example -/// -/// For example, parsing a single expression denoting the addition of two numbers: -/// -/// ``` -/// use ruff_python_parser as parser; -/// let expr = parser::parse_expression("1 + 2"); -/// -/// assert!(expr.is_ok()); -/// -/// ``` -pub fn parse_expression(source: &str) -> Result { - let lexer = lex(source, Mode::Expression); - match parse_tokens(lexer.collect(), source, Mode::Expression)? { - Mod::Expression(expression) => Ok(*expression.body), - Mod::Module(_m) => unreachable!("Mode::Expression doesn't return other variant"), - } -} - -/// Parses a Python expression from a given location. -/// -/// This function allows to specify the location of the expression in the source code, other than -/// that, it behaves exactly like [`parse_expression`]. -/// -/// # Example -/// -/// Parsing a single expression denoting the addition of two numbers, but this time specifying a different, -/// somewhat silly, location: -/// -/// ``` -/// use ruff_python_parser::{parse_expression_starts_at}; -/// # use ruff_text_size::TextSize; -/// -/// let expr = parse_expression_starts_at("1 + 2", TextSize::from(400)); -/// assert!(expr.is_ok()); -/// ``` -pub fn parse_expression_starts_at(source: &str, offset: TextSize) -> Result { - let lexer = lex_starts_at(source, Mode::Module, offset); - match parse_tokens(lexer.collect(), source, Mode::Expression)? { - Mod::Expression(expression) => Ok(*expression.body), - Mod::Module(_m) => unreachable!("Mode::Expression doesn't return other variant"), - } -} - -/// Parse the given Python source code using the specified [`Mode`]. -/// -/// This function is the most general function to parse Python code. Based on the [`Mode`] supplied, -/// it can be used to parse a single expression, a full Python program, an interactive expression -/// or a Python program containing IPython escape commands. -/// -/// # Example -/// -/// If we want to parse a simple expression, we can use the [`Mode::Expression`] mode during -/// parsing: -/// -/// ``` -/// use ruff_python_parser::{Mode, parse}; -/// -/// let expr = parse("1 + 2", Mode::Expression); -/// assert!(expr.is_ok()); -/// ``` -/// -/// Alternatively, we can parse a full Python program consisting of multiple lines: -/// -/// ``` -/// use ruff_python_parser::{Mode, parse}; -/// -/// let source = r#" -/// class Greeter: -/// -/// def greet(self): -/// print("Hello, world!") -/// "#; -/// let program = parse(source, Mode::Module); -/// assert!(program.is_ok()); -/// ``` -/// -/// Additionally, we can parse a Python program containing IPython escapes: -/// -/// ``` -/// use ruff_python_parser::{Mode, parse}; -/// -/// let source = r#" -/// %timeit 1 + 2 -/// ?str.replace -/// !ls -/// "#; -/// let program = parse(source, Mode::Ipython); -/// assert!(program.is_ok()); -/// ``` -pub fn parse(source: &str, mode: Mode) -> Result { - parse_starts_at(source, mode, TextSize::default()) -} - -/// Parse the given Python source code using the specified [`Mode`] and [`TextSize`]. -/// -/// This function allows to specify the location of the source code, other than -/// that, it behaves exactly like [`parse`]. -/// -/// # Example -/// -/// ``` -/// # use ruff_text_size::TextSize; -/// use ruff_python_parser::{Mode, parse_starts_at}; -/// -/// let source = r#" -/// def fib(i): -/// a, b = 0, 1 -/// for _ in range(i): -/// a, b = b, a + b -/// return a -/// -/// print(fib(42)) -/// "#; -/// let program = parse_starts_at(source, Mode::Module, TextSize::from(0)); -/// assert!(program.is_ok()); -/// ``` -pub fn parse_starts_at(source: &str, mode: Mode, offset: TextSize) -> Result { - let lxr = lexer::lex_starts_at(source, mode, offset); - parse_tokens(lxr.collect(), source, mode) -} - -/// Parse an iterator of [`LexResult`]s using the specified [`Mode`]. -/// -/// This could allow you to perform some preprocessing on the tokens before parsing them. -/// -/// # Example -/// -/// As an example, instead of parsing a string, we can parse a list of tokens after we generate -/// them using the [`lexer::lex`] function: -/// -/// ``` -/// use ruff_python_parser::{lexer::lex, Mode, parse_tokens}; -/// -/// let source = "1 + 2"; -/// let expr = parse_tokens(lex(source, Mode::Expression).collect(), source, Mode::Expression); -/// assert!(expr.is_ok()); -/// ``` -pub fn parse_tokens(tokens: Vec, source: &str, mode: Mode) -> Result { - let marker_token = (Tok::start_marker(mode), TextRange::default()); - let lexer = std::iter::once(Ok(marker_token)).chain(TokenSource::new(tokens)); - python::TopParser::new() - .parse( - source, - mode, - lexer.map_ok(|(t, range)| (range.start(), t, range.end())), - ) - .map_err(parse_error_from_lalrpop) -} - -/// Represents represent errors that occur during parsing and are -/// returned by the `parse_*` functions. - -#[derive(Debug, PartialEq)] -pub struct ParseError { - pub error: ParseErrorType, - pub offset: TextSize, -} - -impl std::ops::Deref for ParseError { - type Target = ParseErrorType; - - fn deref(&self) -> &Self::Target { - &self.error - } -} - -impl std::error::Error for ParseError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - Some(&self.error) - } -} - -impl std::fmt::Display for ParseError { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!( - f, - "{} at byte offset {}", - &self.error, - u32::from(self.offset) - ) - } -} - -/// Represents the different types of errors that can occur during parsing. -#[derive(Debug, PartialEq)] -pub enum ParseErrorType { - /// Parser encountered an unexpected end of input - Eof, - /// Parser encountered an extra token - ExtraToken(Tok), - /// Parser encountered an invalid token - InvalidToken, - /// Parser encountered an unexpected token - UnrecognizedToken(Tok, Option), - // Maps to `User` type from `lalrpop-util` - /// Parser encountered an error during lexing. - Lexical(LexicalErrorType), -} - -impl std::error::Error for ParseErrorType {} - -// Convert `lalrpop_util::ParseError` to our internal type -fn parse_error_from_lalrpop(err: LalrpopError) -> ParseError { - match err { - // TODO: Are there cases where this isn't an EOF? - LalrpopError::InvalidToken { location } => ParseError { - error: ParseErrorType::Eof, - offset: location, - }, - LalrpopError::ExtraToken { token } => ParseError { - error: ParseErrorType::ExtraToken(token.1), - offset: token.0, - }, - LalrpopError::User { error } => ParseError { - offset: error.location(), - error: ParseErrorType::Lexical(error.into_error()), - }, - LalrpopError::UnrecognizedToken { token, expected } => { - // Hacky, but it's how CPython does it. See PyParser_AddToken, - // in particular "Only one possible expected token" comment. - let expected = (expected.len() == 1).then(|| expected[0].clone()); - ParseError { - error: ParseErrorType::UnrecognizedToken(token.1, expected), - offset: token.0, - } - } - LalrpopError::UnrecognizedEof { location, expected } => { - // This could be an initial indentation error that we should ignore - let indent_error = expected == ["Indent"]; - if indent_error { - ParseError { - error: ParseErrorType::Lexical(LexicalErrorType::IndentationError), - offset: location, - } - } else { - ParseError { - error: ParseErrorType::Eof, - offset: location, - } - } - } - } -} - -impl std::fmt::Display for ParseErrorType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match *self { - ParseErrorType::Eof => write!(f, "Got unexpected EOF"), - ParseErrorType::ExtraToken(ref tok) => write!(f, "Got extraneous token: {tok:?}"), - ParseErrorType::InvalidToken => write!(f, "Got invalid token"), - ParseErrorType::UnrecognizedToken(ref tok, ref expected) => { - if *tok == Tok::Indent { - write!(f, "unexpected indent") - } else if expected.as_deref() == Some("Indent") { - write!(f, "expected an indented block") - } else { - write!(f, "invalid syntax. Got unexpected token {tok}") - } - } - ParseErrorType::Lexical(ref error) => write!(f, "{error}"), - } - } -} - -impl ParseErrorType { - /// Returns true if the error is an indentation error. - pub fn is_indentation_error(&self) -> bool { - match self { - ParseErrorType::Lexical(LexicalErrorType::IndentationError) => true, - ParseErrorType::UnrecognizedToken(token, expected) => { - *token == Tok::Indent || expected.clone() == Some("Indent".to_owned()) - } - _ => false, - } - } - - /// Returns true if the error is a tab error. - pub fn is_tab_error(&self) -> bool { - matches!( - self, - ParseErrorType::Lexical(LexicalErrorType::TabError | LexicalErrorType::TabsAfterSpaces) - ) - } -} - -impl From for ParseError { - fn from(error: LexicalError) -> Self { - ParseError { - offset: error.location(), - error: ParseErrorType::Lexical(error.into_error()), - } - } -} - -/// An expression that may be parenthesized. -#[derive(Clone, Debug)] -pub(super) struct ParenthesizedExpr { - /// The range of the expression, including any parentheses. - pub(super) range: TextRange, - /// The underlying expression. - pub(super) expr: Expr, -} - -impl ParenthesizedExpr { - /// Returns `true` if the expression is parenthesized. - pub(super) fn is_parenthesized(&self) -> bool { - self.range.start() != self.expr.range().start() - } -} - -impl Ranged for ParenthesizedExpr { - fn range(&self) -> TextRange { - self.range - } -} -impl From for ParenthesizedExpr { - fn from(expr: Expr) -> Self { - ParenthesizedExpr { - range: expr.range(), - expr, - } - } -} -impl From for Expr { - fn from(parenthesized_expr: ParenthesizedExpr) -> Self { - parenthesized_expr.expr - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprIpyEscapeCommand) -> Self { - Expr::IpyEscapeCommand(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprBoolOp) -> Self { - Expr::BoolOp(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprNamed) -> Self { - Expr::Named(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprBinOp) -> Self { - Expr::BinOp(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprUnaryOp) -> Self { - Expr::UnaryOp(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprLambda) -> Self { - Expr::Lambda(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprIf) -> Self { - Expr::If(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprDict) -> Self { - Expr::Dict(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprSet) -> Self { - Expr::Set(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprListComp) -> Self { - Expr::ListComp(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprSetComp) -> Self { - Expr::SetComp(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprDictComp) -> Self { - Expr::DictComp(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprGenerator) -> Self { - Expr::Generator(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprAwait) -> Self { - Expr::Await(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprYield) -> Self { - Expr::Yield(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprYieldFrom) -> Self { - Expr::YieldFrom(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprCompare) -> Self { - Expr::Compare(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprCall) -> Self { - Expr::Call(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprFString) -> Self { - Expr::FString(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprStringLiteral) -> Self { - Expr::StringLiteral(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprBytesLiteral) -> Self { - Expr::BytesLiteral(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprNumberLiteral) -> Self { - Expr::NumberLiteral(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprBooleanLiteral) -> Self { - Expr::BooleanLiteral(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprNoneLiteral) -> Self { - Expr::NoneLiteral(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprEllipsisLiteral) -> Self { - Expr::EllipsisLiteral(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprAttribute) -> Self { - Expr::Attribute(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprSubscript) -> Self { - Expr::Subscript(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprStarred) -> Self { - Expr::Starred(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprName) -> Self { - Expr::Name(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprList) -> Self { - Expr::List(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprTuple) -> Self { - Expr::Tuple(payload).into() - } -} -impl From for ParenthesizedExpr { - fn from(payload: ExprSlice) -> Self { - Expr::Slice(payload).into() - } -} - -#[cfg(test)] -mod tests { - use insta::assert_debug_snapshot; - - use super::*; - - #[cfg(target_pointer_width = "64")] - #[test] - fn size_assertions() { - assert_eq!(std::mem::size_of::(), 72); - } - - #[test] - fn test_parse_empty() { - let parse_ast = parse_suite("").unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_string() { - let source = "'Hello world'"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_f_string() { - let source = "f'Hello world'"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_print_hello() { - let source = "print('Hello world')"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_print_2() { - let source = "print('Hello world', 2)"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_kwargs() { - let source = "my_func('positional', keyword=2)"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_if_elif_else() { - let source = "if 1: 10\nelif 2: 20\nelse: 30"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_lambda() { - let source = "lambda x, y: x * y"; // lambda(x, y): x * y"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_lambda_no_args() { - let source = "lambda: 1"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_tuples() { - let source = "a, b = 4, 5"; - - insta::assert_debug_snapshot!(parse_suite(source).unwrap()); - } - - #[test] - fn test_parse_class() { - let source = "\ -class Foo(A, B): - def __init__(self): - pass - def method_with_default(self, arg='default'): - pass -"; - insta::assert_debug_snapshot!(parse_suite(source).unwrap()); - } - - #[test] - fn test_parse_class_generic_types() { - let source = "\ -# TypeVar -class Foo[T](): ... - -# TypeVar with bound -class Foo[T: str](): ... - -# TypeVar with tuple bound -class Foo[T: (str, bytes)](): ... - -# Multiple TypeVar -class Foo[T, U](): ... - -# Trailing comma -class Foo[T, U,](): ... - -# TypeVarTuple -class Foo[*Ts](): ... - -# ParamSpec -class Foo[**P](): ... - -# Mixed types -class Foo[X, Y: str, *U, **P](): - pass -"; - insta::assert_debug_snapshot!(parse_suite(source).unwrap()); - } - #[test] - fn test_parse_function_definition() { - let source = "\ -def func(a): - ... - -def func[T](a: T) -> T: - ... - -def func[T: str](a: T) -> T: - ... - -def func[T: (str, bytes)](a: T) -> T: - ... - -def func[*Ts](*a: *Ts): - ... - -def func[**P](*args: P.args, **kwargs: P.kwargs): - ... - -def func[T, U: str, *Ts, **P](): - pass - "; - insta::assert_debug_snapshot!(parse_suite(source).unwrap()); - } - - #[test] - fn test_parse_dict_comprehension() { - let source = "{x1: x2 for y in z}"; - let parse_ast = parse_expression(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_list_comprehension() { - let source = "[x for y in z]"; - let parse_ast = parse_expression(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_double_list_comprehension() { - let source = "[x for y, y2 in z for a in b if a < 5 if a > 10]"; - let parse_ast = parse_expression(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_generator_comprehension() { - let source = "(x for y in z)"; - let parse_ast = parse_expression(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_named_expression_generator_comprehension() { - let source = "(x := y + 1 for y in z)"; - let parse_ast = parse_expression(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_if_else_generator_comprehension() { - let source = "(x if y else y for y in z)"; - let parse_ast = parse_expression(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_bool_op_or() { - let source = "x or y"; - let parse_ast = parse_expression(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_parse_bool_op_and() { - let source = "x and y"; - let parse_ast = parse_expression(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_slice() { - let source = "x[1:2:3]"; - let parse_ast = parse_expression(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_named_expression() { - let source = "(x := ( y * z ))"; - let parse_ast = parse_expression(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_with_statement() { - let source = "\ -with 0: pass -with 0 as x: pass -with 0, 1: pass -with 0 as x, 1 as y: pass -with 0 if 1 else 2: pass -with 0 if 1 else 2 as x: pass -with (): pass -with () as x: pass -with (0): pass -with (0) as x: pass -with (0,): pass -with (0,) as x: pass -with (0, 1): pass -with (0, 1) as x: pass -with (*a,): pass -with (*a,) as x: pass -with (0, *a): pass -with (0, *a) as x: pass -with (a := 0): pass -with (a := 0) as x: pass -with (a := 0, b := 1): pass -with (a := 0, b := 1) as x: pass -with (0 as a): pass -with (0 as a,): pass -with (0 as a, 1 as b): pass -with (0 as a, 1 as b,): pass -"; - insta::assert_debug_snapshot!(parse_suite(source).unwrap()); - } - - #[test] - fn test_parenthesized_with_statement() { - let source = "\ -with ((a), (b)): pass -with ((a), (b), c as d, (e)): pass -with (a, b): pass -with (a, b) as c: pass -with ((a, b) as c): pass -with (a as b): pass -with (a): pass -with (a := 0): pass -with (a := 0) as x: pass -with ((a)): pass -with ((a := 0)): pass -with (a as b, (a := 0)): pass -with (a, (a := 0)): pass -with (yield): pass -with (yield from a): pass -with ((yield)): pass -with ((yield from a)): pass -"; - insta::assert_debug_snapshot!(parse_suite(source).unwrap()); - } - - #[test] - fn test_with_statement_invalid() { - for source in [ - "with 0,: pass", - "with 0 as x,: pass", - "with 0 as *x: pass", - "with *a: pass", - "with *a as x: pass", - "with (*a): pass", - "with (*a) as x: pass", - "with *a, 0 as x: pass", - "with (*a, 0 as x): pass", - "with 0 as x, *a: pass", - "with (0 as x, *a): pass", - "with (0 as x) as y: pass", - "with (0 as x), 1: pass", - "with ((0 as x)): pass", - "with a := 0 as x: pass", - "with (a := 0 as x): pass", - ] { - assert!(parse_suite(source).is_err()); - } - } - - #[test] - fn test_star_index() { - let source = "\ -array_slice = array[0, *indexes, -1] -array[0, *indexes, -1] = array_slice -array[*indexes_to_select, *indexes_to_select] -array[3:5, *indexes_to_select] -"; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_generator_expression_argument() { - let source = r#"' '.join( - sql - for sql in ( - "LIMIT %d" % limit if limit else None, - ("OFFSET %d" % offset) if offset else None, - ) -)"#; - let parse_ast = parse_expression(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_try() { - let parse_ast = parse_suite( - r"try: - raise ValueError(1) -except TypeError as e: - print(f'caught {type(e)}') -except OSError as e: - print(f'caught {type(e)}')", - ) - .unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_try_star() { - let parse_ast = parse_suite( - r#"try: - raise ExceptionGroup("eg", - [ValueError(1), TypeError(2), OSError(3), OSError(4)]) -except* TypeError as e: - print(f'caught {type(e)} with nested {e.exceptions}') -except* OSError as e: - print(f'caught {type(e)} with nested {e.exceptions}')"#, - ) - .unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_dict_unpacking() { - let parse_ast = parse_expression(r#"{"a": "b", **c, "d": "e"}"#).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_modes() { - let source = "a[0][1][2][3][4]"; - - assert!(parse(source, Mode::Expression).is_ok()); - assert!(parse(source, Mode::Module).is_ok()); - } - - #[test] - fn test_parse_type_declaration() { - let source = r#" -type X = int -type X = int | str -type X = int | "ForwardRefY" -type X[T] = T | list[X[T]] # recursive -type X[T] = int -type X[T] = list[T] | set[T] -type X[T, *Ts, **P] = (T, Ts, P) -type X[T: int, *Ts, **P] = (T, Ts, P) -type X[T: (int, str), *Ts, **P] = (T, Ts, P) - -# soft keyword as alias name -type type = int -type match = int -type case = int - -# soft keyword as value -type foo = type -type foo = match -type foo = case - -# multine definitions -type \ - X = int -type X \ - = int -type X = \ - int -type X = ( - int -) -type \ - X[T] = T -type X \ - [T] = T -type X[T] \ - = T - -# simple statements -type X = int; type X = str; type X = type -class X: type X = int -"#; - insta::assert_debug_snapshot!(parse_suite(source).unwrap()); - } - - #[test] - fn test_type_as_identifier() { - let source = r"\ -type *a + b, c # ((type * a) + b), c -type *(a + b), c # (type * (a + b)), c -type (*a + b, c) # type ((*(a + b)), c) -type -a * b + c # (type - (a * b)) + c -type -(a * b) + c # (type - (a * b)) + c -type (-a) * b + c # (type (-(a * b))) + c -type ().a # (type()).a -type (()).a # (type(())).a -type ((),).a # (type(())).a -type [a].b # (type[a]).b -type [a,].b # (type[(a,)]).b (not (type[a]).b) -type [(a,)].b # (type[(a,)]).b -type()[a: - b] # (type())[a: b] -if type := 1: pass -type = lambda query: query == event -print(type(12)) -type(type) -a = ( - type in C -) -a = ( - type(b) -) -type ( - X = int -) -type = 1 -type = x = 1 -x = type = 1 -lambda x: type -"; - insta::assert_debug_snapshot!(parse_suite(source).unwrap()); - } - - #[test] - fn test_invalid_type() { - assert!(parse_suite("a: type X = int").is_err()); - assert!(parse_suite("lambda: type X = int").is_err()); - } - - #[test] - fn numeric_literals() { - let source = r"x = 123456789 -x = 123456 -x = .1 -x = 1. -x = 1E+1 -x = 1E-1 -x = 1.000_000_01 -x = 123456789.123456789 -x = 123456789.123456789E123456789 -x = 123456789E123456789 -x = 123456789J -x = 123456789.123456789J -x = 0XB1ACC -x = 0B1011 -x = 0O777 -x = 0.000000006 -x = 10000 -x = 133333 -"; - - insta::assert_debug_snapshot!(parse_suite(source).unwrap()); - } - - #[test] - fn numeric_literals_attribute_access() { - let source = r"x = .1.is_integer() -x = 1. .imag -x = 1E+1.imag -x = 1E-1.real -x = 123456789.123456789.hex() -x = 123456789.123456789E123456789 .real -x = 123456789E123456789 .conjugate() -x = 123456789J.real -x = 123456789.123456789J.__add__(0b1011.bit_length()) -x = 0XB1ACC.conjugate() -x = 0B1011 .conjugate() -x = 0O777 .real -x = 0.000000006 .hex() -x = -100.0000J - -if 10 .real: - ... - -y = 100[no] -y = 100(no) -"; - assert_debug_snapshot!(parse_suite(source).unwrap()); - } - - #[test] - fn test_match_as_identifier() { - let source = r"\ -match *a + b, c # ((match * a) + b), c -match *(a + b), c # (match * (a + b)), c -match (*a + b, c) # match ((*(a + b)), c) -match -a * b + c # (match - (a * b)) + c -match -(a * b) + c # (match - (a * b)) + c -match (-a) * b + c # (match (-(a * b))) + c -match ().a # (match()).a -match (()).a # (match(())).a -match ((),).a # (match(())).a -match [a].b # (match[a]).b -match [a,].b # (match[(a,)]).b (not (match[a]).b) -match [(a,)].b # (match[(a,)]).b -match()[a: - b] # (match())[a: b] -if match := 1: pass -match match: - case 1: pass - case 2: - pass -match = lambda query: query == event -print(match(12)) -"; - insta::assert_debug_snapshot!(parse_suite(source).unwrap()); - } - - #[test] - fn test_patma() { - let source = r#"# Cases sampled from Lib/test/test_patma.py - -# case test_patma_098 -match x: - case -0j: - y = 0 -# case test_patma_142 -match x: - case bytes(z): - y = 0 -# case test_patma_073 -match x: - case 0 if 0: - y = 0 - case 0 if 1: - y = 1 -# case test_patma_006 -match 3: - case 0 | 1 | 2 | 3: - x = True -# case test_patma_049 -match x: - case [0, 1] | [1, 0]: - y = 0 -# case black_check_sequence_then_mapping -match x: - case [*_]: - return "seq" - case {}: - return "map" -# case test_patma_035 -match x: - case {0: [1, 2, {}]}: - y = 0 - case {0: [1, 2, {}] | True} | {1: [[]]} | {0: [1, 2, {}]} | [] | "X" | {}: - y = 1 - case []: - y = 2 -# case test_patma_107 -match x: - case 0.25 + 1.75j: - y = 0 -# case test_patma_097 -match x: - case -0j: - y = 0 -# case test_patma_007 -match 4: - case 0 | 1 | 2 | 3: - x = True -# case test_patma_154 -match x: - case 0 if x: - y = 0 -# case test_patma_134 -match x: - case {1: 0}: - y = 0 - case {0: 0}: - y = 1 - case {**z}: - y = 2 -# case test_patma_185 -match Seq(): - case [*_]: - y = 0 -# case test_patma_063 -match x: - case 1: - y = 0 - case 1: - y = 1 -# case test_patma_248 -match x: - case {"foo": bar}: - y = bar -# case test_patma_019 -match (0, 1, 2): - case [0, 1, *x, 2]: - y = 0 -# case test_patma_052 -match x: - case [0]: - y = 0 - case [1, 0] if (x := x[:0]): - y = 1 - case [1, 0]: - y = 2 -# case test_patma_191 -match w: - case [x, y, *_]: - z = 0 -# case test_patma_110 -match x: - case -0.25 - 1.75j: - y = 0 -# case test_patma_151 -match (x,): - case [y]: - z = 0 -# case test_patma_114 -match x: - case A.B.C.D: - y = 0 -# case test_patma_232 -match x: - case None: - y = 0 -# case test_patma_058 -match x: - case 0: - y = 0 -# case test_patma_233 -match x: - case False: - y = 0 -# case test_patma_078 -match x: - case []: - y = 0 - case [""]: - y = 1 - case "": - y = 2 -# case test_patma_156 -match x: - case z: - y = 0 -# case test_patma_189 -match w: - case [x, y, *rest]: - z = 0 -# case test_patma_042 -match x: - case (0 as z) | (1 as z) | (2 as z) if z == x % 2: - y = 0 -# case test_patma_034 -match x: - case {0: [1, 2, {}]}: - y = 0 - case {0: [1, 2, {}] | False} | {1: [[]]} | {0: [1, 2, {}]} | [] | "X" | {}: - y = 1 - case []: - y = 2 -# case test_patma_123 -match (0, 1, 2): - case 0, *x: - y = 0 -# case test_patma_126 -match (0, 1, 2): - case *x, 2,: - y = 0 -# case test_patma_151 -match x,: - case y,: - z = 0 -# case test_patma_152 -match w, x: - case y, z: - v = 0 -# case test_patma_153 -match w := x,: - case y as v,: - z = 0 -"#; - let parse_ast = parse_suite(source).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_match() { - let parse_ast = parse_suite( - r#" -match {"test": 1}: - case { - **rest, - }: - print(rest) -match {"label": "test"}: - case { - "label": str() | None as label, - }: - print(label) -match x: - case [0, 1,]: - y = 0 -match x: - case (0, 1,): - y = 0 -match x: - case (0,): - y = 0 -match x,: - case z: - pass -match x, y: - case z: - pass -match x, y,: - case z: - pass -"#, - ) - .unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_match_pattern_fstring_literal() { - // F-string literal is not allowed in match pattern. - let parse_error = parse_suite( - r#" -match x: - case f"{y}": - pass -"#, - ) - .err(); - assert!( - parse_error.is_some(), - "expected parse error when f-string literal is used in match pattern" - ); - } - - #[test] - fn test_variadic_generics() { - let parse_ast = parse_suite( - r" -def args_to_tuple(*args: *Ts) -> Tuple[*Ts]: ... -", - ) - .unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn decorator_ranges() { - let parse_ast = parse_suite( - r" -@my_decorator -def test(): - pass - -@class_decorator -class Abcd: - pass -" - .trim(), - ) - .unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_ipython_escape_commands() { - let parse_ast = parse( - r" -# Normal Python code -( - a - % - b -) - -# Dynamic object info -??a.foo -?a.foo -?a.foo? -??a.foo()?? - -# Line magic -%timeit a = b -%timeit foo(b) % 3 -%alias showPath pwd && ls -a -%timeit a =\ - foo(b); b = 2 -%matplotlib --inline -%matplotlib \ - --inline - -# System shell access -!pwd && ls -a | sed 's/^/\ /' -!pwd \ - && ls -a | sed 's/^/\\ /' -!!cd /Users/foo/Library/Application\ Support/ - -# Let's add some Python code to make sure that earlier escapes were handled -# correctly and that we didn't consume any of the following code as a result -# of the escapes. -def foo(): - return ( - a - != - b - ) - -# Transforms into `foo(..)` -/foo 1 2 -;foo 1 2 -,foo 1 2 - -# Indented escape commands -for a in range(5): - !ls - -p1 = !pwd -p2: str = !pwd -foo = %foo \ - bar - -% foo -foo = %foo # comment - -# Help end line magics -foo? -foo.bar?? -foo.bar.baz? -foo[0]?? -foo[0][1]? -foo.bar[0].baz[1]?? -foo.bar[0].baz[2].egg?? -" - .trim(), - Mode::Ipython, - ) - .unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_ipython_escape_command_parse_error() { - let source = r" -a = 1 -%timeit a == 1 - " - .trim(); - let lxr = lexer::lex_starts_at(source, Mode::Ipython, TextSize::default()); - let parse_err = parse_tokens(lxr.collect(), source, Mode::Module).unwrap_err(); - assert_eq!( - parse_err.to_string(), - "IPython escape commands are only allowed in `Mode::Ipython` at byte offset 6" - .to_string() - ); - } - - #[test] - fn test_fstrings() { - let parse_ast = parse_suite( - r#" -f"{" f"}" -f"{foo!s}" -f"{3,}" -f"{3!=4:}" -f'{3:{"}"}>10}' -f'{3:{"{"}>10}' -f"{ foo = }" -f"{ foo = :.3f }" -f"{ foo = !s }" -f"{ 1, 2 = }" -f'{f"{3.1415=:.1f}":*^20}' - -{"foo " f"bar {x + y} " "baz": 10} -match foo: - case "one": - pass - case "implicitly " "concatenated": - pass - -f"\{foo}\{bar:\}" -f"\\{{foo\\}}" -f"""{ - foo:x - y - z -}""" -f"{ ( foo ) = }" -"# - .trim(), - ) - .unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_fstrings_with_unicode() { - let parse_ast = parse_suite( - r#" -u"foo" f"{bar}" "baz" " some" -"foo" f"{bar}" u"baz" " some" -"foo" f"{bar}" "baz" u" some" -u"foo" f"bar {baz} really" u"bar" "no" -"# - .trim(), - ) - .unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_unicode_aliases() { - // https://github.com/RustPython/RustPython/issues/4566 - let parse_ast = parse_suite(r#"x = "\N{BACKSPACE}another cool trick""#).unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } - - #[test] - fn test_tuple() { - let parse_ast = parse_suite( - r#" -a,b -(a,b) -() -(a,) -((a,b)) -"# - .trim(), - ) - .unwrap(); - insta::assert_debug_snapshot!(parse_ast); - } -} diff --git a/crates/ruff_python_parser/src/parser/expression.rs b/crates/ruff_python_parser/src/parser/expression.rs new file mode 100644 index 0000000000..4bc07ac01e --- /dev/null +++ b/crates/ruff_python_parser/src/parser/expression.rs @@ -0,0 +1,2589 @@ +use std::cmp::Ordering; +use std::hash::BuildHasherDefault; +use std::ops::Deref; + +use rustc_hash::FxHashSet; + +use ruff_python_ast::{ + self as ast, BoolOp, CmpOp, ConversionFlag, Expr, ExprContext, FStringElement, IpyEscapeKind, + Number, Operator, UnaryOp, +}; +use ruff_text_size::{Ranged, TextLen, TextRange, TextSize}; + +use crate::parser::helpers::token_kind_to_cmp_op; +use crate::parser::progress::ParserProgress; +use crate::parser::{helpers, FunctionKind, Parser, ParserCtxFlags}; +use crate::string::{parse_fstring_literal_element, parse_string_literal, StringType}; +use crate::token_set::TokenSet; +use crate::{FStringErrorType, Mode, ParseErrorType, Tok, TokenKind}; + +use super::{Parenthesized, RecoveryContextKind}; + +/// A token set consisting of a newline or end of file. +const NEWLINE_EOF_SET: TokenSet = TokenSet::new([TokenKind::Newline, TokenKind::EndOfFile]); + +/// Tokens that represents a literal expression. +const LITERAL_SET: TokenSet = TokenSet::new([ + TokenKind::Int, + TokenKind::Float, + TokenKind::Complex, + TokenKind::String, + TokenKind::Ellipsis, + TokenKind::True, + TokenKind::False, + TokenKind::None, +]); + +/// Tokens that represents either an expression or the start of one. +pub(super) const EXPR_SET: TokenSet = TokenSet::new([ + TokenKind::Name, + TokenKind::Minus, + TokenKind::Plus, + TokenKind::Tilde, + TokenKind::Star, + TokenKind::DoubleStar, + TokenKind::Lpar, + TokenKind::Lbrace, + TokenKind::Lsqb, + TokenKind::Lambda, + TokenKind::Await, + TokenKind::Not, + TokenKind::Yield, + TokenKind::FStringStart, + TokenKind::IpyEscapeCommand, +]) +.union(LITERAL_SET); + +/// Tokens that can appear after an expression. +pub(super) const END_EXPR_SET: TokenSet = TokenSet::new([ + // Ex) `expr` (without a newline) + TokenKind::EndOfFile, + // Ex) `expr` + TokenKind::Newline, + // Ex) `expr;` + TokenKind::Semi, + // Ex) `data[expr:]` + // Ex) `def foo() -> expr:` + // Ex) `{expr: expr}` + TokenKind::Colon, + // Ex) `{expr}` + TokenKind::Rbrace, + // Ex) `[expr]` + TokenKind::Rsqb, + // Ex) `(expr)` + TokenKind::Rpar, + // Ex) `expr,` + TokenKind::Comma, + // Ex) + // + // if True: + // expr + // # <- Dedent + // x + TokenKind::Dedent, + // Ex) `expr if expr else expr` + TokenKind::If, + TokenKind::Else, + // Ex) `with expr as target:` + // Ex) `except expr as NAME:` + TokenKind::As, + // Ex) `raise expr from expr` + TokenKind::From, + // Ex) `[expr for expr in iter]` + TokenKind::For, + // Ex) `[expr async for expr in iter]` + TokenKind::Async, + // Ex) `expr in expr` + TokenKind::In, + // Ex) `name: expr = expr` + // Ex) `f"{expr=}"` + TokenKind::Equal, + // Ex) `f"{expr!s}"` + TokenKind::Exclamation, +]); + +/// Tokens that can appear at the end of a sequence. +const END_SEQUENCE_SET: TokenSet = END_EXPR_SET.remove(TokenKind::Comma); + +impl<'src> Parser<'src> { + /// Returns `true` if the current token is the start of an expression. + pub(super) fn at_expr(&self) -> bool { + self.at_ts(EXPR_SET) + } + + /// Returns `true` if the current token ends a sequence. + pub(super) fn at_sequence_end(&self) -> bool { + self.at_ts(END_SEQUENCE_SET) + } + + /// Parses every Python expression. + /// + /// Matches the `expressions` rule in the [Python grammar]. + /// + /// The caller can specify whether starred expression is allowed or not. This + /// doesn't affect the parsing of a starred expression as it will be parsed + /// nevertheless. But, if it is not allowed, an error is reported. + /// + /// Use [`Parser::parse_star_expression_list`] if the starred expression is + /// required with a bitwise OR precedence. + /// + /// [Python grammar]: https://docs.python.org/3/reference/grammar.html + pub(super) fn parse_expression_list( + &mut self, + allow_starred_expression: AllowStarredExpression, + ) -> ParsedExpr { + let start = self.node_start(); + let parsed_expr = self.parse_conditional_expression_or_higher(allow_starred_expression); + + if self.at(TokenKind::Comma) { + Expr::Tuple(self.parse_tuple_expression( + parsed_expr.expr, + start, + Parenthesized::No, + |p| p.parse_conditional_expression_or_higher(allow_starred_expression), + )) + .into() + } else { + parsed_expr + } + } + + /// Parses every Python expression. + /// + /// Matches the `star_expressions` rule in the [Python grammar]. + /// + /// [Python grammar]: https://docs.python.org/3/reference/grammar.html + pub(super) fn parse_star_expression_list(&mut self) -> ParsedExpr { + let start = self.node_start(); + let parsed_expr = self.parse_star_expression_or_higher(AllowNamedExpression::No); + + if self.at(TokenKind::Comma) { + Expr::Tuple(self.parse_tuple_expression( + parsed_expr.expr, + start, + Parenthesized::No, + |parser| parser.parse_star_expression_or_higher(AllowNamedExpression::No), + )) + .into() + } else { + parsed_expr + } + } + + /// Parses a star expression or any other expression. + /// + /// Matches either the `star_named_expression` or `star_expression` rule in + /// the [Python grammar] depending on whether named expressions are allowed + /// or not respectively. + /// + /// NOTE: If you have expressions separated by commas and want to parse them + /// individually instead of as a tuple, as done by [`Parser::parse_star_expression_list`], + /// use this function. + /// + /// [Python grammar]: https://docs.python.org/3/reference/grammar.html + pub(super) fn parse_star_expression_or_higher( + &mut self, + allow_named_expression: AllowNamedExpression, + ) -> ParsedExpr { + // This method parses starred expression with a different precedence, + // so don't allow starred expression in other branches. + if self.at(TokenKind::Star) { + Expr::Starred(self.parse_starred_expression(StarredExpressionPrecedence::BitOr)).into() + } else if allow_named_expression.is_yes() { + self.parse_named_expression_or_higher(AllowStarredExpression::No) + } else { + self.parse_conditional_expression_or_higher(AllowStarredExpression::No) + } + } + + /// Parses every Python expression except unparenthesized tuple. + /// + /// Matches the `named_expression` rule in the [Python grammar]. + /// + /// The caller can specify whether starred expression is allowed or not. This + /// doesn't affect the parsing of a starred expression as it will be parsed + /// nevertheless. But, if it is not allowed, an error is reported. + /// + /// Use [`Parser::parse_star_expression_or_higher`] with [`AllowNamedExpression::Yes`] + /// if the starred expression is required with a bitwise OR precedence. + /// + /// NOTE: If you have expressions separated by commas and want to parse them + /// individually instead of as a tuple, as done by [`Parser::parse_expression_list`] + /// use this function! + /// + /// [Python grammar]: https://docs.python.org/3/reference/grammar.html + pub(super) fn parse_named_expression_or_higher( + &mut self, + allow_starred_expression: AllowStarredExpression, + ) -> ParsedExpr { + let start = self.node_start(); + let parsed_expr = self.parse_conditional_expression_or_higher(allow_starred_expression); + + if self.at(TokenKind::ColonEqual) { + Expr::Named(self.parse_named_expression(parsed_expr.expr, start)).into() + } else { + parsed_expr + } + } + + /// Parses every Python expression except unparenthesized tuple and named expressions. + /// + /// Matches the `expression` rule in the [Python grammar]. + /// + /// The caller can specify whether starred expression is allowed or not. This + /// doesn't affect the parsing of a starred expression as it will be parsed + /// nevertheless. But, if it is not allowed, an error is reported. + /// + /// Use [`Parser::parse_star_expression_or_higher`] with [`AllowNamedExpression::No`] + /// if the starred expression is required with a bitwise OR precedence. + /// + /// NOTE: If you have expressions separated by commas and want to parse them + /// individually instead of as a tuple, as done by [`Parser::parse_expression_list`] + /// use this function! + /// + /// [Python grammar]: https://docs.python.org/3/reference/grammar.html + pub(super) fn parse_conditional_expression_or_higher( + &mut self, + allow_starred_expression: AllowStarredExpression, + ) -> ParsedExpr { + if self.at(TokenKind::Lambda) { + Expr::Lambda(self.parse_lambda_expr()).into() + } else { + let start = self.node_start(); + let parsed_expr = self.parse_simple_expression(allow_starred_expression); + + if self.at(TokenKind::If) { + Expr::If(self.parse_if_expression(parsed_expr.expr, start)).into() + } else { + parsed_expr + } + } + } + + /// Parses every Python expression except unparenthesized tuples, named expressions, + /// and `if` expression. + /// + /// This is a combination of the `disjunction`, `starred_expression`, `yield_expr` + /// and `lambdef` rules of the [Python grammar]. + /// + /// Note that this function parses yield and lambda expression but reports an error + /// as they're not allowed in this context. This is done for better error recovery. + /// Use [`Parser::parse_yield_expression_or_else`] to allow parsing yield expression. + /// Use [`Parser::parse_conditional_expression_or_higher`] or any methods which calls + /// into the specified method to allow parsing lambda expression. + /// + /// The caller can specify whether starred expression is allowed or not. This + /// doesn't affect the parsing of a starred expression as it will be parsed + /// nevertheless. But, if it is not allowed, an error is reported. + /// + /// [Python grammar]: https://docs.python.org/3/reference/grammar.html + fn parse_simple_expression( + &mut self, + allow_starred_expression: AllowStarredExpression, + ) -> ParsedExpr { + let parsed_expr = self.parse_expression_with_precedence(Precedence::Initial); + + if allow_starred_expression.is_no() && parsed_expr.is_unparenthesized_starred_expr() { + self.add_error(ParseErrorType::InvalidStarredExpressionUsage, &parsed_expr); + } + + parsed_expr + } + + /// Returns the binding power of the current token for a Pratt parser. + /// + /// This includes the precedence and associativity of the current token. + /// If the current token is not an operator, it returns [`Precedence::Unknown`], + /// [`TokenKind::Unknown`], and [`Associativity::Left`] respectively. + /// + /// See: + fn current_binding_power(&mut self) -> (Precedence, TokenKind, Associativity) { + const NOT_AN_OPERATOR: (Precedence, TokenKind, Associativity) = + (Precedence::Unknown, TokenKind::Unknown, Associativity::Left); + + let kind = self.current_token_kind(); + + match kind { + TokenKind::Or => (Precedence::Or, kind, Associativity::Left), + TokenKind::And => (Precedence::And, kind, Associativity::Left), + TokenKind::Not if self.peek() == TokenKind::In => ( + Precedence::ComparisonsMembershipIdentity, + kind, + Associativity::Left, + ), + TokenKind::Is + | TokenKind::In + | TokenKind::EqEqual + | TokenKind::NotEqual + | TokenKind::Less + | TokenKind::LessEqual + | TokenKind::Greater + | TokenKind::GreaterEqual => ( + Precedence::ComparisonsMembershipIdentity, + kind, + Associativity::Left, + ), + TokenKind::Vbar => (Precedence::BitOr, kind, Associativity::Left), + TokenKind::CircumFlex => (Precedence::BitXor, kind, Associativity::Left), + TokenKind::Amper => (Precedence::BitAnd, kind, Associativity::Left), + TokenKind::LeftShift | TokenKind::RightShift => { + (Precedence::LeftRightShift, kind, Associativity::Left) + } + TokenKind::Plus | TokenKind::Minus => (Precedence::AddSub, kind, Associativity::Left), + TokenKind::Star + | TokenKind::Slash + | TokenKind::DoubleSlash + | TokenKind::Percent + | TokenKind::At => (Precedence::MulDivRemain, kind, Associativity::Left), + TokenKind::DoubleStar => (Precedence::Exponent, kind, Associativity::Right), + _ => NOT_AN_OPERATOR, + } + } + + /// Parses an expression with binding power of at least `previous_precedence`. + /// + /// This method uses the [Pratt parsing algorithm]. + /// + /// [Pratt parsing algorithm]: https://matklad.github.io/2020/04/13/simple-but-powerful-pratt-parsing.html + fn parse_expression_with_precedence(&mut self, previous_precedence: Precedence) -> ParsedExpr { + let start = self.node_start(); + let mut lhs = self.parse_lhs_expression(previous_precedence); + + let mut progress = ParserProgress::default(); + + loop { + progress.assert_progressing(self); + + let (current_precedence, token, associativity) = self.current_binding_power(); + if current_precedence < previous_precedence { + break; + } + + // Don't parse a `CompareExpr` if we are parsing a `Comprehension` or `ForStmt` + if token.is_compare_operator() && self.has_ctx(ParserCtxFlags::FOR_TARGET) { + break; + } + + let operator_binding_power = match associativity { + Associativity::Left => current_precedence.increment_precedence(), + Associativity::Right => current_precedence, + }; + + self.bump(token); + + // We need to create a dedicated node for boolean operations and + // comparison operations even though they are infix operators. + if token.is_bool_operator() { + lhs = Expr::BoolOp(self.parse_bool_operation_expression( + lhs.expr, + start, + token, + operator_binding_power, + )) + .into(); + continue; + } else if token.is_compare_operator() { + lhs = Expr::Compare(self.parse_compare_expression( + lhs.expr, + start, + token, + operator_binding_power, + )) + .into(); + continue; + } + + let rhs = self.parse_expression_with_precedence(operator_binding_power); + + lhs.expr = Expr::BinOp(ast::ExprBinOp { + left: Box::new(lhs.expr), + op: Operator::try_from(token).unwrap(), + right: Box::new(rhs.expr), + range: self.node_range(start), + }); + } + + lhs + } + + /// Parses the left-hand side of an expression. + /// + /// This includes prefix expressions such as unary operators, boolean `not`, + /// `await`, `lambda`. It also parses atoms and postfix expressions. + /// + /// The given [`Precedence`] is used to determine if the parsed expression + /// is valid in that context. For example, a unary operator is not valid + /// in an `await` expression in which case the `previous_precedence` would + /// be [`Precedence::Await`]. + fn parse_lhs_expression(&mut self, previous_precedence: Precedence) -> ParsedExpr { + let start = self.node_start(); + + let lhs = match self.current_token_kind() { + unary_tok @ (TokenKind::Plus | TokenKind::Minus | TokenKind::Tilde) => { + let unary_expr = self.parse_unary_expression(); + if previous_precedence > Precedence::PosNegBitNot + // > The power operator `**` binds less tightly than an arithmetic + // > or bitwise unary operator on its right, that is, 2**-1 is 0.5. + // + // Reference: https://docs.python.org/3/reference/expressions.html#id21 + && previous_precedence != Precedence::Exponent + { + self.add_error( + ParseErrorType::OtherError(format!( + "Unary {unary_tok} expression cannot be used here", + )), + &unary_expr, + ); + } + Expr::UnaryOp(unary_expr).into() + } + TokenKind::Not => { + let unary_expr = self.parse_unary_expression(); + if previous_precedence > Precedence::Not { + self.add_error( + ParseErrorType::OtherError( + "Boolean 'not' expression cannot be used here".to_string(), + ), + &unary_expr, + ); + } + Expr::UnaryOp(unary_expr).into() + } + TokenKind::Star => { + let starred_expr = + self.parse_starred_expression(StarredExpressionPrecedence::Conditional); + if previous_precedence > Precedence::Initial { + self.add_error(ParseErrorType::InvalidStarredExpressionUsage, &starred_expr); + } + Expr::Starred(starred_expr).into() + } + TokenKind::Await => { + let await_expr = self.parse_await_expression(); + // `await` expressions cannot be nested + if previous_precedence >= Precedence::Await { + self.add_error( + ParseErrorType::OtherError( + "Await expression cannot be used here".to_string(), + ), + &await_expr, + ); + } + Expr::Await(await_expr).into() + } + TokenKind::Lambda => { + // Lambda expression isn't allowed in this context but we'll still + // parse it and report an error for better recovery. + let lambda_expr = self.parse_lambda_expr(); + self.add_error(ParseErrorType::InvalidLambdaExpressionUsage, &lambda_expr); + Expr::Lambda(lambda_expr).into() + } + TokenKind::Yield => { + // Yield expressions aren't allowed in this context but we'll still + // parse it and report an error for better recovery. + let expr = self.parse_yield_expression(); + self.add_error(ParseErrorType::InvalidYieldExpressionUsage, &expr); + expr.into() + } + _ => self.parse_atom(), + }; + + ParsedExpr { + expr: self.parse_postfix_expression(lhs.expr, start), + is_parenthesized: lhs.is_parenthesized, + } + } + + /// Parses an expression with a minimum precedence of bitwise `or`. + /// + /// This methods actually parses the expression using the `expression` rule + /// of the [Python grammar] and then validates the parsed expression. In a + /// sense, it matches the `bitwise_or` rule of the [Python grammar]. + /// + /// [Python grammar]: https://docs.python.org/3/reference/grammar.html + fn parse_expression_with_bitwise_or_precedence(&mut self) -> ParsedExpr { + let parsed_expr = self.parse_conditional_expression_or_higher(AllowStarredExpression::No); + + if parsed_expr.is_parenthesized { + // Parentheses resets the precedence, so we don't need to validate it. + return parsed_expr; + } + + let expr_name = match parsed_expr.expr { + Expr::Compare(_) => "Comparison", + Expr::BoolOp(_) + | Expr::UnaryOp(ast::ExprUnaryOp { + op: ast::UnaryOp::Not, + .. + }) => "Boolean", + Expr::If(_) => "Conditional", + Expr::Lambda(_) => "Lambda", + _ => return parsed_expr, + }; + + self.add_error( + ParseErrorType::OtherError(format!("{expr_name} expression cannot be used here")), + &parsed_expr, + ); + + parsed_expr + } + + /// Parses a name. + /// + /// For an invalid name, the `id` field will be an empty string and the `ctx` + /// field will be [`ExprContext::Invalid`]. + /// + /// See: + pub(super) fn parse_name(&mut self) -> ast::ExprName { + let identifier = self.parse_identifier(); + + let ctx = if identifier.is_valid() { + ExprContext::Load + } else { + ExprContext::Invalid + }; + + ast::ExprName { + range: identifier.range, + id: identifier.id, + ctx, + } + } + + /// Parses an identifier. + /// + /// For an invalid identifier, the `id` field will be an empty string. + /// + /// See: + pub(super) fn parse_identifier(&mut self) -> ast::Identifier { + let range = self.current_token_range(); + + if self.at(TokenKind::Name) { + let (Tok::Name { name }, _) = self.bump(TokenKind::Name) else { + unreachable!(); + }; + ast::Identifier { + id: name.to_string(), + range, + } + } else { + if self.current_token_kind().is_keyword() { + let (tok, range) = self.next_token(); + self.add_error( + ParseErrorType::OtherError(format!( + "Expected an identifier, but found a keyword '{tok}' that cannot be used here" + )), + range, + ); + + ast::Identifier { + id: tok.to_string(), + range, + } + } else { + self.add_error( + ParseErrorType::OtherError("Expected an identifier".into()), + range, + ); + ast::Identifier { + id: String::new(), + range: self.missing_node_range(), + } + } + } + } + + /// Parses an atom. + /// + /// See: + fn parse_atom(&mut self) -> ParsedExpr { + let start = self.node_start(); + + let lhs = match self.current_token_kind() { + TokenKind::Float => { + let (Tok::Float { value }, _) = self.bump(TokenKind::Float) else { + unreachable!() + }; + + Expr::NumberLiteral(ast::ExprNumberLiteral { + value: Number::Float(value), + range: self.node_range(start), + }) + } + TokenKind::Complex => { + let (Tok::Complex { real, imag }, _) = self.bump(TokenKind::Complex) else { + unreachable!() + }; + Expr::NumberLiteral(ast::ExprNumberLiteral { + value: Number::Complex { real, imag }, + range: self.node_range(start), + }) + } + TokenKind::Int => { + let (Tok::Int { value }, _) = self.bump(TokenKind::Int) else { + unreachable!() + }; + Expr::NumberLiteral(ast::ExprNumberLiteral { + value: Number::Int(value), + range: self.node_range(start), + }) + } + TokenKind::True => { + self.bump(TokenKind::True); + Expr::BooleanLiteral(ast::ExprBooleanLiteral { + value: true, + range: self.node_range(start), + }) + } + TokenKind::False => { + self.bump(TokenKind::False); + Expr::BooleanLiteral(ast::ExprBooleanLiteral { + value: false, + range: self.node_range(start), + }) + } + TokenKind::None => { + self.bump(TokenKind::None); + Expr::NoneLiteral(ast::ExprNoneLiteral { + range: self.node_range(start), + }) + } + TokenKind::Ellipsis => { + self.bump(TokenKind::Ellipsis); + Expr::EllipsisLiteral(ast::ExprEllipsisLiteral { + range: self.node_range(start), + }) + } + TokenKind::Name => Expr::Name(self.parse_name()), + TokenKind::IpyEscapeCommand => { + Expr::IpyEscapeCommand(self.parse_ipython_escape_command_expression()) + } + TokenKind::String | TokenKind::FStringStart => self.parse_strings(), + TokenKind::Lpar => { + return self.parse_parenthesized_expression(); + } + TokenKind::Lsqb => self.parse_list_like_expression(), + TokenKind::Lbrace => self.parse_set_or_dict_like_expression(), + + kind => { + if kind.is_keyword() { + Expr::Name(self.parse_name()) + } else { + self.add_error( + ParseErrorType::ExpectedExpression, + self.current_token_range(), + ); + Expr::Name(ast::ExprName { + range: self.missing_node_range(), + id: String::new(), + ctx: ExprContext::Invalid, + }) + } + } + }; + + lhs.into() + } + + /// Parses a postfix expression in a loop until there are no postfix expressions left to parse. + /// + /// For a given left-hand side, a postfix expression can begin with either `(` for a call + /// expression, `[` for a subscript expression, or `.` for an attribute expression. + /// + /// This method does nothing if the current token is not a candidate for a postfix expression. + pub(super) fn parse_postfix_expression(&mut self, mut lhs: Expr, start: TextSize) -> Expr { + loop { + lhs = match self.current_token_kind() { + TokenKind::Lpar => Expr::Call(self.parse_call_expression(lhs, start)), + TokenKind::Lsqb => Expr::Subscript(self.parse_subscript_expression(lhs, start)), + TokenKind::Dot => Expr::Attribute(self.parse_attribute_expression(lhs, start)), + _ => break lhs, + }; + } + } + + /// Parse a call expression. + /// + /// The function name is parsed by the caller and passed as `func` along with + /// the `start` position of the call expression. + /// + /// # Panics + /// + /// If the parser isn't position at a `(` token. + /// + /// See: + fn parse_call_expression(&mut self, func: Expr, start: TextSize) -> ast::ExprCall { + let arguments = self.parse_arguments(); + + ast::ExprCall { + func: Box::new(func), + arguments, + range: self.node_range(start), + } + } + + /// Parses an argument list. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `(` token. + /// + /// See: + pub(super) fn parse_arguments(&mut self) -> ast::Arguments { + let start = self.node_start(); + self.bump(TokenKind::Lpar); + + let mut args = vec![]; + let mut keywords = vec![]; + let mut seen_keyword_argument = false; // foo = 1 + let mut seen_keyword_unpacking = false; // **foo + + self.parse_comma_separated_list(RecoveryContextKind::Arguments, |parser| { + let argument_start = parser.node_start(); + if parser.eat(TokenKind::DoubleStar) { + let value = + parser.parse_conditional_expression_or_higher(AllowStarredExpression::No); + + keywords.push(ast::Keyword { + arg: None, + value: value.expr, + range: parser.node_range(argument_start), + }); + + seen_keyword_unpacking = true; + } else { + let start = parser.node_start(); + let mut parsed_expr = + parser.parse_named_expression_or_higher(AllowStarredExpression::Yes); + + match parser.current_token_kind() { + TokenKind::Async | TokenKind::For => { + if parsed_expr.is_unparenthesized_starred_expr() { + parser.add_error( + ParseErrorType::IterableUnpackingInComprehension, + &parsed_expr, + ); + } + + parsed_expr = Expr::Generator(parser.parse_generator_expression( + parsed_expr.expr, + GeneratorExpressionInParentheses::No(start), + )) + .into(); + } + _ => { + if seen_keyword_unpacking && parsed_expr.is_unparenthesized_starred_expr() { + parser.add_error( + ParseErrorType::InvalidArgumentUnpackingOrder, + &parsed_expr, + ); + } + } + } + + if parser.eat(TokenKind::Equal) { + seen_keyword_argument = true; + let arg = if let Expr::Name(ident_expr) = parsed_expr.expr { + ast::Identifier { + id: ident_expr.id, + range: ident_expr.range, + } + } else { + // TODO(dhruvmanila): Parser shouldn't drop the `parsed_expr` if it's + // not a name expression. We could add the expression into `args` but + // that means the error is a missing comma instead. + parser.add_error( + ParseErrorType::OtherError("Expected a parameter name".to_string()), + &parsed_expr, + ); + ast::Identifier { + id: String::new(), + range: parsed_expr.range(), + } + }; + + let value = + parser.parse_conditional_expression_or_higher(AllowStarredExpression::No); + + keywords.push(ast::Keyword { + arg: Some(arg), + value: value.expr, + range: parser.node_range(argument_start), + }); + } else { + if !parsed_expr.is_unparenthesized_starred_expr() { + if seen_keyword_unpacking { + parser.add_error( + ParseErrorType::PositionalAfterKeywordUnpacking, + &parsed_expr, + ); + } else if seen_keyword_argument { + parser.add_error( + ParseErrorType::PositionalAfterKeywordArgument, + &parsed_expr, + ); + } + } + args.push(parsed_expr.expr); + } + } + }); + + self.expect(TokenKind::Rpar); + + let arguments = ast::Arguments { + range: self.node_range(start), + args: args.into_boxed_slice(), + keywords: keywords.into_boxed_slice(), + }; + + self.validate_arguments(&arguments); + + arguments + } + + /// Parses a subscript expression. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `[` token. + /// + /// See: + fn parse_subscript_expression( + &mut self, + mut value: Expr, + start: TextSize, + ) -> ast::ExprSubscript { + self.bump(TokenKind::Lsqb); + + // To prevent the `value` context from being `Del` within a `del` statement, + // we set the context as `Load` here. + helpers::set_expr_ctx(&mut value, ExprContext::Load); + + // Slice range doesn't include the `[` token. + let slice_start = self.node_start(); + + // Create an error when receiving an empty slice to parse, e.g. `x[]` + if self.eat(TokenKind::Rsqb) { + let slice_range = self.node_range(slice_start); + self.add_error(ParseErrorType::EmptySlice, slice_range); + + return ast::ExprSubscript { + value: Box::new(value), + slice: Box::new(Expr::Name(ast::ExprName { + range: slice_range, + id: String::new(), + ctx: ExprContext::Invalid, + })), + ctx: ExprContext::Load, + range: self.node_range(start), + }; + } + + let mut slice = self.parse_slice(); + + // If there are more than one element in the slice, we need to create a tuple + // expression to represent it. + if self.eat(TokenKind::Comma) { + let mut slices = vec![slice]; + + self.parse_comma_separated_list(RecoveryContextKind::Slices, |parser| { + slices.push(parser.parse_slice()); + }); + + slice = Expr::Tuple(ast::ExprTuple { + elts: slices, + ctx: ExprContext::Load, + range: self.node_range(slice_start), + parenthesized: false, + }); + } else if slice.is_starred_expr() { + // If the only slice element is a starred expression, that is represented + // using a tuple expression with a single element. This is the second case + // in the `slices` rule in the Python grammar. + slice = Expr::Tuple(ast::ExprTuple { + elts: vec![slice], + ctx: ExprContext::Load, + range: self.node_range(slice_start), + parenthesized: false, + }); + } + + self.expect(TokenKind::Rsqb); + + ast::ExprSubscript { + value: Box::new(value), + slice: Box::new(slice), + ctx: ExprContext::Load, + range: self.node_range(start), + } + } + + /// Parses a slice expression. + /// + /// See: + fn parse_slice(&mut self) -> Expr { + const UPPER_END_SET: TokenSet = + TokenSet::new([TokenKind::Comma, TokenKind::Colon, TokenKind::Rsqb]) + .union(NEWLINE_EOF_SET); + const STEP_END_SET: TokenSet = + TokenSet::new([TokenKind::Comma, TokenKind::Rsqb]).union(NEWLINE_EOF_SET); + + let start = self.node_start(); + + let lower = if self.at_expr() { + let lower = self.parse_named_expression_or_higher(AllowStarredExpression::Yes); + if self.at_ts(NEWLINE_EOF_SET.union([TokenKind::Rsqb, TokenKind::Comma].into())) { + return lower.expr; + } + + if !lower.is_parenthesized { + match lower.expr { + Expr::Starred(_) => { + self.add_error(ParseErrorType::InvalidStarredExpressionUsage, &lower); + } + Expr::Named(_) => { + self.add_error(ParseErrorType::UnparenthesizedNamedExpression, &lower); + } + _ => {} + } + } + + Some(lower.expr) + } else { + None + }; + + self.expect(TokenKind::Colon); + + let lower = lower.map(Box::new); + let upper = if self.at_ts(UPPER_END_SET) { + None + } else { + Some(Box::new( + self.parse_conditional_expression_or_higher(AllowStarredExpression::No) + .expr, + )) + }; + + let step = if self.eat(TokenKind::Colon) { + if self.at_ts(STEP_END_SET) { + None + } else { + Some(Box::new( + self.parse_conditional_expression_or_higher(AllowStarredExpression::No) + .expr, + )) + } + } else { + None + }; + + Expr::Slice(ast::ExprSlice { + range: self.node_range(start), + lower, + upper, + step, + }) + } + + /// Parses a unary expression. + /// + /// This includes the unary arithmetic `+` and `-`, bitwise `~`, and the + /// boolean `not` operators. + /// + /// # Panics + /// + /// If the parser isn't positioned at any of the unary operators. + /// + /// See: + pub(super) fn parse_unary_expression(&mut self) -> ast::ExprUnaryOp { + let start = self.node_start(); + + let op = UnaryOp::try_from(self.current_token_kind()) + .expect("current token should be a unary operator"); + self.bump(self.current_token_kind()); + + let operand = if op.is_not() { + self.parse_expression_with_precedence(Precedence::Not) + } else { + // plus, minus and tilde + self.parse_expression_with_precedence(Precedence::PosNegBitNot) + }; + + ast::ExprUnaryOp { + op, + operand: Box::new(operand.expr), + range: self.node_range(start), + } + } + + /// Parses an attribute expression. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `.` token. + /// + /// See: + pub(super) fn parse_attribute_expression( + &mut self, + value: Expr, + start: TextSize, + ) -> ast::ExprAttribute { + self.bump(TokenKind::Dot); + + let attr = self.parse_identifier(); + + ast::ExprAttribute { + value: Box::new(value), + attr, + ctx: ExprContext::Load, + range: self.node_range(start), + } + } + + /// Parses a boolean operation expression. + /// + /// Note that the boolean `not` operator is parsed as a unary operator and + /// not as a boolean operation. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `or` or `and` token. + /// + /// See: + fn parse_bool_operation_expression( + &mut self, + lhs: Expr, + start: TextSize, + operator_token: TokenKind, + operator_binding_power: Precedence, + ) -> ast::ExprBoolOp { + let mut values = vec![lhs]; + let mut progress = ParserProgress::default(); + + // Keep adding the expression to `values` until we see a different + // token than `operator_token`. + loop { + progress.assert_progressing(self); + + let parsed_expr = self.parse_expression_with_precedence(operator_binding_power); + values.push(parsed_expr.expr); + + if !self.eat(operator_token) { + break; + } + } + + ast::ExprBoolOp { + values, + op: BoolOp::try_from(operator_token).unwrap(), + range: self.node_range(start), + } + } + + /// Parse a comparison expression. + /// + /// This includes the following operators: + /// - Value comparisons: `==`, `!=`, `<`, `<=`, `>`, and `>=`. + /// - Membership tests: `in` and `not in`. + /// - Identity tests: `is` and `is not`. + /// + /// # Panics + /// + /// If the parser isn't positioned at any of the comparison operators. + /// + /// See: + fn parse_compare_expression( + &mut self, + lhs: Expr, + start: TextSize, + operator: TokenKind, + operator_binding_power: Precedence, + ) -> ast::ExprCompare { + let compare_operator = token_kind_to_cmp_op([operator, self.current_token_kind()]).unwrap(); + + // Bump the appropriate token when the compare operator is made up of + // two separate tokens. + match compare_operator { + CmpOp::IsNot => { + self.bump(TokenKind::Not); + } + CmpOp::NotIn => { + self.bump(TokenKind::In); + } + _ => {} + } + + let mut comparators = vec![]; + let mut compare_operators = vec![compare_operator]; + + let mut progress = ParserProgress::default(); + + loop { + progress.assert_progressing(self); + + let parsed_expr = self.parse_expression_with_precedence(operator_binding_power); + comparators.push(parsed_expr.expr); + + let next_operator = self.current_token_kind(); + if !next_operator.is_compare_operator() { + break; + } + self.bump(next_operator); // compare operator + + if let Ok(compare_operator) = + token_kind_to_cmp_op([next_operator, self.current_token_kind()]) + { + // Bump the appropriate token when the compare operator is made up of + // two separate tokens. + match compare_operator { + CmpOp::IsNot => { + self.bump(TokenKind::Not); + } + CmpOp::NotIn => { + self.bump(TokenKind::In); + } + _ => {} + } + + compare_operators.push(compare_operator); + } else { + break; + } + } + + ast::ExprCompare { + left: Box::new(lhs), + ops: compare_operators.into_boxed_slice(), + comparators: comparators.into_boxed_slice(), + range: self.node_range(start), + } + } + + /// Parses all kinds of strings and implicitly concatenated strings. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `String` or `FStringStart` token. + /// + /// See: (Search "strings:") + pub(super) fn parse_strings(&mut self) -> Expr { + const STRING_START_SET: TokenSet = + TokenSet::new([TokenKind::String, TokenKind::FStringStart]); + + let start = self.node_start(); + let mut strings = vec![]; + + let mut progress = ParserProgress::default(); + + while self.at_ts(STRING_START_SET) { + progress.assert_progressing(self); + + if self.at(TokenKind::String) { + strings.push(self.parse_string_or_byte_literal()); + } else { + strings.push(StringType::FString(self.parse_fstring())); + } + } + + let range = self.node_range(start); + + match strings.len() { + // This is not possible as the function was called by matching against a + // `String` or `FStringStart` token. + 0 => unreachable!("Expected to parse at least one string"), + // We need a owned value, hence the `pop` here. + 1 => match strings.pop().unwrap() { + StringType::Str(string) => Expr::StringLiteral(ast::ExprStringLiteral { + value: ast::StringLiteralValue::single(string), + range, + }), + StringType::Bytes(bytes) => Expr::BytesLiteral(ast::ExprBytesLiteral { + value: ast::BytesLiteralValue::single(bytes), + range, + }), + StringType::FString(fstring) => Expr::FString(ast::ExprFString { + value: ast::FStringValue::single(fstring), + range, + }), + }, + _ => self.handle_implicitly_concatenated_strings(strings, range), + } + } + + /// Handles implicitly concatenated strings. + /// + /// # Panics + /// + /// If the length of `strings` is less than 2. + fn handle_implicitly_concatenated_strings( + &mut self, + strings: Vec, + range: TextRange, + ) -> Expr { + assert!(strings.len() > 1); + + let mut has_fstring = false; + let mut byte_literal_count = 0; + for string in &strings { + match string { + StringType::FString(_) => has_fstring = true, + StringType::Bytes(_) => byte_literal_count += 1, + StringType::Str(_) => {} + } + } + let has_bytes = byte_literal_count > 0; + + if has_bytes { + match byte_literal_count.cmp(&strings.len()) { + Ordering::Less => { + // TODO(dhruvmanila): This is not an ideal recovery because the parser + // replaces the byte literals with an invalid string literal node. Any + // downstream tools can extract the raw bytes from the range. + // + // We could convert the node into a string and mark it as invalid + // and would be clever to mark the type which is fewer in quantity. + + // test_err mixed_bytes_and_non_bytes_literals + // 'first' b'second' + // f'first' b'second' + // 'first' f'second' b'third' + self.add_error( + ParseErrorType::OtherError( + "Bytes literal cannot be mixed with non-bytes literals".to_string(), + ), + range, + ); + } + // Only construct a byte expression if all the literals are bytes + // otherwise, we'll try either string or f-string. This is to retain + // as much information as possible. + Ordering::Equal => { + let mut values = Vec::with_capacity(strings.len()); + for string in strings { + values.push(match string { + StringType::Bytes(value) => value, + _ => unreachable!("Expected `StringType::Bytes`"), + }); + } + return Expr::from(ast::ExprBytesLiteral { + value: ast::BytesLiteralValue::concatenated(values), + range, + }); + } + Ordering::Greater => unreachable!(), + } + } + + // TODO(dhruvmanila): Parser drops unterminated strings here as well + // because the lexer doesn't emit them. + + // test_err implicitly_concatenated_unterminated_string + // 'hello' 'world + // 1 + 1 + // 'hello' f'world {x} + // 2 + 2 + + // test_err implicitly_concatenated_unterminated_string_multiline + // ( + // 'hello' + // f'world {x} + // ) + // 1 + 1 + // ( + // 'first' + // 'second + // f'third' + // ) + // 2 + 2 + + if !has_fstring { + let mut values = Vec::with_capacity(strings.len()); + for string in strings { + values.push(match string { + StringType::Str(value) => value, + _ => ast::StringLiteral::invalid(string.range()), + }); + } + return Expr::from(ast::ExprStringLiteral { + value: ast::StringLiteralValue::concatenated(values), + range, + }); + } + + let mut parts = Vec::with_capacity(strings.len()); + for string in strings { + match string { + StringType::FString(fstring) => parts.push(ast::FStringPart::FString(fstring)), + StringType::Str(string) => parts.push(ast::FStringPart::Literal(string)), + StringType::Bytes(bytes) => parts.push(ast::FStringPart::Literal( + ast::StringLiteral::invalid(bytes.range()), + )), + } + } + + Expr::from(ast::ExprFString { + value: ast::FStringValue::concatenated(parts), + range, + }) + } + + /// Parses a single string or byte literal. + /// + /// This does not handle implicitly concatenated strings. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `String` token. + /// + /// See: + fn parse_string_or_byte_literal(&mut self) -> StringType { + let (Tok::String { value, kind }, range) = self.bump(TokenKind::String) else { + unreachable!() + }; + + match parse_string_literal(value, kind, range) { + Ok(string) => string, + Err(error) => { + let location = error.location(); + self.add_error(ParseErrorType::Lexical(error.into_error()), location); + + if kind.is_byte_string() { + // test_err invalid_byte_literal + // b'123a𝐁c' + // rb"a𝐁c123" + // b"""123a𝐁c""" + StringType::Bytes(ast::BytesLiteral { + value: Box::new([]), + range, + flags: ast::BytesLiteralFlags::from(kind).with_invalid(), + }) + } else { + // test_err invalid_string_literal + // 'hello \N{INVALID} world' + // """hello \N{INVALID} world""" + StringType::Str(ast::StringLiteral { + value: "".into(), + range, + flags: ast::StringLiteralFlags::from(kind).with_invalid(), + }) + } + } + } + } + + /// Parses a f-string. + /// + /// This does not handle implicitly concatenated strings. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `FStringStart` token. + /// + /// See: (Search "fstring:") + /// See: + fn parse_fstring(&mut self) -> ast::FString { + let start = self.node_start(); + + let (Tok::FStringStart(kind), _) = self.bump(TokenKind::FStringStart) else { + unreachable!() + }; + let elements = self.parse_fstring_elements(); + + self.expect(TokenKind::FStringEnd); + + ast::FString { + elements, + range: self.node_range(start), + flags: kind.into(), + } + } + + /// Parses a list of f-string elements. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `{` or `FStringMiddle` token. + fn parse_fstring_elements(&mut self) -> Vec { + let mut elements = vec![]; + + self.parse_list(RecoveryContextKind::FStringElements, |parser| { + let element = match parser.current_token_kind() { + TokenKind::Lbrace => { + FStringElement::Expression(parser.parse_fstring_expression_element()) + } + TokenKind::FStringMiddle => { + let (Tok::FStringMiddle { value, kind, .. }, range) = parser.next_token() + else { + unreachable!() + }; + FStringElement::Literal( + parse_fstring_literal_element(value, kind, range).unwrap_or_else( + |lex_error| { + // test_err invalid_fstring_literal_element + // f'hello \N{INVALID} world' + // f"""hello \N{INVALID} world""" + let location = lex_error.location(); + parser.add_error( + ParseErrorType::Lexical(lex_error.into_error()), + location, + ); + ast::FStringLiteralElement { + value: "".into(), + range, + } + }, + ), + ) + } + // `Invalid` tokens are created when there's a lexical error, so + // we ignore it here to avoid creating unexpected token errors + TokenKind::Unknown => { + parser.next_token(); + return; + } + tok => { + // This should never happen because the list parsing will only + // call this closure for the above token kinds which are the same + // as in the FIRST set. + unreachable!( + "f-string: unexpected token `{tok:?}` at {:?}", + parser.current_token_range() + ); + } + }; + elements.push(element); + }); + + elements + } + + /// Parses a f-string expression element. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `{` token. + fn parse_fstring_expression_element(&mut self) -> ast::FStringExpressionElement { + let start = self.node_start(); + self.bump(TokenKind::Lbrace); + + // test_err f_string_empty_expression + // f"{}" + // f"{ }" + + // test_err f_string_invalid_starred_expr + // # Starred expression inside f-string has a minimum precedence of bitwise or. + // f"{*}" + // f"{*x and y}" + // f"{*yield x}" + let value = self.parse_yield_expression_or_else(Parser::parse_star_expression_list); + + if !value.is_parenthesized && value.expr.is_lambda_expr() { + // TODO(dhruvmanila): This requires making some changes in lambda expression + // parsing logic to handle the emitted `FStringMiddle` token in case the + // lambda expression is not parenthesized. + + // test_err f_string_lambda_without_parentheses + // f"{lambda x: x}" + self.add_error( + ParseErrorType::FStringError(FStringErrorType::LambdaWithoutParentheses), + value.range(), + ); + } + let debug_text = if self.eat(TokenKind::Equal) { + let leading_range = TextRange::new(start + "{".text_len(), value.start()); + let trailing_range = TextRange::new(value.end(), self.current_token_range().start()); + Some(ast::DebugText { + leading: self.src_text(leading_range).to_string(), + trailing: self.src_text(trailing_range).to_string(), + }) + } else { + None + }; + + let conversion = if self.eat(TokenKind::Exclamation) { + let conversion_flag_range = self.current_token_range(); + if let Tok::Name { name } = self.next_token().0 { + match &*name { + "s" => ConversionFlag::Str, + "r" => ConversionFlag::Repr, + "a" => ConversionFlag::Ascii, + _ => { + // test_err f_string_invalid_conversion_flag_name_tok + // f"{x!z}" + self.add_error( + ParseErrorType::FStringError(FStringErrorType::InvalidConversionFlag), + conversion_flag_range, + ); + ConversionFlag::None + } + } + } else { + // test_err f_string_invalid_conversion_flag_other_tok + // f"{x!123}" + // f"{x!'a'}" + self.add_error( + ParseErrorType::FStringError(FStringErrorType::InvalidConversionFlag), + conversion_flag_range, + ); + ConversionFlag::None + } + } else { + ConversionFlag::None + }; + + let format_spec = if self.eat(TokenKind::Colon) { + let spec_start = self.node_start(); + let elements = self.parse_fstring_elements(); + Some(Box::new(ast::FStringFormatSpec { + range: self.node_range(spec_start), + elements, + })) + } else { + None + }; + + // We're using `eat` here instead of `expect` to use the f-string specific error type. + if !self.eat(TokenKind::Rbrace) { + // TODO(dhruvmanila): This requires some changes in the lexer. One of them + // would be to emit `FStringEnd`. Currently, the following test cases doesn't + // really work as expected. Refer https://github.com/astral-sh/ruff/pull/10372 + + // test_err f_string_unclosed_lbrace + // f"{" + // f"{foo!r" + // f"{foo=" + // f"{" + // f"""{""" + + // The lexer does emit `FStringEnd` for the following test cases: + + // test_err f_string_unclosed_lbrace_in_format_spec + // f"hello {x:" + // f"hello {x:.3f" + self.add_error( + ParseErrorType::FStringError(FStringErrorType::UnclosedLbrace), + self.current_token_range(), + ); + } + + ast::FStringExpressionElement { + expression: Box::new(value.expr), + debug_text, + conversion, + format_spec, + range: self.node_range(start), + } + } + + /// Parses a list or a list comprehension expression. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `[` token. + /// + /// See: + fn parse_list_like_expression(&mut self) -> Expr { + let start = self.node_start(); + + self.bump(TokenKind::Lsqb); + + // Nice error message when having a unclosed open bracket `[` + if self.at_ts(NEWLINE_EOF_SET) { + self.add_error( + ParseErrorType::OtherError("missing closing bracket `]`".to_string()), + self.current_token_range(), + ); + } + + // Return an empty `ListExpr` when finding a `]` right after the `[` + if self.eat(TokenKind::Rsqb) { + return Expr::List(ast::ExprList { + elts: vec![], + ctx: ExprContext::Load, + range: self.node_range(start), + }); + } + + // Parse the first element with a more general rule and limit it later. + let first_element = self.parse_star_expression_or_higher(AllowNamedExpression::Yes); + + match self.current_token_kind() { + TokenKind::Async | TokenKind::For => { + // Parenthesized starred expression isn't allowed either but that is + // handled by the `parse_parenthesized_expression` method. + if first_element.is_unparenthesized_starred_expr() { + self.add_error( + ParseErrorType::IterableUnpackingInComprehension, + &first_element, + ); + } + + Expr::ListComp(self.parse_list_comprehension_expression(first_element.expr, start)) + } + _ => Expr::List(self.parse_list_expression(first_element.expr, start)), + } + } + + /// Parses a set, dict, set comprehension, or dict comprehension. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `{` token. + /// + /// See: + /// - + /// - + /// - + fn parse_set_or_dict_like_expression(&mut self) -> Expr { + let start = self.node_start(); + self.bump(TokenKind::Lbrace); + + // Nice error message when having a unclosed open brace `{` + if self.at_ts(NEWLINE_EOF_SET) { + self.add_error( + ParseErrorType::OtherError("missing closing brace `}`".to_string()), + self.current_token_range(), + ); + } + + // Return an empty `DictExpr` when finding a `}` right after the `{` + if self.eat(TokenKind::Rbrace) { + return Expr::Dict(ast::ExprDict { + keys: vec![], + values: vec![], + range: self.node_range(start), + }); + } + + if self.eat(TokenKind::DoubleStar) { + // Handle dictionary unpacking. Here, the grammar is `'**' bitwise_or` + // which requires limiting the expression. + let value = self.parse_expression_with_bitwise_or_precedence(); + + return Expr::Dict(self.parse_dictionary_expression(None, value.expr, start)); + } + + // For dictionary expressions, the key uses the `expression` rule while for + // set expressions, the element uses the `star_expression` rule. So, use the + // one that is more general and limit it later. + let key_or_element = self.parse_star_expression_or_higher(AllowNamedExpression::Yes); + + match self.current_token_kind() { + TokenKind::Async | TokenKind::For => { + if key_or_element.is_unparenthesized_starred_expr() { + self.add_error( + ParseErrorType::IterableUnpackingInComprehension, + &key_or_element, + ); + } + + Expr::SetComp(self.parse_set_comprehension_expression(key_or_element.expr, start)) + } + TokenKind::Colon => { + // Now, we know that it's either a dictionary expression or a dictionary comprehension. + // In either case, the key is limited to an `expression`. + if !key_or_element.is_parenthesized { + match key_or_element.expr { + Expr::Starred(_) => self.add_error( + ParseErrorType::InvalidStarredExpressionUsage, + &key_or_element.expr, + ), + Expr::Named(_) => self.add_error( + ParseErrorType::UnparenthesizedNamedExpression, + &key_or_element, + ), + _ => {} + } + } + + self.bump(TokenKind::Colon); + let value = self.parse_conditional_expression_or_higher(AllowStarredExpression::No); + + if matches!(self.current_token_kind(), TokenKind::Async | TokenKind::For) { + Expr::DictComp(self.parse_dictionary_comprehension_expression( + key_or_element.expr, + value.expr, + start, + )) + } else { + Expr::Dict(self.parse_dictionary_expression( + Some(key_or_element.expr), + value.expr, + start, + )) + } + } + _ => Expr::Set(self.parse_set_expression(key_or_element.expr, start)), + } + } + + /// Parses an expression in parentheses, a tuple expression, or a generator expression. + /// + /// Matches the `(tuple | group | genexp)` rule in the [Python grammar]. + /// + /// [Python grammar]: https://docs.python.org/3/reference/grammar.html + fn parse_parenthesized_expression(&mut self) -> ParsedExpr { + let start = self.node_start(); + self.bump(TokenKind::Lpar); + + // Nice error message when having a unclosed open parenthesis `(` + if self.at_ts(NEWLINE_EOF_SET) { + let range = self.current_token_range(); + self.add_error( + ParseErrorType::OtherError("missing closing parenthesis `)`".to_string()), + range, + ); + } + + // Return an empty `TupleExpr` when finding a `)` right after the `(` + if self.eat(TokenKind::Rpar) { + return Expr::Tuple(ast::ExprTuple { + elts: vec![], + ctx: ExprContext::Load, + range: self.node_range(start), + parenthesized: true, + }) + .into(); + } + + // We need to unset the `FOR_TARGET` in the context when parsing a parenthesized expression + // otherwise a parenthesized comparison expression will not be parsed in a `for` target. + + // test_ok parenthesized_compare_expr_in_for + // for (x in y)[0] in iter: ... + // for (x in y).attr in iter: ... + + // test_err parenthesized_compare_expr_in_for + // for (x in y)() in iter: ... + // for (x in y) in iter: ... + let current_context = self.ctx - ParserCtxFlags::FOR_TARGET; + let saved_context = self.set_ctx(current_context); + + // Use the more general rule of the three to parse the first element + // and limit it later. + let mut parsed_expr = self.parse_yield_expression_or_else(|p| { + p.parse_star_expression_or_higher(AllowNamedExpression::Yes) + }); + + let parsed_expr = match self.current_token_kind() { + TokenKind::Comma => { + // grammar: `tuple` + let tuple = self.parse_tuple_expression( + parsed_expr.expr, + start, + Parenthesized::Yes, + |parser| parser.parse_star_expression_or_higher(AllowNamedExpression::Yes), + ); + + ParsedExpr { + expr: tuple.into(), + is_parenthesized: false, + } + } + TokenKind::Async | TokenKind::For => { + // grammar: `genexp` + if parsed_expr.is_unparenthesized_starred_expr() { + self.add_error( + ParseErrorType::IterableUnpackingInComprehension, + &parsed_expr, + ); + } + + let generator = Expr::Generator(self.parse_generator_expression( + parsed_expr.expr, + GeneratorExpressionInParentheses::Yes(start), + )); + + ParsedExpr { + expr: generator, + is_parenthesized: false, + } + } + _ => { + // grammar: `group` + if parsed_expr.expr.is_starred_expr() { + self.add_error(ParseErrorType::InvalidStarredExpressionUsage, &parsed_expr); + } + + self.expect(TokenKind::Rpar); + + parsed_expr.is_parenthesized = true; + parsed_expr + } + }; + + self.restore_ctx(current_context, saved_context); + + parsed_expr + } + + /// Parses multiple items separated by a comma into a tuple expression. + /// + /// Uses the `parse_func` to parse each item in the tuple. + pub(super) fn parse_tuple_expression( + &mut self, + first_element: Expr, + start: TextSize, + parenthesized: Parenthesized, + mut parse_func: impl FnMut(&mut Parser<'src>) -> ParsedExpr, + ) -> ast::ExprTuple { + // TODO(dhruvmanila): Can we remove `parse_func` and use `parenthesized` to + // determine the parsing function? + + if !self.at_sequence_end() { + self.expect(TokenKind::Comma); + } + + let mut elts = vec![first_element]; + + self.parse_comma_separated_list(RecoveryContextKind::TupleElements(parenthesized), |p| { + elts.push(parse_func(p).expr); + }); + + if parenthesized.is_yes() { + self.expect(TokenKind::Rpar); + } + + ast::ExprTuple { + elts, + ctx: ExprContext::Load, + range: self.node_range(start), + parenthesized: parenthesized.is_yes(), + } + } + + /// Parses a list expression. + /// + /// See: + fn parse_list_expression(&mut self, first_element: Expr, start: TextSize) -> ast::ExprList { + if !self.at_sequence_end() { + self.expect(TokenKind::Comma); + } + + let mut elts = vec![first_element]; + + self.parse_comma_separated_list(RecoveryContextKind::ListElements, |parser| { + elts.push( + parser + .parse_star_expression_or_higher(AllowNamedExpression::Yes) + .expr, + ); + }); + + self.expect(TokenKind::Rsqb); + + ast::ExprList { + elts, + ctx: ExprContext::Load, + range: self.node_range(start), + } + } + + /// Parses a set expression. + /// + /// See: + fn parse_set_expression(&mut self, first_element: Expr, start: TextSize) -> ast::ExprSet { + if !self.at_sequence_end() { + self.expect(TokenKind::Comma); + } + + let mut elts = vec![first_element]; + + self.parse_comma_separated_list(RecoveryContextKind::SetElements, |parser| { + elts.push( + parser + .parse_star_expression_or_higher(AllowNamedExpression::Yes) + .expr, + ); + }); + + self.expect(TokenKind::Rbrace); + + ast::ExprSet { + range: self.node_range(start), + elts, + } + } + + /// Parses a dictionary expression. + /// + /// See: + fn parse_dictionary_expression( + &mut self, + key: Option, + value: Expr, + start: TextSize, + ) -> ast::ExprDict { + if !self.at_sequence_end() { + self.expect(TokenKind::Comma); + } + + let mut keys = vec![key]; + let mut values = vec![value]; + + self.parse_comma_separated_list(RecoveryContextKind::DictElements, |parser| { + if parser.eat(TokenKind::DoubleStar) { + keys.push(None); + + // Handle dictionary unpacking. Here, the grammar is `'**' bitwise_or` + // which requires limiting the expression. + values.push(parser.parse_expression_with_bitwise_or_precedence().expr); + } else { + keys.push(Some( + parser + .parse_conditional_expression_or_higher(AllowStarredExpression::No) + .expr, + )); + parser.expect(TokenKind::Colon); + + values.push( + parser + .parse_conditional_expression_or_higher(AllowStarredExpression::No) + .expr, + ); + } + }); + + self.expect(TokenKind::Rbrace); + + ast::ExprDict { + range: self.node_range(start), + keys, + values, + } + } + + /// Parses a list of comprehension generators. + /// + /// These are the `for` and `async for` clauses in a comprehension, optionally + /// followed by `if` clauses. + /// + /// See: + fn parse_generators(&mut self) -> Vec { + const GENERATOR_SET: TokenSet = TokenSet::new([TokenKind::For, TokenKind::Async]); + + let mut generators = vec![]; + let mut progress = ParserProgress::default(); + + while self.at_ts(GENERATOR_SET) { + progress.assert_progressing(self); + generators.push(self.parse_comprehension()); + } + + generators + } + + /// Parses a comprehension. + /// + /// # Panics + /// + /// If the parser isn't positioned at an `async` or `for` token. + /// + /// See: + fn parse_comprehension(&mut self) -> ast::Comprehension { + let start = self.node_start(); + + let is_async = self.eat(TokenKind::Async); + + if is_async { + // test_err comprehension_missing_for_after_async + // (async) + // (x async x in iter) + self.expect(TokenKind::For); + } else { + self.bump(TokenKind::For); + }; + + let saved_context = self.set_ctx(ParserCtxFlags::FOR_TARGET); + let mut target = self.parse_expression_list(AllowStarredExpression::Yes); + self.restore_ctx(ParserCtxFlags::FOR_TARGET, saved_context); + + helpers::set_expr_ctx(&mut target.expr, ExprContext::Store); + self.validate_assignment_target(&target.expr); + + self.expect(TokenKind::In); + let iter = self.parse_simple_expression(AllowStarredExpression::No); + + let mut ifs = vec![]; + let mut progress = ParserProgress::default(); + + while self.eat(TokenKind::If) { + progress.assert_progressing(self); + + let parsed_expr = self.parse_simple_expression(AllowStarredExpression::No); + + ifs.push(parsed_expr.expr); + } + + ast::Comprehension { + range: self.node_range(start), + target: target.expr, + iter: iter.expr, + ifs, + is_async, + } + } + + /// Parses a generator expression. + /// + /// The given `in_parentheses` parameter is used to determine whether the generator + /// expression is enclosed in parentheses or not: + /// - `Yes`, expect the `)` token after the generator expression. + /// - `No`, no parentheses are expected. + /// - `Maybe`, consume the `)` token if it's present. + /// + /// The contained start position in each variant is used to determine the range + /// of the generator expression. + /// + /// See: + pub(super) fn parse_generator_expression( + &mut self, + element: Expr, + in_parentheses: GeneratorExpressionInParentheses, + ) -> ast::ExprGenerator { + let generators = self.parse_generators(); + + let (parenthesized, start) = match in_parentheses { + GeneratorExpressionInParentheses::Yes(lpar_start) => { + self.expect(TokenKind::Rpar); + (true, lpar_start) + } + GeneratorExpressionInParentheses::No(expr_start) => (false, expr_start), + GeneratorExpressionInParentheses::Maybe { + lpar_start, + expr_start, + } => { + if self.eat(TokenKind::Rpar) { + (true, lpar_start) + } else { + (false, expr_start) + } + } + }; + + ast::ExprGenerator { + elt: Box::new(element), + generators, + range: self.node_range(start), + parenthesized, + } + } + + /// Parses a list comprehension expression. + /// + /// See: + fn parse_list_comprehension_expression( + &mut self, + element: Expr, + start: TextSize, + ) -> ast::ExprListComp { + let generators = self.parse_generators(); + + self.expect(TokenKind::Rsqb); + + ast::ExprListComp { + elt: Box::new(element), + generators, + range: self.node_range(start), + } + } + + /// Parses a dictionary comprehension expression. + /// + /// See: + fn parse_dictionary_comprehension_expression( + &mut self, + key: Expr, + value: Expr, + start: TextSize, + ) -> ast::ExprDictComp { + let generators = self.parse_generators(); + + self.expect(TokenKind::Rbrace); + + ast::ExprDictComp { + key: Box::new(key), + value: Box::new(value), + generators, + range: self.node_range(start), + } + } + + /// Parses a set comprehension expression. + /// + /// See: + fn parse_set_comprehension_expression( + &mut self, + element: Expr, + start: TextSize, + ) -> ast::ExprSetComp { + let generators = self.parse_generators(); + + self.expect(TokenKind::Rbrace); + + ast::ExprSetComp { + elt: Box::new(element), + generators, + range: self.node_range(start), + } + } + + /// Parses a starred expression with the given precedence. + /// + /// The expression is parsed with the highest precedence. If the precedence + /// of the parsed expression is lower than the given precedence, an error + /// is reported. + /// + /// For example, if the given precedence is [`StarredExpressionPrecedence::BitOr`], + /// the comparison expression is not allowed. + /// + /// Refer to the [Python grammar] for more information. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `*` token. + /// + /// [Python grammar]: https://docs.python.org/3/reference/grammar.html + fn parse_starred_expression( + &mut self, + precedence: StarredExpressionPrecedence, + ) -> ast::ExprStarred { + let start = self.node_start(); + self.bump(TokenKind::Star); + + let parsed_expr = match precedence { + StarredExpressionPrecedence::Conditional => { + self.parse_conditional_expression_or_higher(AllowStarredExpression::No) + } + StarredExpressionPrecedence::BitOr => { + self.parse_expression_with_bitwise_or_precedence() + } + }; + + ast::ExprStarred { + value: Box::new(parsed_expr.expr), + ctx: ExprContext::Load, + range: self.node_range(start), + } + } + + /// Parses an `await` expression. + /// + /// # Panics + /// + /// If the parser isn't positioned at an `await` token. + /// + /// See: + fn parse_await_expression(&mut self) -> ast::ExprAwait { + let start = self.node_start(); + self.bump(TokenKind::Await); + + let parsed_expr = self.parse_expression_with_precedence(Precedence::Await); + + ast::ExprAwait { + value: Box::new(parsed_expr.expr), + range: self.node_range(start), + } + } + + /// Parses a yield expression if the parser is positioned at a `yield` token + /// or calls the given closure to parse an expression. + /// + /// This method is used where the grammar allows a `yield` expression or an + /// alternative expression. For example, the grammar for a parenthesized + /// expression is `(yield_expr | named_expression)`. + pub(super) fn parse_yield_expression_or_else(&mut self, f: F) -> ParsedExpr + where + F: Fn(&mut Parser<'src>) -> ParsedExpr, + { + if self.at(TokenKind::Yield) { + self.parse_yield_expression().into() + } else { + f(self) + } + } + + /// Parses a `yield` expression. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `yield` token. + /// + /// See: + fn parse_yield_expression(&mut self) -> Expr { + let start = self.node_start(); + self.bump(TokenKind::Yield); + + if self.eat(TokenKind::From) { + return self.parse_yield_from_expression(start); + } + + let value = self + .at_expr() + .then(|| Box::new(self.parse_star_expression_list().expr)); + + Expr::Yield(ast::ExprYield { + value, + range: self.node_range(start), + }) + } + + /// Parses a `yield from` expression. + /// + /// This method should not be used directly. Use [`Parser::parse_yield_expression`] + /// even when parsing a `yield from` expression. + /// + /// See: + fn parse_yield_from_expression(&mut self, start: TextSize) -> Expr { + // Grammar: + // 'yield' 'from' expression + // + // Here, a tuple expression isn't allowed without the parentheses. But, we + // allow it here to report better error message. + // + // Now, this also solves another problem. Take the following example: + // + // ```python + // yield from x, y + // ``` + // + // If we didn't use the `parse_expression_list` method here, the parser + // would have stopped at the comma. Then, the outer expression would + // have been a tuple expression with two elements: `yield from x` and `y`. + let expr = self.parse_expression_list(AllowStarredExpression::No).expr; + + match &expr { + Expr::Tuple(tuple) if !tuple.parenthesized => { + self.add_error(ParseErrorType::UnparenthesizedTupleExpression, &expr); + } + _ => {} + } + + Expr::YieldFrom(ast::ExprYieldFrom { + value: Box::new(expr), + range: self.node_range(start), + }) + } + + /// Parses a named expression (`:=`). + /// + /// # Panics + /// + /// If the parser isn't positioned at a `:=` token. + /// + /// See: + pub(super) fn parse_named_expression( + &mut self, + mut target: Expr, + start: TextSize, + ) -> ast::ExprNamed { + self.bump(TokenKind::ColonEqual); + + if !target.is_name_expr() { + self.add_error(ParseErrorType::InvalidNamedAssignmentTarget, target.range()); + } + helpers::set_expr_ctx(&mut target, ExprContext::Store); + + let value = self.parse_conditional_expression_or_higher(AllowStarredExpression::No); + + ast::ExprNamed { + target: Box::new(target), + value: Box::new(value.expr), + range: self.node_range(start), + } + } + + /// Parses a lambda expression. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `lambda` token. + /// + /// See: + fn parse_lambda_expr(&mut self) -> ast::ExprLambda { + let start = self.node_start(); + self.bump(TokenKind::Lambda); + + let parameters = if self.at(TokenKind::Colon) { + // test_ok lambda_with_no_parameters + // lambda: 1 + None + } else { + Some(Box::new(self.parse_parameters(FunctionKind::Lambda))) + }; + + self.expect(TokenKind::Colon); + + // test_ok lambda_with_valid_body + // lambda x: x + // lambda x: x if True else y + // lambda x: await x + // lambda x: lambda y: x + y + // lambda x: (yield x) # Parenthesized `yield` is fine + // lambda x: x, *y + + // test_err lambda_body_with_starred_expr + // lambda x: *y + // lambda x: *y, + // lambda x: *y, z + // lambda x: *y and z + + // test_err lambda_body_with_yield_expr + // lambda x: yield y + // lambda x: yield from y + let body = self.parse_conditional_expression_or_higher(AllowStarredExpression::No); + + ast::ExprLambda { + body: Box::new(body.expr), + parameters, + range: self.node_range(start), + } + } + + /// Parses an `if` expression. + /// + /// # Panics + /// + /// If the parser isn't positioned at an `if` token. + /// + /// See: + fn parse_if_expression(&mut self, body: Expr, start: TextSize) -> ast::ExprIf { + self.bump(TokenKind::If); + + let test = self.parse_simple_expression(AllowStarredExpression::No); + + self.expect(TokenKind::Else); + + let orelse = self.parse_conditional_expression_or_higher(AllowStarredExpression::No); + + ast::ExprIf { + body: Box::new(body), + test: Box::new(test.expr), + orelse: Box::new(orelse.expr), + range: self.node_range(start), + } + } + + /// Parses an IPython escape command at the expression level. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `IpyEscapeCommand` token. + /// If the escape command kind is not `%` or `!`. + fn parse_ipython_escape_command_expression(&mut self) -> ast::ExprIpyEscapeCommand { + let start = self.node_start(); + + let (Tok::IpyEscapeCommand { value, kind }, _) = self.bump(TokenKind::IpyEscapeCommand) + else { + unreachable!() + }; + + if !matches!(kind, IpyEscapeKind::Magic | IpyEscapeKind::Shell) { + // This should never occur as the lexer won't allow it. + unreachable!("IPython escape command expression is only allowed for % and !"); + } + + let command = ast::ExprIpyEscapeCommand { + range: self.node_range(start), + kind, + value, + }; + + if self.mode != Mode::Ipython { + self.add_error(ParseErrorType::UnexpectedIpythonEscapeCommand, &command); + } + + command + } + + /// Validate that the given arguments doesn't have any duplicate keyword argument. + /// + /// Report errors for all the duplicate names found. + fn validate_arguments(&mut self, arguments: &ast::Arguments) { + let mut all_arg_names = FxHashSet::with_capacity_and_hasher( + arguments.keywords.len(), + BuildHasherDefault::default(), + ); + + for (name, range) in arguments + .keywords + .iter() + .filter_map(|argument| argument.arg.as_ref().map(|arg| (arg, argument.range))) + { + let arg_name = name.as_str(); + if !all_arg_names.insert(arg_name) { + self.add_error( + ParseErrorType::DuplicateKeywordArgumentError(arg_name.to_string()), + range, + ); + } + } + } +} + +#[derive(Debug)] +pub(super) struct ParsedExpr { + pub(super) expr: Expr, + pub(super) is_parenthesized: bool, +} + +impl ParsedExpr { + #[inline] + pub(super) const fn is_unparenthesized_starred_expr(&self) -> bool { + !self.is_parenthesized && self.expr.is_starred_expr() + } +} + +impl From for ParsedExpr { + #[inline] + fn from(expr: Expr) -> Self { + ParsedExpr { + expr, + is_parenthesized: false, + } + } +} + +impl Deref for ParsedExpr { + type Target = Expr; + + fn deref(&self) -> &Self::Target { + &self.expr + } +} + +impl Ranged for ParsedExpr { + #[inline] + fn range(&self) -> TextRange { + self.expr.range() + } +} + +/// Binding power associativity +enum Associativity { + Left, + Right, +} + +/// Represents the precedence levels for various operators and expressions of Python. +/// Variants at the top have lower precedence and variants at the bottom have +/// higher precedence. +/// +/// Note: Some expressions like if-else, named expression (`:=`), lambda, subscription, +/// slicing, call and attribute reference expressions, that are mentioned in the link +/// below are better handled in other parts of the parser. +/// +/// See: +#[derive(Debug, Ord, Eq, PartialEq, PartialOrd, Copy, Clone)] +enum Precedence { + /// Precedence for an unknown operator. + Unknown, + /// The initital precedence when parsing an expression. + Initial, + /// Precedence of boolean `or` operator. + Or, + /// Precedence of boolean `and` operator. + And, + /// Precedence of boolean `not` unary operator. + Not, + /// Precedence of comparisons operators (`<`, `<=`, `>`, `>=`, `!=`, `==`), + /// memberships tests (`in`, `not in`) and identity tests (`is` `is not`). + ComparisonsMembershipIdentity, + /// Precedence of `Bitwise OR` (`|`) operator. + BitOr, + /// Precedence of `Bitwise XOR` (`^`) operator. + BitXor, + /// Precedence of `Bitwise AND` (`&`) operator. + BitAnd, + /// Precedence of left and right shift operators (`<<`, `>>`). + LeftRightShift, + /// Precedence of addition (`+`) and subtraction (`-`) operators. + AddSub, + /// Precedence of multiplication (`*`), matrix multiplication (`@`), division (`/`), floor + /// division (`//`) and remainder operators (`%`). + MulDivRemain, + /// Precedence of positive (`+`), negative (`-`), `Bitwise NOT` (`~`) unary operators. + PosNegBitNot, + /// Precedence of exponentiation operator (`**`). + Exponent, + /// Precedence of `await` expression. + Await, +} + +impl Precedence { + fn increment_precedence(self) -> Precedence { + match self { + Precedence::Or => Precedence::And, + Precedence::And => Precedence::Not, + Precedence::Not => Precedence::ComparisonsMembershipIdentity, + Precedence::ComparisonsMembershipIdentity => Precedence::BitOr, + Precedence::BitOr => Precedence::BitXor, + Precedence::BitXor => Precedence::BitAnd, + Precedence::BitAnd => Precedence::LeftRightShift, + Precedence::LeftRightShift => Precedence::AddSub, + Precedence::AddSub => Precedence::MulDivRemain, + Precedence::MulDivRemain => Precedence::PosNegBitNot, + Precedence::PosNegBitNot => Precedence::Exponent, + Precedence::Exponent => Precedence::Await, + // We've reached the highest precedence, we can't increment anymore, + // so return the same precedence. + Precedence::Await => Precedence::Await, + // When this function is invoked, the precedence will never be 'Unknown' or 'Initial'. + // This is due to their lower precedence values, causing them to exit the loop in the + // `parse_expression_with_precedence` function before the execution of this function. + Precedence::Unknown | Precedence::Initial => unreachable!(), + } + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub(super) enum GeneratorExpressionInParentheses { + /// The generator expression is in parentheses. The given [`TextSize`] is the + /// start of the left parenthesis. E.g., `(x for x in range(10))`. + Yes(TextSize), + + /// The generator expression is not in parentheses. The given [`TextSize`] is the + /// start of the expression. E.g., `x for x in range(10)`. + No(TextSize), + + /// The generator expression may or may not be in parentheses. The given [`TextSize`]s + /// are the start of the left parenthesis and the start of the expression, respectively. + Maybe { + /// The start of the left parenthesis. + lpar_start: TextSize, + /// The start of the expression. + expr_start: TextSize, + }, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +enum StarredExpressionPrecedence { + BitOr, + Conditional, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub(super) enum AllowNamedExpression { + Yes, + No, +} + +impl AllowNamedExpression { + const fn is_yes(self) -> bool { + matches!(self, AllowNamedExpression::Yes) + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub(super) enum AllowStarredExpression { + Yes, + No, +} + +impl AllowStarredExpression { + const fn is_no(self) -> bool { + matches!(self, AllowStarredExpression::No) + } +} diff --git a/crates/ruff_python_parser/src/parser/helpers.rs b/crates/ruff_python_parser/src/parser/helpers.rs new file mode 100644 index 0000000000..fdb066674b --- /dev/null +++ b/crates/ruff_python_parser/src/parser/helpers.rs @@ -0,0 +1,45 @@ +use ruff_python_ast::{self as ast, CmpOp, Expr, ExprContext}; + +use crate::TokenKind; + +/// Set the `ctx` for `Expr::Id`, `Expr::Attribute`, `Expr::Subscript`, `Expr::Starred`, +/// `Expr::Tuple` and `Expr::List`. If `expr` is either `Expr::Tuple` or `Expr::List`, +/// recursively sets the `ctx` for their elements. +pub(super) fn set_expr_ctx(expr: &mut Expr, new_ctx: ExprContext) { + match expr { + Expr::Name(ast::ExprName { ctx, .. }) + | Expr::Attribute(ast::ExprAttribute { ctx, .. }) + | Expr::Subscript(ast::ExprSubscript { ctx, .. }) => *ctx = new_ctx, + Expr::Starred(ast::ExprStarred { value, ctx, .. }) => { + *ctx = new_ctx; + set_expr_ctx(value, new_ctx); + } + Expr::UnaryOp(ast::ExprUnaryOp { operand, .. }) => { + set_expr_ctx(operand, new_ctx); + } + Expr::List(ast::ExprList { elts, ctx, .. }) + | Expr::Tuple(ast::ExprTuple { elts, ctx, .. }) => { + *ctx = new_ctx; + elts.iter_mut() + .for_each(|element| set_expr_ctx(element, new_ctx)); + } + _ => {} + } +} + +/// Converts a [`TokenKind`] array of size 2 to its correspondent [`CmpOp`]. +pub(super) fn token_kind_to_cmp_op(kind: [TokenKind; 2]) -> Result { + Ok(match kind { + [TokenKind::Is, TokenKind::Not] => CmpOp::IsNot, + [TokenKind::Is, _] => CmpOp::Is, + [TokenKind::Not, TokenKind::In] => CmpOp::NotIn, + [TokenKind::In, _] => CmpOp::In, + [TokenKind::EqEqual, _] => CmpOp::Eq, + [TokenKind::NotEqual, _] => CmpOp::NotEq, + [TokenKind::Less, _] => CmpOp::Lt, + [TokenKind::LessEqual, _] => CmpOp::LtE, + [TokenKind::Greater, _] => CmpOp::Gt, + [TokenKind::GreaterEqual, _] => CmpOp::GtE, + _ => return Err(()), + }) +} diff --git a/crates/ruff_python_parser/src/parser/mod.rs b/crates/ruff_python_parser/src/parser/mod.rs new file mode 100644 index 0000000000..6313f21694 --- /dev/null +++ b/crates/ruff_python_parser/src/parser/mod.rs @@ -0,0 +1,1288 @@ +use std::cmp::Ordering; + +use bitflags::bitflags; +use drop_bomb::DebugDropBomb; + +use ast::Mod; +use ruff_python_ast as ast; +use ruff_text_size::{Ranged, TextRange, TextSize}; + +use crate::lexer::lex; +use crate::parser::progress::{ParserProgress, TokenId}; +use crate::{ + lexer::{LexResult, Spanned}, + token_set::TokenSet, + token_source::TokenSource, + Mode, ParseError, ParseErrorType, Tok, TokenKind, +}; + +use self::expression::AllowStarredExpression; + +mod expression; +mod helpers; +mod pattern; +mod progress; +mod recovery; +mod statement; +#[cfg(test)] +mod tests; + +#[derive(Debug)] +pub struct Program { + ast: ast::Mod, + parse_errors: Vec, +} + +impl Program { + /// Returns the parsed AST. + pub fn ast(&self) -> &ast::Mod { + &self.ast + } + + /// Returns a list of syntax errors found during parsing. + pub fn errors(&self) -> &[ParseError] { + &self.parse_errors + } + + /// Consumes the `Program` and returns the parsed AST. + pub fn into_ast(self) -> ast::Mod { + self.ast + } + + /// Consumes the `Program` and returns a list of syntax errors found during parsing. + pub fn into_errors(self) -> Vec { + self.parse_errors + } + + /// Returns `true` if the program is valid i.e., it has no syntax errors. + pub fn is_valid(&self) -> bool { + self.parse_errors.is_empty() + } + + pub fn parse_str(source: &str, mode: Mode) -> Program { + let tokens = lex(source, mode); + Self::parse_tokens(source, tokens.collect(), mode) + } + + pub fn parse_tokens(source: &str, tokens: Vec, mode: Mode) -> Program { + Parser::new(source, mode, TokenSource::new(tokens)).parse_program() + } +} + +#[derive(Debug)] +pub(crate) struct Parser<'src> { + source: &'src str, + tokens: TokenSource, + + /// Stores all the syntax errors found during the parsing. + errors: Vec, + + /// This tracks the current expression or statement being parsed. + /// + /// The `ctx` is also used to create custom error messages and forbid certain + /// expressions or statements of being parsed. The `ctx` should be empty after + /// an expression or statement is done parsing. + ctx: ParserCtxFlags, + + /// Specify the mode in which the code will be parsed. + mode: Mode, + + /// Current token along with its range. + current: Spanned, + + /// The ID of the current token. This is used to track the progress of the parser + /// to avoid infinite loops when the parser is stuck. + current_token_id: TokenId, + + /// The end of the last processed. Used to determine a node's end. + last_token_end: TextSize, + + /// The range of the tokens to parse. + /// + /// The range is equal to `[0; source.len())` when parsing an entire file. The range can be + /// different when parsing only a part of a file using the [`crate::lex_starts_at`] and + /// [`crate::parse_expression_starts_at`] APIs in which case the the range is equal to + /// `[offset; subrange.len())`. + tokens_range: TextRange, + + recovery_context: RecoveryContext, +} + +impl<'src> Parser<'src> { + pub(crate) fn new(source: &'src str, mode: Mode, mut tokens: TokenSource) -> Parser<'src> { + let tokens_range = TextRange::new( + tokens.position().unwrap_or_default(), + tokens.end().unwrap_or_default(), + ); + + let current = tokens + .next() + .unwrap_or_else(|| (Tok::EndOfFile, TextRange::empty(tokens_range.end()))); + + Parser { + mode, + source, + errors: Vec::new(), + ctx: ParserCtxFlags::empty(), + tokens, + recovery_context: RecoveryContext::empty(), + last_token_end: tokens_range.start(), + current, + current_token_id: TokenId::default(), + tokens_range, + } + } + + pub(crate) fn parse_program(mut self) -> Program { + let ast = if self.mode == Mode::Expression { + let start = self.node_start(); + let parsed_expr = self.parse_expression_list(AllowStarredExpression::No); + + // All of the remaining newlines are actually going to be non-logical newlines. + self.eat(TokenKind::Newline); + + if !self.at(TokenKind::EndOfFile) { + self.add_error( + ParseErrorType::UnexpectedExpressionToken, + self.current_token_range(), + ); + + // TODO(dhruvmanila): How should error recovery work here? Just truncate after the expression? + let mut progress = ParserProgress::default(); + loop { + progress.assert_progressing(&self); + if self.at(TokenKind::EndOfFile) { + break; + } + self.next_token(); + } + } + + self.bump(TokenKind::EndOfFile); + + Mod::Expression(ast::ModExpression { + body: Box::new(parsed_expr.expr), + range: self.node_range(start), + }) + } else { + let body = self.parse_list_into_vec( + RecoveryContextKind::ModuleStatements, + Parser::parse_statement, + ); + + self.bump(TokenKind::EndOfFile); + + Mod::Module(ast::ModModule { + body, + range: self.tokens_range, + }) + }; + + Program { + ast, + parse_errors: self.finish(), + } + } + + fn finish(self) -> Vec { + // After parsing, the `ctx` and `ctx_stack` should be empty. + // If it's not, you probably forgot to call `clear_ctx` somewhere. + assert_eq!(self.ctx, ParserCtxFlags::empty()); + assert_eq!( + self.current_token_kind(), + TokenKind::EndOfFile, + "Parser should be at the end of the file." + ); + + // TODO consider re-integrating lexical error handling into the parser? + let parse_errors = self.errors; + let lex_errors = self.tokens.finish(); + + // Fast path for when there are no lex errors. + // There's no fast path for when there are no parse errors because a lex error + // always results in a parse error. + if lex_errors.is_empty() { + return parse_errors; + } + + let mut merged = Vec::with_capacity(parse_errors.len().saturating_add(lex_errors.len())); + + let mut parse_errors = parse_errors.into_iter().peekable(); + let mut lex_errors = lex_errors.into_iter().peekable(); + + while let (Some(parse_error), Some(lex_error)) = (parse_errors.peek(), lex_errors.peek()) { + match parse_error + .location + .start() + .cmp(&lex_error.location().start()) + { + Ordering::Less => merged.push(parse_errors.next().unwrap()), + Ordering::Equal => { + // Skip the parse error if we already have a lex error at the same location.. + parse_errors.next().unwrap(); + merged.push(lex_errors.next().unwrap().into()); + } + Ordering::Greater => merged.push(lex_errors.next().unwrap().into()), + } + } + + merged.extend(parse_errors); + merged.extend(lex_errors.map(ParseError::from)); + + merged + } + + #[inline] + #[must_use] + fn set_ctx(&mut self, ctx: ParserCtxFlags) -> SavedParserContext { + SavedParserContext { + flags: std::mem::replace(&mut self.ctx, ctx), + bomb: DebugDropBomb::new( + "You must restore the old parser context explicit by calling `restore_ctx`", + ), + } + } + + #[inline] + fn restore_ctx(&mut self, current: ParserCtxFlags, mut saved_context: SavedParserContext) { + assert_eq!(self.ctx, current); + saved_context.bomb.defuse(); + self.ctx = saved_context.flags; + } + + #[inline] + fn has_ctx(&self, ctx: ParserCtxFlags) -> bool { + self.ctx.intersects(ctx) + } + + /// Returns the start position for a node that starts at the current token. + fn node_start(&self) -> TextSize { + self.current_token_range().start() + } + + fn node_range(&self, start: TextSize) -> TextRange { + // It's possible during error recovery that the parsing didn't consume any tokens. In that case, + // `last_token_end` still points to the end of the previous token but `start` is the start of the current token. + // Calling `TextRange::new(start, self.last_token_end)` would panic in that case because `start > end`. + // This path "detects" this case and creates an empty range instead. + if self.node_start() == start { + TextRange::empty(start) + } else { + TextRange::new(start, self.last_token_end) + } + } + + fn missing_node_range(&self) -> TextRange { + // TODO(dhruvmanila): This range depends on whether the missing node is + // on the leftmost or the rightmost of the expression. It's incorrect for + // the leftmost missing node because the range is outside the expression + // range. For example, + // + // ```python + // value = ** y + // # ^^^^ expression range + // # ^ last token end + // ``` + TextRange::empty(self.last_token_end) + } + + /// Moves the parser to the next token. + /// + /// Returns the old current token as an owned value. + fn next_token(&mut self) -> Spanned { + let next = self + .tokens + .next() + .unwrap_or_else(|| (Tok::EndOfFile, TextRange::empty(self.tokens_range.end()))); + + self.current_token_id.increment(); + + let current = std::mem::replace(&mut self.current, next); + + if !matches!( + current.0, + // TODO explore including everything up to the dedent as part of the body. + Tok::Dedent + // Don't include newlines in the body + | Tok::Newline + // TODO(micha): Including the semi feels more correct but it isn't compatible with lalrpop and breaks the + // formatters semicolon detection. Exclude it for now + | Tok::Semi + ) { + self.last_token_end = current.1.end(); + } + + current + } + + /// Returns the next token kind without consuming it. + fn peek(&self) -> TokenKind { + self.tokens + .peek() + .map_or(TokenKind::EndOfFile, |spanned| spanned.0) + } + + /// Returns the current token kind along with its range. + /// + /// Use [`Parser::current_token_kind`] or [`Parser::current_token_range`] to only get the kind + /// or range respectively. + #[inline] + fn current_token(&self) -> (TokenKind, TextRange) { + (self.current_token_kind(), self.current_token_range()) + } + + /// Returns the current token kind. + #[inline] + fn current_token_kind(&self) -> TokenKind { + // TODO: Converting the token kind over and over again can be expensive. + TokenKind::from_token(&self.current.0) + } + + /// Returns the range of the current token. + #[inline] + fn current_token_range(&self) -> TextRange { + self.current.1 + } + + /// Returns the current token ID. + #[inline] + fn current_token_id(&self) -> TokenId { + self.current_token_id + } + + /// Eat the current token if it is of the given kind, returning `true` in + /// that case. Otherwise, return `false`. + fn eat(&mut self, kind: TokenKind) -> bool { + if self.at(kind) { + self.next_token(); + true + } else { + false + } + } + + /// Bumps the current token assuming it is of the given kind. + /// + /// Returns the current token as an owned value. + /// + /// # Panics + /// + /// If the current token is not of the given kind. + fn bump(&mut self, kind: TokenKind) -> (Tok, TextRange) { + assert_eq!(self.current_token_kind(), kind); + + self.next_token() + } + + /// Bumps the current token assuming it is found in the given token set. + /// + /// Returns the current token as an owned value. + /// + /// # Panics + /// + /// If the current token is not found in the given token set. + fn bump_ts(&mut self, ts: TokenSet) -> (Tok, TextRange) { + assert!(ts.contains(self.current_token_kind())); + + self.next_token() + } + + fn expect(&mut self, expected: TokenKind) -> bool { + if self.eat(expected) { + return true; + } + + let (found, range) = self.current_token(); + self.add_error(ParseErrorType::ExpectedToken { found, expected }, range); + false + } + + fn add_error(&mut self, error: ParseErrorType, ranged: T) + where + T: Ranged, + { + fn inner(errors: &mut Vec, error: ParseErrorType, range: TextRange) { + // Avoid flagging multiple errors at the same location + let is_same_location = errors + .last() + .is_some_and(|last| last.location.start() == range.start()); + + if !is_same_location { + errors.push(ParseError { + error, + location: range, + }); + } + } + + inner(&mut self.errors, error, ranged.range()); + } + + /// Returns `true` if the current token is of the given kind. + fn at(&self, kind: TokenKind) -> bool { + self.current_token_kind() == kind + } + + /// Returns `true` if the current token is found in the given token set. + fn at_ts(&self, ts: TokenSet) -> bool { + ts.contains(self.current_token_kind()) + } + + fn src_text(&self, ranged: T) -> &'src str + where + T: Ranged, + { + let range = ranged.range(); + // `ranged` uses absolute ranges to the source text of an entire file. Fix the source by + // subtracting the start offset when parsing only a part of a file (when parsing the tokens + // from `lex_starts_at`). + &self.source[range - self.tokens_range.start()] + } + + /// Parses a list of elements into a vector where each element is parsed using + /// the given `parse_element` function. + fn parse_list_into_vec( + &mut self, + recovery_context_kind: RecoveryContextKind, + parse_element: impl Fn(&mut Parser<'src>) -> T, + ) -> Vec { + let mut elements = Vec::new(); + self.parse_list(recovery_context_kind, |p| elements.push(parse_element(p))); + elements + } + + /// Parses a list of elements where each element is parsed using the given + /// `parse_element` function. + /// + /// The difference between this function and `parse_list_into_vec` is that + /// this function does not return the parsed elements. Instead, it is the + /// caller's responsibility to handle the parsed elements. This is the reason + /// that the `parse_element` parameter is bound to [`FnMut`] instead of [`Fn`]. + fn parse_list( + &mut self, + recovery_context_kind: RecoveryContextKind, + mut parse_element: impl FnMut(&mut Parser<'src>), + ) { + let mut progress = ParserProgress::default(); + + let saved_context = self.recovery_context; + self.recovery_context = self + .recovery_context + .union(RecoveryContext::from_kind(recovery_context_kind)); + + loop { + progress.assert_progressing(self); + + // The end of file marker ends all lists. + if self.at(TokenKind::EndOfFile) { + break; + } + + if recovery_context_kind.is_list_element(self) { + parse_element(self); + } else if recovery_context_kind.is_list_terminator(self) { + break; + } else { + // Not a recognised element. Add an error and either skip the token or break + // parsing the list if the token is recognised as an element or terminator of an + // enclosing list. + let error = recovery_context_kind.create_error(self); + self.add_error(error, self.current_token_range()); + + // Run the error recovery: This also handles the case when an element is missing + // between two commas: `a,,b` + if self.is_enclosing_list_element_or_terminator() { + break; + } + + self.next_token(); + } + } + + self.recovery_context = saved_context; + } + + /// Parses a comma separated list of elements into a vector where each element + /// is parsed using the given `parse_element` function. + fn parse_comma_separated_list_into_vec( + &mut self, + recovery_context_kind: RecoveryContextKind, + parse_element: impl Fn(&mut Parser<'src>) -> T, + ) -> Vec { + let mut elements = Vec::new(); + self.parse_comma_separated_list(recovery_context_kind, |p| elements.push(parse_element(p))); + elements + } + + /// Parses a comma separated list of elements where each element is parsed + /// sing the given `parse_element` function. + /// + /// The difference between this function and `parse_comma_separated_list_into_vec` + /// is that this function does not return the parsed elements. Instead, it is the + /// caller's responsibility to handle the parsed elements. This is the reason + /// that the `parse_element` parameter is bound to [`FnMut`] instead of [`Fn`]. + fn parse_comma_separated_list( + &mut self, + recovery_context_kind: RecoveryContextKind, + mut parse_element: impl FnMut(&mut Parser<'src>), + ) { + let mut progress = ParserProgress::default(); + + let saved_context = self.recovery_context; + self.recovery_context = self + .recovery_context + .union(RecoveryContext::from_kind(recovery_context_kind)); + + let mut trailing_comma_range: Option = None; + + loop { + progress.assert_progressing(self); + + // The end of file marker ends all lists. + if self.at(TokenKind::EndOfFile) { + break; + } + + if recovery_context_kind.is_list_element(self) { + parse_element(self); + + let maybe_comma_range = self.current_token_range(); + if self.eat(TokenKind::Comma) { + trailing_comma_range = Some(maybe_comma_range); + continue; + } + trailing_comma_range = None; + + if recovery_context_kind.is_list_terminator(self) { + break; + } + + self.expect(TokenKind::Comma); + } else if recovery_context_kind.is_list_terminator(self) { + break; + } else { + // Not a recognised element. Add an error and either skip the token or break + // parsing the list if the token is recognised as an element or terminator of an + // enclosing list. + let error = recovery_context_kind.create_error(self); + self.add_error(error, self.current_token_range()); + + // Run the error recovery: This also handles the case when an element is missing + // between two commas: `a,,b` + if self.is_enclosing_list_element_or_terminator() { + break; + } + + if self.at(TokenKind::Comma) { + trailing_comma_range = Some(self.current_token_range()); + } else { + trailing_comma_range = None; + } + + self.next_token(); + } + } + + if let Some(trailing_comma_range) = trailing_comma_range { + if !recovery_context_kind.allow_trailing_comma() { + self.add_error( + ParseErrorType::OtherError("Trailing comma not allowed".to_string()), + trailing_comma_range, + ); + } + } + + self.recovery_context = saved_context; + } + + #[cold] + fn is_enclosing_list_element_or_terminator(&self) -> bool { + for context in self.recovery_context.kind_iter() { + if context.is_list_terminator(self) || context.is_list_element(self) { + return true; + } + } + + false + } +} + +#[derive(Copy, Clone, Debug, Eq, PartialEq)] +enum SequenceMatchPatternParentheses { + Tuple, + List, +} + +impl SequenceMatchPatternParentheses { + /// Returns the token kind that closes the parentheses. + const fn closing_kind(self) -> TokenKind { + match self { + SequenceMatchPatternParentheses::Tuple => TokenKind::Rpar, + SequenceMatchPatternParentheses::List => TokenKind::Rsqb, + } + } + + /// Returns `true` if the parentheses are for a list pattern e.g., `case [a, b]: ...`. + const fn is_list(self) -> bool { + matches!(self, SequenceMatchPatternParentheses::List) + } +} + +bitflags! { + #[derive(Default, Debug, Clone, Copy, PartialEq, Eq)] + struct ParserCtxFlags: u8 { + const FOR_TARGET = 1 << 2; + } +} + +#[derive(Debug, PartialEq, Copy, Clone)] +enum FunctionKind { + /// A lambda expression, e.g., `lambda x: x` + Lambda, + /// A function definition, e.g., `def f(x): ...` + FunctionDef, +} + +impl FunctionKind { + /// Returns the token that terminates a list of parameters. + const fn list_terminator(self) -> TokenKind { + match self { + FunctionKind::Lambda => TokenKind::Colon, + FunctionKind::FunctionDef => TokenKind::Rpar, + } + } +} + +#[derive(Debug, PartialEq, Copy, Clone)] +enum WithItemKind { + /// A list of `with` items that are surrounded by parentheses. + /// + /// ```python + /// with (item1, item2): ... + /// with (item1, item2 as foo): ... + /// ``` + /// + /// The parentheses belongs to the `with` statement. + Parenthesized, + + /// The `with` item has a parenthesized expression. + /// + /// ```python + /// with (item) as foo: ... + /// ``` + /// + /// The parentheses belongs to the context expression. + ParenthesizedExpression, + + /// A list of `with` items that has only one item which is a parenthesized + /// generator expression. + /// + /// ```python + /// with (x for x in range(10)): ... + /// ``` + /// + /// The parentheses belongs to the generator expression. + SingleParenthesizedGeneratorExpression, + + /// The `with` items aren't parenthesized in any way. + /// + /// ```python + /// with item: ... + /// with item as foo: ... + /// with item1, item2: ... + /// ``` + /// + /// There are no parentheses around the items. + Unparenthesized, +} + +impl WithItemKind { + /// Returns the token that terminates a list of `with` items. + const fn list_terminator(self) -> TokenKind { + match self { + WithItemKind::Parenthesized => TokenKind::Rpar, + WithItemKind::Unparenthesized + | WithItemKind::ParenthesizedExpression + | WithItemKind::SingleParenthesizedGeneratorExpression => TokenKind::Colon, + } + } + + /// Returns `true` if the `with` item is a parenthesized expression i.e., the + /// parentheses belong to the context expression. + const fn is_parenthesized_expression(self) -> bool { + matches!( + self, + WithItemKind::ParenthesizedExpression + | WithItemKind::SingleParenthesizedGeneratorExpression + ) + } +} + +#[derive(Debug, PartialEq, Copy, Clone)] +enum Parenthesized { + /// The elements are parenthesized, e.g., `(a, b)`. + Yes, + /// The elements are not parenthesized, e.g., `a, b`. + No, +} + +impl From for Parenthesized { + fn from(value: bool) -> Self { + if value { + Parenthesized::Yes + } else { + Parenthesized::No + } + } +} + +impl Parenthesized { + /// Returns `true` if the parenthesized value is `Yes`. + const fn is_yes(self) -> bool { + matches!(self, Parenthesized::Yes) + } +} + +#[derive(Copy, Clone, Debug)] +enum RecoveryContextKind { + /// When parsing a list of statements at the module level i.e., at the top level of a file. + ModuleStatements, + + /// When parsing a list of statements in a block e.g., the body of a function or a class. + BlockStatements, + + /// The `elif` clauses of an `if` statement + Elif, + + /// The `except` clauses of a `try` statement + Except, + + /// When parsing a list of assignment targets + AssignmentTargets, + + /// When parsing a list of type parameters + TypeParams, + + /// When parsing a list of names in a `from ... import ...` statement + ImportFromAsNames(Parenthesized), + + /// When parsing a list of names in an `import` statement + ImportNames, + + /// When parsing a list of slice elements e.g., `data[1, 2]`. + /// + /// This is different from `ListElements` as the surrounding context is + /// different in that the list is part of a subscript expression. + Slices, + + /// When parsing a list of elements in a list expression e.g., `[1, 2]` + ListElements, + + /// When parsing a list of elements in a set expression e.g., `{1, 2}` + SetElements, + + /// When parsing a list of elements in a dictionary expression e.g., `{1: "a", **data}` + DictElements, + + /// When parsing a list of elements in a tuple expression e.g., `(1, 2)` + TupleElements(Parenthesized), + + /// When parsing a list of patterns in a match statement with an optional + /// parentheses, e.g., `case a, b: ...`, `case (a, b): ...`, `case [a, b]: ...` + SequenceMatchPattern(Option), + + /// When parsing a mapping pattern in a match statement + MatchPatternMapping, + + /// When parsing a list of arguments in a class pattern for the match statement + MatchPatternClassArguments, + + /// When parsing a list of arguments in a function call or a class definition + Arguments, + + /// When parsing a `del` statement + DeleteTargets, + + /// When parsing a list of identifiers + Identifiers, + + /// When parsing a list of parameters in a function definition which can be + /// either a function definition or a lambda expression. + Parameters(FunctionKind), + + /// When parsing a list of items in a `with` statement + WithItems(WithItemKind), + + /// When parsing a list of f-string elements which are either literal elements + /// or expressions. + FStringElements, +} + +impl RecoveryContextKind { + /// Returns `true` if a trailing comma is allowed in the current context. + const fn allow_trailing_comma(self) -> bool { + matches!( + self, + RecoveryContextKind::Slices + | RecoveryContextKind::TupleElements(_) + | RecoveryContextKind::SetElements + | RecoveryContextKind::ListElements + | RecoveryContextKind::DictElements + | RecoveryContextKind::Arguments + | RecoveryContextKind::MatchPatternMapping + | RecoveryContextKind::SequenceMatchPattern(_) + | RecoveryContextKind::MatchPatternClassArguments + // Only allow a trailing comma if the with item itself is parenthesized + | RecoveryContextKind::WithItems(WithItemKind::Parenthesized) + | RecoveryContextKind::Parameters(_) + | RecoveryContextKind::TypeParams + | RecoveryContextKind::DeleteTargets + | RecoveryContextKind::ImportFromAsNames(Parenthesized::Yes) + ) + } + + fn is_list_terminator(self, p: &Parser) -> bool { + match self { + // The program must consume all tokens until the end + RecoveryContextKind::ModuleStatements => false, + RecoveryContextKind::BlockStatements => p.at(TokenKind::Dedent), + + RecoveryContextKind::Elif => p.at(TokenKind::Else), + RecoveryContextKind::Except => { + matches!(p.current_token_kind(), TokenKind::Finally | TokenKind::Else) + } + RecoveryContextKind::AssignmentTargets => { + // test_ok assign_targets_terminator + // x = y = z = 1; a, b + // x = y = z = 1 + // a, b + matches!(p.current_token_kind(), TokenKind::Newline | TokenKind::Semi) + } + + // Tokens other than `]` are for better error recovery. For example, recover when we + // find the `:` of a clause header or the equal of a type assignment. + RecoveryContextKind::TypeParams => { + matches!( + p.current_token_kind(), + TokenKind::Rsqb + | TokenKind::Newline + | TokenKind::Colon + | TokenKind::Equal + | TokenKind::Lpar + ) + } + // The names of an import statement cannot be parenthesized, so `)` is not a + // terminator. + RecoveryContextKind::ImportNames => { + // test_ok import_stmt_terminator + // import a, b; import c, d + // import a, b + // c, d + matches!(p.current_token_kind(), TokenKind::Semi | TokenKind::Newline) + } + RecoveryContextKind::ImportFromAsNames(_) => { + // test_ok from_import_stmt_terminator + // from a import (b, c) + // from a import (b, c); x, y + // from a import b, c; x, y + // from a import b, c + // x, y + matches!( + p.current_token_kind(), + TokenKind::Rpar | TokenKind::Semi | TokenKind::Newline + ) + } + // The elements in a container expression cannot end with a newline + // as all of them are actually non-logical newlines. + RecoveryContextKind::Slices | RecoveryContextKind::ListElements => { + p.at(TokenKind::Rsqb) + } + RecoveryContextKind::SetElements | RecoveryContextKind::DictElements => { + p.at(TokenKind::Rbrace) + } + RecoveryContextKind::TupleElements(parenthesized) => { + if parenthesized.is_yes() { + p.at(TokenKind::Rpar) + } else { + p.at_sequence_end() + } + } + RecoveryContextKind::SequenceMatchPattern(parentheses) => match parentheses { + None => { + // test_ok match_sequence_pattern_terminator + // match subject: + // case a: ... + // case a if x: ... + // case a, b: ... + // case a, b if x: ... + matches!(p.current_token_kind(), TokenKind::Colon | TokenKind::If) + } + Some(parentheses) => { + // test_ok match_sequence_pattern_parentheses_terminator + // match subject: + // case [a, b]: ... + // case (a, b): ... + p.at(parentheses.closing_kind()) + } + }, + RecoveryContextKind::MatchPatternMapping => p.at(TokenKind::Rbrace), + RecoveryContextKind::MatchPatternClassArguments => p.at(TokenKind::Rpar), + RecoveryContextKind::Arguments => p.at(TokenKind::Rpar), + RecoveryContextKind::DeleteTargets | RecoveryContextKind::Identifiers => { + // test_ok del_targets_terminator + // del a, b; c, d + // del a, b + // c, d + matches!(p.current_token_kind(), TokenKind::Semi | TokenKind::Newline) + } + RecoveryContextKind::Parameters(function_kind) => { + // `lambda x, y: ...` or `def f(x, y): ...` + p.at(function_kind.list_terminator()) + // To recover from missing closing parentheses + || p.at(TokenKind::Rarrow) + || p.at_compound_stmt() + } + RecoveryContextKind::WithItems(with_item_kind) => { + p.at(with_item_kind.list_terminator()) + } + RecoveryContextKind::FStringElements => { + // Tokens other than `FStringEnd` and `}` are for better error recovery + p.at_ts(TokenSet::new([ + TokenKind::FStringEnd, + // test_err unterminated_fstring_newline_recovery + // f"hello + // 1 + 1 + // f"hello {x + // 2 + 2 + // f"hello {x: + // 3 + 3 + // f"hello {x} + // 4 + 4 + TokenKind::Newline, + // When the parser is parsing f-string elements inside format spec, + // the terminator would be `}`. + + // test_ok fstring_format_spec_terminator + // f"hello {x:} world" + // f"hello {x:.3f} world" + TokenKind::Rbrace, + ])) + } + } + } + + fn is_list_element(self, p: &Parser) -> bool { + match self { + RecoveryContextKind::ModuleStatements => p.at_stmt(), + RecoveryContextKind::BlockStatements => p.at_stmt(), + RecoveryContextKind::Elif => p.at(TokenKind::Elif), + RecoveryContextKind::Except => p.at(TokenKind::Except), + RecoveryContextKind::AssignmentTargets => p.at(TokenKind::Equal), + RecoveryContextKind::TypeParams => p.at_type_param(), + RecoveryContextKind::ImportNames => p.at(TokenKind::Name), + RecoveryContextKind::ImportFromAsNames(_) => { + matches!(p.current_token_kind(), TokenKind::Star | TokenKind::Name) + } + RecoveryContextKind::Slices => p.at(TokenKind::Colon) || p.at_expr(), + RecoveryContextKind::ListElements + | RecoveryContextKind::SetElements + | RecoveryContextKind::TupleElements(_) => p.at_expr(), + RecoveryContextKind::DictElements => p.at(TokenKind::DoubleStar) || p.at_expr(), + RecoveryContextKind::SequenceMatchPattern(_) => { + // `+` doesn't start any pattern but is here for better error recovery. + p.at(TokenKind::Plus) || p.at_pattern_start() + } + RecoveryContextKind::MatchPatternMapping => { + // A star pattern is invalid as a mapping key and is here only for + // better error recovery. + p.at(TokenKind::Star) || p.at_mapping_pattern_start() + } + RecoveryContextKind::MatchPatternClassArguments => p.at_pattern_start(), + RecoveryContextKind::Arguments => p.at_expr(), + RecoveryContextKind::DeleteTargets => p.at_expr(), + RecoveryContextKind::Identifiers => p.at(TokenKind::Name), + RecoveryContextKind::Parameters(_) => matches!( + p.current_token_kind(), + TokenKind::Name | TokenKind::Star | TokenKind::DoubleStar | TokenKind::Slash + ), + RecoveryContextKind::WithItems(_) => p.at_expr(), + RecoveryContextKind::FStringElements => matches!( + p.current_token_kind(), + // Literal element + TokenKind::FStringMiddle + // Expression element + | TokenKind::Lbrace + ), + } + } + + fn create_error(self, p: &Parser) -> ParseErrorType { + match self { + RecoveryContextKind::ModuleStatements | RecoveryContextKind::BlockStatements => { + if p.at(TokenKind::Indent) { + ParseErrorType::UnexpectedIndentation + } else { + ParseErrorType::OtherError("Expected a statement".to_string()) + } + } + RecoveryContextKind::Elif => ParseErrorType::OtherError( + "Expected an `elif` or `else` clause, or the end of the `if` statement." + .to_string(), + ), + RecoveryContextKind::Except => ParseErrorType::OtherError( + "Expected an `except` or `finally` clause or the end of the `try` statement." + .to_string(), + ), + RecoveryContextKind::AssignmentTargets => { + if p.current_token_kind().is_keyword() { + ParseErrorType::OtherError( + "The keyword is not allowed as a variable declaration name".to_string(), + ) + } else { + ParseErrorType::OtherError("Expected an assignment target".to_string()) + } + } + RecoveryContextKind::TypeParams => ParseErrorType::OtherError( + "Expected a type parameter or the end of the type parameter list".to_string(), + ), + RecoveryContextKind::ImportFromAsNames(parenthesized) => { + if parenthesized.is_yes() { + ParseErrorType::OtherError("Expected an import name or a ')'".to_string()) + } else { + ParseErrorType::OtherError("Expected an import name".to_string()) + } + } + RecoveryContextKind::ImportNames => { + ParseErrorType::OtherError("Expected an import name".to_string()) + } + RecoveryContextKind::Slices => ParseErrorType::OtherError( + "Expected an expression or the end of the slice list".to_string(), + ), + RecoveryContextKind::ListElements => { + ParseErrorType::OtherError("Expected an expression or a ']'".to_string()) + } + RecoveryContextKind::SetElements | RecoveryContextKind::DictElements => { + ParseErrorType::OtherError("Expected an expression or a '}'".to_string()) + } + RecoveryContextKind::TupleElements(parenthesized) => { + if parenthesized.is_yes() { + ParseErrorType::OtherError("Expected an expression or a ')'".to_string()) + } else { + ParseErrorType::OtherError("Expected an expression".to_string()) + } + } + RecoveryContextKind::SequenceMatchPattern(_) => ParseErrorType::OtherError( + "Expected a pattern or the end of the sequence pattern".to_string(), + ), + RecoveryContextKind::MatchPatternMapping => ParseErrorType::OtherError( + "Expected a mapping pattern or the end of the mapping pattern".to_string(), + ), + RecoveryContextKind::MatchPatternClassArguments => { + ParseErrorType::OtherError("Expected a pattern or a ')'".to_string()) + } + RecoveryContextKind::Arguments => { + ParseErrorType::OtherError("Expected an expression or a ')'".to_string()) + } + RecoveryContextKind::DeleteTargets => { + ParseErrorType::OtherError("Expected a delete target".to_string()) + } + RecoveryContextKind::Identifiers => { + ParseErrorType::OtherError("Expected an identifier".to_string()) + } + RecoveryContextKind::Parameters(_) => ParseErrorType::OtherError( + "Expected a parameter or the end of the parameter list".to_string(), + ), + RecoveryContextKind::WithItems(with_item_kind) => match with_item_kind { + WithItemKind::Parenthesized => { + ParseErrorType::OtherError("Expected an expression or a ')'".to_string()) + } + _ => ParseErrorType::OtherError( + "Expected an expression or the end of the with item list".to_string(), + ), + }, + RecoveryContextKind::FStringElements => ParseErrorType::OtherError( + "Expected an f-string element or the end of the f-string".to_string(), + ), + } + } +} + +#[derive(Debug, Copy, Clone, Default, PartialEq, Eq)] +struct RecoveryContext(u32); + +bitflags! { + impl RecoveryContext: u32 { + const MODULE_STATEMENTS = 1 << 0; + const BLOCK_STATEMENTS = 1 << 1; + const ELIF = 1 << 2; + const EXCEPT = 1 << 3; + const ASSIGNMENT_TARGETS = 1 << 4; + const TYPE_PARAMS = 1 << 5; + const IMPORT_FROM_AS_NAMES_PARENTHESIZED = 1 << 6; + const IMPORT_FROM_AS_NAMES_UNPARENTHESIZED = 1 << 7; + const IMPORT_NAMES = 1 << 8; + const SLICES = 1 << 9; + const LIST_ELEMENTS = 1 << 10; + const SET_ELEMENTS = 1 << 11; + const DICT_ELEMENTS = 1 << 12; + const TUPLE_ELEMENTS_PARENTHESIZED = 1 << 13; + const TUPLE_ELEMENTS_UNPARENTHESIZED = 1 << 14; + const SEQUENCE_MATCH_PATTERN = 1 << 15; + const SEQUENCE_MATCH_PATTERN_LIST = 1 << 16; + const SEQUENCE_MATCH_PATTERN_TUPLE = 1 << 17; + const MATCH_PATTERN_MAPPING = 1 << 18; + const MATCH_PATTERN_CLASS_ARGUMENTS = 1 << 19; + const ARGUMENTS = 1 << 20; + const DELETE = 1 << 21; + const IDENTIFIERS = 1 << 22; + const FUNCTION_PARAMETERS = 1 << 23; + const LAMBDA_PARAMETERS = 1 << 24; + const WITH_ITEMS_PARENTHESIZED = 1 << 25; + const WITH_ITEMS_PARENTHESIZED_EXPRESSION = 1 << 26; + const WITH_ITEMS_SINGLE_PARENTHESIZED_GENERATOR_EXPRESSION = 1 << 27; + const WITH_ITEMS_UNPARENTHESIZED = 1 << 28; + const F_STRING_ELEMENTS = 1 << 29; + } +} + +impl RecoveryContext { + const fn from_kind(kind: RecoveryContextKind) -> Self { + match kind { + RecoveryContextKind::ModuleStatements => RecoveryContext::MODULE_STATEMENTS, + RecoveryContextKind::BlockStatements => RecoveryContext::BLOCK_STATEMENTS, + RecoveryContextKind::Elif => RecoveryContext::ELIF, + RecoveryContextKind::Except => RecoveryContext::EXCEPT, + RecoveryContextKind::AssignmentTargets => RecoveryContext::ASSIGNMENT_TARGETS, + RecoveryContextKind::TypeParams => RecoveryContext::TYPE_PARAMS, + RecoveryContextKind::ImportFromAsNames(parenthesized) => match parenthesized { + Parenthesized::Yes => RecoveryContext::IMPORT_FROM_AS_NAMES_PARENTHESIZED, + Parenthesized::No => RecoveryContext::IMPORT_FROM_AS_NAMES_UNPARENTHESIZED, + }, + RecoveryContextKind::ImportNames => RecoveryContext::IMPORT_NAMES, + RecoveryContextKind::Slices => RecoveryContext::SLICES, + RecoveryContextKind::ListElements => RecoveryContext::LIST_ELEMENTS, + RecoveryContextKind::SetElements => RecoveryContext::SET_ELEMENTS, + RecoveryContextKind::DictElements => RecoveryContext::DICT_ELEMENTS, + RecoveryContextKind::TupleElements(parenthesized) => match parenthesized { + Parenthesized::Yes => RecoveryContext::TUPLE_ELEMENTS_PARENTHESIZED, + Parenthesized::No => RecoveryContext::TUPLE_ELEMENTS_UNPARENTHESIZED, + }, + RecoveryContextKind::SequenceMatchPattern(parentheses) => match parentheses { + None => RecoveryContext::SEQUENCE_MATCH_PATTERN, + Some(SequenceMatchPatternParentheses::List) => { + RecoveryContext::SEQUENCE_MATCH_PATTERN_LIST + } + Some(SequenceMatchPatternParentheses::Tuple) => { + RecoveryContext::SEQUENCE_MATCH_PATTERN_TUPLE + } + }, + RecoveryContextKind::MatchPatternMapping => RecoveryContext::MATCH_PATTERN_MAPPING, + RecoveryContextKind::MatchPatternClassArguments => { + RecoveryContext::MATCH_PATTERN_CLASS_ARGUMENTS + } + RecoveryContextKind::Arguments => RecoveryContext::ARGUMENTS, + RecoveryContextKind::DeleteTargets => RecoveryContext::DELETE, + RecoveryContextKind::Identifiers => RecoveryContext::IDENTIFIERS, + RecoveryContextKind::Parameters(function_kind) => match function_kind { + FunctionKind::Lambda => RecoveryContext::LAMBDA_PARAMETERS, + FunctionKind::FunctionDef => RecoveryContext::FUNCTION_PARAMETERS, + }, + RecoveryContextKind::WithItems(with_item_kind) => match with_item_kind { + WithItemKind::Parenthesized => RecoveryContext::WITH_ITEMS_PARENTHESIZED, + WithItemKind::ParenthesizedExpression => { + RecoveryContext::WITH_ITEMS_PARENTHESIZED_EXPRESSION + } + WithItemKind::SingleParenthesizedGeneratorExpression => { + RecoveryContext::WITH_ITEMS_SINGLE_PARENTHESIZED_GENERATOR_EXPRESSION + } + WithItemKind::Unparenthesized => RecoveryContext::WITH_ITEMS_UNPARENTHESIZED, + }, + RecoveryContextKind::FStringElements => RecoveryContext::F_STRING_ELEMENTS, + } + } + + /// Safe conversion to the corresponding [`RecoveryContextKind`] (inverse of [`Self::from_kind`]). + /// + /// Returns `None` if the `RecoveryContext` is empty or has multiple flags set. + const fn to_kind(self) -> Option { + Some(match self { + RecoveryContext::MODULE_STATEMENTS => RecoveryContextKind::ModuleStatements, + RecoveryContext::BLOCK_STATEMENTS => RecoveryContextKind::BlockStatements, + RecoveryContext::ELIF => RecoveryContextKind::Elif, + RecoveryContext::EXCEPT => RecoveryContextKind::Except, + RecoveryContext::ASSIGNMENT_TARGETS => RecoveryContextKind::AssignmentTargets, + RecoveryContext::TYPE_PARAMS => RecoveryContextKind::TypeParams, + RecoveryContext::IMPORT_FROM_AS_NAMES_PARENTHESIZED => { + RecoveryContextKind::ImportFromAsNames(Parenthesized::Yes) + } + RecoveryContext::IMPORT_FROM_AS_NAMES_UNPARENTHESIZED => { + RecoveryContextKind::ImportFromAsNames(Parenthesized::No) + } + RecoveryContext::IMPORT_NAMES => RecoveryContextKind::ImportNames, + RecoveryContext::SLICES => RecoveryContextKind::Slices, + RecoveryContext::LIST_ELEMENTS => RecoveryContextKind::ListElements, + RecoveryContext::SET_ELEMENTS => RecoveryContextKind::SetElements, + RecoveryContext::DICT_ELEMENTS => RecoveryContextKind::DictElements, + RecoveryContext::TUPLE_ELEMENTS_PARENTHESIZED => { + RecoveryContextKind::TupleElements(Parenthesized::Yes) + } + RecoveryContext::TUPLE_ELEMENTS_UNPARENTHESIZED => { + RecoveryContextKind::TupleElements(Parenthesized::No) + } + RecoveryContext::SEQUENCE_MATCH_PATTERN => { + RecoveryContextKind::SequenceMatchPattern(None) + } + RecoveryContext::SEQUENCE_MATCH_PATTERN_LIST => { + RecoveryContextKind::SequenceMatchPattern(Some( + SequenceMatchPatternParentheses::List, + )) + } + RecoveryContext::SEQUENCE_MATCH_PATTERN_TUPLE => { + RecoveryContextKind::SequenceMatchPattern(Some( + SequenceMatchPatternParentheses::Tuple, + )) + } + RecoveryContext::MATCH_PATTERN_MAPPING => RecoveryContextKind::MatchPatternMapping, + RecoveryContext::MATCH_PATTERN_CLASS_ARGUMENTS => { + RecoveryContextKind::MatchPatternClassArguments + } + RecoveryContext::ARGUMENTS => RecoveryContextKind::Arguments, + RecoveryContext::DELETE => RecoveryContextKind::DeleteTargets, + RecoveryContext::IDENTIFIERS => RecoveryContextKind::Identifiers, + RecoveryContext::FUNCTION_PARAMETERS => { + RecoveryContextKind::Parameters(FunctionKind::FunctionDef) + } + RecoveryContext::LAMBDA_PARAMETERS => { + RecoveryContextKind::Parameters(FunctionKind::Lambda) + } + RecoveryContext::WITH_ITEMS_PARENTHESIZED => { + RecoveryContextKind::WithItems(WithItemKind::Parenthesized) + } + RecoveryContext::WITH_ITEMS_PARENTHESIZED_EXPRESSION => { + RecoveryContextKind::WithItems(WithItemKind::ParenthesizedExpression) + } + RecoveryContext::WITH_ITEMS_SINGLE_PARENTHESIZED_GENERATOR_EXPRESSION => { + RecoveryContextKind::WithItems(WithItemKind::SingleParenthesizedGeneratorExpression) + } + RecoveryContext::WITH_ITEMS_UNPARENTHESIZED => { + RecoveryContextKind::WithItems(WithItemKind::Unparenthesized) + } + RecoveryContext::F_STRING_ELEMENTS => RecoveryContextKind::FStringElements, + _ => return None, + }) + } + + fn kind_iter(self) -> impl Iterator { + self.iter().map(|context| { + context + .to_kind() + .expect("Expected context to be of a single kind.") + }) + } +} + +#[derive(Debug)] +struct SavedParserContext { + flags: ParserCtxFlags, + bomb: DebugDropBomb, +} diff --git a/crates/ruff_python_parser/src/parser/pattern.rs b/crates/ruff_python_parser/src/parser/pattern.rs new file mode 100644 index 0000000000..9395676227 --- /dev/null +++ b/crates/ruff_python_parser/src/parser/pattern.rs @@ -0,0 +1,752 @@ +use ruff_python_ast::{self as ast, Expr, ExprContext, Number, Operator, Pattern, Singleton}; +use ruff_text_size::{Ranged, TextSize}; + +use crate::parser::progress::ParserProgress; +use crate::parser::{recovery, Parser, RecoveryContextKind, SequenceMatchPatternParentheses}; +use crate::token_set::TokenSet; +use crate::{ParseErrorType, Tok, TokenKind}; + +/// The set of tokens that can start a literal pattern. +const LITERAL_PATTERN_START_SET: TokenSet = TokenSet::new([ + TokenKind::None, + TokenKind::True, + TokenKind::False, + TokenKind::String, + TokenKind::Int, + TokenKind::Float, + TokenKind::Complex, + TokenKind::Minus, // Unary minus +]); + +/// The set of tokens that can start a pattern. +const PATTERN_START_SET: TokenSet = TokenSet::new([ + // Star pattern + TokenKind::Star, + // Capture pattern + // Wildcard pattern ('_' is a name token) + // Value pattern (name or attribute) + // Class pattern + TokenKind::Name, + // Group pattern + TokenKind::Lpar, + // Sequence pattern + TokenKind::Lsqb, + // Mapping pattern + TokenKind::Lbrace, +]) +.union(LITERAL_PATTERN_START_SET); + +/// The set of tokens that can start a mapping pattern. +const MAPPING_PATTERN_START_SET: TokenSet = TokenSet::new([ + // Double star pattern + TokenKind::DoubleStar, + // Value pattern + TokenKind::Name, +]) +.union(LITERAL_PATTERN_START_SET); + +impl<'src> Parser<'src> { + /// Returns `true` if the current token is a valid start of a pattern. + pub(super) fn at_pattern_start(&self) -> bool { + self.at_ts(PATTERN_START_SET) + } + + /// Returns `true` if the current token is a valid start of a mapping pattern. + pub(super) fn at_mapping_pattern_start(&self) -> bool { + self.at_ts(MAPPING_PATTERN_START_SET) + } + + /// Entry point to start parsing a pattern. + /// + /// See: + pub(super) fn parse_match_patterns(&mut self) -> Pattern { + let start = self.node_start(); + + // We don't yet know if it's a sequence pattern or a single pattern, so + // we need to allow star pattern here. + let pattern = self.parse_match_pattern(AllowStarPattern::Yes); + + if self.at(TokenKind::Comma) { + Pattern::MatchSequence(self.parse_sequence_match_pattern(pattern, start, None)) + } else { + // We know it's not a sequence pattern now, so check for star pattern usage. + if pattern.is_match_star() { + self.add_error(ParseErrorType::InvalidStarPatternUsage, &pattern); + } + pattern + } + } + + /// Parses an `or_pattern` or an `as_pattern`. + /// + /// See: + fn parse_match_pattern(&mut self, allow_star_pattern: AllowStarPattern) -> Pattern { + let start = self.node_start(); + + // We don't yet know if it's an or pattern or an as pattern, so use whatever + // was passed in. + let mut lhs = self.parse_match_pattern_lhs(allow_star_pattern); + + // Or pattern + if self.at(TokenKind::Vbar) { + // We know it's an `or` pattern now, so check for star pattern usage. + if lhs.is_match_star() { + self.add_error(ParseErrorType::InvalidStarPatternUsage, &lhs); + } + + let mut patterns = vec![lhs]; + let mut progress = ParserProgress::default(); + + while self.eat(TokenKind::Vbar) { + progress.assert_progressing(self); + let pattern = self.parse_match_pattern_lhs(AllowStarPattern::No); + patterns.push(pattern); + } + + lhs = Pattern::MatchOr(ast::PatternMatchOr { + range: self.node_range(start), + patterns, + }); + } + + // As pattern + if self.eat(TokenKind::As) { + // We know it's an `as` pattern now, so check for star pattern usage. + if lhs.is_match_star() { + self.add_error(ParseErrorType::InvalidStarPatternUsage, &lhs); + } + + let ident = self.parse_identifier(); + lhs = Pattern::MatchAs(ast::PatternMatchAs { + range: self.node_range(start), + name: Some(ident), + pattern: Some(Box::new(lhs)), + }); + } + + lhs + } + + /// Parses a pattern. + /// + /// See: + fn parse_match_pattern_lhs(&mut self, allow_star_pattern: AllowStarPattern) -> Pattern { + let start = self.node_start(); + + let mut lhs = match self.current_token_kind() { + TokenKind::Lbrace => Pattern::MatchMapping(self.parse_match_pattern_mapping()), + TokenKind::Star => { + let star_pattern = self.parse_match_pattern_star(); + if allow_star_pattern.is_no() { + self.add_error(ParseErrorType::InvalidStarPatternUsage, &star_pattern); + } + Pattern::MatchStar(star_pattern) + } + TokenKind::Lpar | TokenKind::Lsqb => self.parse_parenthesized_or_sequence_pattern(), + _ => self.parse_match_pattern_literal(), + }; + + if self.at(TokenKind::Lpar) { + lhs = Pattern::MatchClass(self.parse_match_pattern_class(lhs, start)); + } + + if matches!( + self.current_token_kind(), + TokenKind::Plus | TokenKind::Minus + ) { + lhs = Pattern::MatchValue(self.parse_complex_literal_pattern(lhs, start)); + } + + lhs + } + + /// Parses a mapping pattern. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `{` token. + /// + /// See: + fn parse_match_pattern_mapping(&mut self) -> ast::PatternMatchMapping { + let start = self.node_start(); + self.bump(TokenKind::Lbrace); + + let mut keys = vec![]; + let mut patterns = vec![]; + let mut rest = None; + + self.parse_comma_separated_list(RecoveryContextKind::MatchPatternMapping, |parser| { + let mapping_item_start = parser.node_start(); + + if parser.eat(TokenKind::DoubleStar) { + let identifier = parser.parse_identifier(); + if rest.is_some() { + parser.add_error( + ParseErrorType::OtherError( + "Only one double star pattern is allowed".to_string(), + ), + parser.node_range(mapping_item_start), + ); + } + // TODO(dhruvmanila): It's not possible to retain multiple double starred + // patterns because of the way the mapping node is represented in the grammar. + // The last value will always win. Update the AST representation. + // See: https://github.com/astral-sh/ruff/pull/10477#discussion_r1535143536 + rest = Some(identifier); + } else { + let key = match parser.parse_match_pattern_lhs(AllowStarPattern::No) { + Pattern::MatchValue(ast::PatternMatchValue { value, .. }) => *value, + Pattern::MatchSingleton(ast::PatternMatchSingleton { value, range }) => { + match value { + Singleton::None => Expr::NoneLiteral(ast::ExprNoneLiteral { range }), + Singleton::True => { + Expr::BooleanLiteral(ast::ExprBooleanLiteral { value: true, range }) + } + Singleton::False => Expr::BooleanLiteral(ast::ExprBooleanLiteral { + value: false, + range, + }), + } + } + pattern => { + parser.add_error( + ParseErrorType::OtherError("Invalid mapping pattern key".to_string()), + &pattern, + ); + recovery::pattern_to_expr(pattern) + } + }; + keys.push(key); + + parser.expect(TokenKind::Colon); + + patterns.push(parser.parse_match_pattern(AllowStarPattern::No)); + + if rest.is_some() { + parser.add_error( + ParseErrorType::OtherError( + "Pattern cannot follow a double star pattern".to_string(), + ), + parser.node_range(mapping_item_start), + ); + } + } + }); + + self.expect(TokenKind::Rbrace); + + ast::PatternMatchMapping { + range: self.node_range(start), + keys, + patterns, + rest, + } + } + + /// Parses a star pattern. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `*` token. + /// + /// See: + fn parse_match_pattern_star(&mut self) -> ast::PatternMatchStar { + let start = self.node_start(); + self.bump(TokenKind::Star); + + let ident = self.parse_identifier(); + + ast::PatternMatchStar { + range: self.node_range(start), + name: if ident.is_valid() && ident.id == "_" { + None + } else { + Some(ident) + }, + } + } + + /// Parses a parenthesized pattern or a sequence pattern. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `(` or `[` token. + /// + /// See: + fn parse_parenthesized_or_sequence_pattern(&mut self) -> Pattern { + let start = self.node_start(); + let parentheses = if self.eat(TokenKind::Lpar) { + SequenceMatchPatternParentheses::Tuple + } else { + self.bump(TokenKind::Lsqb); + SequenceMatchPatternParentheses::List + }; + + if matches!( + self.current_token_kind(), + TokenKind::Newline | TokenKind::Colon + ) { + // TODO(dhruvmanila): This recovery isn't possible currently because + // of the soft keyword transformer. If there's a missing closing + // parenthesis, it'll consider `case` a name token instead. + self.add_error( + ParseErrorType::OtherError(format!( + "Missing '{closing}'", + closing = if parentheses.is_list() { "]" } else { ")" } + )), + self.current_token_range(), + ); + } + + if self.eat(parentheses.closing_kind()) { + return Pattern::MatchSequence(ast::PatternMatchSequence { + patterns: vec![], + range: self.node_range(start), + }); + } + + let mut pattern = self.parse_match_pattern(AllowStarPattern::Yes); + + if parentheses.is_list() || self.at(TokenKind::Comma) { + pattern = Pattern::MatchSequence(self.parse_sequence_match_pattern( + pattern, + start, + Some(parentheses), + )); + } else { + self.expect(parentheses.closing_kind()); + } + + pattern + } + + /// Parses the rest of a sequence pattern, given the first element. + /// + /// If the `parentheses` is `None`, it is an [open sequence pattern]. + /// + /// See: + /// + /// [open sequence pattern]: https://docs.python.org/3/reference/compound_stmts.html#grammar-token-python-grammar-open_sequence_pattern + fn parse_sequence_match_pattern( + &mut self, + first_element: Pattern, + start: TextSize, + parentheses: Option, + ) -> ast::PatternMatchSequence { + if parentheses.is_some_and(|parentheses| { + self.at(parentheses.closing_kind()) || self.peek() == parentheses.closing_kind() + }) { + // The comma is optional if it is a single-element sequence + self.eat(TokenKind::Comma); + } else { + self.expect(TokenKind::Comma); + } + + let mut patterns = vec![first_element]; + + self.parse_comma_separated_list( + RecoveryContextKind::SequenceMatchPattern(parentheses), + |parser| patterns.push(parser.parse_match_pattern(AllowStarPattern::Yes)), + ); + + if let Some(parentheses) = parentheses { + self.expect(parentheses.closing_kind()); + } + + ast::PatternMatchSequence { + range: self.node_range(start), + patterns, + } + } + + /// Parses a literal pattern. + /// + /// See: + fn parse_match_pattern_literal(&mut self) -> Pattern { + let start = self.node_start(); + match self.current_token_kind() { + TokenKind::None => { + self.bump(TokenKind::None); + Pattern::MatchSingleton(ast::PatternMatchSingleton { + value: Singleton::None, + range: self.node_range(start), + }) + } + TokenKind::True => { + self.bump(TokenKind::True); + Pattern::MatchSingleton(ast::PatternMatchSingleton { + value: Singleton::True, + range: self.node_range(start), + }) + } + TokenKind::False => { + self.bump(TokenKind::False); + Pattern::MatchSingleton(ast::PatternMatchSingleton { + value: Singleton::False, + range: self.node_range(start), + }) + } + TokenKind::String | TokenKind::FStringStart => { + let str = self.parse_strings(); + + Pattern::MatchValue(ast::PatternMatchValue { + value: Box::new(str), + range: self.node_range(start), + }) + } + TokenKind::Complex => { + let (Tok::Complex { real, imag }, _) = self.bump(TokenKind::Complex) else { + unreachable!() + }; + let range = self.node_range(start); + + Pattern::MatchValue(ast::PatternMatchValue { + value: Box::new(Expr::NumberLiteral(ast::ExprNumberLiteral { + value: Number::Complex { real, imag }, + range, + })), + range, + }) + } + TokenKind::Int => { + let (Tok::Int { value }, _) = self.bump(TokenKind::Int) else { + unreachable!() + }; + let range = self.node_range(start); + + Pattern::MatchValue(ast::PatternMatchValue { + value: Box::new(Expr::NumberLiteral(ast::ExprNumberLiteral { + value: Number::Int(value), + range, + })), + range, + }) + } + TokenKind::Float => { + let (Tok::Float { value }, _) = self.bump(TokenKind::Float) else { + unreachable!() + }; + let range = self.node_range(start); + + Pattern::MatchValue(ast::PatternMatchValue { + value: Box::new(Expr::NumberLiteral(ast::ExprNumberLiteral { + value: Number::Float(value), + range, + })), + range, + }) + } + TokenKind::Name if self.peek() == TokenKind::Dot => { + let (Tok::Name { name }, _) = self.bump(TokenKind::Name) else { + unreachable!() + }; + let id = Expr::Name(ast::ExprName { + id: name.to_string(), + ctx: ExprContext::Load, + range: self.node_range(start), + }); + + let attribute = self.parse_attr_expr_for_match_pattern(id, start); + + Pattern::MatchValue(ast::PatternMatchValue { + value: Box::new(attribute), + range: self.node_range(start), + }) + } + TokenKind::Name => { + let (Tok::Name { name }, _) = self.bump(TokenKind::Name) else { + unreachable!() + }; + let range = self.node_range(start); + + // test_ok match_as_pattern + // match foo: + // case foo_bar: ... + // case _: ... + Pattern::MatchAs(ast::PatternMatchAs { + range, + pattern: None, + name: if &*name == "_" { + None + } else { + Some(ast::Identifier { + id: name.to_string(), + range, + }) + }, + }) + } + // The `+` is only for better error recovery. + TokenKind::Minus | TokenKind::Plus + if matches!( + self.peek(), + TokenKind::Int | TokenKind::Float | TokenKind::Complex + ) => + { + let unary_expr = self.parse_unary_expression(); + + if unary_expr.op.is_u_add() { + self.add_error( + ParseErrorType::OtherError( + "Unary '+' is not allowed as a literal pattern".to_string(), + ), + &unary_expr, + ); + } + + Pattern::MatchValue(ast::PatternMatchValue { + value: Box::new(Expr::UnaryOp(unary_expr)), + range: self.node_range(start), + }) + } + kind => { + // Upon encountering an unexpected token, return a `Pattern::MatchValue` containing + // an empty `Expr::Name`. + let invalid_node = if kind.is_keyword() { + Expr::Name(self.parse_name()) + } else { + self.add_error( + ParseErrorType::OtherError("Expected a pattern".to_string()), + self.current_token_range(), + ); + Expr::Name(ast::ExprName { + range: self.missing_node_range(), + id: String::new(), + ctx: ExprContext::Invalid, + }) + }; + + Pattern::MatchValue(ast::PatternMatchValue { + range: invalid_node.range(), + value: Box::new(invalid_node), + }) + } + } + } + + /// Parses a complex literal pattern, given the `lhs` pattern and the `start` + /// position of the pattern. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `+` or `-` token. + /// + /// See: + fn parse_complex_literal_pattern( + &mut self, + lhs: Pattern, + start: TextSize, + ) -> ast::PatternMatchValue { + let operator = if self.eat(TokenKind::Plus) { + Operator::Add + } else { + self.bump(TokenKind::Minus); + Operator::Sub + }; + + let lhs_value = if let Pattern::MatchValue(lhs) = lhs { + if !is_real_number(&lhs.value) { + self.add_error(ParseErrorType::ExpectedRealNumber, &lhs); + } + lhs.value + } else { + self.add_error(ParseErrorType::ExpectedRealNumber, &lhs); + Box::new(recovery::pattern_to_expr(lhs)) + }; + + let rhs_pattern = self.parse_match_pattern_lhs(AllowStarPattern::No); + let rhs_value = if let Pattern::MatchValue(rhs) = rhs_pattern { + if !is_complex_number(&rhs.value) { + self.add_error(ParseErrorType::ExpectedImaginaryNumber, &rhs); + } + rhs.value + } else { + self.add_error(ParseErrorType::ExpectedImaginaryNumber, &rhs_pattern); + Box::new(recovery::pattern_to_expr(rhs_pattern)) + }; + + let range = self.node_range(start); + + ast::PatternMatchValue { + value: Box::new(Expr::BinOp(ast::ExprBinOp { + left: lhs_value, + op: operator, + right: rhs_value, + range, + })), + range, + } + } + + /// Parses an attribute expression until the current token is not a `.`. + fn parse_attr_expr_for_match_pattern(&mut self, mut lhs: Expr, start: TextSize) -> Expr { + while self.current_token_kind() == TokenKind::Dot { + lhs = Expr::Attribute(self.parse_attribute_expression(lhs, start)); + } + + lhs + } + + /// Parses the [pattern arguments] in a class pattern. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `(` token. + /// + /// See: + /// + /// [pattern arguments]: https://docs.python.org/3/reference/compound_stmts.html#grammar-token-python-grammar-pattern_arguments + fn parse_match_pattern_class( + &mut self, + cls: Pattern, + start: TextSize, + ) -> ast::PatternMatchClass { + let arguments_start = self.node_start(); + + let cls = match cls { + Pattern::MatchAs(ast::PatternMatchAs { + pattern: None, + name: Some(ident), + .. + }) => { + if ident.is_valid() { + Box::new(Expr::Name(ast::ExprName { + range: ident.range(), + id: ident.id, + ctx: ExprContext::Load, + })) + } else { + Box::new(Expr::Name(ast::ExprName { + range: ident.range(), + id: String::new(), + ctx: ExprContext::Invalid, + })) + } + } + Pattern::MatchValue(ast::PatternMatchValue { value, .. }) + if matches!(&*value, Expr::Attribute(_)) => + { + value + } + pattern => { + self.add_error( + ParseErrorType::OtherError("Invalid value for a class pattern".to_string()), + &pattern, + ); + Box::new(recovery::pattern_to_expr(pattern)) + } + }; + + self.bump(TokenKind::Lpar); + + let mut patterns = vec![]; + let mut keywords = vec![]; + let mut has_seen_pattern = false; + let mut has_seen_keyword_pattern = false; + + self.parse_comma_separated_list( + RecoveryContextKind::MatchPatternClassArguments, + |parser| { + let pattern_start = parser.node_start(); + let pattern = parser.parse_match_pattern(AllowStarPattern::No); + + if parser.eat(TokenKind::Equal) { + has_seen_pattern = false; + has_seen_keyword_pattern = true; + + let key = if let Pattern::MatchAs(ast::PatternMatchAs { + pattern: None, + name: Some(name), + .. + }) = pattern + { + name + } else { + parser.add_error( + ParseErrorType::OtherError( + "Expected an identifier for the keyword pattern".to_string(), + ), + &pattern, + ); + ast::Identifier { + id: String::new(), + range: parser.missing_node_range(), + } + }; + + let value_pattern = parser.parse_match_pattern(AllowStarPattern::No); + + keywords.push(ast::PatternKeyword { + attr: key, + pattern: value_pattern, + range: parser.node_range(pattern_start), + }); + } else { + has_seen_pattern = true; + patterns.push(pattern); + } + + if has_seen_keyword_pattern && has_seen_pattern { + parser.add_error( + ParseErrorType::OtherError( + "Positional patterns cannot follow keyword patterns".to_string(), + ), + parser.node_range(pattern_start), + ); + } + }, + ); + + self.expect(TokenKind::Rpar); + + ast::PatternMatchClass { + cls, + arguments: ast::PatternArguments { + patterns, + keywords, + range: self.node_range(arguments_start), + }, + range: self.node_range(start), + } + } +} + +#[derive(Debug, Clone, Copy)] +enum AllowStarPattern { + Yes, + No, +} + +impl AllowStarPattern { + const fn is_no(self) -> bool { + matches!(self, AllowStarPattern::No) + } +} + +/// Returns `true` if the given expression is a real number literal or a unary +/// addition or subtraction of a real number literal. +const fn is_real_number(expr: &Expr) -> bool { + match expr { + Expr::NumberLiteral(ast::ExprNumberLiteral { + value: ast::Number::Int(_) | ast::Number::Float(_), + .. + }) => true, + Expr::UnaryOp(ast::ExprUnaryOp { + op: ast::UnaryOp::UAdd | ast::UnaryOp::USub, + operand, + .. + }) => is_real_number(operand), + _ => false, + } +} + +/// Returns `true` if the given expression is a complex number literal. +const fn is_complex_number(expr: &Expr) -> bool { + matches!( + expr, + Expr::NumberLiteral(ast::ExprNumberLiteral { + value: ast::Number::Complex { .. }, + .. + }) + ) +} diff --git a/crates/ruff_python_parser/src/parser/progress.rs b/crates/ruff_python_parser/src/parser/progress.rs new file mode 100644 index 0000000000..ad6f3884cb --- /dev/null +++ b/crates/ruff_python_parser/src/parser/progress.rs @@ -0,0 +1,46 @@ +use crate::parser::Parser; + +#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)] +pub(super) struct TokenId(u32); + +impl TokenId { + /// Increments the value of the token ID. + pub(super) fn increment(&mut self) { + // It's fine to just wrap around because the main purpose is to check whether + // the previous token ID is different from the current token ID. + self.0 = self.0.wrapping_add(1); + } +} + +/// Captures the progress of the parser and allows to test if the parsing is still making progress +#[derive(Debug, Copy, Clone, Default)] +pub(super) struct ParserProgress(Option); + +impl ParserProgress { + /// Returns true if the parser has passed this position + #[inline] + fn has_progressed(self, p: &Parser) -> bool { + match self.0 { + None => true, + Some(prev_token_id) => prev_token_id != p.current_token_id(), + } + } + + /// Asserts that the parsing is still making progress. + /// + /// # Panics + /// + /// Panics if the parser hasn't progressed since the last call. + #[inline] + pub(super) fn assert_progressing(&mut self, p: &Parser) { + assert!( + self.has_progressed(p), + "The parser is no longer progressing. Stuck at '{}' {:?}:{:?}", + p.src_text(p.current_token_range()), + p.current_token_kind(), + p.current_token_range(), + ); + + self.0 = Some(p.current_token_id()); + } +} diff --git a/crates/ruff_python_parser/src/parser/recovery.rs b/crates/ruff_python_parser/src/parser/recovery.rs new file mode 100644 index 0000000000..9d25c99ccd --- /dev/null +++ b/crates/ruff_python_parser/src/parser/recovery.rs @@ -0,0 +1,168 @@ +use ruff_python_ast::{self as ast, Expr, ExprContext, Pattern}; +use ruff_text_size::{Ranged, TextLen, TextRange}; + +/// Convert the given [`Pattern`] to an [`Expr`]. +/// +/// This is used to convert an invalid use of pattern to their equivalent expression +/// to preserve the structure of the pattern. +/// +/// The conversion is done as follows: +/// - `PatternMatchSingleton`: Boolean and None literals +/// - `PatternMatchValue`: The value itself +/// - `PatternMatchSequence`: List literal +/// - `PatternMatchMapping`: Dictionary literal +/// - `PatternMatchClass`: Call expression +/// - `PatternMatchStar`: Starred expression +/// - `PatternMatchAs`: The pattern itself or the name +/// - `PatternMatchOr`: Binary expression with `|` operator +/// +/// Note that the sequence pattern is always converted to a list literal even +/// if it was surrounded by parentheses. +/// +/// # Note +/// +/// This function returns an invalid [`ast::ExprName`] if the given pattern is a [`Pattern::MatchAs`] +/// with both the pattern and name present. This is because it cannot be converted to an expression +/// without dropping one of them as there's no way to represent `x as y` as a valid expression. +pub(super) fn pattern_to_expr(pattern: Pattern) -> Expr { + match pattern { + Pattern::MatchSingleton(ast::PatternMatchSingleton { range, value }) => match value { + ast::Singleton::True => { + Expr::BooleanLiteral(ast::ExprBooleanLiteral { value: true, range }) + } + ast::Singleton::False => Expr::BooleanLiteral(ast::ExprBooleanLiteral { + value: false, + range, + }), + ast::Singleton::None => Expr::NoneLiteral(ast::ExprNoneLiteral { range }), + }, + Pattern::MatchValue(ast::PatternMatchValue { value, .. }) => *value, + // We don't know which kind of sequence this is: `case [1, 2]:` or `case (1, 2):`. + Pattern::MatchSequence(ast::PatternMatchSequence { range, patterns }) => { + Expr::List(ast::ExprList { + elts: patterns.into_iter().map(pattern_to_expr).collect(), + ctx: ExprContext::Store, + range, + }) + } + Pattern::MatchMapping(ast::PatternMatchMapping { + range, + keys, + patterns, + rest, + }) => { + let mut keys = keys.into_iter().map(Option::Some).collect::>(); + let mut values = patterns + .into_iter() + .map(pattern_to_expr) + .collect::>(); + if let Some(rest) = rest { + keys.push(None); + values.push(Expr::Name(ast::ExprName { + range: rest.range, + id: rest.id, + ctx: ExprContext::Store, + })); + } + Expr::Dict(ast::ExprDict { + range, + keys, + values, + }) + } + Pattern::MatchClass(ast::PatternMatchClass { + range, + cls, + arguments, + }) => Expr::Call(ast::ExprCall { + range, + func: cls, + arguments: ast::Arguments { + range: arguments.range, + args: arguments + .patterns + .into_iter() + .map(pattern_to_expr) + .collect(), + keywords: arguments + .keywords + .into_iter() + .map(|keyword_pattern| ast::Keyword { + range: keyword_pattern.range, + arg: Some(keyword_pattern.attr), + value: pattern_to_expr(keyword_pattern.pattern), + }) + .collect(), + }, + }), + Pattern::MatchStar(ast::PatternMatchStar { range, name }) => { + if let Some(name) = name { + Expr::Starred(ast::ExprStarred { + range, + value: Box::new(Expr::Name(ast::ExprName { + range: name.range, + id: name.id, + ctx: ExprContext::Store, + })), + ctx: ExprContext::Store, + }) + } else { + Expr::Starred(ast::ExprStarred { + range, + value: Box::new(Expr::Name(ast::ExprName { + range: TextRange::new(range.end() - "_".text_len(), range.end()), + id: "_".to_string(), + ctx: ExprContext::Store, + })), + ctx: ExprContext::Store, + }) + } + } + Pattern::MatchAs(ast::PatternMatchAs { + range, + pattern, + name, + }) => match (pattern, name) { + (Some(_), Some(_)) => Expr::Name(ast::ExprName { + range, + id: String::new(), + ctx: ExprContext::Invalid, + }), + (Some(pattern), None) => pattern_to_expr(*pattern), + (None, Some(name)) => Expr::Name(ast::ExprName { + range: name.range, + id: name.id, + ctx: ExprContext::Store, + }), + (None, None) => Expr::Name(ast::ExprName { + range, + id: "_".to_string(), + ctx: ExprContext::Store, + }), + }, + Pattern::MatchOr(ast::PatternMatchOr { patterns, .. }) => { + let to_bin_expr = |left: Pattern, right: Pattern| ast::ExprBinOp { + range: TextRange::new(left.start(), right.end()), + left: Box::new(pattern_to_expr(left)), + op: ast::Operator::BitOr, + right: Box::new(pattern_to_expr(right)), + }; + + let mut iter = patterns.into_iter(); + + match (iter.next(), iter.next()) { + (Some(left), Some(right)) => { + Expr::BinOp(iter.fold(to_bin_expr(left, right), |expr_bin_op, pattern| { + ast::ExprBinOp { + range: TextRange::new(expr_bin_op.start(), pattern.end()), + left: Box::new(Expr::BinOp(expr_bin_op)), + op: ast::Operator::BitOr, + right: Box::new(pattern_to_expr(pattern)), + } + })) + } + _ => unreachable!("Or patterns can only be formed with at least two patterns."), + } + } + } +} diff --git a/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__expr_mode_invalid_syntax1.snap b/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__expr_mode_invalid_syntax1.snap new file mode 100644 index 0000000000..a3b74e9fad --- /dev/null +++ b/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__expr_mode_invalid_syntax1.snap @@ -0,0 +1,8 @@ +--- +source: crates/ruff_python_parser/src/parser/tests.rs +expression: error +--- +ParseError { + error: UnexpectedExpressionToken, + location: 6..12, +} diff --git a/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__expr_mode_invalid_syntax2.snap b/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__expr_mode_invalid_syntax2.snap new file mode 100644 index 0000000000..ba26114dd8 --- /dev/null +++ b/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__expr_mode_invalid_syntax2.snap @@ -0,0 +1,8 @@ +--- +source: crates/ruff_python_parser/src/parser/tests.rs +expression: error +--- +ParseError { + error: UnexpectedExpressionToken, + location: 7..13, +} diff --git a/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__expr_mode_invalid_syntax3.snap b/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__expr_mode_invalid_syntax3.snap new file mode 100644 index 0000000000..ba26114dd8 --- /dev/null +++ b/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__expr_mode_invalid_syntax3.snap @@ -0,0 +1,8 @@ +--- +source: crates/ruff_python_parser/src/parser/tests.rs +expression: error +--- +ParseError { + error: UnexpectedExpressionToken, + location: 7..13, +} diff --git a/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__expr_mode_valid_syntax.snap b/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__expr_mode_valid_syntax.snap new file mode 100644 index 0000000000..3f8f1ed6de --- /dev/null +++ b/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__expr_mode_valid_syntax.snap @@ -0,0 +1,11 @@ +--- +source: crates/ruff_python_parser/src/parser/tests.rs +expression: expr +--- +Name( + ExprName { + range: 0..5, + id: "first", + ctx: Load, + }, +) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__ipython_escape_commands.snap b/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__ipython_escape_commands.snap similarity index 99% rename from crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__ipython_escape_commands.snap rename to crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__ipython_escape_commands.snap index 1ec5ddd1fd..cc658cadf8 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__ipython_escape_commands.snap +++ b/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__ipython_escape_commands.snap @@ -1,5 +1,5 @@ --- -source: crates/ruff_python_parser/src/parser.rs +source: crates/ruff_python_parser/src/parser/tests.rs expression: parse_ast --- Module( diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__unicode_aliases.snap b/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__unicode_aliases.snap similarity index 95% rename from crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__unicode_aliases.snap rename to crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__unicode_aliases.snap index 8468f2c175..67b838399a 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__unicode_aliases.snap +++ b/crates/ruff_python_parser/src/parser/snapshots/ruff_python_parser__parser__tests__unicode_aliases.snap @@ -1,5 +1,5 @@ --- -source: crates/ruff_python_parser/src/parser.rs +source: crates/ruff_python_parser/src/parser/tests.rs expression: parse_ast --- [ diff --git a/crates/ruff_python_parser/src/parser/statement.rs b/crates/ruff_python_parser/src/parser/statement.rs new file mode 100644 index 0000000000..eb490328fd --- /dev/null +++ b/crates/ruff_python_parser/src/parser/statement.rs @@ -0,0 +1,3461 @@ +use std::fmt::Display; +use std::hash::BuildHasherDefault; + +use rustc_hash::FxHashSet; + +use ruff_python_ast::{ + self as ast, ExceptHandler, Expr, ExprContext, IpyEscapeKind, Operator, Stmt, WithItem, +}; +use ruff_text_size::{Ranged, TextRange, TextSize}; + +use crate::parser::expression::{GeneratorExpressionInParentheses, ParsedExpr, EXPR_SET}; +use crate::parser::progress::ParserProgress; +use crate::parser::{ + helpers, FunctionKind, Parser, ParserCtxFlags, RecoveryContext, RecoveryContextKind, + WithItemKind, +}; +use crate::token_set::TokenSet; +use crate::{Mode, ParseErrorType, Tok, TokenKind}; + +use super::expression::{AllowNamedExpression, AllowStarredExpression}; +use super::Parenthesized; + +/// Tokens that represent compound statements. +const COMPOUND_STMT_SET: TokenSet = TokenSet::new([ + TokenKind::Match, + TokenKind::If, + TokenKind::With, + TokenKind::While, + TokenKind::For, + TokenKind::Try, + TokenKind::Def, + TokenKind::Class, + TokenKind::Async, + TokenKind::At, +]); + +/// Tokens that represent simple statements, but doesn't include expressions. +const SIMPLE_STMT_SET: TokenSet = TokenSet::new([ + TokenKind::Pass, + TokenKind::Return, + TokenKind::Break, + TokenKind::Continue, + TokenKind::Global, + TokenKind::Nonlocal, + TokenKind::Assert, + TokenKind::Yield, + TokenKind::Del, + TokenKind::Raise, + TokenKind::Import, + TokenKind::From, + TokenKind::Type, + TokenKind::IpyEscapeCommand, +]); + +/// Tokens that represent simple statements, including expressions. +const SIMPLE_STMT_WITH_EXPR_SET: TokenSet = SIMPLE_STMT_SET.union(EXPR_SET); + +/// Tokens that represents all possible statements, including simple, compound, +/// and expression statements. +const STMTS_SET: TokenSet = SIMPLE_STMT_WITH_EXPR_SET.union(COMPOUND_STMT_SET); + +/// Tokens that represent operators that can be used in augmented assignments. +const AUGMENTED_ASSIGN_SET: TokenSet = TokenSet::new([ + TokenKind::PlusEqual, + TokenKind::MinusEqual, + TokenKind::StarEqual, + TokenKind::DoubleStarEqual, + TokenKind::SlashEqual, + TokenKind::DoubleSlashEqual, + TokenKind::PercentEqual, + TokenKind::AtEqual, + TokenKind::AmperEqual, + TokenKind::VbarEqual, + TokenKind::CircumflexEqual, + TokenKind::LeftShiftEqual, + TokenKind::RightShiftEqual, +]); + +impl<'src> Parser<'src> { + /// Returns `true` if the current token is the start of a compound statement. + pub(super) fn at_compound_stmt(&self) -> bool { + self.at_ts(COMPOUND_STMT_SET) + } + + /// Returns `true` if the current token is the start of a simple statement, + /// including expressions. + fn at_simple_stmt(&self) -> bool { + self.at_ts(SIMPLE_STMT_WITH_EXPR_SET) + } + + /// Returns `true` if the current token is the start of a simple, compound or expression + /// statement. + pub(super) fn at_stmt(&self) -> bool { + self.at_ts(STMTS_SET) + } + + /// Checks if the parser is currently positioned at the start of a type parameter. + pub(super) fn at_type_param(&self) -> bool { + let token = self.current_token_kind(); + matches!( + token, + TokenKind::Star | TokenKind::DoubleStar | TokenKind::Name + ) || token.is_keyword() + } + + /// Parses a compound or a single simple statement. + /// + /// See: + /// - + /// - + pub(super) fn parse_statement(&mut self) -> Stmt { + let start = self.node_start(); + + match self.current_token_kind() { + TokenKind::If => Stmt::If(self.parse_if_statement()), + TokenKind::For => Stmt::For(self.parse_for_statement(start)), + TokenKind::While => Stmt::While(self.parse_while_statement()), + TokenKind::Def => Stmt::FunctionDef(self.parse_function_definition(vec![], start)), + TokenKind::Class => Stmt::ClassDef(self.parse_class_definition(vec![], start)), + TokenKind::Try => Stmt::Try(self.parse_try_statement()), + TokenKind::With => Stmt::With(self.parse_with_statement(start)), + TokenKind::At => self.parse_decorators(), + TokenKind::Async => self.parse_async_statement(), + TokenKind::Match => Stmt::Match(self.parse_match_statement()), + _ => self.parse_single_simple_statement(), + } + } + + /// Parses a single simple statement. + /// + /// This statement must be terminated by a newline or semicolon. + /// + /// Use [`Parser::parse_simple_statements`] to parse a sequence of simple statements. + fn parse_single_simple_statement(&mut self) -> Stmt { + let stmt = self.parse_simple_statement(); + + // The order of the token is important here. + let has_eaten_semicolon = self.eat(TokenKind::Semi); + let has_eaten_newline = self.eat(TokenKind::Newline); + + if !has_eaten_newline { + if !has_eaten_semicolon && self.at_simple_stmt() { + // test_err simple_stmts_on_same_line + // a b + // a + b c + d + // break; continue pass; continue break + self.add_error( + ParseErrorType::SimpleStatementsOnSameLine, + self.current_token_range(), + ); + } else if self.at_compound_stmt() { + // test_err simple_and_compound_stmt_on_same_line + // a; if b: pass; b + self.add_error( + ParseErrorType::SimpleAndCompoundStatementOnSameLine, + self.current_token_range(), + ); + } + } + + stmt + } + + /// Parses a sequence of simple statements. + /// + /// If there is more than one statement in this sequence, it is expected to be separated by a + /// semicolon. The sequence can optionally end with a semicolon, but regardless of whether + /// a semicolon is present or not, it is expected to end with a newline. + /// + /// Matches the `simple_stmts` rule in the [Python grammar]. + /// + /// [Python grammar]: https://docs.python.org/3/reference/grammar.html + fn parse_simple_statements(&mut self) -> Vec { + let mut stmts = vec![]; + let mut progress = ParserProgress::default(); + + loop { + progress.assert_progressing(self); + + stmts.push(self.parse_simple_statement()); + + if !self.eat(TokenKind::Semi) { + if self.at_simple_stmt() { + // test_err simple_stmts_on_same_line_in_block + // if True: break; continue pass; continue break + self.add_error( + ParseErrorType::SimpleStatementsOnSameLine, + self.current_token_range(), + ); + } else { + // test_ok simple_stmts_in_block + // if True: pass + // if True: pass; + // if True: pass; continue + // if True: pass; continue; + // x = 1 + break; + } + } + + if !self.at_simple_stmt() { + break; + } + } + + // Ideally, we should use `expect` here but we use `eat` for better error message. Later, + // if the parser isn't at the start of a compound statement, we'd `expect` a newline. + if !self.eat(TokenKind::Newline) { + if self.at_compound_stmt() { + // test_err simple_and_compound_stmt_on_same_line_in_block + // if True: pass if False: pass + // if True: pass; if False: pass + self.add_error( + ParseErrorType::SimpleAndCompoundStatementOnSameLine, + self.current_token_range(), + ); + } else { + // test_err multiple_clauses_on_same_line + // if True: pass elif False: pass else: pass + // if True: pass; elif False: pass; else: pass + // for x in iter: break else: pass + // for x in iter: break; else: pass + // try: pass except exc: pass else: pass finally: pass + // try: pass; except exc: pass; else: pass; finally: pass + self.add_error( + ParseErrorType::ExpectedToken { + found: self.current_token_kind(), + expected: TokenKind::Newline, + }, + self.current_token_range(), + ); + } + } + + // test_ok simple_stmts_with_semicolons + // return; import a; from x import y; z; type T = int + stmts + } + + /// Parses a simple statement. + /// + /// See: + fn parse_simple_statement(&mut self) -> Stmt { + match self.current_token_kind() { + TokenKind::Return => Stmt::Return(self.parse_return_statement()), + TokenKind::Import => Stmt::Import(self.parse_import_statement()), + TokenKind::From => Stmt::ImportFrom(self.parse_from_import_statement()), + TokenKind::Pass => Stmt::Pass(self.parse_pass_statement()), + TokenKind::Continue => Stmt::Continue(self.parse_continue_statement()), + TokenKind::Break => Stmt::Break(self.parse_break_statement()), + TokenKind::Raise => Stmt::Raise(self.parse_raise_statement()), + TokenKind::Del => Stmt::Delete(self.parse_delete_statement()), + TokenKind::Assert => Stmt::Assert(self.parse_assert_statement()), + TokenKind::Global => Stmt::Global(self.parse_global_statement()), + TokenKind::Nonlocal => Stmt::Nonlocal(self.parse_nonlocal_statement()), + TokenKind::Type => Stmt::TypeAlias(self.parse_type_alias_statement()), + TokenKind::IpyEscapeCommand => { + Stmt::IpyEscapeCommand(self.parse_ipython_escape_command_statement()) + } + _ => { + let start = self.node_start(); + + // simple_stmt: `... | yield_stmt | star_expressions | ...` + let parsed_expr = + self.parse_yield_expression_or_else(Parser::parse_star_expression_list); + + if self.at(TokenKind::Equal) { + Stmt::Assign(self.parse_assign_statement(parsed_expr, start)) + } else if self.at(TokenKind::Colon) { + Stmt::AnnAssign(self.parse_annotated_assignment_statement(parsed_expr, start)) + } else if let Some(op) = self.current_token_kind().as_augmented_assign_operator() { + Stmt::AugAssign(self.parse_augmented_assignment_statement( + parsed_expr, + op, + start, + )) + } else if self.mode == Mode::Ipython && self.at(TokenKind::Question) { + Stmt::IpyEscapeCommand( + self.parse_ipython_help_end_escape_command_statement(&parsed_expr), + ) + } else { + Stmt::Expr(ast::StmtExpr { + range: self.node_range(start), + value: Box::new(parsed_expr.expr), + }) + } + } + } + } + + /// Parses a delete statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `del` token. + /// + /// See: + fn parse_delete_statement(&mut self) -> ast::StmtDelete { + let start = self.node_start(); + self.bump(TokenKind::Del); + + // test_err del_incomplete_target + // del x, y. + // z + // del x, y[ + // z + let targets = self.parse_comma_separated_list_into_vec( + RecoveryContextKind::DeleteTargets, + |parser| { + // Allow starred expression to raise a better error message for + // an invalid delete target later. + let mut target = + parser.parse_conditional_expression_or_higher(AllowStarredExpression::Yes); + helpers::set_expr_ctx(&mut target.expr, ExprContext::Del); + + // test_err invalid_del_target + // del x + 1 + // del {'x': 1} + // del {'x', 'y'} + // del None, True, False, 1, 1.0, "abc" + parser.validate_delete_target(&target.expr); + + target.expr + }, + ); + + if targets.is_empty() { + // test_err del_stmt_empty + // del + self.add_error( + ParseErrorType::EmptyDeleteTargets, + self.current_token_range(), + ); + } + + ast::StmtDelete { + targets, + range: self.node_range(start), + } + } + + /// Parses a `return` statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `return` token. + /// + /// See: + fn parse_return_statement(&mut self) -> ast::StmtReturn { + let start = self.node_start(); + self.bump(TokenKind::Return); + + // test_err return_stmt_invalid_expr + // return * + // return yield x + // return yield from x + // return x := 1 + // return *x and y + let value = self + .at_expr() + .then(|| Box::new(self.parse_star_expression_list().expr)); + + ast::StmtReturn { + range: self.node_range(start), + value, + } + } + + /// Parses a `raise` statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `raise` token. + /// + /// See: + fn parse_raise_statement(&mut self) -> ast::StmtRaise { + let start = self.node_start(); + self.bump(TokenKind::Raise); + + let exc = if self.at(TokenKind::Newline) { + None + } else { + // test_err raise_stmt_invalid_exc + // raise *x + // raise yield x + // raise x := 1 + let exc = self.parse_expression_list(AllowStarredExpression::No); + + if let Some(ast::ExprTuple { + parenthesized: false, + .. + }) = exc.as_tuple_expr() + { + // test_err raise_stmt_unparenthesized_tuple_exc + // raise x, + // raise x, y + // raise x, y from z + self.add_error(ParseErrorType::UnparenthesizedTupleExpression, &exc); + } + + Some(Box::new(exc.expr)) + }; + + let cause = (exc.is_some() && self.eat(TokenKind::From)).then(|| { + // test_err raise_stmt_invalid_cause + // raise x from *y + // raise x from yield y + // raise x from y := 1 + let cause = self.parse_expression_list(AllowStarredExpression::No); + + if let Some(ast::ExprTuple { + parenthesized: false, + .. + }) = cause.as_tuple_expr() + { + // test_err raise_stmt_unparenthesized_tuple_cause + // raise x from y, + // raise x from y, z + self.add_error(ParseErrorType::UnparenthesizedTupleExpression, &cause); + } + + Box::new(cause.expr) + }); + + ast::StmtRaise { + range: self.node_range(start), + exc, + cause, + } + } + + /// Parses an import statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at an `import` token. + /// + /// See: + fn parse_import_statement(&mut self) -> ast::StmtImport { + let start = self.node_start(); + self.bump(TokenKind::Import); + + // test_err import_stmt_parenthesized_names + // import (a) + // import (a, b) + + // test_err import_stmt_star_import + // import * + // import x, *, y + + // test_err import_stmt_trailing_comma + // import , + // import x, y, + + let names = self + .parse_comma_separated_list_into_vec(RecoveryContextKind::ImportNames, |p| { + p.parse_alias(ImportStyle::Import) + }); + + if names.is_empty() { + // test_err import_stmt_empty + // import + self.add_error(ParseErrorType::EmptyImportNames, self.current_token_range()); + } + + ast::StmtImport { + range: self.node_range(start), + names, + } + } + + /// Parses a `from` import statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `from` token. + /// + /// See: + fn parse_from_import_statement(&mut self) -> ast::StmtImportFrom { + let start = self.node_start(); + self.bump(TokenKind::From); + + let mut leading_dots = 0; + let mut progress = ParserProgress::default(); + + loop { + progress.assert_progressing(self); + + if self.eat(TokenKind::Dot) { + leading_dots += 1; + } else if self.eat(TokenKind::Ellipsis) { + leading_dots += 3; + } else { + break; + } + } + + let module = if self.at(TokenKind::Name) { + Some(self.parse_dotted_name()) + } else { + if leading_dots == 0 { + // test_err from_import_missing_module + // from + // from import x + self.add_error( + ParseErrorType::OtherError("Expected a module name".to_string()), + self.current_token_range(), + ); + } + None + }; + + // test_ok from_import_no_space + // from.import x + // from...import x + self.expect(TokenKind::Import); + + let names_start = self.node_start(); + let mut names = vec![]; + let mut seen_star_import = false; + + let parenthesized = Parenthesized::from(self.eat(TokenKind::Lpar)); + + // test_err from_import_unparenthesized_trailing_comma + // from a import b, + // from a import b as c, + // from a import b, c, + self.parse_comma_separated_list( + RecoveryContextKind::ImportFromAsNames(parenthesized), + |parser| { + // test_err from_import_dotted_names + // from x import a. + // from x import a.b + // from x import a, b.c, d, e.f, g + let alias = parser.parse_alias(ImportStyle::ImportFrom); + seen_star_import |= alias.name.id == "*"; + names.push(alias); + }, + ); + + if names.is_empty() { + // test_err from_import_empty_names + // from x import + // from x import () + // from x import ,, + self.add_error(ParseErrorType::EmptyImportNames, self.current_token_range()); + } + + if seen_star_import && names.len() > 1 { + // test_err from_import_star_with_other_names + // from x import *, a + // from x import a, *, b + // from x import *, a as b + // from x import *, *, a + self.add_error( + ParseErrorType::OtherError("Star import must be the only import".to_string()), + self.node_range(names_start), + ); + } + + if parenthesized.is_yes() { + // test_err from_import_missing_rpar + // from x import (a, b + // 1 + 1 + // from x import (a, b, + // 2 + 2 + self.expect(TokenKind::Rpar); + } + + ast::StmtImportFrom { + module, + names, + level: Some(leading_dots), + range: self.node_range(start), + } + } + + /// Parses an `import` or `from` import name. + /// + /// See: + /// - + /// - + fn parse_alias(&mut self, style: ImportStyle) -> ast::Alias { + let start = self.node_start(); + if self.eat(TokenKind::Star) { + let range = self.node_range(start); + return ast::Alias { + name: ast::Identifier { + id: "*".into(), + range, + }, + asname: None, + range, + }; + } + + let name = match style { + ImportStyle::Import => self.parse_dotted_name(), + ImportStyle::ImportFrom => self.parse_identifier(), + }; + + let asname = if self.eat(TokenKind::As) { + if self.at(TokenKind::Name) { + Some(self.parse_identifier()) + } else { + // test_err import_alias_missing_asname + // import x as + self.add_error( + ParseErrorType::OtherError("Expected symbol after `as`".to_string()), + self.current_token_range(), + ); + None + } + } else { + None + }; + + ast::Alias { + range: self.node_range(start), + name, + asname, + } + } + + /// Parses a dotted name. + /// + /// A dotted name is a sequence of identifiers separated by a single dot. + fn parse_dotted_name(&mut self) -> ast::Identifier { + let start = self.node_start(); + + let mut dotted_name = self.parse_identifier().id; + let mut progress = ParserProgress::default(); + + while self.eat(TokenKind::Dot) { + progress.assert_progressing(self); + + // test_err dotted_name_multiple_dots + // import a..b + // import a...b + dotted_name.push('.'); + dotted_name.push_str(&self.parse_identifier()); + } + + // test_ok dotted_name_normalized_spaces + // import a.b.c + // import a . b . c + ast::Identifier { + id: dotted_name, + range: self.node_range(start), + } + } + + /// Parses a `pass` statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `pass` token. + /// + /// See: + fn parse_pass_statement(&mut self) -> ast::StmtPass { + let start = self.node_start(); + self.bump(TokenKind::Pass); + ast::StmtPass { + range: self.node_range(start), + } + } + + /// Parses a `continue` statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `continue` token. + /// + /// See: + fn parse_continue_statement(&mut self) -> ast::StmtContinue { + let start = self.node_start(); + self.bump(TokenKind::Continue); + ast::StmtContinue { + range: self.node_range(start), + } + } + + /// Parses a `break` statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `break` token. + /// + /// See: + fn parse_break_statement(&mut self) -> ast::StmtBreak { + let start = self.node_start(); + self.bump(TokenKind::Break); + ast::StmtBreak { + range: self.node_range(start), + } + } + + /// Parses an `assert` statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at an `assert` token. + /// + /// See: + fn parse_assert_statement(&mut self) -> ast::StmtAssert { + let start = self.node_start(); + self.bump(TokenKind::Assert); + + // test_err assert_empty_test + // assert + + // test_err assert_invalid_test_expr + // assert *x + // assert assert x + // assert yield x + // assert x := 1 + let test = self.parse_conditional_expression_or_higher(AllowStarredExpression::No); + + let msg = if self.eat(TokenKind::Comma) { + if self.at_expr() { + // test_err assert_invalid_msg_expr + // assert False, *x + // assert False, assert x + // assert False, yield x + // assert False, x := 1 + Some(Box::new( + self.parse_conditional_expression_or_higher(AllowStarredExpression::No) + .expr, + )) + } else { + // test_err assert_empty_msg + // assert x, + self.add_error( + ParseErrorType::ExpectedExpression, + self.current_token_range(), + ); + None + } + } else { + None + }; + + ast::StmtAssert { + test: Box::new(test.expr), + msg, + range: self.node_range(start), + } + } + + /// Parses a global statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `global` token. + /// + /// See: + fn parse_global_statement(&mut self) -> ast::StmtGlobal { + let start = self.node_start(); + self.bump(TokenKind::Global); + + // test_err global_stmt_trailing_comma + // global , + // global x, + // global x, y, + + // test_err global_stmt_expression + // global x + 1 + let names = self.parse_comma_separated_list_into_vec( + RecoveryContextKind::Identifiers, + Parser::parse_identifier, + ); + + if names.is_empty() { + // test_err global_stmt_empty + // global + self.add_error(ParseErrorType::EmptyGlobalNames, self.current_token_range()); + } + + // test_ok global_stmt + // global x + // global x, y, z + ast::StmtGlobal { + range: self.node_range(start), + names, + } + } + + /// Parses a nonlocal statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `nonlocal` token. + /// + /// See: + fn parse_nonlocal_statement(&mut self) -> ast::StmtNonlocal { + let start = self.node_start(); + self.bump(TokenKind::Nonlocal); + + // test_err nonlocal_stmt_trailing_comma + // nonlocal , + // nonlocal x, + // nonlocal x, y, + + // test_err nonlocal_stmt_expression + // nonlocal x + 1 + let names = self.parse_comma_separated_list_into_vec( + RecoveryContextKind::Identifiers, + Parser::parse_identifier, + ); + + if names.is_empty() { + // test_err nonlocal_stmt_empty + // nonlocal + self.add_error( + ParseErrorType::EmptyNonlocalNames, + self.current_token_range(), + ); + } + + // test_ok nonlocal_stmt + // nonlocal x + // nonlocal x, y, z + ast::StmtNonlocal { + range: self.node_range(start), + names, + } + } + + /// Parses a type alias statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `type` token. + /// + /// See: + fn parse_type_alias_statement(&mut self) -> ast::StmtTypeAlias { + let start = self.node_start(); + self.bump(TokenKind::Type); + + let mut name = Expr::Name(self.parse_name()); + helpers::set_expr_ctx(&mut name, ExprContext::Store); + + let type_params = self.try_parse_type_params(); + + self.expect(TokenKind::Equal); + + // test_err type_alias_incomplete_stmt + // type + // type x + // type x = + + // test_err type_alias_invalid_value_expr + // type x = *y + // type x = yield y + // type x = yield from y + // type x = x := 1 + let value = self.parse_conditional_expression_or_higher(AllowStarredExpression::No); + + ast::StmtTypeAlias { + name: Box::new(name), + type_params, + value: Box::new(value.expr), + range: self.node_range(start), + } + } + + /// Parses an IPython escape command at the statement level. + /// + /// # Panics + /// + /// If the parser isn't positioned at an `IpyEscapeCommand` token. + fn parse_ipython_escape_command_statement(&mut self) -> ast::StmtIpyEscapeCommand { + let start = self.node_start(); + + let (Tok::IpyEscapeCommand { value, kind }, _) = self.bump(TokenKind::IpyEscapeCommand) + else { + unreachable!() + }; + + let range = self.node_range(start); + if self.mode != Mode::Ipython { + self.add_error(ParseErrorType::UnexpectedIpythonEscapeCommand, range); + } + + ast::StmtIpyEscapeCommand { range, kind, value } + } + + /// Parses an IPython help end escape command at the statement level. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `?` token. + fn parse_ipython_help_end_escape_command_statement( + &mut self, + parsed_expr: &ParsedExpr, + ) -> ast::StmtIpyEscapeCommand { + // We are permissive than the original implementation because we would allow whitespace + // between the expression and the suffix while the IPython implementation doesn't allow it. + // For example, `foo ?` would be valid in our case but invalid for IPython. + fn unparse_expr(parser: &mut Parser, expr: &Expr, buffer: &mut String) { + match expr { + Expr::Name(ast::ExprName { id, .. }) => { + buffer.push_str(id.as_str()); + } + Expr::Subscript(ast::ExprSubscript { value, slice, .. }) => { + unparse_expr(parser, value, buffer); + buffer.push('['); + + if let Expr::NumberLiteral(ast::ExprNumberLiteral { + value: ast::Number::Int(integer), + .. + }) = &**slice + { + buffer.push_str(&format!("{integer}")); + } else { + parser.add_error( + ParseErrorType::OtherError( + "Only integer literals are allowed in subscript expressions in help end escape command" + .to_string() + ), + slice.range(), + ); + buffer.push_str(parser.src_text(slice.range())); + } + + buffer.push(']'); + } + Expr::Attribute(ast::ExprAttribute { value, attr, .. }) => { + unparse_expr(parser, value, buffer); + buffer.push('.'); + buffer.push_str(attr.as_str()); + } + _ => { + parser.add_error( + ParseErrorType::OtherError( + "Expected name, subscript or attribute expression in help end escape command" + .to_string() + ), + expr, + ); + } + } + } + + let start = self.node_start(); + self.bump(TokenKind::Question); + + let kind = if self.eat(TokenKind::Question) { + IpyEscapeKind::Help2 + } else { + IpyEscapeKind::Help + }; + + if parsed_expr.is_parenthesized { + let token_range = self.node_range(start); + self.add_error( + ParseErrorType::OtherError( + "Help end escape command cannot be applied on a parenthesized expression" + .to_string(), + ), + token_range, + ); + } + + if self.at(TokenKind::Question) { + self.add_error( + ParseErrorType::OtherError( + "Maximum of 2 `?` tokens are allowed in help end escape command".to_string(), + ), + self.current_token_range(), + ); + } + + let mut value = String::new(); + unparse_expr(self, &parsed_expr.expr, &mut value); + + ast::StmtIpyEscapeCommand { + value: value.into_boxed_str(), + kind, + range: self.node_range(parsed_expr.start()), + } + } + + /// Parse an assignment statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at an `=` token. + /// + /// See: + fn parse_assign_statement(&mut self, target: ParsedExpr, start: TextSize) -> ast::StmtAssign { + self.bump(TokenKind::Equal); + + let mut targets = vec![target.expr]; + + // test_err assign_stmt_missing_rhs + // x = + // 1 + 1 + // x = y = + // 2 + 2 + // x = = y + // 3 + 3 + + // test_err assign_stmt_keyword_target + // a = pass = c + // a + b + // a = b = pass = c + // a + b + + // test_err assign_stmt_invalid_value_expr + // x = *a and b + // x = *yield x + // x = *yield from x + // x = *lambda x: x + // x = x := 1 + + let mut value = self.parse_yield_expression_or_else(Parser::parse_star_expression_list); + + if self.at(TokenKind::Equal) { + // This path is only taken when there are more than one assignment targets. + self.parse_list(RecoveryContextKind::AssignmentTargets, |parser| { + parser.bump(TokenKind::Equal); + + let mut parsed_expr = + parser.parse_yield_expression_or_else(Parser::parse_star_expression_list); + + std::mem::swap(&mut value, &mut parsed_expr); + + targets.push(parsed_expr.expr); + }); + } + + for target in &mut targets { + helpers::set_expr_ctx(target, ExprContext::Store); + // test_err assign_stmt_invalid_target + // 1 = 1 + // x = 1 = 2 + // x = 1 = y = 2 = z + // ["a", "b"] = ["a", "b"] + self.validate_assignment_target(target); + } + + ast::StmtAssign { + targets, + value: Box::new(value.expr), + range: self.node_range(start), + } + } + + /// Parses an annotated assignment statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `:` token. + /// + /// See: + fn parse_annotated_assignment_statement( + &mut self, + mut target: ParsedExpr, + start: TextSize, + ) -> ast::StmtAnnAssign { + self.bump(TokenKind::Colon); + + // test_err ann_assign_stmt_invalid_target + // "abc": str = "def" + // call(): str = "no" + // *x: int = 1, 2 + // # Tuple assignment + // x,: int = 1 + // x, y: int = 1, 2 + // (x, y): int = 1, 2 + // # List assignment + // [x]: int = 1 + // [x, y]: int = 1, 2 + self.validate_annotated_assignment_target(&target.expr); + + helpers::set_expr_ctx(&mut target.expr, ExprContext::Store); + + // test_ok ann_assign_stmt_simple_target + // a: int # simple + // (a): int + // a.b: int + // a[0]: int + let simple = target.is_name_expr() && !target.is_parenthesized; + + // test_err ann_assign_stmt_invalid_annotation + // x: *int = 1 + // x: yield a = 1 + // x: yield from b = 1 + // x: y := int = 1 + + // test_err ann_assign_stmt_type_alias_annotation + // a: type X = int + // lambda: type X = int + let annotation = self.parse_conditional_expression_or_higher(AllowStarredExpression::No); + + let value = if self.eat(TokenKind::Equal) { + if self.at_expr() { + // test_err ann_assign_stmt_invalid_value + // x: Any = *a and b + // x: Any = x := 1 + // x: list = [x, *a | b, *a or b] + Some(Box::new( + self.parse_yield_expression_or_else(Parser::parse_star_expression_list) + .expr, + )) + } else { + // test_err ann_assign_stmt_missing_rhs + // x: int = + self.add_error( + ParseErrorType::ExpectedExpression, + self.current_token_range(), + ); + None + } + } else { + None + }; + + ast::StmtAnnAssign { + target: Box::new(target.expr), + annotation: Box::new(annotation.expr), + value, + simple, + range: self.node_range(start), + } + } + + /// Parses an augmented assignment statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at an augmented assignment token. + /// + /// See: + fn parse_augmented_assignment_statement( + &mut self, + mut target: ParsedExpr, + op: Operator, + start: TextSize, + ) -> ast::StmtAugAssign { + // Consume the operator + self.bump_ts(AUGMENTED_ASSIGN_SET); + + if !matches!( + &target.expr, + Expr::Name(_) | Expr::Attribute(_) | Expr::Subscript(_) + ) { + // test_err aug_assign_stmt_invalid_target + // 1 += 1 + // "a" += "b" + // *x += 1 + // pass += 1 + // x += pass + // (x + y) += 1 + self.add_error(ParseErrorType::InvalidAugmentedAssignmentTarget, &target); + } + + helpers::set_expr_ctx(&mut target.expr, ExprContext::Store); + + // test_err aug_assign_stmt_missing_rhs + // x += + // 1 + 1 + // x += y += + // 2 + 2 + + // test_err aug_assign_stmt_invalid_value + // x += *a and b + // x += *yield x + // x += *yield from x + // x += *lambda x: x + // x += y := 1 + let value = self.parse_yield_expression_or_else(Parser::parse_star_expression_list); + + ast::StmtAugAssign { + target: Box::new(target.expr), + op, + value: Box::new(value.expr), + range: self.node_range(start), + } + } + + /// Parses an `if` statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at an `if` token. + /// + /// See: + fn parse_if_statement(&mut self) -> ast::StmtIf { + let start = self.node_start(); + self.bump(TokenKind::If); + + // test_err if_stmt_invalid_test_expr + // if *x: ... + // if yield x: ... + // if yield from x: ... + + // test_err if_stmt_missing_test + // if : ... + let test = self.parse_named_expression_or_higher(AllowStarredExpression::No); + + // test_err if_stmt_missing_colon + // if x + // if x + // pass + // a = 1 + self.expect(TokenKind::Colon); + + // test_err if_stmt_empty_body + // if True: + // 1 + 1 + let body = self.parse_body(Clause::If); + + // test_err if_stmt_misspelled_elif + // if True: + // pass + // elf: + // pass + // else: + // pass + let mut elif_else_clauses = self.parse_clauses(Clause::ElIf, |p| { + p.parse_elif_or_else_clause(ElifOrElse::Elif) + }); + + if self.at(TokenKind::Else) { + elif_else_clauses.push(self.parse_elif_or_else_clause(ElifOrElse::Else)); + } + + ast::StmtIf { + test: Box::new(test.expr), + body, + elif_else_clauses, + range: self.node_range(start), + } + } + + /// Parses an `elif` or `else` clause. + /// + /// # Panics + /// + /// If the parser isn't positioned at an `elif` or `else` token. + fn parse_elif_or_else_clause(&mut self, kind: ElifOrElse) -> ast::ElifElseClause { + let start = self.node_start(); + self.bump(kind.as_token_kind()); + + let test = if kind.is_elif() { + // test_err if_stmt_invalid_elif_test_expr + // if x: + // pass + // elif *x: + // pass + // elif yield x: + // pass + Some( + self.parse_named_expression_or_higher(AllowStarredExpression::No) + .expr, + ) + } else { + None + }; + + // test_err if_stmt_elif_missing_colon + // if x: + // pass + // elif y + // pass + // else: + // pass + self.expect(TokenKind::Colon); + + let body = self.parse_body(kind.as_clause()); + + ast::ElifElseClause { + test, + body, + range: self.node_range(start), + } + } + + /// Parses a `try` statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `try` token. + /// + /// See: + fn parse_try_statement(&mut self) -> ast::StmtTry { + let try_start = self.node_start(); + self.bump(TokenKind::Try); + self.expect(TokenKind::Colon); + + let mut is_star = false; + + let try_body = self.parse_body(Clause::Try); + + let has_except = self.at(TokenKind::Except); + + // TODO(dhruvmanila): Raise syntax error if there are both 'except' and 'except*' + // on the same 'try' + // test_err try_stmt_mixed_except_kind + // try: + // pass + // except: + // pass + // except* ExceptionGroup: + // pass + // try: + // pass + // except* ExceptionGroup: + // pass + // except: + // pass + let handlers = self.parse_clauses(Clause::Except, |p| { + let (handler, kind) = p.parse_except_clause(); + is_star |= kind.is_star(); + handler + }); + + // test_err try_stmt_misspelled_except + // try: + // pass + // exept: # spellchecker:disable-line + // pass + // finally: + // pass + // a = 1 + // try: + // pass + // except: + // pass + // exept: # spellchecker:disable-line + // pass + // b = 1 + + let orelse = if self.eat(TokenKind::Else) { + self.expect(TokenKind::Colon); + self.parse_body(Clause::Else) + } else { + vec![] + }; + + let (finalbody, has_finally) = if self.eat(TokenKind::Finally) { + self.expect(TokenKind::Colon); + (self.parse_body(Clause::Finally), true) + } else { + (vec![], false) + }; + + if !has_except && !has_finally { + // test_err try_stmt_missing_except_finally + // try: + // pass + // try: + // pass + // else: + // pass + self.add_error( + ParseErrorType::OtherError( + "Expected `except` or `finally` after `try` block".to_string(), + ), + self.current_token_range(), + ); + } + + if has_finally && self.at(TokenKind::Else) { + // test_err try_stmt_invalid_order + // try: + // pass + // finally: + // pass + // else: + // pass + self.add_error( + ParseErrorType::OtherError( + "`else` block must come before `finally` block".to_string(), + ), + self.current_token_range(), + ); + } + + ast::StmtTry { + body: try_body, + handlers, + orelse, + finalbody, + is_star, + range: self.node_range(try_start), + } + } + + /// Parses an `except` clause of a `try` statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at an `except` token. + fn parse_except_clause(&mut self) -> (ExceptHandler, ExceptClauseKind) { + let start = self.node_start(); + self.bump(TokenKind::Except); + + let block_kind = if self.eat(TokenKind::Star) { + ExceptClauseKind::Star + } else { + ExceptClauseKind::Normal + }; + + let type_ = if self.at_expr() { + // test_err except_stmt_invalid_expression + // try: + // pass + // except yield x: + // pass + // try: + // pass + // except* *x: + // pass + let parsed_expr = self.parse_expression_list(AllowStarredExpression::No); + if matches!( + parsed_expr.expr, + Expr::Tuple(ast::ExprTuple { + parenthesized: false, + .. + }) + ) { + // test_err except_stmt_unparenthesized_tuple + // try: + // pass + // except x, y: + // pass + // except x, y as exc: + // pass + // try: + // pass + // except* x, y: + // pass + // except* x, y as eg: + // pass + self.add_error( + ParseErrorType::OtherError( + "Multiple exception types must be parenthesized".to_string(), + ), + &parsed_expr, + ); + } + Some(Box::new(parsed_expr.expr)) + } else { + if block_kind.is_star() || self.at(TokenKind::As) { + // test_err except_stmt_missing_exception + // try: + // pass + // except as exc: + // pass + // # If a '*' is present then exception type is required + // try: + // pass + // except*: + // pass + // except* + // pass + // except* as exc: + // pass + self.add_error( + ParseErrorType::OtherError("Expected one or more exception types".to_string()), + self.current_token_range(), + ); + } + None + }; + + let name = if self.eat(TokenKind::As) { + if self.at(TokenKind::Name) { + Some(self.parse_identifier()) + } else { + // test_err except_stmt_missing_as_name + // try: + // pass + // except Exception as: + // pass + // except Exception as + // pass + self.add_error( + ParseErrorType::OtherError("Expected name after `as`".to_string()), + self.current_token_range(), + ); + None + } + } else { + None + }; + + // test_err except_stmt_missing_exception_and_as_name + // try: + // pass + // except as: + // pass + + self.expect(TokenKind::Colon); + + let except_body = self.parse_body(Clause::Except); + + ( + ExceptHandler::ExceptHandler(ast::ExceptHandlerExceptHandler { + type_, + name, + body: except_body, + range: self.node_range(start), + }), + block_kind, + ) + } + + /// Parses a `for` statement. + /// + /// The given `start` offset is the start of either the `for` token or the + /// `async` token if it's an async for statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `for` token. + /// + /// See: + fn parse_for_statement(&mut self, start: TextSize) -> ast::StmtFor { + self.bump(TokenKind::For); + + // This is to avoid the ambiguity of the `in` token which is used in + // both the `for` statement and the comparison expression. For example: + // + // ```python + // for x in y: + // # ^^^^^^ + // # This is not a comparison expression + // pass + // ``` + let saved_context = self.set_ctx(ParserCtxFlags::FOR_TARGET); + + // test_err for_stmt_missing_target + // for in x: ... + let mut target = self.parse_expression_list(AllowStarredExpression::Yes); + + self.restore_ctx(ParserCtxFlags::FOR_TARGET, saved_context); + + helpers::set_expr_ctx(&mut target.expr, ExprContext::Store); + + // test_err for_stmt_invalid_target + // for 1 in x: ... + // for "a" in x: ... + // for *x and y in z: ... + // for *x | y in z: ... + // for await x in z: ... + // for [x, 1, y, *["a"]] in z: ... + self.validate_assignment_target(&target.expr); + + // test_err for_stmt_missing_in_keyword + // for a b: ... + // for a: ... + self.expect(TokenKind::In); + + // test_err for_stmt_missing_iter + // for x in: + // a = 1 + + // test_err for_stmt_invalid_iter_expr + // for x in *a and b: ... + // for x in yield a: ... + // for target in x := 1: ... + let iter = self.parse_star_expression_list(); + + self.expect(TokenKind::Colon); + + let body = self.parse_body(Clause::For); + + let orelse = if self.eat(TokenKind::Else) { + self.expect(TokenKind::Colon); + self.parse_body(Clause::Else) + } else { + vec![] + }; + + ast::StmtFor { + target: Box::new(target.expr), + iter: Box::new(iter.expr), + is_async: false, + body, + orelse, + range: self.node_range(start), + } + } + + /// Parses a `while` statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `while` token. + /// + /// See: + fn parse_while_statement(&mut self) -> ast::StmtWhile { + let start = self.node_start(); + self.bump(TokenKind::While); + + // test_err while_stmt_missing_test + // while : ... + // while : + // a = 1 + + // test_err while_stmt_invalid_test_expr + // while *x: ... + // while yield x: ... + // while a, b: ... + // while a := 1, b: ... + let test = self.parse_named_expression_or_higher(AllowStarredExpression::No); + + // test_err while_stmt_missing_colon + // while ( + // a < 30 # comment + // ) + // pass + self.expect(TokenKind::Colon); + + let body = self.parse_body(Clause::While); + + let orelse = if self.eat(TokenKind::Else) { + self.expect(TokenKind::Colon); + self.parse_body(Clause::Else) + } else { + vec![] + }; + + ast::StmtWhile { + test: Box::new(test.expr), + body, + orelse, + range: self.node_range(start), + } + } + + /// Parses a function definition. + /// + /// The given `start` offset is the start of either of the following: + /// - `def` token + /// - `async` token if it's an asynchronous function definition with no decorators + /// - `@` token if the function definition has decorators + /// + /// # Panics + /// + /// If the parser isn't positioned at a `def` token. + /// + /// See: + fn parse_function_definition( + &mut self, + decorator_list: Vec, + start: TextSize, + ) -> ast::StmtFunctionDef { + self.bump(TokenKind::Def); + + // test_err function_def_missing_identifier + // def (): ... + // def () -> int: ... + let name = self.parse_identifier(); + + // test_err function_def_unclosed_type_param_list + // def foo[T1, *T2(a, b): + // return a + b + // x = 10 + let type_params = self.try_parse_type_params(); + + // test_err function_def_unclosed_parameter_list + // def foo(a: int, b: + // def foo(): + // return 42 + // def foo(a: int, b: str + // x = 10 + let parameters_start = self.node_start(); + self.expect(TokenKind::Lpar); + let mut parameters = self.parse_parameters(FunctionKind::FunctionDef); + self.expect(TokenKind::Rpar); + + // test_ok function_def_parameter_range + // def foo( + // first: int, + // second: int, + // ) -> int: ... + parameters.range = self.node_range(parameters_start); + + let returns = if self.eat(TokenKind::Rarrow) { + if self.at_expr() { + // test_ok function_def_valid_return_expr + // def foo() -> int | str: ... + // def foo() -> lambda x: x: ... + // def foo() -> (yield x): ... + // def foo() -> int if True else str: ... + + // test_err function_def_invalid_return_expr + // def foo() -> *int: ... + // def foo() -> (*int): ... + // def foo() -> yield x: ... + let returns = self.parse_expression_list(AllowStarredExpression::No); + + if matches!( + returns.expr, + Expr::Tuple(ast::ExprTuple { + parenthesized: false, + .. + }) + ) { + // test_ok function_def_parenthesized_return_types + // def foo() -> (int,): ... + // def foo() -> (int, str): ... + + // test_err function_def_unparenthesized_return_types + // def foo() -> int,: ... + // def foo() -> int, str: ... + self.add_error( + ParseErrorType::OtherError( + "Multiple return types must be parenthesized".to_string(), + ), + returns.range(), + ); + } + + Some(Box::new(returns.expr)) + } else { + // test_err function_def_missing_return_type + // def foo() -> : ... + self.add_error( + ParseErrorType::ExpectedExpression, + self.current_token_range(), + ); + + None + } + } else { + None + }; + + self.expect(TokenKind::Colon); + + // test_err function_def_empty_body + // def foo(): + // def foo() -> int: + // x = 42 + let body = self.parse_body(Clause::FunctionDef); + + ast::StmtFunctionDef { + name, + type_params, + parameters: Box::new(parameters), + body, + decorator_list, + is_async: false, + returns, + range: self.node_range(start), + } + } + + /// Parses a class definition. + /// + /// The given `start` offset is the start of either the `def` token or the + /// `@` token if the class definition has decorators. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `class` token. + /// + /// See: + fn parse_class_definition( + &mut self, + decorator_list: Vec, + start: TextSize, + ) -> ast::StmtClassDef { + self.bump(TokenKind::Class); + + // test_err class_def_missing_name + // class : ... + // class (): ... + // class (metaclass=ABC): ... + let name = self.parse_identifier(); + + // test_err class_def_unclosed_type_param_list + // class Foo[T1, *T2(a, b): + // pass + // x = 10 + let type_params = self.try_parse_type_params(); + + // test_ok class_def_arguments + // class Foo: ... + // class Foo(): ... + let arguments = self + .at(TokenKind::Lpar) + .then(|| Box::new(self.parse_arguments())); + + self.expect(TokenKind::Colon); + + // test_err class_def_empty_body + // class Foo: + // class Foo(): + // x = 42 + let body = self.parse_body(Clause::Class); + + ast::StmtClassDef { + range: self.node_range(start), + decorator_list, + name, + type_params: type_params.map(Box::new), + arguments, + body, + } + } + + /// Parses a `with` statement + /// + /// The given `start` offset is the start of either the `with` token or the + /// `async` token if it's an async with statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `with` token. + /// + /// See: + fn parse_with_statement(&mut self, start: TextSize) -> ast::StmtWith { + self.bump(TokenKind::With); + + let items = self.parse_with_items(); + self.expect(TokenKind::Colon); + + let body = self.parse_body(Clause::With); + + ast::StmtWith { + items, + body, + is_async: false, + range: self.node_range(start), + } + } + + /// Parses a list of with items. + /// + /// See: + fn parse_with_items(&mut self) -> Vec { + let start = self.node_start(); + let mut items = vec![]; + + if !self.at_expr() { + self.add_error( + ParseErrorType::OtherError( + "Expected the start of an expression after `with` keyword".to_string(), + ), + self.current_token_range(), + ); + return items; + } + + let with_item_kind = if self.eat(TokenKind::Lpar) { + self.parse_parenthesized_with_items(start, &mut items) + } else { + WithItemKind::Unparenthesized + }; + + if with_item_kind.is_parenthesized_expression() { + // The trailing comma is optional because (1) they aren't allowed in parenthesized + // expression context and, (2) We need to raise the correct error if they're present. + // + // Consider the following three examples: + // + // ```python + // with (item1, item2): ... # (1) + // with (item1, item2),: ... # (2) + // with (item1, item2), item3,: ... # (3) + // ``` + // + // Here, (1) is valid and represents a parenthesized with items while (2) and (3) + // are invalid as they are parenthesized expression. Example (3) will raise an error + // stating that a trailing comma isn't allowed, while (2) will raise an "expected an + // expression" error. + // + // The reason that (2) expects an expression is because if it raised an error + // similar to (3), we would be suggesting to remove the trailing comma, which would + // make it a parenthesized with items. This would contradict our original assumption + // that it's a parenthesized expression. + // + // However, for (3), the error is being raised by the list parsing logic and if the + // trailing comma is removed, it still remains a parenthesized expression, so it's + // fine to raise the error. + if self.eat(TokenKind::Comma) && !self.at_expr() { + self.add_error( + ParseErrorType::ExpectedExpression, + self.current_token_range(), + ); + } + } + + // This call is a no-op if the with items are parenthesized as all of them + // have already been parsed. + self.parse_comma_separated_list(RecoveryContextKind::WithItems(with_item_kind), |parser| { + items.push(parser.parse_with_item(WithItemParsingState::Regular).item); + }); + + if with_item_kind == WithItemKind::Parenthesized { + self.expect(TokenKind::Rpar); + } + + items + } + + /// Parse the with items coming after an ambiguous `(` token. + /// + /// To understand the ambiguity, consider the following example: + /// + /// ```python + /// with (item1, item2): ... # (1) + /// with (item1, item2) as f: ... # (2) + /// ``` + /// + /// When the parser is at the `(` token after the `with` keyword, it doesn't + /// know if it's used to parenthesize the with items or if it's part of a + /// parenthesized expression of the first with item. The challenge here is + /// that until the parser sees the matching `)` token, it can't resolve the + /// ambiguity. This requires infinite lookahead. + /// + /// This method resolves the ambiguity by parsing the with items assuming that + /// it's a parenthesized with items. Then, once it finds the matching `)`, it + /// checks if the assumption still holds true. If it doesn't, then it combines + /// the parsed with items into a single with item with an appropriate expression. + /// + /// The return value is the kind of with items parsed. Note that there could + /// still be other with items which needs to be parsed as this method stops + /// when the matching `)` is found. + fn parse_parenthesized_with_items( + &mut self, + start: TextSize, + items: &mut Vec, + ) -> WithItemKind { + // We'll start with the assumption that the with items are parenthesized. + let mut with_item_kind = WithItemKind::Parenthesized; + + // Keep track of certain properties to determine if the with items are + // parenthesized or if it's a parenthesized expression. Refer to their + // usage for examples and explanation. + let mut has_trailing_comma = false; + let mut has_optional_vars = false; + + // Start with parsing the first with item after an ambiguous `(` token + // with the start offset. + let mut state = WithItemParsingState::AmbiguousLparFirstItem(start); + + let mut parsed_with_items = vec![]; + let mut progress = ParserProgress::default(); + + loop { + progress.assert_progressing(self); + + // We stop at the first `)` found. Any nested parentheses will be + // consumed by the with item parsing. This check needs to be done + // first in case there are no with items. For example, + // + // ```python + // with (): ... + // with () as x: ... + // ``` + if self.at(TokenKind::Rpar) { + break; + } + + let parsed_with_item = self.parse_with_item(state); + + if parsed_with_item.item.context_expr.is_generator_expr() + && parsed_with_item.used_ambiguous_lpar + { + // For generator expressions, it's a bit tricky. We need to check if parsing + // a generator expression has used the ambiguous `(` token. This is the case + // for a parenthesized generator expression which is using the ambiguous `(` + // as the start of the generator expression. For example: + // + // ```python + // with (x for x in range(10)): ... + // # ^ + // # Consumed by `parse_with_item` + // ``` + // + // This is only allowed if it's the first with item which is made sure by the + // `with_item_parsing` state. + with_item_kind = WithItemKind::SingleParenthesizedGeneratorExpression; + parsed_with_items.push(parsed_with_item); + break; + } + + has_optional_vars |= parsed_with_item.item.optional_vars.is_some(); + + parsed_with_items.push(parsed_with_item); + + has_trailing_comma = self.eat(TokenKind::Comma); + if !has_trailing_comma { + break; + } + + // Update the with item parsing to indicate that we're no longer + // parsing the first with item, but we haven't yet found the `)` to + // the corresponding ambiguous `(`. + state = WithItemParsingState::AmbiguousLparRest; + } + + // Check if our assumption is incorrect and it's actually a parenthesized + // expression. + if !with_item_kind.is_parenthesized_expression() && self.at(TokenKind::Rpar) { + if has_optional_vars { + // If any of the with item has optional variables, then our assumption is + // correct and it is a parenthesized with items. Now, we need to restrict + // the grammar for a with item's context expression which is: + // + // with_item: expression ... + // + // So, named, starred and yield expressions not allowed. + for parsed_with_item in &parsed_with_items { + // Parentheses resets the precedence. + if parsed_with_item.is_parenthesized { + continue; + } + let err = match parsed_with_item.item.context_expr { + Expr::Named(_) => ParseErrorType::UnparenthesizedNamedExpression, + Expr::Starred(_) => ParseErrorType::InvalidStarredExpressionUsage, + Expr::Yield(_) | Expr::YieldFrom(_) => { + ParseErrorType::InvalidYieldExpressionUsage + } + _ => continue, + }; + self.add_error(err, &parsed_with_item.item.context_expr); + } + } else if self.peek() == TokenKind::Colon { + // Here, the parser is at a `)` followed by a `:`. + if parsed_with_items.is_empty() { + // No with items, treat it as a parenthesized expression to + // create an empty tuple expression. + with_item_kind = WithItemKind::ParenthesizedExpression; + } else { + // These expressions, if unparenthesized, are only allowed if it's + // a parenthesized expression and none of the with items have an + // optional variable. + if parsed_with_items.iter().any(|parsed_with_item| { + !parsed_with_item.is_parenthesized + && matches!( + parsed_with_item.item.context_expr, + Expr::Named(_) + | Expr::Starred(_) + | Expr::Yield(_) + | Expr::YieldFrom(_) + ) + }) { + with_item_kind = WithItemKind::ParenthesizedExpression; + } + } + } else { + // For any other token followed by `)`, if any of the items has + // an optional variables (`as ...`), then our assumption is correct. + // Otherwise, treat it as a parenthesized expression. For example: + // + // ```python + // with (item1, item2 as f): ... + // ``` + // + // This also helps in raising the correct syntax error for the + // following case: + // ```python + // with (item1, item2 as f) as x: ... + // # ^^ + // # Expecting `:` but got `as` + // ``` + with_item_kind = WithItemKind::ParenthesizedExpression; + } + } + + if with_item_kind == WithItemKind::Parenthesized && !self.at(TokenKind::Rpar) { + // test_err with_items_parenthesized_missing_comma + // with (item1 item2): ... + // with (item1 as f1 item2): ... + // with (item1, item2 item3, item4): ... + // with (item1, item2 as f1 item3, item4): ... + // with (item1, item2: ... + self.expect(TokenKind::Comma); + } + + // Transform the items if it's a parenthesized expression. + if with_item_kind.is_parenthesized_expression() { + // The generator expression has already consumed the `)`, so avoid + // expecting it again. + if with_item_kind != WithItemKind::SingleParenthesizedGeneratorExpression { + self.expect(TokenKind::Rpar); + } + + let lhs = if parsed_with_items.len() == 1 && !has_trailing_comma { + // SAFETY: We've checked that `items` has only one item. + let expr = parsed_with_items.pop().unwrap().item.context_expr; + + // Here, we know that it's a parenthesized expression so the expression + // should be checked against the grammar rule which is: + // + // group: (yield_expr | named_expression) + // + // So, no starred expression allowed. + if expr.is_starred_expr() { + self.add_error(ParseErrorType::InvalidStarredExpressionUsage, &expr); + } + expr + } else { + let mut elts = Vec::with_capacity(parsed_with_items.len()); + + // Here, we know that it's a tuple expression so each expression should + // be checked against the tuple element grammar rule which: + // + // tuple: '(' [ star_named_expression ',' [star_named_expressions] ] ')' + // + // So, no yield expressions allowed. + for expr in parsed_with_items + .drain(..) + .map(|parsed_with_item| parsed_with_item.item.context_expr) + { + if matches!(expr, Expr::Yield(_) | Expr::YieldFrom(_)) { + self.add_error(ParseErrorType::InvalidYieldExpressionUsage, &expr); + } + elts.push(expr); + } + + Expr::Tuple(ast::ExprTuple { + range: self.node_range(start), + elts, + ctx: ExprContext::Load, + parenthesized: true, + }) + }; + + // Remember that the expression is parenthesized and the parser has just + // consumed the `)` token. We need to check for any possible postfix + // expressions. For example: + // + // ```python + // with (foo)(): ... + // # ^ + // + // with (1, 2)[0]: ... + // # ^ + // + // with (foo.bar).baz: ... + // # ^ + // ``` + // + // The reason being that the opening parenthesis is ambiguous and isn't + // considered when parsing the with item in the case. So, the parser + // stops when it sees the `)` token and doesn't check for any postfix + // expressions. + let context_expr = self.parse_postfix_expression(lhs, start); + + let optional_vars = self + .at(TokenKind::As) + .then(|| Box::new(self.parse_with_item_optional_vars().expr)); + + items.push(ast::WithItem { + range: self.node_range(start), + context_expr, + optional_vars, + }); + } else { + items.extend(parsed_with_items.drain(..).map(|item| item.item)); + } + + with_item_kind + } + + /// Parses a single `with` item. + /// + /// See: + fn parse_with_item(&mut self, state: WithItemParsingState) -> ParsedWithItem { + let start = self.node_start(); + + let mut used_ambiguous_lpar = false; + + // The grammar for the context expression of a with item depends on the state + // of with item parsing. + let context_expr = if state.is_ambiguous_lpar() { + // If it's in an ambiguous state, the parenthesis (`(`) could be part of any + // of the following expression: + // + // Tuple expression - star_named_expression + // Generator expression - named_expression + // Parenthesized expression - (yield_expr | named_expression) + // Parenthesized with items - expression + // + // Here, the right side specifies the grammar for an element corresponding + // to the expression mentioned in the left side. + // + // So, the grammar used should be able to parse an element belonging to any + // of the above expression. At a later point, once the parser understands + // where the parenthesis belongs to, it'll validate and report errors for + // any invalid expression usage. + // + // Thus, we can conclude that the grammar used should be: + // (yield_expr | star_named_expression) + let parsed_expr = self.parse_yield_expression_or_else(|p| { + p.parse_star_expression_or_higher(AllowNamedExpression::Yes) + }); + + if matches!(self.current_token_kind(), TokenKind::Async | TokenKind::For) { + if parsed_expr.is_unparenthesized_starred_expr() { + self.add_error( + ParseErrorType::IterableUnpackingInComprehension, + &parsed_expr, + ); + } + + let generator_expr = + if let WithItemParsingState::AmbiguousLparFirstItem(lpar_start) = state { + // The parser is at the first with item after the ambiguous `(` token. + // For example: + // + // ```python + // with (x for x in range(10)): ... + // with (x for x in range(10)), item: ... + // ``` + let generator_expr = self.parse_generator_expression( + parsed_expr.expr, + GeneratorExpressionInParentheses::Maybe { + lpar_start, + expr_start: start, + }, + ); + used_ambiguous_lpar = generator_expr.parenthesized; + generator_expr + } else { + // For better error recovery. We would not take this path if the + // expression was parenthesized as it would be parsed as a generator + // expression by `parse_conditional_expression_or_higher`. + // + // ```python + // # This path will be taken for + // with (item, x for x in range(10)): ... + // + // # This path will not be taken for + // with (item, (x for x in range(10))): ... + // ``` + self.parse_generator_expression( + parsed_expr.expr, + GeneratorExpressionInParentheses::No(start), + ) + }; + + if !generator_expr.parenthesized { + self.add_error( + ParseErrorType::OtherError( + "Unparenthesized generator expression cannot be used here".to_string(), + ), + generator_expr.range(), + ); + } + + Expr::Generator(generator_expr).into() + } else { + parsed_expr + } + } else { + // If it's not in an ambiguous state, then the grammar of the with item + // should be used which is `expression`. + self.parse_conditional_expression_or_higher(AllowStarredExpression::No) + }; + + let optional_vars = self + .at(TokenKind::As) + .then(|| Box::new(self.parse_with_item_optional_vars().expr)); + + ParsedWithItem { + is_parenthesized: context_expr.is_parenthesized, + used_ambiguous_lpar, + item: ast::WithItem { + range: self.node_range(start), + context_expr: context_expr.expr, + optional_vars, + }, + } + } + + /// Parses the optional variables in a `with` item. + /// + /// # Panics + /// + /// If the parser isn't positioned at an `as` token. + fn parse_with_item_optional_vars(&mut self) -> ParsedExpr { + self.bump(TokenKind::As); + + let mut target = self.parse_conditional_expression_or_higher(AllowStarredExpression::Yes); + + // This has the same semantics as an assignment target. + self.validate_assignment_target(&target.expr); + + helpers::set_expr_ctx(&mut target.expr, ExprContext::Store); + + target + } + + /// Parses a match statement. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `match` token. + /// + /// See: + fn parse_match_statement(&mut self) -> ast::StmtMatch { + let start = self.node_start(); + self.bump(TokenKind::Match); + + let subject_start = self.node_start(); + + // Subject expression grammar is: + // + // subject_expr: + // | star_named_expression ',' star_named_expressions? + // | named_expression + // + // First try with `star_named_expression`, then if there's no comma, + // we'll restrict it to `named_expression`. + let subject = self.parse_star_expression_or_higher(AllowNamedExpression::Yes); + + // test_ok match_stmt_subject_expr + // match x := 1: + // case _: ... + // match (x := 1): + // case _: ... + // # Starred expressions are only allowed in tuple expression + // match *x | y, z: + // case _: ... + // match await x: + // case _: ... + + // test_err match_stmt_invalid_subject_expr + // match (*x): + // case _: ... + // # Starred expression precedence test + // match *x and y, z: + // case _: ... + // match yield x: + // case _: ... + let subject = if self.at(TokenKind::Comma) { + let tuple = + self.parse_tuple_expression(subject.expr, subject_start, Parenthesized::No, |p| { + p.parse_star_expression_or_higher(AllowNamedExpression::Yes) + }); + + Expr::Tuple(tuple).into() + } else { + if subject.is_unparenthesized_starred_expr() { + // test_err match_stmt_single_starred_subject + // match *foo: + // case _: ... + self.add_error(ParseErrorType::InvalidStarredExpressionUsage, &subject); + } + subject + }; + + self.expect(TokenKind::Colon); + + // test_err match_stmt_no_newline_before_case + // match foo: case _: ... + self.expect(TokenKind::Newline); + + // Use `eat` instead of `expect` for better error message. + if !self.eat(TokenKind::Indent) { + // test_err match_stmt_expect_indented_block + // match foo: + // case _: ... + self.add_error( + ParseErrorType::OtherError( + "Expected an indented block after `match` statement".to_string(), + ), + self.current_token_range(), + ); + } + + let cases = self.parse_match_case_blocks(); + + // TODO(dhruvmanila): Should we expect `Dedent` only if there was an `Indent` present? + self.expect(TokenKind::Dedent); + + ast::StmtMatch { + subject: Box::new(subject.expr), + cases, + range: self.node_range(start), + } + } + + /// Parses a list of match case blocks. + fn parse_match_case_blocks(&mut self) -> Vec { + let mut cases = vec![]; + + if !self.at(TokenKind::Case) { + // test_err match_stmt_expected_case_block + // match x: + // x = 1 + // match x: + // match y: + // case _: ... + self.add_error( + ParseErrorType::OtherError("Expected `case` block".to_string()), + self.current_token_range(), + ); + return cases; + } + + let mut progress = ParserProgress::default(); + + while self.at(TokenKind::Case) { + progress.assert_progressing(self); + cases.push(self.parse_match_case()); + } + + cases + } + + /// Parses a single match case block. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `case` token. + /// + /// See: + fn parse_match_case(&mut self) -> ast::MatchCase { + let start = self.node_start(); + self.bump(TokenKind::Case); + + // test_err match_stmt_missing_pattern + // # TODO(dhruvmanila): Here, `case` is a name token because of soft keyword transformer + // match x: + // case : ... + let pattern = self.parse_match_patterns(); + + let guard = if self.eat(TokenKind::If) { + if self.at_expr() { + // test_ok match_stmt_valid_guard_expr + // match x: + // case y if a := 1: ... + // match x: + // case y if a if True else b: ... + // match x: + // case y if lambda a: b: ... + // match x: + // case y if (yield x): ... + + // test_err match_stmt_invalid_guard_expr + // match x: + // case y if *a: ... + // match x: + // case y if (*a): ... + // match x: + // case y if yield x: ... + Some(Box::new( + self.parse_named_expression_or_higher(AllowStarredExpression::No) + .expr, + )) + } else { + // test_err match_stmt_missing_guard_expr + // match x: + // case y if: ... + self.add_error( + ParseErrorType::ExpectedExpression, + self.current_token_range(), + ); + None + } + } else { + None + }; + + self.expect(TokenKind::Colon); + let body = self.parse_body(Clause::Match); + + ast::MatchCase { + pattern, + guard, + body, + range: self.node_range(start), + } + } + + /// Parses a statement that is valid after an `async` token. + /// + /// If the statement is not a valid `async` statement, an error will be reported + /// and it will be parsed as a statement. + /// + /// See: + /// - + /// - + /// - + fn parse_async_statement(&mut self) -> Stmt { + let async_start = self.node_start(); + self.bump(TokenKind::Async); + + match self.current_token_kind() { + // test_ok async_function_definition + // async def foo(): ... + TokenKind::Def => Stmt::FunctionDef(ast::StmtFunctionDef { + is_async: true, + ..self.parse_function_definition(vec![], async_start) + }), + + // test_ok async_with_statement + // async with item: ... + TokenKind::With => Stmt::With(ast::StmtWith { + is_async: true, + ..self.parse_with_statement(async_start) + }), + + // test_ok async_for_statement + // async for target in iter: ... + TokenKind::For => Stmt::For(ast::StmtFor { + is_async: true, + ..self.parse_for_statement(async_start) + }), + + kind => { + // test_err async_unexpected_token + // async class Foo: ... + // async while test: ... + // async x = 1 + // async async def foo(): ... + // # TODO(dhruvmanila): Here, `match` is actually a Name token because + // # of the soft keyword # transformer + // async match test: + // case _: ... + self.add_error( + ParseErrorType::UnexpectedTokenAfterAsync(kind), + self.current_token_range(), + ); + + // Although this statement is not a valid `async` statement, + // we still parse it. + self.parse_statement() + } + } + } + + /// Parses a decorator list followed by a class, function or async function definition. + /// + /// See: + fn parse_decorators(&mut self) -> Stmt { + let start = self.node_start(); + + let mut decorators = vec![]; + let mut progress = ParserProgress::default(); + + // test_err decorator_missing_expression + // @def foo(): ... + // @ + // def foo(): ... + // @@ + // def foo(): ... + while self.at(TokenKind::At) { + progress.assert_progressing(self); + + let decorator_start = self.node_start(); + self.bump(TokenKind::At); + + // test_err decorator_invalid_expression + // @*x + // @(*x) + // @((*x)) + // @yield x + // @yield from x + // def foo(): ... + let parsed_expr = self.parse_named_expression_or_higher(AllowStarredExpression::No); + + decorators.push(ast::Decorator { + expression: parsed_expr.expr, + range: self.node_range(decorator_start), + }); + + // test_err decorator_missing_newline + // @x def foo(): ... + // @x async def foo(): ... + // @x class Foo: ... + self.expect(TokenKind::Newline); + } + + match self.current_token_kind() { + TokenKind::Def => Stmt::FunctionDef(self.parse_function_definition(decorators, start)), + TokenKind::Class => Stmt::ClassDef(self.parse_class_definition(decorators, start)), + TokenKind::Async if self.peek() == TokenKind::Def => { + self.bump(TokenKind::Async); + + // test_ok decorator_async_function + // @decorator + // async def foo(): ... + Stmt::FunctionDef(ast::StmtFunctionDef { + is_async: true, + ..self.parse_function_definition(decorators, start) + }) + } + _ => { + // test_err decorator_unexpected_token + // @foo + // async with x: ... + // @foo + // x = 1 + self.add_error( + ParseErrorType::OtherError( + "Expected class, function definition or async function definition after decorator".to_string(), + ), + self.current_token_range(), + ); + + // TODO(dhruvmanila): It seems that this recovery drops all the parsed + // decorators. Maybe we could convert them into statement expression + // with a flag indicating that this expression is part of a decorator. + // It's only possible to keep them if it's a function or class definition. + // We could possibly keep them if there's indentation error: + // + // ```python + // @decorator + // @decorator + // def foo(): ... + // ``` + // + // Or, parse it as a binary expression where the left side is missing. + // We would need to convert each decorator into a binary expression. + self.parse_statement() + } + } + } + + /// Parses the body of the given [`Clause`]. + /// + /// This could either be a single statement that's on the same line as the + /// clause header or an indented block. + fn parse_body(&mut self, parent_clause: Clause) -> Vec { + // Note: The test cases in this method chooses a clause at random to test + // the error logic. + + let newline_range = self.current_token_range(); + if self.eat(TokenKind::Newline) { + if self.at(TokenKind::Indent) { + return self.parse_block(); + } + // test_err clause_expect_indented_block + // # Here, the error is highlighted at the `pass` token + // if True: + // pass + // # The parser is at the end of the program, so let's highlight + // # at the newline token after `:` + // if True: + self.add_error( + ParseErrorType::OtherError(format!( + "Expected an indented block after {parent_clause}" + )), + if self.current_token_range().is_empty() { + newline_range + } else { + self.current_token_range() + }, + ); + } else { + if self.at_simple_stmt() { + return self.parse_simple_statements(); + } + // test_err clause_expect_single_statement + // if True: if True: pass + self.add_error( + ParseErrorType::OtherError("Expected a simple statement".to_string()), + self.current_token_range(), + ); + } + + Vec::new() + } + + /// Parses a block of statements. + /// + /// # Panics + /// + /// If the parser isn't positioned at an `Indent` token. + fn parse_block(&mut self) -> Vec { + self.bump(TokenKind::Indent); + + let statements = + self.parse_list_into_vec(RecoveryContextKind::BlockStatements, Self::parse_statement); + + self.expect(TokenKind::Dedent); + + statements + } + + /// Parses a single parameter for the given function kind. + /// + /// Matches either the `param_no_default_star_annotation` or `param_no_default` + /// rule in the [Python grammar] depending on whether star annotation is allowed + /// or not. + /// + /// Use [`Parser::parse_parameter_with_default`] to allow parameter with default + /// values. + /// + /// [Python grammar]: https://docs.python.org/3/reference/grammar.html + fn parse_parameter( + &mut self, + start: TextSize, + function_kind: FunctionKind, + allow_star_annotation: AllowStarAnnotation, + ) -> ast::Parameter { + let name = self.parse_identifier(); + + // Annotations are only allowed for function definition. For lambda expression, + // the `:` token would indicate its body. + let annotation = match function_kind { + FunctionKind::FunctionDef if self.eat(TokenKind::Colon) => { + if self.at_expr() { + let parsed_expr = match allow_star_annotation { + AllowStarAnnotation::Yes => { + // test_ok param_with_star_annotation + // def foo(*args: *int | str): ... + // def foo(*args: *(int or str)): ... + + // test_err param_with_invalid_star_annotation + // def foo(*args: *): ... + // def foo(*args: (*tuple[int])): ... + // def foo(*args: *int or str): ... + // def foo(*args: *yield x): ... + // # def foo(*args: **int): ... + self.parse_star_expression_or_higher(AllowNamedExpression::No) + } + AllowStarAnnotation::No => { + // test_ok param_with_annotation + // def foo(arg: int): ... + // def foo(arg: lambda x: x): ... + // def foo(arg: (yield x)): ... + // def foo(arg: (x := int)): ... + + // test_err param_with_invalid_annotation + // def foo(arg: *int): ... + // def foo(arg: yield int): ... + // def foo(arg: x := int): ... + self.parse_conditional_expression_or_higher(AllowStarredExpression::No) + } + }; + Some(Box::new(parsed_expr.expr)) + } else { + // test_err param_missing_annotation + // def foo(x:): ... + // def foo(x:,): ... + self.add_error( + ParseErrorType::ExpectedExpression, + self.current_token_range(), + ); + None + } + } + _ => None, + }; + + ast::Parameter { + range: self.node_range(start), + name, + annotation, + } + } + + /// Parses a parameter with an optional default expression. + /// + /// Matches the `param_maybe_default` rule in the [Python grammar]. + /// + /// This method doesn't allow star annotation. Use [`Parser::parse_parameter`] + /// instead. + /// + /// [Python grammar]: https://docs.python.org/3/reference/grammar.html + fn parse_parameter_with_default( + &mut self, + start: TextSize, + function_kind: FunctionKind, + ) -> ast::ParameterWithDefault { + let parameter = self.parse_parameter(start, function_kind, AllowStarAnnotation::No); + + let default = if self.eat(TokenKind::Equal) { + if self.at_expr() { + // test_ok param_with_default + // def foo(x=lambda y: y): ... + // def foo(x=1 if True else 2): ... + // def foo(x=await y): ... + // def foo(x=(yield y)): ... + + // test_err param_with_invalid_default + // def foo(x=*int): ... + // def foo(x=(*int)): ... + // def foo(x=yield y): ... + Some(Box::new( + self.parse_conditional_expression_or_higher(AllowStarredExpression::No) + .expr, + )) + } else { + // test_err param_missing_default + // def foo(x=): ... + // def foo(x: int = ): ... + self.add_error( + ParseErrorType::ExpectedExpression, + self.current_token_range(), + ); + None + } + } else { + None + }; + + ast::ParameterWithDefault { + range: self.node_range(start), + parameter, + default, + } + } + + /// Parses a parameter list for the given function kind. + /// + /// See: + pub(super) fn parse_parameters(&mut self, function_kind: FunctionKind) -> ast::Parameters { + let start = self.node_start(); + + // TODO(dhruvmanila): This has the same problem as `parse_match_pattern_mapping` + // has where if there are multiple kwarg or vararg, the last one will win and + // the parser will drop the previous ones. Another thing is the vararg and kwarg + // uses `Parameter` (not `ParameterWithDefault`) which means that the parser cannot + // recover well from `*args=(1, 2)`. + let mut parameters = ast::Parameters { + range: TextRange::default(), + posonlyargs: vec![], + args: vec![], + kwonlyargs: vec![], + vararg: None, + kwarg: None, + }; + + let mut seen_default_param = false; // `a=10` + let mut seen_positional_only_separator = false; // `/` + let mut seen_keyword_only_separator = false; // `*` + let mut seen_keyword_only_param_after_separator = false; + + // Range of the keyword only separator if it's the last parameter in the list. + let mut last_keyword_only_separator_range = None; + + self.parse_comma_separated_list(RecoveryContextKind::Parameters(function_kind), |parser| { + let param_start = parser.node_start(); + + if parameters.kwarg.is_some() { + // TODO(dhruvmanila): This fails AST validation in tests because + // of the pre-order visit + // test_err params_follows_var_keyword_param + // def foo(**kwargs, a, /, b=10, *, *args): ... + parser.add_error( + ParseErrorType::ParamAfterVarKeywordParam, + parser.current_token_range(), + ); + } + + match parser.current_token_kind() { + TokenKind::Star => { + let star_range = parser.current_token_range(); + parser.bump(TokenKind::Star); + + if parser.at(TokenKind::Name) { + let param = parser.parse_parameter(param_start, function_kind, AllowStarAnnotation::Yes); + let param_star_range = parser.node_range(star_range.start()); + + if parser.at(TokenKind::Equal) { + // test_err params_var_positional_with_default + // def foo(a, *args=(1, 2)): ... + parser.add_error( + ParseErrorType::VarParameterWithDefault, + parser.current_token_range(), + ); + } + + if seen_keyword_only_separator || parameters.vararg.is_some() { + // test_err params_multiple_varargs + // def foo(a, *, *args, b): ... + // # def foo(a, *, b, c, *args): ... + // def foo(a, *args1, *args2, b): ... + // def foo(a, *args1, b, c, *args2): ... + parser.add_error( + ParseErrorType::OtherError( + "Only one '*' parameter allowed".to_string(), + ), + param_star_range, + ); + } + + // TODO(dhruvmanila): The AST doesn't allow multiple `vararg`, so let's + // choose to keep the first one so that the parameters remain in preorder. + if parameters.vararg.is_none() { + parameters.vararg = Some(Box::new(param)); + } + + last_keyword_only_separator_range = None; + } else { + if seen_keyword_only_separator { + // test_err params_multiple_star_separator + // def foo(a, *, *, b): ... + // def foo(a, *, b, c, *): ... + parser.add_error( + ParseErrorType::OtherError( + "Only one '*' separator allowed".to_string(), + ), + star_range, + ); + } + + if parameters.vararg.is_some() { + // test_err params_star_separator_after_star_param + // def foo(a, *args, *, b): ... + // def foo(a, *args, b, c, *): ... + parser.add_error( + ParseErrorType::OtherError( + "Keyword-only parameter separator not allowed after '*' parameter" + .to_string(), + ), + star_range, + ); + } + + seen_keyword_only_separator = true; + last_keyword_only_separator_range = Some(star_range); + } + } + TokenKind::DoubleStar => { + let double_star_range = parser.current_token_range(); + parser.bump(TokenKind::DoubleStar); + + let param = parser.parse_parameter(param_start, function_kind, AllowStarAnnotation::No); + let param_double_star_range = parser.node_range(double_star_range.start()); + + if parameters.kwarg.is_some() { + // test_err params_multiple_kwargs + // def foo(a, **kwargs1, **kwargs2): ... + parser.add_error( + ParseErrorType::OtherError( + "Only one '**' parameter allowed".to_string(), + ), + param_double_star_range, + ); + } + + if parser.at(TokenKind::Equal) { + // test_err params_var_keyword_with_default + // def foo(a, **kwargs={'b': 1, 'c': 2}): ... + parser.add_error( + ParseErrorType::VarParameterWithDefault, + parser.current_token_range(), + ); + } + + if seen_keyword_only_separator && !seen_keyword_only_param_after_separator { + // test_ok params_seen_keyword_only_param_after_star + // def foo(*, a, **kwargs): ... + // def foo(*, a=10, **kwargs): ... + + // test_err params_kwarg_after_star_separator + // def foo(*, **kwargs): ... + parser.add_error( + ParseErrorType::ExpectedKeywordParam, + param_double_star_range, + ); + } + + parameters.kwarg = Some(Box::new(param)); + last_keyword_only_separator_range = None; + } + TokenKind::Slash => { + let slash_range = parser.current_token_range(); + parser.bump(TokenKind::Slash); + + if parameters.is_empty() { + // test_err params_no_arg_before_slash + // def foo(/): ... + // def foo(/, a): ... + parser.add_error( + ParseErrorType::OtherError( + "Position-only parameter separator not allowed as first parameter" + .to_string(), + ), + slash_range, + ); + } + + if seen_positional_only_separator { + // test_err params_multiple_slash_separator + // def foo(a, /, /, b): ... + // def foo(a, /, b, c, /): ... + parser.add_error( + ParseErrorType::OtherError( + "Only one '/' separator allowed".to_string(), + ), + slash_range, + ); + } + + if seen_keyword_only_separator || parameters.vararg.is_some() { + // test_err params_star_after_slash + // def foo(*a, /): ... + // def foo(a, *args, b, /): ... + // def foo(a, *, /, b): ... + // def foo(a, *, b, c, /, d): ... + parser.add_error( + ParseErrorType::OtherError( + "'/' parameter must appear before '*' parameter".to_string(), + ), + slash_range, + ); + } + + if !seen_positional_only_separator { + // We should only swap if we're seeing the separator for the + // first time, otherwise it's a user error. + std::mem::swap(&mut parameters.args, &mut parameters.posonlyargs); + seen_positional_only_separator = true; + } + + last_keyword_only_separator_range = None; + } + TokenKind::Name => { + let param = parser.parse_parameter_with_default(param_start, function_kind); + + // TODO(dhruvmanila): Pyright seems to only highlight the first non-default argument + // https://github.com/microsoft/pyright/blob/3b70417dd549f6663b8f86a76f75d8dfd450f4a8/packages/pyright-internal/src/parser/parser.ts#L2038-L2042 + if param.default.is_none() + && seen_default_param + && !seen_keyword_only_separator + && parameters.vararg.is_none() + { + // test_ok params_non_default_after_star + // def foo(a=10, *, b, c=11, d): ... + // def foo(a=10, *args, b, c=11, d): ... + + // test_err params_non_default_after_default + // def foo(a=10, b, c: int): ... + parser + .add_error(ParseErrorType::NonDefaultParamAfterDefaultParam, ¶m); + } + + seen_default_param |= param.default.is_some(); + + if seen_keyword_only_separator { + seen_keyword_only_param_after_separator = true; + } + + if seen_keyword_only_separator || parameters.vararg.is_some() { + parameters.kwonlyargs.push(param); + } else { + parameters.args.push(param); + } + last_keyword_only_separator_range = None; + } + _ => { + // This corresponds to the expected token kinds for `is_list_element`. + unreachable!("Expected Name, '*', '**', or '/'"); + } + } + }); + + if let Some(star_range) = last_keyword_only_separator_range { + // test_err params_expected_after_star_separator + // def foo(*): ... + // def foo(*,): ... + // def foo(a, *): ... + // def foo(a, *,): ... + // def foo(*, **kwargs): ... + self.add_error(ParseErrorType::ExpectedKeywordParam, star_range); + } + + parameters.range = self.node_range(start); + + // test_err params_duplicate_names + // def foo(a, a=10, *a, a, a: str, **a): ... + self.validate_parameters(¶meters); + + parameters + } + + /// Try to parse a type parameter list. If the parser is not at the start of a + /// type parameter list, return `None`. + /// + /// See: + fn try_parse_type_params(&mut self) -> Option { + self.at(TokenKind::Lsqb).then(|| self.parse_type_params()) + } + + /// Parses a type parameter list. + /// + /// # Panics + /// + /// If the parser isn't positioned at a `[` token. + /// + /// See: + fn parse_type_params(&mut self) -> ast::TypeParams { + let start = self.node_start(); + self.bump(TokenKind::Lsqb); + + let type_params = self.parse_comma_separated_list_into_vec( + RecoveryContextKind::TypeParams, + Parser::parse_type_param, + ); + + self.expect(TokenKind::Rsqb); + + ast::TypeParams { + range: self.node_range(start), + type_params, + } + } + + /// Parses a type parameter. + /// + /// See: + fn parse_type_param(&mut self) -> ast::TypeParam { + let start = self.node_start(); + + // TODO(dhruvmanila): CPython throws an error if `TypeVarTuple` or `ParamSpec` + // has bounds: + // + // type X[*T: int] = int + // ^^^^^ + // SyntaxError: cannot use bound with TypeVarTuple + // + // We should do the same but currently we can't without throwing away the parsed + // expression because the AST can't contain it. + + if self.eat(TokenKind::Star) { + let name = self.parse_identifier(); + + // test_err type_param_type_var_tuple_bound + // type X[*T: int] = int + ast::TypeParam::TypeVarTuple(ast::TypeParamTypeVarTuple { + range: self.node_range(start), + name, + }) + } else if self.eat(TokenKind::DoubleStar) { + let name = self.parse_identifier(); + + // test_err type_param_param_spec_bound + // type X[**T: int] = int + ast::TypeParam::ParamSpec(ast::TypeParamParamSpec { + range: self.node_range(start), + name, + }) + } else { + let name = self.parse_identifier(); + + let bound = if self.eat(TokenKind::Colon) { + if self.at_expr() { + // test_err type_param_invalid_bound_expr + // type X[T: *int] = int + // type X[T: yield x] = int + // type X[T: yield from x] = int + // type X[T: x := int] = int + Some(Box::new( + self.parse_conditional_expression_or_higher(AllowStarredExpression::No) + .expr, + )) + } else { + // test_err type_param_missing_bound + // type X[T: ] = int + // type X[T1: , T2] = int + self.add_error( + ParseErrorType::ExpectedExpression, + self.current_token_range(), + ); + None + } + } else { + None + }; + + ast::TypeParam::TypeVar(ast::TypeParamTypeVar { + range: self.node_range(start), + name, + bound, + }) + } + } + + /// Validate that the given expression is a valid assignment target. + /// + /// If the expression is a list or tuple, then validate each element in the list. + /// If it's a starred expression, then validate the value of the starred expression. + /// + /// Report an error for each invalid assignment expression found. + pub(super) fn validate_assignment_target(&mut self, expr: &Expr) { + match expr { + Expr::Starred(ast::ExprStarred { value, .. }) => self.validate_assignment_target(value), + Expr::List(ast::ExprList { elts, .. }) | Expr::Tuple(ast::ExprTuple { elts, .. }) => { + for expr in elts { + self.validate_assignment_target(expr); + } + } + Expr::Name(_) | Expr::Attribute(_) | Expr::Subscript(_) => {} + _ => self.add_error(ParseErrorType::InvalidAssignmentTarget, expr.range()), + } + } + + /// Validate that the given expression is a valid annotated assignment target. + /// + /// Unlike [`Parser::validate_assignment_target`], starred, list and tuple + /// expressions aren't allowed here. + fn validate_annotated_assignment_target(&mut self, expr: &Expr) { + match expr { + Expr::List(_) => self.add_error( + ParseErrorType::OtherError( + "Only single target (not list) can be annotated".to_string(), + ), + expr, + ), + Expr::Tuple(_) => self.add_error( + ParseErrorType::OtherError( + "Only single target (not tuple) can be annotated".to_string(), + ), + expr, + ), + Expr::Name(_) | Expr::Attribute(_) | Expr::Subscript(_) => {} + _ => self.add_error(ParseErrorType::InvalidAnnotatedAssignmentTarget, expr), + } + } + + /// Validate that the given expression is a valid delete target. + /// + /// If the expression is a list or tuple, then validate each element in the list. + /// + /// See: + fn validate_delete_target(&mut self, expr: &Expr) { + match expr { + Expr::List(ast::ExprList { elts, .. }) | Expr::Tuple(ast::ExprTuple { elts, .. }) => { + for expr in elts { + self.validate_delete_target(expr); + } + } + Expr::Name(_) | Expr::Attribute(_) | Expr::Subscript(_) => {} + _ => self.add_error(ParseErrorType::InvalidDeleteTarget, expr), + } + } + + /// Validate that the given parameters doesn't have any duplicate names. + /// + /// Report errors for all the duplicate names found. + fn validate_parameters(&mut self, parameters: &ast::Parameters) { + let mut all_arg_names = FxHashSet::with_capacity_and_hasher( + parameters.posonlyargs.len() + + parameters.args.len() + + usize::from(parameters.vararg.is_some()) + + parameters.kwonlyargs.len() + + usize::from(parameters.kwarg.is_some()), + BuildHasherDefault::default(), + ); + + let posonlyargs = parameters.posonlyargs.iter(); + let args = parameters.args.iter(); + let kwonlyargs = parameters.kwonlyargs.iter(); + + let vararg = parameters.vararg.as_deref(); + let kwarg = parameters.kwarg.as_deref(); + + for arg in posonlyargs + .chain(args) + .chain(kwonlyargs) + .map(|arg| &arg.parameter) + .chain(vararg) + .chain(kwarg) + { + let range = arg.name.range; + let arg_name = arg.name.as_str(); + if !all_arg_names.insert(arg_name) { + self.add_error( + ParseErrorType::DuplicateParameter(arg_name.to_string()), + range, + ); + } + } + } + + /// Specialized [`Parser::parse_list_into_vec`] for parsing a sequence of clauses. + /// + /// The difference is that the parser only continues parsing for as long as it sees the token + /// indicating the start of the specific clause. This is different from + /// [`Parser::parse_list_into_vec`] that performs error recovery when the next token is not a + /// list terminator or the start of a list element. + /// + /// The special method is necessary because Python uses indentation over explicit delimiters to + /// indicate the end of a clause. + /// + /// ```python + /// if True: ... + /// elif False: ... + /// elf x: .... + /// else: ... + /// ``` + /// + /// It would be nice if the above example would recover and either skip over the `elf x: ...` + /// or parse it as a nested statement so that the parser recognises the `else` clause. But + /// Python makes this hard (without writing custom error recovery logic) because `elf x: ` + /// could also be an annotated assignment that went wrong ;) + /// + /// For now, don't recover when parsing clause headers, but add the terminator tokens (e.g. + /// `Else`) to the recovery context so that expression recovery stops when it encounters an + /// `else` token. + fn parse_clauses( + &mut self, + clause: Clause, + mut parse_clause: impl FnMut(&mut Parser<'src>) -> T, + ) -> Vec { + let mut clauses = Vec::new(); + let mut progress = ParserProgress::default(); + + let recovery_kind = match clause { + Clause::ElIf => RecoveryContextKind::Elif, + Clause::Except => RecoveryContextKind::Except, + _ => unreachable!("Clause is not supported"), + }; + + let saved_context = self.recovery_context; + self.recovery_context = self + .recovery_context + .union(RecoveryContext::from_kind(recovery_kind)); + + while recovery_kind.is_list_element(self) { + progress.assert_progressing(self); + + clauses.push(parse_clause(self)); + } + + self.recovery_context = saved_context; + + clauses + } +} + +#[derive(Copy, Clone)] +enum Clause { + If, + Else, + ElIf, + For, + With, + Class, + While, + FunctionDef, + Match, + Try, + Except, + Finally, +} + +impl Display for Clause { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Clause::If => write!(f, "`if` statement"), + Clause::Else => write!(f, "`else` clause"), + Clause::ElIf => write!(f, "`elif` clause"), + Clause::For => write!(f, "`for` statement"), + Clause::With => write!(f, "`with` statement"), + Clause::Class => write!(f, "`class` definition"), + Clause::While => write!(f, "`while` statement"), + Clause::FunctionDef => write!(f, "function definition"), + Clause::Match => write!(f, "`match` statement"), + Clause::Try => write!(f, "`try` statement"), + Clause::Except => write!(f, "`except` clause"), + Clause::Finally => write!(f, "`finally` clause"), + } + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +enum WithItemParsingState { + /// The parser is currently parsing a with item without any ambiguity. + Regular, + + /// The parser is currently parsing the first with item after an ambiguous + /// left parenthesis. The contained offset is the start of the left parenthesis. + /// + /// ```python + /// with (item1, item2): ... + /// ``` + /// + /// The parser is at the start of `item1`. + AmbiguousLparFirstItem(TextSize), + + /// The parser is currently parsing one of the with items after an ambiguous + /// left parenthesis, but not the first one. + /// + /// ```python + /// with (item1, item2, item3): ... + /// ``` + /// + /// The parser could be at the start of `item2` or `item3`, but not `item1`. + AmbiguousLparRest, +} + +impl WithItemParsingState { + const fn is_ambiguous_lpar(self) -> bool { + matches!( + self, + Self::AmbiguousLparFirstItem(_) | Self::AmbiguousLparRest + ) + } +} + +struct ParsedWithItem { + /// The contained with item. + item: WithItem, + /// If the context expression of the item is parenthesized. + is_parenthesized: bool, + /// If the parsing used the ambiguous left parenthesis. + used_ambiguous_lpar: bool, +} + +#[derive(Debug, Copy, Clone)] +enum ElifOrElse { + Elif, + Else, +} + +impl ElifOrElse { + const fn is_elif(self) -> bool { + matches!(self, ElifOrElse::Elif) + } + + const fn as_token_kind(self) -> TokenKind { + match self { + ElifOrElse::Elif => TokenKind::Elif, + ElifOrElse::Else => TokenKind::Else, + } + } + + const fn as_clause(self) -> Clause { + match self { + ElifOrElse::Elif => Clause::ElIf, + ElifOrElse::Else => Clause::Else, + } + } +} + +/// The kind of the except clause. +#[derive(Debug, Copy, Clone)] +enum ExceptClauseKind { + /// A normal except clause e.g., `except Exception as e: ...`. + Normal, + /// An except clause with a star e.g., `except *: ...`. + Star, +} + +impl ExceptClauseKind { + const fn is_star(self) -> bool { + matches!(self, ExceptClauseKind::Star) + } +} + +#[derive(Debug, Copy, Clone)] +enum AllowStarAnnotation { + Yes, + No, +} + +#[derive(Debug, Copy, Clone)] +enum ImportStyle { + /// E.g., `import foo, bar` + Import, + /// E.g., `from foo import bar, baz` + ImportFrom, +} diff --git a/crates/ruff_python_parser/src/parser/tests.rs b/crates/ruff_python_parser/src/parser/tests.rs new file mode 100644 index 0000000000..ec23d01d27 --- /dev/null +++ b/crates/ruff_python_parser/src/parser/tests.rs @@ -0,0 +1,152 @@ +use crate::{lex, parse, parse_expression, parse_suite, parse_tokens, Mode}; + +#[test] +fn test_modes() { + let source = "a[0][1][2][3][4]"; + + assert!(parse(source, Mode::Expression).is_ok()); + assert!(parse(source, Mode::Module).is_ok()); +} + +#[test] +fn test_expr_mode_invalid_syntax1() { + let source = "first second"; + let error = parse_expression(source).unwrap_err(); + + insta::assert_debug_snapshot!(error); +} + +#[test] +fn test_expr_mode_invalid_syntax2() { + let source = r"first + +second +"; + let error = parse_expression(source).unwrap_err(); + + insta::assert_debug_snapshot!(error); +} + +#[test] +fn test_expr_mode_invalid_syntax3() { + let source = r"first + +second + +third +"; + let error = parse_expression(source).unwrap_err(); + + insta::assert_debug_snapshot!(error); +} + +#[test] +fn test_expr_mode_valid_syntax() { + let source = "first + +"; + let expr = parse_expression(source).unwrap(); + + insta::assert_debug_snapshot!(expr); +} + +#[test] +fn test_unicode_aliases() { + // https://github.com/RustPython/RustPython/issues/4566 + let source = r#"x = "\N{BACKSPACE}another cool trick""#; + let parse_ast = parse_suite(source).unwrap(); + + insta::assert_debug_snapshot!(parse_ast); +} + +#[test] +fn test_ipython_escape_commands() { + let parse_ast = parse( + r" +# Normal Python code +( + a + % + b +) + +# Dynamic object info +??a.foo +?a.foo +?a.foo? +??a.foo()?? + +# Line magic +%timeit a = b +%timeit foo(b) % 3 +%alias showPath pwd && ls -a +%timeit a =\ + foo(b); b = 2 +%matplotlib --inline +%matplotlib \ + --inline + +# System shell access +!pwd && ls -a | sed 's/^/\ /' +!pwd \ + && ls -a | sed 's/^/\\ /' +!!cd /Users/foo/Library/Application\ Support/ + +# Let's add some Python code to make sure that earlier escapes were handled +# correctly and that we didn't consume any of the following code as a result +# of the escapes. +def foo(): + return ( + a + != + b + ) + +# Transforms into `foo(..)` +/foo 1 2 +;foo 1 2 +,foo 1 2 + +# Indented escape commands +for a in range(5): + !ls + +p1 = !pwd +p2: str = !pwd +foo = %foo \ + bar + +% foo +foo = %foo # comment + +# Help end line magics +foo? +foo.bar?? +foo.bar.baz? +foo[0]?? +foo[0][1]? +foo.bar[0].baz[1]?? +foo.bar[0].baz[2].egg?? +" + .trim(), + Mode::Ipython, + ) + .unwrap(); + insta::assert_debug_snapshot!(parse_ast); +} + +#[test] +fn test_ipython_escape_command_parse_error() { + let source = r" +a = 1 +%timeit a == 1 + " + .trim(); + let lxr = lex(source, Mode::Ipython); + let parse_err = parse_tokens(lxr.collect(), source, Mode::Module).unwrap_err(); + assert_eq!( + parse_err.to_string(), + "IPython escape commands are only allowed in `Mode::Ipython` at byte range 6..20" + .to_string() + ); +} diff --git a/crates/ruff_python_parser/src/python.lalrpop b/crates/ruff_python_parser/src/python.lalrpop deleted file mode 100644 index a38750c317..0000000000 --- a/crates/ruff_python_parser/src/python.lalrpop +++ /dev/null @@ -1,2093 +0,0 @@ -// See also: file:///usr/share/doc/python/html/reference/grammar.html?highlight=grammar -// See also: https://github.com/antlr/grammars-v4/blob/master/python3/Python3.g4 -// See also: file:///usr/share/doc/python/html/reference/compound_stmts.html#function-definitions -// See also: https://greentreesnakes.readthedocs.io/en/latest/nodes.html#keyword - -use ruff_text_size::{Ranged, TextLen, TextRange, TextSize}; -use ruff_python_ast::{self as ast, Int, IpyEscapeKind, AnyStringKind}; -use crate::{ - FStringErrorType, - Mode, - lexer::{LexicalError, LexicalErrorType}, - function::{ArgumentList, parse_arguments, validate_pos_params, validate_arguments}, - context::set_context, - string::{StringType, concatenated_strings, parse_fstring_literal_element, parse_string_literal}, - token, - invalid, -}; -use lalrpop_util::ParseError; - -grammar(source_code: &str, mode: Mode); - -// This is a hack to reduce the amount of lalrpop tables generated: -// For each public entry point, a full parse table is generated. -// By having only a single pub function, we reduce this to one. -pub(crate) Top: ast::Mod = { - StartModule => ast::ModModule { body, range: (start..end).into() }.into(), - StartExpression ("\n")* => ast::ModExpression { body: Box::new(body.into()), range: (start..end).into() }.into() -}; - -Program: ast::Suite = { - => vec![], - // Compound statements - => { - statements.push(next); - statements - }, - - // Small statements - ";")*> ";"? "\n" => { - statements.extend(small); - statements.push(last); - statements - }, - - // Empty lines - "\n" => s, -}; - -Suite: ast::Suite = { - ";")*> ";"? "\n" => { - statements.push(last); - statements - }, - "\n" Indent Dedent => s, -}; - - -// One or more statements -Statements: Vec = { - // First simple statement - ";")*> ";"? "\n" => { - head.push(last); - head - }, - - // The first compound statement - => vec![s], - - // Any subsequent compound statements - => { - statements.push(next); - statements - }, - - // Any subsequent small statements - ";")*> ";"? "\n" => { - statements.extend(small); - statements.push(last); - statements - }, -}; - -SmallStatement: ast::Stmt = { - ExpressionStatement, - PassStatement, - DelStatement, - FlowStatement, - ImportStatement, - GlobalStatement, - NonlocalStatement, - AssertStatement, - TypeAliasStatement, - IpyEscapeCommandStatement, - IpyHelpEndEscapeCommandStatement, -}; - -PassStatement: ast::Stmt = { - "pass" => { - ast::Stmt::Pass(ast::StmtPass { range: (location..end_location).into() }) - }, -}; - -DelStatement: ast::Stmt = { - "del" => { - ast::Stmt::Delete( - ast::StmtDelete { targets: targets.into_iter().map(|expr| set_context(expr.into(), ast::ExprContext::Del)).collect(), range: (location..end_location).into() } - ) - }, -}; - -ExpressionStatement: ast::Stmt = { - =>? { - // Just an expression, no assignment: - if suffix.is_empty() { - Ok(ast::Stmt::Expr( - ast::StmtExpr { value: Box::new(expression.into()), range: (location..end_location).into() } - )) - } else { - let mut targets = vec![set_context(expression.into(), ast::ExprContext::Store)]; - let mut values = suffix; - - let value = Box::new(values.pop().unwrap().into()); - - for target in values { - targets.push(set_context(target.into(), ast::ExprContext::Store)); - } - invalid::assignment_targets(&targets)?; - Ok(ast::Stmt::Assign( - ast::StmtAssign { targets, value, range: (location..end_location).into() } - )) - } - }, - =>? { - invalid::assignment_target(&target.expr)?; - Ok(ast::Stmt::AugAssign( - ast::StmtAugAssign { - target: Box::new(set_context(target.into(), ast::ExprContext::Store)), - op, - value: Box::new(rhs.into()), - range: (location..end_location).into() - }, - )) - }, - > ":" > =>? { - let simple = target.expr.is_name_expr(); - invalid::assignment_target(&target.expr)?; - Ok(ast::Stmt::AnnAssign( - ast::StmtAnnAssign { - target: Box::new(set_context(target.into(), ast::ExprContext::Store)), - annotation: Box::new(annotation.into()), - value: rhs.map(ast::Expr::from).map(Box::new), - simple, - range: (location..end_location).into() - }, - )) - }, -}; - -AssignSuffix: crate::parser::ParenthesizedExpr = { - "=" => e, - "=" => e -}; - -TestListOrYieldExpr: crate::parser::ParenthesizedExpr = { - TestList, - YieldExpr -} - -#[inline] -TestOrStarExprList: crate::parser::ParenthesizedExpr = { - // as far as I can tell, these were the same - TestList -}; - -TestOrStarExpr: crate::parser::ParenthesizedExpr = { - Test<"all">, - StarExpr, -}; - -NamedOrStarExpr: crate::parser::ParenthesizedExpr = { - NamedExpression, - StarExpr, -}; - -TestOrStarNamedExpr: crate::parser::ParenthesizedExpr = { - NamedExpressionTest, - StarExpr, -}; - -AugAssign: ast::Operator = { - "+=" => ast::Operator::Add, - "-=" => ast::Operator::Sub, - "*=" => ast::Operator::Mult, - "@=" => ast::Operator::MatMult, - "/=" => ast::Operator::Div, - "%=" => ast::Operator::Mod, - "&=" => ast::Operator::BitAnd, - "|=" => ast::Operator::BitOr, - "^=" => ast::Operator::BitXor, - "<<=" => ast::Operator::LShift, - ">>=" => ast::Operator::RShift, - "**=" => ast::Operator::Pow, - "//=" => ast::Operator::FloorDiv, -}; - -FlowStatement: ast::Stmt = { - "break" => { - - ast::Stmt::Break(ast::StmtBreak { range: (location..end_location).into() }) - }, - "continue" => { - ast::Stmt::Continue(ast::StmtContinue { range: (location..end_location).into() }) - }, - "return" => { - ast::Stmt::Return( - ast::StmtReturn { value: value.map(ast::Expr::from).map(Box::new), range: (location..end_location).into() } - ) - }, - => { - ast::Stmt::Expr( - ast::StmtExpr { value: Box::new(expression.into()), range: (location..end_location).into() } - ) - }, - RaiseStatement, -}; - -RaiseStatement: ast::Stmt = { - "raise" => { - ast::Stmt::Raise( - ast::StmtRaise { exc: None, cause: None, range: (location..end_location).into() } - ) - }, - "raise" > >)?> => { - ast::Stmt::Raise( - ast::StmtRaise { exc: Some(Box::new(exc.into())), cause: cause.map(ast::Expr::from).map(Box::new), range: (location..end_location).into() } - ) - }, -}; - -ImportStatement: ast::Stmt = { - "import" >> => { - ast::Stmt::Import( - ast::StmtImport { names, range: (location..end_location).into() } - ) - }, - "from" "import" => { - let (level, module) = source; - ast::Stmt::ImportFrom( - ast::StmtImportFrom { - level, - module, - names, - range: (location..end_location).into() - }, - ) - }, -}; - -ImportFromLocation: (Option, Option) = { - => { - (Some(dots.iter().sum()), Some(name)) - }, - => { - (Some(dots.iter().sum()), None) - }, -}; - -ImportDots: u32 = { - "..." => 3, - "." => 1, -}; - -ImportAsNames: Vec = { - >> => i, - "(" >> ","? ")" => i, - "*" => { - // Star import all - vec![ast::Alias { name: ast::Identifier::new("*", (location..end_location).into()), asname: None, range: (location..end_location).into() }] - }, -}; - - -#[inline] -ImportAsAlias: ast::Alias = { - )?> => ast::Alias { name, asname: a, range: (location..end_location).into() }, -} - -// A name like abc or abc.def.ghi -DottedName: ast::Identifier = { - => ast::Identifier::new(n, (location..end_location).into()), - => { - let mut r = String::from(n); - for x in n2 { - r.push('.'); - r.push_str(x.1.as_str()); - } - ast::Identifier::new(r, (location..end_location).into()) - }, -}; - -GlobalStatement: ast::Stmt = { - "global" > => { - ast::Stmt::Global( - ast::StmtGlobal { names, range: (location..end_location).into() } - ) - }, -}; - -NonlocalStatement: ast::Stmt = { - "nonlocal" > => { - ast::Stmt::Nonlocal( - ast::StmtNonlocal { names, range: (location..end_location).into() } - ) - }, -}; - -AssertStatement: ast::Stmt = { - "assert" > >)?> => { - ast::Stmt::Assert( - ast::StmtAssert { - test: Box::new(test.into()), - msg: msg.map(ast::Expr::from).map(Box::new), - range: (location..end_location).into() - } - ) - }, -}; - -IpyEscapeCommandStatement: ast::Stmt = { - =>? { - if mode == Mode::Ipython { - Ok(ast::Stmt::IpyEscapeCommand( - ast::StmtIpyEscapeCommand { - kind: c.0, - value: c.1, - range: (location..end_location).into() - } - )) - } else { - Err(LexicalError::new( - LexicalErrorType::OtherError("IPython escape commands are only allowed in `Mode::Ipython`".to_string().into_boxed_str()), - location, - ))? - } - } -} - -IpyEscapeCommandExpr: crate::parser::ParenthesizedExpr = { - =>? { - if mode == Mode::Ipython { - // This should never occur as the lexer won't allow it. - if !matches!(c.0, IpyEscapeKind::Magic | IpyEscapeKind::Shell) { - return Err(LexicalError::new( - LexicalErrorType::OtherError("IPython escape command expr is only allowed for % and !".to_string().into_boxed_str()), - location, - ))?; - } - Ok(ast::ExprIpyEscapeCommand { - kind: c.0, - value: c.1, - range: (location..end_location).into() - }.into()) - } else { - Err(LexicalError::new( - LexicalErrorType::OtherError("IPython escape commands are only allowed in `Mode::Ipython`".to_string().into_boxed_str()), - location, - ))? - } - } -} - -IpyHelpEndEscapeCommandStatement: ast::Stmt = { - // We are permissive than the original implementation because we would allow whitespace - // between the expression and the suffix while the IPython implementation doesn't allow it. - // For example, `foo ?` would be valid in our case but invalid from IPython. - > =>? { - fn unparse_expr(expr: &ast::Expr, buffer: &mut String) -> Result<(), LexicalError> { - match expr { - ast::Expr::Name(ast::ExprName { id, .. }) => { - buffer.push_str(id.as_str()); - }, - ast::Expr::Subscript(ast::ExprSubscript { value, slice, range, .. }) => { - let ast::Expr::NumberLiteral(ast::ExprNumberLiteral { value: ast::Number::Int(integer), .. }) = slice.as_ref() else { - return Err(LexicalError::new( - LexicalErrorType::OtherError("only integer literals are allowed in Subscript expressions in help end escape command".to_string().into_boxed_str()), - range.start(), - )); - }; - unparse_expr(value, buffer)?; - buffer.push('['); - buffer.push_str(&format!("{}", integer)); - buffer.push(']'); - }, - ast::Expr::Attribute(ast::ExprAttribute { value, attr, .. }) => { - unparse_expr(value, buffer)?; - buffer.push('.'); - buffer.push_str(attr.as_str()); - }, - _ => { - return Err(LexicalError::new( - LexicalErrorType::OtherError("only Name, Subscript and Attribute expressions are allowed in help end escape command".to_string().into_boxed_str()), - expr.start(), - )); - } - } - Ok(()) - } - - if mode != Mode::Ipython { - return Err(ParseError::User { - error: LexicalError::new( - LexicalErrorType::OtherError("IPython escape commands are only allowed in `Mode::Ipython`".to_string().into_boxed_str()), - location, - ), - }); - } - - let kind = match suffix.len() { - 1 => IpyEscapeKind::Help, - 2 => IpyEscapeKind::Help2, - _ => { - return Err(ParseError::User { - error: LexicalError::new( - LexicalErrorType::OtherError("maximum of 2 `?` tokens are allowed in help end escape command".to_string().into_boxed_str()), - location, - ), - }); - } - }; - - let mut value = String::new(); - unparse_expr(&e.into(), &mut value)?; - - Ok(ast::Stmt::IpyEscapeCommand( - ast::StmtIpyEscapeCommand { - kind, - value: value.into_boxed_str(), - range: (location..end_location).into() - } - )) - } -} - -CompoundStatement: ast::Stmt = { - MatchStatement, - IfStatement, - WhileStatement, - ForStatement, - TryStatement, - WithStatement, - FuncDef, - ClassDef, -}; - -MatchStatement: ast::Stmt = { - "match" ":" "\n" Indent Dedent => { - let end_location = cases - .last() - .unwrap() - .body - .last() - .unwrap() - .end(); - ast::Stmt::Match( - ast::StmtMatch { - subject: Box::new(subject.into()), - cases, - range: (location..end_location).into() - } - ) - }, - "match" "," ":" "\n" Indent Dedent => { - let end_location = cases - .last() - .unwrap() - .body - .last() - .unwrap() - .end(); - ast::Stmt::Match( - ast::StmtMatch { - subject: Box::new(ast::Expr::Tuple( - ast::ExprTuple { - elts: vec![subject.into()], - ctx: ast::ExprContext::Load, - range: (tuple_location..tuple_end_location).into(), - parenthesized: false - }, - )), - cases, - range: (location..end_location).into() - } - ) - }, - "match" > ","? ":" "\n" Indent Dedent => { - let end_location = cases - .last() - .unwrap() - .body - .last() - .unwrap() - .end(); - let elts = elts.into_iter().map(ast::Expr::from).collect(); - ast::Stmt::Match( - ast::StmtMatch { - subject: Box::new(ast::Expr::Tuple( - ast::ExprTuple { - elts, - ctx: ast::ExprContext::Load, - range: (tuple_location..tuple_end_location).into(), - parenthesized: false - }, - )), - cases, - range: (location..end_location).into() - } - ) - } -} - -MatchCase: ast::MatchCase = { - "case" ":" => { - // SAFETY: `body` is never empty because it is non-optional and `Suite` matches one or more statements. - let end = body.last().unwrap().end(); - ast::MatchCase { - pattern, - guard: guard.map(Box::new), - body, - range: (start..end).into() - } - }, -} - -Guard: ast::Expr = { - "if" => { - guard.into() - } -} - -Patterns: ast::Pattern = { - "," => ast::Pattern::MatchSequence( - ast::PatternMatchSequence { - patterns: vec![pattern], - range: (location..end_location).into() - }, - ), - > ","? => { - ast::Pattern::MatchSequence( - ast::PatternMatchSequence { - patterns, - range: (location..end_location).into() - }, - ) - }, - => pattern -} - -Pattern: ast::Pattern = { - => pattern, - => pattern, -} - -AsPattern: ast::Pattern = { - "as" =>? { - if name.as_str() == "_" { - Err(LexicalError::new( - LexicalErrorType::OtherError("cannot use '_' as a target".to_string().into_boxed_str()), - location, - ))? - } else { - Ok(ast::Pattern::MatchAs( - ast::PatternMatchAs { - pattern: Some(Box::new(pattern)), - name: Some(name), - range: (location..end_location).into() - }, - )) - } - }, -} - -OrPattern: ast::Pattern = { - => pattern, - > => { - ast::Pattern::MatchOr( - ast::PatternMatchOr { patterns, range: (location..end_location).into() } - ) - } -} - -ClosedPattern: ast::Pattern = { - => node, - => node, - => node, - => node, - => node, - => node, - => node, -} - -SequencePattern: ast::Pattern = { - // A single-item tuple is a special case: it's a group pattern, _not_ a sequence pattern. - "(" ")" => pattern, - "(" ")" => ast::PatternMatchSequence { - patterns: vec![], - range: (location..end_location).into() - }.into(), - "(" "," ")" => { - ast::PatternMatchSequence { - patterns: vec![pattern], - range: (location..end_location).into() - }.into() - }, - "(" ",")+> ","? ")" => { - let mut patterns = patterns; - patterns.push(last); - ast::PatternMatchSequence { - patterns, - range: (location..end_location).into() - }.into() - }, - "[" > "]" => ast::PatternMatchSequence { - patterns, - range: (location..end_location).into() - }.into(), -} - -StarPattern: ast::Pattern = { - "*" => ast::PatternMatchStar { - name: if name.as_str() == "_" { None } else { Some(name) }, - range: (location..end_location).into() - }.into(), -} - -NumberAtom: crate::parser::ParenthesizedExpr = { - => ast::Expr::NumberLiteral( - ast::ExprNumberLiteral { value, range: (location..end_location).into() } - ).into(), -} - -NumberExpr: crate::parser::ParenthesizedExpr = { - NumberAtom, - "-" => ast::Expr::UnaryOp( - ast::ExprUnaryOp { - op: ast::UnaryOp::USub, - operand: Box::new(operand.into()), - range: (location..end_location).into() - } - ).into(), -} - -AddOpExpr: crate::parser::ParenthesizedExpr = { - => ast::ExprBinOp { - left: Box::new(left.into()), - op, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into(), -} - -LiteralPattern: ast::Pattern = { - "None" => ast::PatternMatchSingleton { - value: ast::Singleton::None, - range: (location..end_location).into() - }.into(), - "True" => ast::PatternMatchSingleton { - value: true.into(), - range: (location..end_location).into() - }.into(), - "False" => ast::PatternMatchSingleton { - value: false.into(), - range: (location..end_location).into() - }.into(), - => ast::PatternMatchValue { - value: Box::new(value.into()), - range: (location..end_location).into() - }.into(), - => ast::PatternMatchValue { - value: Box::new(value.into()), - range: (location..end_location).into() - }.into(), - => ast::PatternMatchValue { - value: Box::new(string.into()), - range: (location..end_location).into() - }.into(), - > =>? Ok(ast::PatternMatchValue { - value: Box::new(concatenated_strings(strings, (location..end_location).into())?), - range: (location..end_location).into() - }.into()), -} - -CapturePattern: ast::Pattern = { - => ast::PatternMatchAs { - pattern: None, - name: if name.as_str() == "_" { None } else { Some(name) }, - range: (location..end_location).into() - }.into(), -} - -MatchName: ast::Expr = { - => ast::Expr::Name( - ast::ExprName { id: id.into(), ctx: ast::ExprContext::Load, range: (location..end_location).into() }, - ), -} - -MatchNameOrAttr: ast::Expr = { - "." => ast::ExprAttribute { - value: Box::new(name), - attr, - ctx: ast::ExprContext::Load, - range: (location..end_location).into() - }.into(), - "." => ast::ExprAttribute { - value: Box::new(e), - attr, - ctx: ast::ExprContext::Load, - range: (location..end_location).into() - }.into(), -} - -ValuePattern: ast::Pattern = { - => ast::PatternMatchValue { - value: Box::new(e), - range: (location..end_location).into() - }.into(), -} - -MappingKey: ast::Expr = { - MatchNameOrAttr, - String, - => e.into(), - => e.into(), - "None" => ast::ExprNoneLiteral { - range: (location..end_location).into() - }.into(), - "True" => ast::ExprBooleanLiteral { - value: true, - range: (location..end_location).into() - }.into(), - "False" => ast::ExprBooleanLiteral { - value: false, - range: (location..end_location).into() - }.into(), -} - -MatchMappingEntry: (ast::Expr, ast::Pattern) = { - ":" => (k, v), -}; - -MappingPattern: ast::Pattern = { - "{" "}" => { - ast::PatternMatchMapping { - keys: vec![], - patterns: vec![], - rest: None, - range: (location..end_location).into() - }.into() - }, - "{" > ","? "}" => { - let (keys, patterns) = e - .into_iter() - .unzip(); - ast::PatternMatchMapping { - keys, - patterns, - rest: None, - range: (location..end_location).into() - }.into() - }, - "{" "**" ","? "}" => { - ast::PatternMatchMapping { - keys: vec![], - patterns: vec![], - rest: Some(rest), - range: (location..end_location).into() - }.into() - }, - "{" > "," "**" ","? "}" => { - let (keys, patterns) = e - .into_iter() - .unzip(); - ast::PatternMatchMapping { - keys, - patterns, - rest: Some(rest), - range: (location..end_location).into() - }.into() - }, -} - -MatchKeywordEntry: ast::PatternKeyword = { - "=" => ast::PatternKeyword { - attr, - pattern, - range: (location..end_location).into() - }, -}; - -ClassPattern: ast::Pattern = { - => { - ast::PatternMatchClass { - cls: Box::new(cls), - arguments, - range: (location..end_location).into() - }.into() - }, - => { - ast::PatternMatchClass { - cls: Box::new(cls), - arguments, - range: (location..end_location).into() - }.into() - }, -} - -PatternArguments: ast::PatternArguments = { - "(" > "," > ","? ")" => { - ast::PatternArguments { - patterns, - keywords, - range: (location..end_location).into() - } - }, - "(" > ","? ")" => { - ast::PatternArguments { - patterns, - keywords: vec![], - range: (location..end_location).into() - } - }, - "(" > ","? ")" => { - ast::PatternArguments { - patterns: vec![], - keywords, - range: (location..end_location).into() - } - }, - "(" ")" => { - ast::PatternArguments { - patterns: vec![], - keywords: vec![], - range: (location..end_location).into() - } - }, -}; - -IfStatement: ast::Stmt = { - "if" ":" "elif" ":" )*> "else" ":" )?> => { - let elif_else_clauses: Vec<_> = s2.into_iter().map(|(start, test, body)| ast::ElifElseClause { - range: (start..body.last().unwrap().end()).into(), - test: Some(test.into()), - body, - }).chain(s3.into_iter().map(|(start, body)| ast::ElifElseClause { - range: (start..body.last().unwrap().end()).into(), - test: None, - body, - })).collect(); - - let end_location = elif_else_clauses - .last() - .map_or_else(|| body.last().unwrap().end(), Ranged::end); - - ast::Stmt::If( - ast::StmtIf { test: Box::new(test.into()), body, elif_else_clauses, range: (location..end_location).into() } - ) - }, -}; - -WhileStatement: ast::Stmt = { - "while" ":" )?> => { - let orelse = s2.unwrap_or_default(); - let end_location = orelse - .last() - .or_else(|| body.last()) - .unwrap() - .end(); - ast::Stmt::While( - ast::StmtWhile { - test: Box::new(test.into()), - body, - orelse, - range: (location..end_location).into() - }, - ) - }, -}; - -ForStatement: ast::Stmt = { - "for" "in" ":" )?> => { - let orelse = orelse.unwrap_or_default(); - let end_location = orelse - .last() - .or_else(|| body.last()) - .unwrap() - .end(); - let target = Box::new(set_context(target.into(), ast::ExprContext::Store)); - let iter = Box::new(iter.into()); - ast::Stmt::For(ast::StmtFor { target, iter, body, orelse, is_async: is_async.is_some(), range: (location..end_location).into() }) - }, -}; - -TryStatement: ast::Stmt = { - "try" ":" )?> )?> => { - let orelse = orelse.unwrap_or_default(); - let finalbody = finalbody.unwrap_or_default(); - let end_location = finalbody - .last() - .map(Ranged::end) - .or_else(|| orelse.last().map(Ranged::end)) - .or_else(|| handlers.last().map(Ranged::end)) - .unwrap(); - ast::Stmt::Try( - ast::StmtTry { - body, - handlers, - orelse, - finalbody, - is_star: false, - range: (location..end_location).into() - }, - ) - }, - "try" ":" )?> )?> => { - let orelse = orelse.unwrap_or_default(); - let finalbody = finalbody.unwrap_or_default(); - let end_location = finalbody - .last() - .or_else(|| orelse.last()) - .map(Ranged::end) - .or_else(|| handlers.last().map(Ranged::end)) - .unwrap(); - ast::Stmt::Try( - ast::StmtTry { - body, - handlers, - orelse, - finalbody, - is_star: true, - range: (location..end_location).into() - }, - ) - }, - "try" ":" )> => { - let handlers = vec![]; - let orelse = vec![]; - let end_location = finalbody.last().unwrap().end(); - ast::Stmt::Try( - ast::StmtTry { - body, - handlers, - orelse, - finalbody, - is_star: false, - range: (location..end_location).into() - }, - ) - }, -}; - -ExceptStarClause: ast::ExceptHandler = { - "except" "*" > ":" => { - let end_location = body.last().unwrap().end(); - ast::ExceptHandler::ExceptHandler( - ast::ExceptHandlerExceptHandler { - type_: Some(Box::new(typ.into())), - name: None, - body, - range: (location..end_location).into() - }, - ) - }, - "except" "*" > "as" )> ":" => { - let end_location = body.last().unwrap().end(); - ast::ExceptHandler::ExceptHandler( - ast::ExceptHandlerExceptHandler { - type_: Some(Box::new(x.0.into())), - name: Some(x.1), - body, - range: (location..end_location).into() - }, - ) - }, -}; - - -ExceptClause: ast::ExceptHandler = { - "except" ?> ":" => { - let end_location = body.last().unwrap().end(); - ast::ExceptHandler::ExceptHandler( - ast::ExceptHandlerExceptHandler { - type_: typ.map(ast::Expr::from).map(Box::new), - name: None, - body, - range: (location..end_location).into() - }, - ) - }, - "except" > "as" )> ":" => { - let end_location = body.last().unwrap().end(); - ast::ExceptHandler::ExceptHandler( - ast::ExceptHandlerExceptHandler { - type_: Some(Box::new(x.0.into())), - name: Some(x.1), - body, - range: (location..end_location).into() - }, - ) - }, -}; - -WithStatement: ast::Stmt = { - "with" ":" => { - let end_location = body.last().unwrap().end(); - ast::StmtWith { items, body, is_async: is_async.is_some(), range: (location..end_location).into() }.into() - }, -}; - -WithItems: Vec = { - "(" ","? ")", - "(" ",")?> >)*> ","? ")" => { - left.into_iter().flatten().chain([mid]).chain(right).collect() - }, - > => { - // Special-case: if the `WithItem` is a parenthesized named expression, then the item - // should _exclude_ the outer parentheses in its range. For example: - // ```python - // with (a := 0): pass - // ``` - // In this case, the `(` and `)` are part of the `with` statement. - // The same applies to `yield` and `yield from`. - let item = if item.optional_vars.is_none() && matches!(item.context_expr, ast::Expr::Named(_) | ast::Expr::Yield(_) | ast::Expr::YieldFrom(_)) { - ast::WithItem { - range: item.range().add_start(TextSize::new(1)).sub_end(TextSize::new(1)), - context_expr: item.context_expr, - optional_vars: item.optional_vars, - } - } else { - item - }; - vec![item] - }, - > >)+> => { - [item].into_iter().chain(items).collect() - } -}; - -#[inline] -WithItemsNoAs: Vec = { - >> => { - all.into_iter().map(|context_expr| ast::WithItem { - range: context_expr.range(), - context_expr: context_expr.into(), - optional_vars: None, - }).collect() - }, -} - -WithItem: ast::WithItem = { - > => { - ast::WithItem { - range: context_expr.range(), - context_expr: context_expr.into(), - optional_vars: None, - } - }, - , -}; - -WithItemAs: ast::WithItem = { - > "as" > => { - let optional_vars = Some(Box::new(set_context(optional_vars.into(), ast::ExprContext::Store))); - ast::WithItem { - context_expr: context_expr.into(), - optional_vars, - range: (location..end_location).into(), - } - }, -} - -FuncDef: ast::Stmt = { - "def" " >)?> ":" => { - let parameters = Box::new(parameters); - let returns = returns.map(ast::Expr::from).map(Box::new); - let end_location = body.last().unwrap().end(); - ast::StmtFunctionDef { - name, - parameters, - body, - decorator_list, - returns, - type_params, - is_async: is_async.is_some(), - range: (location..end_location).into(), - }.into() - }, -}; - -TypeAliasName: ast::Expr = { - => ast::ExprName { - id: name.into(), - ctx: ast::ExprContext::Store, - range: (location..end_location).into(), - }.into(), -} - -TypeAliasStatement: ast::Stmt = { - "type" "=" > => { - ast::Stmt::TypeAlias( - ast::StmtTypeAlias { - name: Box::new(name), - value: Box::new(value.into()), - type_params, - range: (location..end_location).into() - }, - ) - }, -}; - -Parameters: ast::Parameters = { - "(" )?> ")" =>? { - a.as_ref().map(validate_arguments).transpose()?; - - let range = (location..end_location).into(); - let args = a - .map_or_else(|| ast::Parameters::empty(range), |mut arguments| { - arguments.range = range; - arguments - }); - - Ok(args) - } -}; - -// Note that this is a macro which is used once for function defs, and -// once for lambda defs. -ParameterList: ast::Parameters = { - > >)?> ","? =>? { - validate_pos_params(¶m1)?; - let (posonlyargs, args) = param1; - - // Now gather rest of parameters: - let (vararg, kwonlyargs, kwarg) = args2.unwrap_or((None, vec![], None)); - - Ok(ast::Parameters { - posonlyargs, - args, - kwonlyargs, - vararg, - kwarg, - range: (location..end_location).into() - }) - }, - > ","? => { - let (vararg, kwonlyargs, kwarg) = params; - ast::Parameters { - posonlyargs: vec![], - args: vec![], - kwonlyargs, - vararg, - kwarg, - range: (location..end_location).into() - } - }, -}; - -// Use inline here to make sure the "," is not creating an ambiguity. -#[inline] -ParameterDefs: (Vec, Vec) = { - >> => { - (vec![], args) - }, - >> "," "/" >)*> => { - (posonlyargs, args) - }, -}; - -ParameterDef: ast::ParameterWithDefault = { - => i, - "=" > => { - i.default = Some(Box::new(default.into())); - i.range = (i.range.start()..end_location).into(); - i - }, -}; - -UntypedParameter: ast::ParameterWithDefault = { - => { - let parameter = ast::Parameter { name, annotation: None, range: (location..end_location).into() }; - ast::ParameterWithDefault { parameter, default: None, range: (location..end_location).into() } - }, -}; -StarUntypedParameter: ast::Parameter = { - "*" => ast::Parameter { name:arg, annotation: None, range: (location..end_location).into() }, -}; - -DoubleStarUntypedParameter: ast::Parameter = { - "**" => ast::Parameter { name:arg, annotation: None, range: (location..end_location).into() }, -}; - -TypedParameter: ast::ParameterWithDefault = { - >)?> => { - let annotation = annotation.map(ast::Expr::from).map(Box::new); - let parameter = ast::Parameter { name, annotation, range: (location..end_location).into() }; - ast::ParameterWithDefault { parameter, default: None, range: (location..end_location).into() } - }, -}; - -StarTypedParameter: ast::Parameter = { - "*" )?> => { - let annotation = annotation.map(ast::Expr::from).map(Box::new); - ast::Parameter { name, annotation, range: (location..end_location).into() } - }, -}; - -DoubleStarTypedParameter: ast::Parameter = { - "**" >)?> => { - let annotation = annotation.map(ast::Expr::from).map(Box::new); - ast::Parameter { name, annotation, range: (location..end_location).into() } - }, -}; - -// Use inline here to make sure the "," is not creating an ambiguity. -// TODO: figure out another grammar that makes this inline no longer required. -#[inline] -ParameterListStarArgs: (Option>, Vec, Option>) = { - >)*> )?> =>? { - let kwarg = kwarg.map(Box::new); - let va = Some(Box::new(va)); - - Ok((va, kwonlyargs, kwarg)) - }, - "*" >)*> )?> =>? { - if kwonlyargs.is_empty() { - return Err(LexicalError::new( - LexicalErrorType::OtherError("named arguments must follow bare *".to_string().into_boxed_str()), - location, - ))?; - } - - let kwarg = kwarg.map(Box::new); - - Ok((None, kwonlyargs, kwarg)) - }, - )> =>? { - let kwarg = Some(Box::new(kwarg)); - - Ok((None, vec![], kwarg)) - }, -}; - -ClassDef: ast::Stmt = { - "class" ":" => { - let end_location = body.last().unwrap().end(); - ast::Stmt::ClassDef( - ast::StmtClassDef { - name, - arguments: arguments.map(Box::new), - body, - decorator_list, - type_params: type_params.map(Box::new), - range: (location..end_location).into() - }, - ) - }, -}; - -TypeParams: ast::TypeParams = { - "[" > ","? "]" => { - ast::TypeParams { - type_params: vars, - range: (location..end_location).into() - } - } -}; - -TypeParam: ast::TypeParam = { - >)?> => { - ast::TypeParam::TypeVar( - ast::TypeParamTypeVar { name, bound: bound.map(ast::Expr::from).map(Box::new), range: (location..end_location).into() } - ) - }, - "*" => { - ast::TypeParam::TypeVarTuple( - ast::TypeParamTypeVarTuple { name, range: (location..end_location).into() } - ) - }, - "**" => { - ast::TypeParam::ParamSpec( - ast::TypeParamParamSpec { name, range: (location..end_location).into() } - ) - } -}; - -// Decorators: -Decorator: ast::Decorator = { - "@" "\n" => { - ast::Decorator { range: (location..end_location).into(), expression: expression.into() } - }, -}; - -YieldExpr: crate::parser::ParenthesizedExpr = { - "yield" => ast::ExprYield { - value: value.map(ast::Expr::from).map(Box::new), - range: (location..end_location).into(), - }.into(), - "yield" "from" > => ast::ExprYieldFrom { - value: Box::new(value.into()), - range: (location..end_location).into(), - }.into(), -}; - -Test: crate::parser::ParenthesizedExpr = { - > "if" > "else" > => ast::ExprIf { - test: Box::new(test.into()), - body: Box::new(body.into()), - orelse: Box::new(orelse.into()), - range: (location..end_location).into() - }.into(), - OrTest, - LambdaDef, -}; - -NamedExpressionTest: crate::parser::ParenthesizedExpr = { - NamedExpression, - Test<"all">, -} - -NamedExpressionName: crate::parser::ParenthesizedExpr = { - => ast::ExprName { - id: id.into(), - ctx: ast::ExprContext::Store, - range: (location..end_location).into(), - }.into(), -} - -NamedExpression: crate::parser::ParenthesizedExpr = { - ":=" > => { - ast::ExprNamed { - target: Box::new(target.into()), - value: Box::new(value.into()), - range: (location..end_location).into(), - }.into() - }, -}; - -LambdaDef: crate::parser::ParenthesizedExpr = { - "lambda" ?> ":" > =>? { - if fstring_middle.is_some() { - return Err(LexicalError::new( - LexicalErrorType::FStringError(FStringErrorType::LambdaWithoutParentheses), - location, - ))?; - } - parameters.as_ref().map(validate_arguments).transpose()?; - - Ok(ast::ExprLambda { - parameters: parameters.map(Box::new), - body: Box::new(body.into()), - range: (location..end_location).into() - }.into()) - } -} - -OrTest: crate::parser::ParenthesizedExpr = { - > "or")+> > => { - let values = values.into_iter().chain(std::iter::once(last)).map(ast::Expr::from).collect(); - ast::ExprBoolOp { op: ast::BoolOp::Or, values, range: (location..end_location).into() }.into() - }, - AndTest, -}; - -AndTest: crate::parser::ParenthesizedExpr = { - > "and")+> > => { - let values = values.into_iter().chain(std::iter::once(last)).map(ast::Expr::from).collect(); - ast::ExprBoolOp { op: ast::BoolOp::And, values, range: (location..end_location).into() }.into() - }, - NotTest, -}; - -NotTest: crate::parser::ParenthesizedExpr = { - "not" > => ast::ExprUnaryOp { - operand: Box::new(operand.into()), - op: ast::UnaryOp::Not, - range: (location..end_location).into(), - }.into(), - Comparison, -}; - -Comparison: crate::parser::ParenthesizedExpr = { - > )+> => { - let mut ops = Vec::with_capacity(comparisons.len()); - let mut comparators = Vec::with_capacity(comparisons.len()); - for (op, comparator) in comparisons { - ops.push(op); - comparators.push(comparator.into()); - } - ast::ExprCompare { - left: Box::new(left.into()), - ops: ops.into_boxed_slice(), - comparators: comparators.into_boxed_slice(), - range: (location..end_location).into(), - }.into() - }, - Expression, -}; - -CompOp: ast::CmpOp = { - "==" => ast::CmpOp::Eq, - "!=" => ast::CmpOp::NotEq, - "<" => ast::CmpOp::Lt, - "<=" => ast::CmpOp::LtE, - ">" => ast::CmpOp::Gt, - ">=" => ast::CmpOp::GtE, - "in" => ast::CmpOp::In, - "not" "in" => ast::CmpOp::NotIn, - "is" => ast::CmpOp::Is, - "is" "not" => ast::CmpOp::IsNot, -}; - -Expression: crate::parser::ParenthesizedExpr = { - > "|" > => ast::ExprBinOp { - left: Box::new(left.into()), - op: ast::Operator::BitOr, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into(), - XorExpression, -}; - -XorExpression: crate::parser::ParenthesizedExpr = { - > "^" > => ast::ExprBinOp { - left: Box::new(left.into()), - op: ast::Operator::BitXor, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into(), - AndExpression, -}; - -AndExpression: crate::parser::ParenthesizedExpr = { - > "&" > => ast::ExprBinOp { - left: Box::new(left.into()), - op: ast::Operator::BitAnd, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into(), - ShiftExpression, -}; - -ShiftExpression: crate::parser::ParenthesizedExpr = { - > > => ast::ExprBinOp { - left: Box::new(left.into()), - op, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into(), - ArithmeticExpression, -}; - -ShiftOp: ast::Operator = { - "<<" => ast::Operator::LShift, - ">>" => ast::Operator::RShift, -}; - -ArithmeticExpression: crate::parser::ParenthesizedExpr = { - > > => ast::ExprBinOp { - left: Box::new(left.into()), - op, - right: Box::new(right.into()), - range: (location..end_location).into(), - }.into(), - Term, -}; - -AddOp: ast::Operator = { - "+" => ast::Operator::Add, - "-" => ast::Operator::Sub, -}; - -Term: crate::parser::ParenthesizedExpr = { - > > => ast::ExprBinOp { - left: Box::new(left.into()), - op, - right: Box::new(right.into()), - range: (location..end_location).into(), - }.into(), - Factor, -}; - -MulOp: ast::Operator = { - "*" => ast::Operator::Mult, - "/" => ast::Operator::Div, - "//" => ast::Operator::FloorDiv, - "%" => ast::Operator::Mod, - "@" => ast::Operator::MatMult, -}; - -Factor: crate::parser::ParenthesizedExpr = { - > => ast::ExprUnaryOp { - operand: Box::new(operand.into()), - op, - range: (location..end_location).into(), - }.into(), - Power, -}; - -UnaryOp: ast::UnaryOp = { - "+" => ast::UnaryOp::UAdd, - "-" => ast::UnaryOp::USub, - "~" => ast::UnaryOp::Invert, -}; - -Power: crate::parser::ParenthesizedExpr = { - > "**" > => ast::ExprBinOp { - left: Box::new(left.into()), - op: ast::Operator::Pow, - right: Box::new(right.into()), - range: (location..end_location).into(), - }.into(), - AtomExpr, -}; - -AtomExpr: crate::parser::ParenthesizedExpr = { - "await" > => { - ast::ExprAwait { value: Box::new(value.into()), range: (location..end_location).into() }.into() - }, - AtomExpr2, -} - -AtomExpr2: crate::parser::ParenthesizedExpr = { - Atom, - > => ast::ExprCall { - func: Box::new(func.into()), - arguments, - range: (location..end_location).into(), - }.into(), - > "[" "]" => ast::ExprSubscript { - value: Box::new(value.into()), - slice: Box::new(slice.into()), - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - }.into(), - > "." => ast::ExprAttribute { - value: Box::new(value.into()), - attr, - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - }.into(), -}; - -SubscriptList: crate::parser::ParenthesizedExpr = { - Subscript, - "," => { - ast::ExprTuple { - elts: vec![s1.into()], - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: false - }.into() - }, - > ","? => { - let elts = elts.into_iter().map(ast::Expr::from).collect(); - ast::ExprTuple { - elts, - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: false - }.into() - } -}; - -Subscript: crate::parser::ParenthesizedExpr = { - TestOrStarNamedExpr, - ?> ":" ?> => { - let lower = lower.map(ast::Expr::from).map(Box::new); - let upper = upper.map(ast::Expr::from).map(Box::new); - let step = step.flatten().map(ast::Expr::from).map(Box::new); - ast::Expr::Slice( - ast::ExprSlice { lower, upper, step, range: (location..end_location).into() } - ).into() - } -}; - -SliceOp: Option = { - ":" ?> => e, -} - -String: ast::Expr = { - => string.into(), - > =>? { - Ok(concatenated_strings(strings, (location..end_location).into())?) - } -}; - -StringLiteralOrFString: StringType = { - StringLiteral, - FStringExpr, -}; - -StringLiteral: StringType = { - =>? { - let (source, kind) = string; - Ok(parse_string_literal(source, kind, (location..end_location).into())?) - } -}; - -FStringExpr: StringType = { - FStringEnd => { - StringType::FString(ast::FString { - elements, - range: (location..end_location).into(), - flags: start.into() - }) - } -}; - -FStringMiddlePattern: ast::FStringElement = { - FStringReplacementField, - =>? { - let (source, kind) = fstring_middle; - Ok(parse_fstring_literal_element(source, kind, (location..end_location).into())?) - } -}; - -FStringReplacementField: ast::FStringElement = { - "{" "}" =>? { - if value.expr.is_lambda_expr() && !value.is_parenthesized() { - return Err(LexicalError::new( - LexicalErrorType::FStringError(FStringErrorType::LambdaWithoutParentheses), - value.start(), - ))?; - } - let debug_text = debug.map(|_| { - let start_offset = location + "{".text_len(); - let end_offset = if let Some((conversion_start, _)) = conversion { - conversion_start - } else { - format_spec.as_ref().map_or_else( - || end_location - "}".text_len(), - |spec| spec.start() - ":".text_len(), - ) - }; - ast::DebugText { - leading: source_code[TextRange::new(start_offset, value.expr.start())].to_string(), - trailing: source_code[TextRange::new(value.expr.end(), end_offset)].to_string(), - } - }); - Ok( - ast::FStringElement::Expression(ast::FStringExpressionElement { - expression: Box::new(value.into()), - debug_text, - conversion: conversion.map_or(ast::ConversionFlag::None, |(_, conversion_flag)| { - conversion_flag - }), - format_spec: format_spec.map(Box::new), - range: (location..end_location).into(), - }) - ) - } -}; - -FStringFormatSpecSuffix: ast::FStringFormatSpec = { - ":" => format_spec -}; - -FStringFormatSpec: ast::FStringFormatSpec = { - => ast::FStringFormatSpec { - elements, - range: (location..end_location).into(), - }, -}; - -FStringConversion: (TextSize, ast::ConversionFlag) = { - "!" =>? { - let conversion = match s.as_ref() { - "s" => ast::ConversionFlag::Str, - "r" => ast::ConversionFlag::Repr, - "a" => ast::ConversionFlag::Ascii, - _ => Err(LexicalError::new( - LexicalErrorType::FStringError(FStringErrorType::InvalidConversionFlag), - name_location, - ))? - }; - Ok((location, conversion)) - } -}; - -Atom: crate::parser::ParenthesizedExpr = { - => expr.into(), - => ast::ExprNumberLiteral { - value, - range: (location..end_location).into(), - }.into(), - => ast::ExprName { - id: id.into(), - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - }.into(), - "[" "]" => { - let elts = elts.into_iter().flatten().map(ast::Expr::from).collect(); - ast::ExprList { elts, ctx: ast::ExprContext::Load, range: (location..end_location).into() }.into() - }, - "[" "]" => { - ast::ExprListComp { elt: Box::new(elt.into()), generators, range: (location..end_location).into() }.into() - }, - "(" >> ")" if Goal != "no-withitems" => { - if elts.len() == 1 && trailing_comma.is_none() { - crate::parser::ParenthesizedExpr { - expr: elts.into_iter().next().unwrap().into(), - range: (location..end_location).into(), - } - } else { - let elts = elts.into_iter().map(ast::Expr::from).collect(); - ast::ExprTuple { - elts, - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: true - }.into() - } - }, - "(" >> ",")?> )*> ")" =>? { - if left.is_none() && right.is_empty() && trailing_comma.is_none() { - if mid.expr.is_starred_expr() { - return Err(LexicalError::new( - LexicalErrorType::OtherError("cannot use starred expression here".to_string().into_boxed_str()), - mid.start(), - ))?; - } - Ok(crate::parser::ParenthesizedExpr { - expr: mid.into(), - range: (location..end_location).into(), - }) - } else { - let elts = left.into_iter().flatten().chain([mid]).chain(right).map(ast::Expr::from).collect(); - Ok(ast::ExprTuple { - elts, - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: true - }.into()) - } - }, - "(" ")" => ast::ExprTuple { - elts: Vec::new(), - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: true - }.into(), - "(" ")" => crate::parser::ParenthesizedExpr { - expr: e.into(), - range: (location..end_location).into(), - }, - "(" ")" => ast::ExprGenerator { - elt: Box::new(elt.into()), - generators, - range: (location..end_location).into(), - parenthesized: true - }.into(), - "(" "**" > ")" =>? { - Err(LexicalError::new( - LexicalErrorType::OtherError("cannot use double starred expression here".to_string().into_boxed_str()), - location, - ).into()) - }, - "{" "}" => { - let (keys, values) = e - .unwrap_or_default() - .into_iter() - .map(|(k, v)| (k.map(|x| ast::Expr::from(*x)), ast::Expr::from(v))) - .unzip(); - ast::ExprDict { keys, values, range: (location..end_location).into() }.into() - }, - "{" "}" => { - ast::ExprDictComp { - key: Box::new(e1.0.into()), - value: Box::new(e1.1.into()), - generators, - range: (location..end_location).into() - }.into() - }, - "{" "}" => { - let elts = elts.into_iter().map(ast::Expr::from).collect(); - ast::ExprSet { - elts, - range: (location..end_location).into(), - }.into() - }, - "{" "}" => ast::ExprSetComp { - elt: Box::new(elt.into()), - generators, - range: (location..end_location).into(), - }.into(), - "True" => ast::ExprBooleanLiteral { value: true, range: (location..end_location).into() }.into(), - "False" => ast::ExprBooleanLiteral { value: false, range: (location..end_location).into() }.into(), - "None" => ast::ExprNoneLiteral { range: (location..end_location).into() }.into(), - "..." => ast::ExprEllipsisLiteral { range: (location..end_location).into() }.into(), -}; - -ListLiteralValues: Vec = { - > ","? => e, -}; - -DictLiteralValues: Vec<(Option>, crate::parser::ParenthesizedExpr)> = { - > ","? => elements, -}; - -DictEntry: (crate::parser::ParenthesizedExpr, crate::parser::ParenthesizedExpr) = { - > ":" > => (e1, e2), -}; - -DictElement: (Option>, crate::parser::ParenthesizedExpr) = { - => (Some(Box::new(e.0)), e.1), - "**" > => (None, e), -}; - -SetLiteralValues: Vec = { - > ","? => e1 -}; - -ExpressionOrStarExpression: crate::parser::ParenthesizedExpr = { - Expression<"all">, - StarExpr -}; - -ExpressionList: crate::parser::ParenthesizedExpr = { - GenericList -}; - -ExpressionList2: Vec = { - > ","? => elements, -}; - -// A test list is one of: -// - a list of expressions -// - a single expression -// - a single expression followed by a trailing comma -#[inline] -TestList: crate::parser::ParenthesizedExpr = { - GenericList -}; - -GenericList: crate::parser::ParenthesizedExpr = { - > => { - if elts.len() == 1 && trailing_comma.is_none() { - crate::parser::ParenthesizedExpr { - expr: elts.into_iter().next().unwrap().into(), - range: (location..end_location).into(), - } - } else { - let elts = elts.into_iter().map(ast::Expr::from).collect(); - ast::ExprTuple { - elts, - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: false - }.into() - } - } -} - -// Test -StarExpr: crate::parser::ParenthesizedExpr = { - "*" > => ast::ExprStarred { - value: Box::new(value.into()), - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - }.into(), -}; - -// Comprehensions: -CompFor: Vec = => c; - -SingleForComprehension: ast::Comprehension = { - "for" "in" > => { - let is_async = is_async.is_some(); - let ifs = ifs.into_iter().map(ast::Expr::from).collect(); - ast::Comprehension { - target: set_context(target.into(), ast::ExprContext::Store), - iter: iter.into(), - ifs, - is_async, - range: (location..end_location).into() - } - } -}; - -ExpressionNoCond: crate::parser::ParenthesizedExpr = OrTest<"all">; -ComprehensionIf: crate::parser::ParenthesizedExpr = "if" => c; - -Arguments: ast::Arguments = { - "(" > ")" =>? { - let ArgumentList { args, keywords } = parse_arguments(e)?; - Ok(ast::Arguments { - args: args.into_boxed_slice(), - keywords: keywords.into_boxed_slice(), - range: (location..end_location).into() - }) - } -}; - -FunctionArgument: (Option<(TextSize, TextSize, Option)>, ast::Expr) = { - => { - let expr = match generators { - Some(generators) => ast::Expr::Generator( - ast::ExprGenerator { - elt: Box::new(elt.into()), - generators, - range: (location..end_location).into(), - parenthesized: false - } - ), - None => elt.into(), - }; - (None, expr) - }, - "=" > => (Some((location, end_location, Some(i))), e.into()), - "*" > => { - let expr = ast::Expr::Starred(ast::ExprStarred { - value: Box::new(value.into()), ctx: ast::ExprContext::Load, range: (location..end_location).into(), - }); - (None, expr) - }, - "**" > => (Some((location, end_location, None)), e.into()), -}; - -/// Comma separated sequence that allows an optional trailing comma. -#[inline] -Comma: Vec = { - ",")*> => { - if let Some(element) = last { - v.push(element); - } - v - } -}; - -/// One or more items that are separated by a comma. -OneOrMore: Vec = { - => vec![e], - > "," => { - v.push(e); - v - } -}; - -/// Two or more items that are separated by `Sep` -TwoOrMoreSep: Vec = { - Sep => vec![e1, e2], - > Sep => { - v.push(e); - v - } -}; - -/// Two or more items that are contiguous. -TwoOrMore: Vec = { - => vec![e1, e2], - > => { - v.push(e); - v - } -}; - -Number: ast::Number = { - => ast::Number::Int(value), - => ast::Number::Float(value), - => ast::Number::Complex { real: s.0, imag: s.1 }, -}; - -Identifier: ast::Identifier = { - => ast::Identifier::new(s, (location..end_location).into()) -}; - -// Hook external lexer: -extern { - type Location = TextSize; - type Error = LexicalError; - - enum token::Tok { - Indent => token::Tok::Indent, - Dedent => token::Tok::Dedent, - StartModule => token::Tok::StartModule, - StartExpression => token::Tok::StartExpression, - fstring_start => token::Tok::FStringStart(), - FStringEnd => token::Tok::FStringEnd, - "!" => token::Tok::Exclamation, - "?" => token::Tok::Question, - "+" => token::Tok::Plus, - "-" => token::Tok::Minus, - "~" => token::Tok::Tilde, - ":" => token::Tok::Colon, - "." => token::Tok::Dot, - "..." => token::Tok::Ellipsis, - "," => token::Tok::Comma, - "*" => token::Tok::Star, - "**" => token::Tok::DoubleStar, - "&" => token::Tok::Amper, - "@" => token::Tok::At, - "%" => token::Tok::Percent, - "//" => token::Tok::DoubleSlash, - "^" => token::Tok::CircumFlex, - "|" => token::Tok::Vbar, - "<<" => token::Tok::LeftShift, - ">>" => token::Tok::RightShift, - "/" => token::Tok::Slash, - "(" => token::Tok::Lpar, - ")" => token::Tok::Rpar, - "[" => token::Tok::Lsqb, - "]" => token::Tok::Rsqb, - "{" => token::Tok::Lbrace, - "}" => token::Tok::Rbrace, - "=" => token::Tok::Equal, - "+=" => token::Tok::PlusEqual, - "-=" => token::Tok::MinusEqual, - "*=" => token::Tok::StarEqual, - "@=" => token::Tok::AtEqual, - "/=" => token::Tok::SlashEqual, - "%=" => token::Tok::PercentEqual, - "&=" => token::Tok::AmperEqual, - "|=" => token::Tok::VbarEqual, - "^=" => token::Tok::CircumflexEqual, - "<<=" => token::Tok::LeftShiftEqual, - ">>=" => token::Tok::RightShiftEqual, - "**=" => token::Tok::DoubleStarEqual, - "//=" => token::Tok::DoubleSlashEqual, - ":=" => token::Tok::ColonEqual, - "==" => token::Tok::EqEqual, - "!=" => token::Tok::NotEqual, - "<" => token::Tok::Less, - "<=" => token::Tok::LessEqual, - ">" => token::Tok::Greater, - ">=" => token::Tok::GreaterEqual, - "->" => token::Tok::Rarrow, - "and" => token::Tok::And, - "as" => token::Tok::As, - "assert" => token::Tok::Assert, - "async" => token::Tok::Async, - "await" => token::Tok::Await, - "break" => token::Tok::Break, - "class" => token::Tok::Class, - "continue" => token::Tok::Continue, - "def" => token::Tok::Def, - "del" => token::Tok::Del, - "elif" => token::Tok::Elif, - "else" => token::Tok::Else, - "except" => token::Tok::Except, - "finally" => token::Tok::Finally, - "for" => token::Tok::For, - "from" => token::Tok::From, - "global" => token::Tok::Global, - "if" => token::Tok::If, - "import" => token::Tok::Import, - "in" => token::Tok::In, - "is" => token::Tok::Is, - "lambda" => token::Tok::Lambda, - "nonlocal" => token::Tok::Nonlocal, - "not" => token::Tok::Not, - "or" => token::Tok::Or, - "pass" => token::Tok::Pass, - "raise" => token::Tok::Raise, - "return" => token::Tok::Return, - "try" => token::Tok::Try, - "type" => token::Tok::Type, - "while" => token::Tok::While, - "match" => token::Tok::Match, - "case" => token::Tok::Case, - "with" => token::Tok::With, - "yield" => token::Tok::Yield, - "True" => token::Tok::True, - "False" => token::Tok::False, - "None" => token::Tok::None, - int => token::Tok::Int { value: }, - float => token::Tok::Float { value: }, - complex => token::Tok::Complex { real: , imag: }, - string => token::Tok::String { - value: >, - kind: , - }, - fstring_middle => token::Tok::FStringMiddle { - value: >, - kind: , - }, - name => token::Tok::Name { name: > }, - ipy_escape_command => token::Tok::IpyEscapeCommand { - kind: , - value: > - }, - "\n" => token::Tok::Newline, - ";" => token::Tok::Semi, - // "#" => token::Tok::Comment(_), - } -} diff --git a/crates/ruff_python_parser/src/python.rs b/crates/ruff_python_parser/src/python.rs deleted file mode 100644 index c463291f32..0000000000 --- a/crates/ruff_python_parser/src/python.rs +++ /dev/null @@ -1,78968 +0,0 @@ -// auto-generated: "lalrpop 0.20.0" -// sha3: 4ca26eae1233cf922ef88887715de0a4ca45076324249a20b87f095e9638165d -use ruff_text_size::{Ranged, TextLen, TextRange, TextSize}; -use ruff_python_ast::{self as ast, Int, IpyEscapeKind, AnyStringKind}; -use crate::{ - FStringErrorType, - Mode, - lexer::{LexicalError, LexicalErrorType}, - function::{ArgumentList, parse_arguments, validate_pos_params, validate_arguments}, - context::set_context, - string::{StringType, concatenated_strings, parse_fstring_literal_element, parse_string_literal}, - token, - invalid, -}; -use lalrpop_util::ParseError; -#[allow(unused_extern_crates)] -extern crate lalrpop_util as __lalrpop_util; -#[allow(unused_imports)] -use self::__lalrpop_util::state_machine as __state_machine; -extern crate core; -extern crate alloc; - -#[rustfmt::skip] -#[allow(non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports, unused_parens, clippy::all)] -mod __parse__Top { - - use ruff_text_size::{Ranged, TextLen, TextRange, TextSize}; - use ruff_python_ast::{self as ast, Int, IpyEscapeKind, AnyStringKind}; - use crate::{ - FStringErrorType, - Mode, - lexer::{LexicalError, LexicalErrorType}, - function::{ArgumentList, parse_arguments, validate_pos_params, validate_arguments}, - context::set_context, - string::{StringType, concatenated_strings, parse_fstring_literal_element, parse_string_literal}, - token, - invalid, -}; - use lalrpop_util::ParseError; - #[allow(unused_extern_crates)] - extern crate lalrpop_util as __lalrpop_util; - #[allow(unused_imports)] - use self::__lalrpop_util::state_machine as __state_machine; - extern crate core; - extern crate alloc; - use super::__ToTriple; - #[allow(dead_code)] - pub(crate) enum __Symbol<> - { - Variant0(token::Tok), - Variant1((f64, f64)), - Variant2(f64), - Variant3((Box, AnyStringKind)), - Variant4(AnyStringKind), - Variant5(Int), - Variant6((IpyEscapeKind, Box)), - Variant7(Box), - Variant8(core::option::Option), - Variant9(ast::Parameter), - Variant10(core::option::Option), - Variant11(ast::ParameterWithDefault), - Variant12(alloc::vec::Vec), - Variant13((Option>, Vec, Option>)), - Variant14(core::option::Option<(Option>, Vec, Option>)>), - Variant15(crate::parser::ParenthesizedExpr), - Variant16(core::option::Option), - Variant17(alloc::vec::Vec), - Variant18(ast::WithItem), - Variant19(alloc::vec::Vec), - Variant20((token::Tok, ast::Identifier)), - Variant21(alloc::vec::Vec<(token::Tok, ast::Identifier)>), - Variant22(alloc::vec::Vec), - Variant23(ast::Identifier), - Variant24(core::option::Option), - Variant25(ast::Suite), - Variant26(core::option::Option), - Variant27((TextSize, crate::parser::ParenthesizedExpr, ast::Suite)), - Variant28(alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)>), - Variant29((TextSize, ast::Suite)), - Variant30(core::option::Option<(TextSize, ast::Suite)>), - Variant31((Option<(TextSize, TextSize, Option)>, ast::Expr)), - Variant32(alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>), - Variant33(Vec), - Variant34(core::option::Option>), - Variant35(ast::Pattern), - Variant36(alloc::vec::Vec), - Variant37(ast::Stmt), - Variant38(alloc::vec::Vec), - Variant39((crate::parser::ParenthesizedExpr, ast::Identifier)), - Variant40(Vec), - Variant41(core::option::Option>), - Variant42((ast::CmpOp, crate::parser::ParenthesizedExpr)), - Variant43(alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)>), - Variant44(ast::Expr), - Variant45(core::option::Option), - Variant46(ast::Parameters), - Variant47(core::option::Option), - Variant48(TextSize), - Variant49(ast::Operator), - Variant50(ast::Arguments), - Variant51(core::option::Option), - Variant52(Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>), - Variant53(Vec), - Variant54(Vec), - Variant55(core::option::Option>), - Variant56(ast::CmpOp), - Variant57(ast::Decorator), - Variant58(alloc::vec::Vec), - Variant59((Option>, crate::parser::ParenthesizedExpr)), - Variant60((crate::parser::ParenthesizedExpr, crate::parser::ParenthesizedExpr)), - Variant61(Vec<(Option>, crate::parser::ParenthesizedExpr)>), - Variant62(core::option::Option>, crate::parser::ParenthesizedExpr)>>), - Variant63(ast::ExceptHandler), - Variant64(alloc::vec::Vec), - Variant65((TextSize, ast::ConversionFlag)), - Variant66(core::option::Option<(TextSize, ast::ConversionFlag)>), - Variant67(StringType), - Variant68(ast::FStringFormatSpec), - Variant69(core::option::Option), - Variant70(ast::FStringElement), - Variant71(alloc::vec::Vec), - Variant72(core::option::Option<(Option<(TextSize, TextSize, Option)>, ast::Expr)>), - Variant73(ast::Alias), - Variant74(Vec), - Variant75(u32), - Variant76(alloc::vec::Vec), - Variant77((Option, Option)), - Variant78(ast::MatchCase), - Variant79(alloc::vec::Vec), - Variant80(ast::PatternKeyword), - Variant81((ast::Expr, ast::Pattern)), - Variant82(ast::Number), - Variant83(Vec), - Variant84(Vec), - Variant85(Vec<(ast::Expr, ast::Pattern)>), - Variant86(Vec), - Variant87(Vec), - Variant88((Vec, Vec)), - Variant89(core::option::Option), - Variant90(ast::PatternArguments), - Variant91(ast::Comprehension), - Variant92(alloc::vec::Vec), - Variant93(Option), - Variant94(core::option::Option>), - Variant95(Vec), - Variant96(ast::Mod), - Variant97(Vec), - Variant98(ast::TypeParam), - Variant99(ast::TypeParams), - Variant100(core::option::Option), - Variant101(ast::UnaryOp), - Variant102(core::option::Option<(Box, AnyStringKind)>), - } - const __ACTION: &[i16] = &[ - // State 0 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 2 - -772, 0, 0, 0, 0, 0, 0, -772, 0, -772, 0, 0, 0, -772, 0, 0, -772, 0, 0, 0, -772, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -772, 0, -772, -772, -772, -772, 0, 0, 0, 0, 0, -772, -772, -772, -772, 0, -772, -772, -772, -772, 0, 0, 0, 0, -772, -772, -772, -772, -772, 0, 0, -772, -772, -772, -772, 0, -772, -772, -772, -772, -772, -772, -772, -772, -772, 0, 0, 0, -772, 0, 0, 0, 0, 0, -772, -772, 0, -772, -772, -772, -772, -772, - // State 3 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 4 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 5 - -794, -794, -794, 0, -794, -794, -794, 0, -794, 0, 0, -794, -794, 440, -794, -794, 441, -794, 0, 0, 0, 0, 0, -794, -794, -794, 0, -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, 0, -794, 0, 0, 0, 0, -794, -794, -794, -794, -794, 0, -794, 0, 0, 0, 0, 0, 0, 0, 0, -794, 0, 0, -794, -794, 0, -794, 0, -794, -794, 0, 0, 0, -794, -794, 0, 0, 0, 0, 0, 0, 0, 0, 0, -794, -794, -794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 6 - -254, -254, -254, -254, -254, -254, -254, 26, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, 0, 27, 0, -254, -254, -254, -254, -254, 0, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, 0, 0, 0, 28, -254, -254, -254, -254, -254, 0, -254, 0, 0, 0, 0, 0, 0, 0, 0, -254, 0, 0, -254, -254, 0, -254, 0, -254, -254, 0, 0, 0, -254, -254, 0, 0, 0, 0, 0, 0, 0, 0, 0, -254, -254, -254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 7 - -310, -310, 443, 0, -310, 0, -310, 0, -310, 0, 0, -310, -310, 0, -310, -310, 0, -310, 0, 0, 0, 0, 0, -310, -310, -310, 0, -310, 444, 0, -310, 445, -310, 446, 447, 448, 0, -310, 0, 0, -310, 0, 0, 0, 0, -310, 0, -310, -310, -310, 0, -310, 0, 0, 0, 0, 0, 0, 0, 0, -310, 0, 0, -310, -310, 0, -310, 0, 449, 450, 0, 0, 0, 451, -310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, -310, -310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 8 - 453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 9 - -161, -161, -161, 0, -161, -161, -161, 0, -161, 0, 0, -161, -161, 0, -161, -161, 0, -161, 0, 0, 0, 0, 0, -161, -161, -161, 0, -161, -161, 455, -161, -161, -161, -161, -161, -161, 456, -161, -161, 0, -161, 0, 0, 0, 0, -161, -161, -161, -161, -161, 0, -161, 0, 0, 0, 0, 0, 0, 0, 0, -161, 0, 0, -161, -161, 0, -161, 0, -161, -161, 0, 0, 0, -161, -161, 0, 0, 0, 0, 0, 0, 0, 0, 0, -161, -161, -161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 10 - -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, 0, -835, 0, -835, -835, -835, -835, -835, 0, -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, 0, 0, 0, -835, -835, -835, -835, -835, -835, 0, -835, 0, 0, 0, 0, 0, 0, 0, 0, -835, 0, 0, -835, -835, 0, -835, 0, -835, -835, 0, 0, 0, -835, -835, 0, 0, 0, 0, 0, 0, 0, 0, 0, -835, -835, -835, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 436, - // State 11 - -175, -175, -175, 458, -175, -175, -175, 0, -175, 459, 0, -175, -175, -175, -175, -175, -175, -175, 0, 0, 0, 460, 461, -175, -175, -175, 0, -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, 462, -175, 0, 0, 0, 0, -175, -175, -175, -175, -175, 0, -175, 0, 0, 0, 0, 0, 0, 0, 0, -175, 0, 0, -175, -175, 0, -175, 0, -175, -175, 0, 0, 0, -175, -175, 0, 0, 0, 0, 0, 0, 0, 0, 0, -175, -175, -175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 12 - -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, 0, -836, 0, -836, -836, -836, -836, -836, 0, -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, 0, 0, 0, -836, -836, -836, -836, -836, -836, 0, -836, 0, 0, 0, 0, 0, 0, 0, 0, -836, 0, 0, -836, -836, 0, -836, 0, -836, -836, 0, 0, 0, -836, -836, 0, 0, 0, 0, 0, 0, 0, 0, 0, -836, -836, -836, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 436, - // State 13 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 14 - 0, 0, 0, 0, 0, 0, 0, 15, 472, 16, 40, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 15 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 16 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 480, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 17 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 18 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 19 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 20 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 50, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 495, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 21 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 498, 0, 0, 0, 0, 0, 499, 0, 0, 0, 0, 0, - // State 22 - 525, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 526, 18, 527, 0, 59, 528, 60, 61, 0, 0, 0, 0, 62, 63, 64, 65, 66, 0, 0, 19, 67, 68, 20, 0, 529, 69, 70, 530, 71, 72, 73, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 23 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 24 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 25 - 0, 0, 0, 0, 0, 0, 0, 15, 536, 78, 79, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 26 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 27 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 28 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 29 - -309, -309, 443, 0, -309, 0, -309, 0, -309, 0, 0, -309, -309, 0, -309, -309, 0, -309, 0, 0, 0, 0, 0, -309, -309, -309, 0, -309, 444, 0, -309, 445, -309, 446, 447, 448, 0, -309, 0, 0, -309, 0, 0, 0, 0, -309, 0, -309, -309, -309, 0, -309, 0, 0, 0, 0, 0, 0, 0, 0, -309, 0, 0, -309, -309, 0, -309, 0, 449, 450, 0, 0, 0, 451, -309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -309, -309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 30 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 31 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 32 - -431, -431, 0, 0, -431, 0, -431, 15, -431, 16, 0, -431, -431, 425, -431, 0, 426, -431, 0, 0, 427, 0, 0, -431, -431, -431, 0, -431, 0, 0, -431, 0, -431, 0, 0, 0, 0, -431, 0, 0, -431, 428, 429, 430, 17, 0, 0, -431, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, -431, -431, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 33 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 34 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 35 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 36 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 37 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 38 - 0, 0, 0, 0, 0, 0, 0, 0, 557, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 39 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 40 - -949, -949, 0, 0, 0, 0, 0, 15, -949, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, -949, 0, -949, 0, 0, 0, 0, -949, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, -949, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 41 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -554, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -554, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 42 - -253, -253, -253, -253, -253, -253, -253, 26, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, 0, 27, 0, -253, -253, -253, -253, -253, 0, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, 0, 0, 0, 28, -253, -253, -253, -253, -253, 0, -253, 0, 0, 0, 0, 0, 0, 0, 0, -253, 0, 0, -253, -253, 0, -253, 0, -253, -253, 0, 0, 0, -253, -253, 0, 0, 0, 0, 0, 0, 0, 0, 0, -253, -253, -253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 43 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, -723, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 44 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, -727, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 45 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 46 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 95, 22, 434, 0, 435, 436, - // State 47 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 48 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -878, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -878, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 49 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 50 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 576, 0, 0, 0, 0, 0, 499, 0, 0, 0, 0, 0, - // State 51 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 52 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 53 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 581, 0, 0, 0, 100, 0, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 54 - -310, 0, 443, 0, -310, 0, -310, 0, 0, 0, 0, -310, -310, 0, -310, -310, 0, -310, 0, 0, 0, 0, 0, -310, -310, -310, 0, -310, 444, 0, -310, 445, -310, 446, 447, 448, 0, -310, 583, 0, -310, 0, 0, 0, 0, 0, 0, -310, -310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -310, 0, 449, 450, 0, 0, 0, 451, -310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, -310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 55 - -363, 0, 0, 0, 585, 0, 586, 0, 0, 0, 0, 587, 588, 0, 589, 0, 0, 590, 0, 0, 0, 0, 0, 591, 592, 0, 0, -363, 0, 0, 593, 0, 104, 0, 0, 0, 0, 594, 0, 0, 595, 0, 0, 0, 0, 0, 0, 596, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 56 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 57 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 58 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 59 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 60 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 61 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 62 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 613, 614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 0, - // State 63 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 64 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 65 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 0, - // State 66 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 67 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 68 - -779, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, -779, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 69 - -399, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, -399, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 70 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 71 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 72 - 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 657, 658, 125, 0, 0, 0, 0, 0, 0, 0, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 73 - -160, -160, -160, 0, -160, -160, -160, 0, -160, 0, 0, -160, -160, 0, -160, -160, 0, -160, 0, 0, 0, 0, 0, -160, -160, -160, 0, -160, -160, 455, -160, -160, -160, -160, -160, -160, 456, -160, -160, 0, -160, 0, 0, 0, 0, -160, -160, -160, -160, -160, 0, -160, 0, 0, 0, 0, 0, 0, 0, 0, -160, 0, 0, -160, -160, 0, -160, 0, -160, -160, 0, 0, 0, -160, -160, 0, 0, 0, 0, 0, 0, 0, 0, 0, -160, -160, -160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 74 - -174, -174, -174, 458, -174, -174, -174, 0, -174, 459, 0, -174, -174, -174, -174, -174, -174, -174, 0, 0, 0, 460, 461, -174, -174, -174, 0, -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, 462, -174, 0, 0, 0, 0, -174, -174, -174, -174, -174, 0, -174, 0, 0, 0, 0, 0, 0, 0, 0, -174, 0, 0, -174, -174, 0, -174, 0, -174, -174, 0, 0, 0, -174, -174, 0, 0, 0, 0, 0, 0, 0, 0, 0, -174, -174, -174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 75 - 0, 0, 0, 0, 0, 0, 0, 15, 660, 78, 79, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 76 - 0, 0, 0, 0, 0, 0, 0, 0, -423, 0, 0, 0, 0, 0, 0, -423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 77 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 78 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 79 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, -848, 426, 0, 0, 0, 427, 0, 0, 0, 0, 134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, -848, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 80 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 81 - -793, -793, -793, 0, -793, -793, -793, 0, -793, 0, 0, -793, -793, 440, -793, -793, 441, -793, 0, 0, 0, 0, 0, -793, -793, -793, 0, -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, 0, -793, 0, 0, 0, 0, -793, -793, -793, -793, -793, 0, -793, 0, 0, 0, 0, 0, 0, 0, 0, -793, 0, 0, -793, -793, 0, -793, 0, -793, -793, 0, 0, 0, -793, -793, 0, 0, 0, 0, 0, 0, 0, 0, 0, -793, -793, -793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 82 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 83 - 0, 0, 0, 0, 0, 0, 0, 0, -296, 0, 0, 0, 0, 0, 0, -296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -296, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 84 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 85 - 0, 0, 0, 0, 0, 0, 0, 15, 675, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 86 - 0, 0, 0, 0, 0, 0, 0, 15, 678, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 87 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 88 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, -466, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 89 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, 0, 0, 0, -679, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 90 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 142, 22, 434, 0, 435, 436, - // State 91 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 92 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 93 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -718, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 94 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 95 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 50, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, -335, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 96 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, -791, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 97 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 98 - 0, 698, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, 0, 0, 147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 699, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 99 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 100 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 101 - -364, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -364, 0, 0, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 102 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 103 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 707, 435, 436, - // State 104 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 105 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 106 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 107 - 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 657, 658, 125, 0, 0, 0, 0, 0, 0, 0, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 108 - 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 109 - 0, 0, 0, 0, 0, 0, 0, 158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 110 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 613, 614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 0, - // State 111 - -339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -339, 0, 0, 0, 163, 0, 0, 0, 0, 0, 0, 0, -339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 112 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 113 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 114 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 115 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 116 - 0, 0, -794, 0, 0, -794, 0, 0, 0, 0, 0, 0, 0, 440, 0, -794, 441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -794, -794, 0, -794, 0, -794, -794, -794, -794, 0, 0, 0, 0, 0, 0, 0, 0, 0, -794, 0, -794, -794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -794, 0, -794, -794, 0, 0, 0, -794, -794, 0, 0, 0, 0, 0, 0, 0, 0, 0, -794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 117 - 0, 0, -254, -254, 0, -254, 0, 26, 0, -254, -254, 0, 0, -254, 0, -254, -254, 0, 0, 177, 0, -254, -254, 0, 0, 0, 0, 0, -254, -254, 0, -254, 0, -254, -254, -254, -254, 0, 0, -254, 0, 0, 0, 0, 178, 0, -254, 0, -254, -254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -254, 0, -254, -254, 0, 0, 0, -254, -254, 0, 0, 0, 0, 0, 0, 0, 0, 0, -254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 118 - 0, 0, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 444, 0, 0, 445, 0, 446, 447, 448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -310, -310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -310, 0, 449, 450, 0, 0, 0, 451, -310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 119 - 0, 0, -161, 0, 0, -161, 0, 0, 0, 0, 0, 0, 0, 0, 0, -161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -161, 455, 0, -161, 0, -161, -161, -161, 456, 0, 0, 0, 0, 0, 0, 0, 0, 0, -161, 0, -161, -161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -161, 0, -161, -161, 0, 0, 0, -161, -161, 0, 0, 0, 0, 0, 0, 0, 0, 0, -161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 120 - 0, 0, -175, 458, 0, -175, 0, 0, 0, 459, 0, 0, 0, -175, 0, -175, -175, 0, 0, 0, 0, 460, 461, 0, 0, 0, 0, 0, -175, -175, 0, -175, 0, -175, -175, -175, -175, 0, 0, 462, 0, 0, 0, 0, 0, 0, -175, 0, -175, -175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -175, 0, -175, -175, 0, 0, 0, -175, -175, 0, 0, 0, 0, 0, 0, 0, 0, 0, -175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 121 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 122 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 123 - 0, 0, 0, 0, 0, 0, 0, 15, 730, 16, 192, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 124 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 732, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 125 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 126 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 127 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 50, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 736, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 128 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 129 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, -850, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 130 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, -846, 426, 0, 0, 0, 427, 0, 0, 0, 0, 134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, -846, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 131 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, -851, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 132 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -847, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -847, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 133 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, -806, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, -806, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 134 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 135 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 136 - 0, 0, 0, 0, 0, 0, 0, 15, 748, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 137 - 0, 0, 0, 0, 0, 0, 0, 0, 750, 0, 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 138 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, -688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 139 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 0, 0, 0, 0, 0, 0, 0, 0, 0, -700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 140 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, -710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 141 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 142 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -715, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 143 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -719, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 144 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 762, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 145 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, -373, 0, 0, 0, 0, 0, 0, 0, 0, 499, 0, 0, 0, 0, 0, - // State 146 - 0, 698, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 147 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 148 - 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 149 - 0, 0, 0, 0, 0, 0, 0, 158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 150 - -367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -367, 0, 0, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 151 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 152 - 0, 0, 0, 0, 0, 0, 0, 158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 153 - 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 154 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 155 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 156 - 0, 0, 0, 0, 0, 0, 0, 158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 157 - 0, 0, 0, 0, 0, 0, 0, 0, 786, 219, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 158 - -358, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, -358, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 159 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 160 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 161 - 0, 0, 0, 0, 0, 0, 0, 221, 0, 792, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 162 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 163 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 164 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 165 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 166 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 0, - // State 167 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 798, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 168 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 169 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 170 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 171 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 226, 809, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 172 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 173 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 174 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 175 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 176 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 177 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 178 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 179 - 0, 0, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -309, 0, 0, 0, 0, 0, 0, 0, 0, 0, -311, 0, 0, 444, 0, 0, 445, 0, 446, 447, 448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -309, -309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -309, 0, 449, 450, 0, 0, 0, 451, -309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 180 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 181 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 182 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 183 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 184 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 185 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 186 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 187 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 188 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 189 - 0, 0, 0, 0, 0, 0, 0, 0, 825, 0, 0, 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 190 - 0, 0, 0, 0, 0, 0, 0, 0, 828, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 191 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 192 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -554, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -554, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 193 - 0, 0, -253, -253, 0, -253, 0, 26, 0, -253, -253, 0, 0, -253, 0, -253, -253, 0, 0, 27, 0, -253, -253, 0, 0, -255, 0, 0, -253, -253, 0, -253, 0, -253, -253, -253, -253, 0, 0, -253, 0, 0, 0, 0, 28, 0, -253, 0, -253, -253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -253, 0, -253, -253, 0, 0, 0, -253, -253, 0, 0, 0, 0, 0, 0, 0, 0, 0, -253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 194 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 195 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -878, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -878, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 196 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -845, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -845, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 197 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 198 - 0, 0, 0, 0, 0, 0, 0, 15, 839, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 199 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -658, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 200 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -670, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 201 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 243, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -680, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 202 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, -374, 0, 0, 0, 0, 0, 0, 0, 0, 499, 0, 0, 0, 0, 0, - // State 203 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 847, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 204 - 0, 0, 0, 0, 0, 0, 0, 158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 205 - 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 206 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 207 - 0, 0, 0, 0, 0, 0, 0, 158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 208 - 0, 0, 0, 0, 0, 0, 0, 158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 209 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 210 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 211 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 212 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 213 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 214 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 215 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 216 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 217 - 0, 0, 0, 0, 0, 0, 0, 0, -645, 0, 0, 0, 0, 0, 0, 258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 218 - 0, 0, 0, 0, 0, 0, 0, 0, -649, 0, 0, 0, 0, 0, 0, 260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 219 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 220 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 221 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 222 - -437, 0, 0, 0, 0, 0, 0, -437, 0, -437, 0, 0, 0, -437, 0, 0, -437, 0, 0, 0, -437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -437, 0, -437, -437, -437, -437, 0, 0, 0, 0, 0, -437, -437, -437, -437, 0, -437, -437, -437, -437, 264, 872, 0, 0, -437, -437, -437, -437, -437, 0, 0, -437, -437, -437, -437, 0, -437, -437, -437, -437, -437, -437, -437, -437, -437, 0, 0, 0, -437, -437, 0, 0, 0, 0, -437, -437, 0, -437, -437, -437, -437, -437, - // State 223 - -886, 0, 0, 0, 0, 0, 0, -886, 0, -886, 0, 0, 0, -886, 0, 0, -886, 0, 0, 0, -886, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -886, 0, -886, -886, -886, -886, 0, 0, 0, 0, 0, -886, -886, -886, -886, 0, -886, -886, -886, -886, 0, 879, 268, 880, -886, -886, -886, -886, -886, 0, 0, -886, -886, -886, -886, 0, -886, -886, -886, -886, -886, -886, -886, -886, -886, 0, 0, 0, -886, -886, 0, 0, 0, 0, -886, -886, 0, -886, -886, -886, -886, -886, - // State 224 - -890, 0, 0, 0, 0, 0, 0, -890, 0, -890, 0, 0, 0, -890, 0, 0, -890, 0, 0, 0, -890, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -890, 0, -890, -890, -890, -890, 0, 0, 0, 0, 0, -890, -890, -890, -890, 0, -890, -890, -890, -890, 0, 882, 883, 884, -890, -890, -890, -890, -890, 0, 0, -890, -890, -890, -890, 0, -890, -890, -890, -890, -890, -890, -890, -890, -890, 0, 0, 0, -890, -890, 0, 0, 0, 0, -890, -890, 0, -890, -890, -890, -890, -890, - // State 225 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 269, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 226 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 526, 18, 527, 0, 59, 528, 60, 61, 0, 0, 0, 0, 62, 63, 64, 65, 66, 0, 0, 19, 67, 68, 20, 0, 529, 69, 70, 530, 71, 72, 73, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 227 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 228 - 0, 0, -160, 0, 0, -160, 0, 0, 0, 0, 0, 0, 0, 0, 0, -160, 0, 0, 0, 0, 0, 0, 0, 0, 0, -162, 0, 0, -160, 455, 0, -160, 0, -160, -160, -160, 456, 0, 0, 0, 0, 0, 0, 0, 0, 0, -160, 0, -160, -160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -160, 0, -160, -160, 0, 0, 0, -160, -160, 0, 0, 0, 0, 0, 0, 0, 0, 0, -160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 229 - 0, 0, -174, 458, 0, -174, 0, 0, 0, 459, 0, 0, 0, -174, 0, -174, -174, 0, 0, 0, 0, 460, 461, 0, 0, -176, 0, 0, -174, -174, 0, -174, 0, -174, -174, -174, -174, 0, 0, 462, 0, 0, 0, 0, 0, 0, -174, 0, -174, -174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -174, 0, -174, -174, 0, 0, 0, -174, -174, 0, 0, 0, 0, 0, 0, 0, 0, 0, -174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 230 - 0, 0, -793, 0, 0, -793, 0, 0, 0, 0, 0, 0, 0, 440, 0, -793, 441, 0, 0, 0, 0, 0, 0, 0, 0, -795, 0, 0, -793, -793, 0, -793, 0, -793, -793, -793, -793, 0, 0, 0, 0, 0, 0, 0, 0, 0, -793, 0, -793, -793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -793, 0, -793, -793, 0, 0, 0, -793, -793, 0, 0, 0, 0, 0, 0, 0, 0, 0, -793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 231 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 232 - 0, 0, 0, 0, 0, 0, 0, 15, 894, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 233 - 0, 0, 0, 0, 0, 0, 0, 15, 896, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 234 - 0, 0, 0, 0, 0, 0, 0, 15, 898, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 235 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 236 - 0, 0, 0, 0, 0, 0, 0, 0, -801, 0, 0, 0, 0, 0, 0, -801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -801, 0, 0, 0, 0, 0, -801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -801, 0, 0, 281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 237 - 0, 0, 0, 0, 0, 0, 0, 15, 904, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 238 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -661, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 239 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -673, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 240 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 283, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -681, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 241 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 284, 0, 0, 0, 0, 0, 0, 0, 0, 0, -689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 242 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, 0, 0, 0, 0, 0, 0, 0, 0, 0, -701, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 243 - 0, 0, 0, 0, 0, 0, 0, 158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 244 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 245 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 246 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 247 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 248 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 249 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 250 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 251 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 252 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 253 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 254 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 255 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 256 - 0, 0, 0, 0, 0, 0, 0, 0, -601, 296, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 297, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 257 - 0, 0, 0, 0, 0, 0, 0, 0, -636, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 258 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 259 - 0, 0, 0, 0, 0, 0, 0, 0, -640, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 260 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 261 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 262 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 263 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 264 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 265 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 266 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 267 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 268 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 269 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 270 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 271 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 272 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 526, 18, 527, 0, 59, 528, 60, 61, 0, 0, 0, 0, 62, 63, 64, 65, 66, 0, 0, 19, 67, 68, 20, 0, 529, 69, 70, 530, 71, 72, 73, 41, 21, 0, 0, 0, 431, 951, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 273 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 274 - 0, 0, 0, 0, 0, 0, 0, 15, 953, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 275 - 0, 0, 0, 0, 0, 0, 0, 0, 955, 0, 0, 0, 0, 0, 0, 318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 276 - 0, 0, 0, 0, 0, 0, 0, 0, 957, 0, 0, 0, 0, 0, 0, 319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 277 - 0, 0, 0, 0, 0, 0, 0, 15, 958, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 278 - 0, 0, 0, 0, 0, 0, 0, 0, -799, 0, 0, 0, 0, 0, 0, -799, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -799, 0, 0, 0, 0, 0, -799, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -799, 0, 0, 281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -799, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 279 - 0, 0, 0, 0, 0, 0, 0, 0, -802, 0, 0, 0, 0, 0, 0, -802, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -802, 0, 0, 0, 0, 0, -802, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -802, 0, 0, 281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -802, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 280 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 281 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, -690, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 282 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, -702, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 283 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 284 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -671, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 285 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 286 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 287 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 288 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 289 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 290 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 291 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 292 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 293 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 294 - 0, 0, 0, 0, 0, 0, 0, 0, -610, 0, 0, 0, 0, 0, 0, 330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 295 - 0, 0, 0, 0, 0, 0, 0, 0, -622, 0, 0, 0, 0, 0, 0, 331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 296 - 0, 0, 0, 0, 0, 0, 0, 0, -632, 0, 0, 0, 0, 0, 0, 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 297 - 0, 0, 0, 0, 0, 0, 0, 0, -637, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 298 - 0, 0, 0, 0, 0, 0, 0, 0, -641, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 299 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 300 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 301 - 0, 0, 0, 0, 0, 0, 0, 0, 990, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 302 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 303 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 304 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 305 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 994, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 306 - 0, 0, 0, 0, 0, 0, 0, 343, 0, 344, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012, 1013, 1014, 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 435, 436, - // State 307 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 308 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1015, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 309 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 310 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 311 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 312 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 313 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 314 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 315 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 316 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 317 - 0, 0, 0, 0, 0, 0, 0, 15, 1030, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 318 - 0, 0, 0, 0, 0, 0, 0, 15, 1032, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 319 - 0, 0, 0, 0, 0, 0, 0, 0, -800, 0, 0, 0, 0, 0, 0, -800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -800, 0, 0, 0, 0, 0, -800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -800, 0, 0, 281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 320 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 321 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -672, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 322 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 323 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -674, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 324 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 325 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 326 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 327 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 328 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 329 - 0, 0, 0, 0, 0, 0, 0, 0, -580, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 330 - 0, 0, 0, 0, 0, 0, 0, 0, -592, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 331 - 0, 0, 0, 0, 0, 0, 0, 0, -602, 362, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 332 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 333 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 334 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 335 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1053, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 336 - 0, 0, 0, 0, 0, 0, 0, 366, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 337 - 0, 0, 0, 0, 0, 0, 0, 366, -921, 0, 0, 0, 0, 0, 0, -921, 0, 0, 0, 368, 0, 0, 0, 0, 0, -921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -921, 0, 0, 0, -921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -921, 0, -921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 338 - 0, 0, 0, 0, 0, 0, 0, 0, -473, 0, 0, 0, 0, 440, 0, -473, 441, 0, 0, 0, 0, 0, 0, 0, 0, -473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -473, 0, 0, 0, -473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -473, 0, -473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 339 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 372, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 373, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 340 - 0, 0, 0, 0, 0, 0, 0, 0, -475, 0, 0, 0, 0, 0, 0, -475, 0, 0, 0, 0, 0, 0, 0, 0, 0, -475, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -475, 0, 0, 0, -475, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -475, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -475, 0, -475, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 436, - // State 341 - 0, 0, 0, 0, 0, 0, 0, 0, -476, 0, 0, 0, 0, 0, 0, -476, 0, 0, 0, 0, 0, 0, 0, 0, 0, -476, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -476, 0, 0, 0, -476, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -476, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -476, 0, -476, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 436, - // State 342 - 0, 0, 0, 0, 0, 0, 0, 343, 1060, 344, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012, 1013, 1014, 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 435, 436, - // State 343 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 344 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 0, 0, - // State 345 - 0, 0, 0, 0, 0, 0, 0, 343, 0, 344, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012, 1013, 1014, 346, 1064, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 435, 436, - // State 346 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 379, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 1074, 1075, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1076, 0, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 347 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1077, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 348 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 349 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 350 - 0, 0, 0, 0, 0, 0, 0, 15, 1086, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 351 - 0, 0, 0, 0, 0, 0, 0, 15, 1087, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 352 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 353 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -675, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 354 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 355 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 356 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 357 - 0, 0, 0, 0, 0, 0, 0, 0, -583, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 358 - 0, 0, 0, 0, 0, 0, 0, 0, -595, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 359 - 0, 0, 0, 0, 0, 0, 0, 0, -603, 384, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 360 - 0, 0, 0, 0, 0, 0, 0, 0, -611, 0, 0, 0, 0, 0, 0, 385, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 361 - 0, 0, 0, 0, 0, 0, 0, 0, -623, 0, 0, 0, 0, 0, 0, 386, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 362 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 363 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 364 - 0, 0, 0, 0, 0, 0, 0, 343, 0, 344, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012, 1013, 1014, 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 435, 436, - // State 365 - 0, 0, 0, 0, 0, 0, 0, 343, 1113, 344, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012, 1013, 1014, 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 435, 436, - // State 366 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 367 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 368 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 0, 0, - // State 369 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 370 - 0, 0, 0, 0, 0, 0, 0, 343, 0, 344, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, -764, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012, 1013, 1014, 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -764, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 435, 436, - // State 371 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 372 - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 373 - 0, 0, 0, 0, 0, 0, 0, 343, 0, 344, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012, 1013, 1014, 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 435, 436, - // State 374 - 0, 0, 0, 0, 0, 0, 0, 343, 0, 344, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, -765, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012, 1013, 1014, 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -765, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 435, 436, - // State 375 - 0, 0, 0, 0, 0, 0, 0, 343, 0, 344, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012, 1013, 1014, 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 435, 436, - // State 376 - 0, 0, 0, 0, 0, 0, 0, 343, 0, 344, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012, 1013, 1014, 346, 1127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 435, 436, - // State 377 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 440, 0, 0, 441, 0, 0, 0, 0, 0, 0, 0, 0, -479, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 378 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 379 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 380 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 381 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 382 - 0, 0, 0, 0, 0, 0, 0, 0, -612, 0, 0, 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 383 - 0, 0, 0, 0, 0, 0, 0, 0, -624, 0, 0, 0, 0, 0, 0, 394, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 384 - 0, 0, 0, 0, 0, 0, 0, 0, -581, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 385 - 0, 0, 0, 0, 0, 0, 0, 0, -593, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 386 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 387 - 0, 0, 0, 0, 0, 0, 0, 343, 0, 344, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012, 1013, 1014, 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 435, 436, - // State 388 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 400, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 1074, 1075, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1155, 0, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 0, 435, 436, - // State 389 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 390 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 391 - 720, 0, 0, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 425, 0, 0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 429, 430, 17, 0, 0, 0, 0, 0, 58, 0, 18, 527, 0, 0, 528, 0, 61, 0, 0, 0, 0, 0, 63, 64, 0, 66, 0, 0, 19, 0, 68, 20, 0, 529, 69, 70, 0, 71, 0, 0, 41, 21, 0, 0, 0, 431, 0, 0, 0, 0, 0, 432, 433, 0, 22, 434, 531, 435, 436, - // State 392 - 0, 0, 0, 0, 0, 0, 0, 0, -582, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 393 - 0, 0, 0, 0, 0, 0, 0, 0, -594, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 394 - 0, 0, 0, 0, 0, 0, 0, 0, -584, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 395 - 0, 0, 0, 0, 0, 0, 0, 0, -596, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 396 - 0, 0, 0, 0, 0, 0, 0, 343, 0, 344, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012, 1013, 1014, 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 435, 436, - // State 397 - 0, 0, 0, 0, 0, 0, 0, 0, 1170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 398 - 0, 0, 0, 0, 0, 0, 0, 343, 1173, 344, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012, 1013, 1014, 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 433, 0, 0, 434, 0, 435, 436, - // State 399 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 400 - 0, 0, 0, 0, 0, 0, 0, 0, -585, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 401 - 0, 0, 0, 0, 0, 0, 0, 0, -597, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 402 - 0, 0, 0, 0, 0, 0, 0, 0, 1188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, 0, - // State 403 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 404 - -945, -945, -945, 0, -945, 24, -945, 0, -945, 0, 0, -945, -945, 0, -945, -945, 0, -945, 0, 0, 0, 0, 0, -945, -945, -945, 0, -945, -945, 0, -945, -945, -945, -945, -945, -945, 0, -945, -945, 0, -945, 0, 0, 0, 0, -945, -945, -945, -945, -945, 0, -945, 0, 0, 0, 0, 0, 0, 0, 0, -945, 0, 0, -945, -945, 0, -945, 0, -945, -945, 0, 0, 0, -945, -945, 0, 0, 0, 0, 0, 0, 0, 0, 0, -945, -945, -945, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 405 - -561, -561, 0, 0, -561, 0, -561, 0, -561, 0, 0, -561, -561, 0, -561, -561, 0, -561, 0, 0, 0, 0, 0, -561, -561, -561, 0, -561, 0, 0, -561, 0, -561, 0, 0, 0, 0, -561, 0, 0, -561, 0, 0, 0, 0, -561, 0, -561, 0, -561, 0, -561, 0, 0, 0, 0, 0, 0, 0, 0, -561, 0, 0, -561, -561, 0, -561, 0, 0, 0, 0, 0, 0, 0, 439, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -561, -561, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 406 - -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, 0, -245, 0, -245, -245, -245, -245, -245, 0, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, 0, 0, 0, -245, -245, -245, -245, -245, -245, 0, -245, 0, 0, 0, 0, 0, 0, 0, 0, -245, 0, 0, -245, -245, 0, -245, 0, -245, -245, 0, 0, 0, -245, -245, 0, 0, 0, 0, 0, 0, 0, 0, 0, -245, -245, -245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 407 - -769, -769, -769, -769, -769, -769, -769, 0, -769, -769, 29, -769, -769, -769, -769, -769, -769, -769, 0, 0, 0, -769, -769, -769, -769, -769, 0, -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, 0, 0, 0, 0, -769, -769, -769, -769, -769, 0, -769, 0, 0, 0, 0, 0, 0, 0, 0, -769, 0, 0, -769, -769, 0, -769, 0, -769, -769, 0, 0, 0, -769, -769, 0, 0, 0, 0, 0, 0, 0, 0, 0, -769, -769, -769, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 408 - -517, -517, 0, 0, -517, 0, -517, 0, -517, 0, 0, -517, -517, 0, -517, -517, 0, -517, 0, 0, 0, 0, 0, -517, -517, -517, 0, -517, 0, 0, -517, 0, -517, 0, 0, 0, 0, -517, 0, 0, -517, 0, 0, 0, 0, -517, 0, -517, -517, -517, 0, -517, 0, 0, 0, 0, 0, 0, 0, 0, -517, 0, 0, -517, -517, 0, -517, 0, 0, 0, 0, 0, 0, 0, -517, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -517, -517, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 409 - -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, 0, -839, 0, -839, -839, -839, -839, -839, 0, -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, 0, 0, 0, -839, -839, -839, -839, -839, -839, 0, -839, 0, 0, 0, 0, 0, 0, 0, 0, -839, 0, 0, -839, -839, 0, -839, 0, -839, -839, 0, 0, 0, -839, -839, 0, 0, 0, 0, 0, 0, 0, 0, 0, -839, -839, -839, 0, 0, 0, 0, 0, 0, 0, 0, 0, -839, 0, 0, 0, -839, - // State 410 - -859, -859, -859, -859, -859, -859, -859, 0, -859, -859, 0, -859, -859, -859, -859, -859, -859, -859, 0, 0, 0, -859, -859, -859, -859, -859, 0, -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, 0, 0, 0, 0, -859, -859, -859, -859, -859, 0, -859, 0, 0, 0, 0, 0, 0, 0, 0, -859, 0, 0, -859, -859, 0, -859, 0, -859, -859, 0, 0, 0, -859, -859, 0, 0, 0, 0, 0, 0, 0, 0, 0, -859, -859, -859, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 411 - -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, 0, -191, 0, -191, -191, -191, -191, -191, 0, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, 0, 0, 0, -191, -191, -191, -191, -191, -191, 0, -191, 0, 0, 0, 0, 0, 0, 0, 0, -191, 0, 0, -191, -191, 0, -191, 0, -191, -191, 0, 0, 0, -191, -191, 0, 0, 0, 0, 0, 0, 0, 0, 0, -191, -191, -191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 412 - -864, -864, 0, 0, -864, 0, -864, 0, -864, 0, 0, -864, -864, 0, -864, -864, 0, -864, 0, 0, 0, 0, 0, -864, -864, -864, 0, -864, 0, 0, -864, 0, -864, 0, 0, 0, 0, -864, 0, 0, -864, 0, 0, 0, 0, -864, 0, -864, 0, -864, 0, -864, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -864, -864, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -864, -864, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 413 - -165, -165, 0, 0, -165, 0, -165, 0, -165, 0, 0, -165, -165, 0, -165, -165, 0, -165, 0, 0, 0, 0, 0, -165, -165, -165, 0, -165, 0, 0, -165, 0, -165, 0, 0, 0, 0, -165, 0, 0, -165, 0, 0, 0, 0, -165, 0, -165, 454, -165, 0, -165, 0, 0, 0, 0, 0, 0, 0, 0, -165, 0, 0, -165, -165, 0, -165, 0, 0, 0, 0, 0, 0, 0, -165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -165, -165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 414 - -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, 0, -190, 0, -190, -190, -190, -190, -190, 0, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, 0, 0, 0, -190, -190, -190, -190, -190, -190, 0, -190, 0, 0, 0, 0, 0, 0, 0, 0, -190, 0, 0, -190, -190, 0, -190, 0, -190, -190, 0, 0, 0, -190, -190, 0, 0, 0, 0, 0, 0, 0, 0, 0, -190, -190, -190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 415 - -432, -432, 0, 0, -432, 0, -432, 0, -432, 0, 0, -432, -432, 0, -432, 33, 0, -432, 0, 0, 0, 0, 0, -432, -432, -432, 0, -432, 0, 0, -432, 0, -432, 0, 0, 0, 0, -432, 0, 0, -432, 0, 0, 0, 0, 0, 0, -432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -432, -432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 416 - -863, -863, 0, 0, -863, 0, -863, 0, -863, 0, 0, -863, -863, 0, -863, -863, 0, -863, 0, 0, 0, 0, 0, -863, -863, -863, 0, -863, 0, 0, -863, 0, -863, 0, 0, 0, 0, -863, 0, 0, -863, 0, 0, 0, 0, -863, 0, -863, 0, -863, 0, -863, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -863, -863, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -863, -863, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 417 - -393, -393, -393, -393, -393, -393, -393, 0, -393, -393, 0, -393, -393, -393, -393, -393, -393, -393, 0, 0, 0, -393, -393, -393, -393, -393, 0, -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, 0, 0, 0, 0, -393, -393, -393, -393, -393, 0, -393, 0, 0, 0, 0, 0, 0, 0, 0, -393, 0, 0, -393, -393, 0, -393, 0, -393, -393, 0, 0, 0, -393, -393, 0, 0, 0, 0, 0, 0, 0, 0, 0, -393, -393, -393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 418 - -876, -876, 0, 0, -876, 0, -876, 0, -876, 0, 0, -876, -876, 0, -876, -876, 0, -876, 0, 0, 0, 0, 0, -876, -876, -876, 0, -876, 0, 0, -876, 0, -876, 0, 0, 0, 0, -876, 0, 0, -876, 0, 0, 0, 0, 0, 0, -876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -876, -876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 419 - -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, 0, -189, 0, -189, -189, -189, -189, -189, 0, -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, 0, 0, 0, -189, -189, -189, -189, -189, -189, 0, -189, 0, 0, 0, 0, 0, 0, 0, 0, -189, 0, 0, -189, -189, 0, -189, 0, -189, -189, 0, 0, 0, -189, -189, 0, 0, 0, 0, 0, 0, 0, 0, 0, -189, -189, -189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 420 - -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, 0, -838, 0, -838, -838, -838, -838, -838, 0, -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, 0, 0, 0, -838, -838, -838, -838, -838, -838, 0, -838, 0, 0, 0, 0, 0, 0, 0, 0, -838, 0, 0, -838, -838, 0, -838, 0, -838, -838, 0, 0, 0, -838, -838, 0, 0, 0, 0, 0, 0, 0, 0, 0, -838, -838, -838, 0, 0, 0, 0, 0, 0, 0, 0, 0, -838, 0, 0, 0, -838, - // State 421 - -875, -875, 0, 0, -875, 0, -875, 0, -875, 0, 0, -875, -875, 0, -875, -875, 0, -875, 0, 0, 0, 0, 0, -875, -875, -875, 0, -875, 0, 0, -875, 0, -875, 0, 0, 0, 0, -875, 0, 0, -875, 0, 0, 0, 0, 0, 0, -875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -875, -875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 422 - -552, -552, 0, 0, -552, 0, -552, 0, -552, 0, 0, -552, -552, 0, -552, -552, 0, -552, 0, 0, 0, 0, 0, -552, -552, -552, 0, -552, 0, 0, -552, 0, -552, 0, 0, 0, 0, -552, 0, 0, -552, 0, 0, 0, 0, 0, 0, -552, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -552, -552, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 423 - -354, -354, -354, 0, -354, 0, -354, 0, -354, 0, 0, -354, -354, 0, -354, -354, 0, -354, 0, 0, 0, 0, 0, -354, -354, -354, 0, -354, -354, 0, -354, -354, -354, -354, -354, -354, 0, -354, -354, 0, -354, 0, 0, 0, 0, -354, 37, -354, -354, -354, 0, -354, 0, 0, 0, 0, 0, 0, 0, 0, -354, 0, 0, -354, -354, 0, -354, 0, -354, -354, 0, 0, 0, -354, -354, 0, 0, 0, 0, 0, 0, 0, 0, 0, -354, -354, -354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 424 - 0, 0, 0, 0, 0, 0, 0, -917, 0, 0, 0, 0, 0, -917, 0, 0, -917, 0, 0, 0, -917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -917, -917, -917, -917, 0, 0, 0, 0, 0, 0, 0, -917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -917, 0, 0, 0, -917, 0, 0, 0, 0, 0, -917, -917, 0, -917, -917, 0, -917, -917, - // State 425 - 0, 0, 0, 0, 0, 0, 0, -918, 0, 0, 0, 0, 0, -918, 0, 0, -918, 0, 0, 0, -918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -918, -918, -918, -918, 0, 0, 0, 0, 0, 0, 0, -918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -918, 0, 0, 0, -918, 0, 0, 0, 0, 0, -918, -918, 0, -918, -918, 0, -918, -918, - // State 426 - -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, 0, -217, 0, -217, -217, -217, -217, -217, 0, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, 0, 0, 0, -217, -217, -217, -217, -217, -217, 0, -217, 0, 0, 0, 0, 0, 0, 0, 0, -217, 0, 0, -217, -217, 0, -217, 0, -217, -217, 0, 0, 0, -217, -217, 0, 0, 0, 0, 0, 0, 0, 0, 0, -217, -217, -217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 427 - -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, 0, -215, 0, -215, -215, -215, -215, -215, 0, -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, 0, 0, 0, -215, -215, -215, -215, -215, -215, 0, -215, 0, 0, 0, 0, 0, 0, 0, 0, -215, 0, 0, -215, -215, 0, -215, 0, -215, -215, 0, 0, 0, -215, -215, 0, 0, 0, 0, 0, 0, 0, 0, 0, -215, -215, -215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 428 - -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, 0, -216, 0, -216, -216, -216, -216, -216, 0, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, 0, 0, 0, -216, -216, -216, -216, -216, -216, 0, -216, 0, 0, 0, 0, 0, 0, 0, 0, -216, 0, 0, -216, -216, 0, -216, 0, -216, -216, 0, 0, 0, -216, -216, 0, 0, 0, 0, 0, 0, 0, 0, 0, -216, -216, -216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 429 - -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, 0, -214, 0, -214, -214, -214, -214, -214, 0, -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, 0, 0, 0, -214, -214, -214, -214, -214, -214, 0, -214, 0, 0, 0, 0, 0, 0, 0, 0, -214, 0, 0, -214, -214, 0, -214, 0, -214, -214, 0, 0, 0, -214, -214, 0, 0, 0, 0, 0, 0, 0, 0, 0, -214, -214, -214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 430 - 0, 0, 0, 0, 0, 0, 0, -919, 0, 0, 0, 0, 0, -919, 0, 0, -919, 0, 0, 0, -919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -919, -919, -919, -919, 0, 0, 0, 0, 0, 0, 0, -919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -919, 0, 0, 0, -919, 0, 0, 0, 0, 0, -919, -919, 0, -919, -919, 0, -919, -919, - // State 431 - -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, 0, -522, 0, -522, -522, -522, -522, -522, 0, -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, 0, 0, 0, -522, -522, -522, -522, -522, -522, 0, -522, 0, 0, 0, 0, 0, 0, 0, 0, -522, 0, 0, -522, -522, 0, -522, 0, -522, -522, 0, 0, 0, -522, -522, 0, 0, 0, 0, 0, 0, 0, 0, 0, -522, -522, -522, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 432 - -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, 0, -521, 0, -521, -521, -521, -521, -521, 0, -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, 0, 0, 0, -521, -521, -521, -521, -521, -521, 0, -521, 0, 0, 0, 0, 0, 0, 0, 0, -521, 0, 0, -521, -521, 0, -521, 0, -521, -521, 0, 0, 0, -521, -521, 0, 0, 0, 0, 0, 0, 0, 0, 0, -521, -521, -521, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 433 - -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, 0, -520, 0, -520, -520, -520, -520, -520, 0, -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, 0, 0, 0, -520, -520, -520, -520, -520, -520, 0, -520, 0, 0, 0, 0, 0, 0, 0, 0, -520, 0, 0, -520, -520, 0, -520, 0, -520, -520, 0, 0, 0, -520, -520, 0, 0, 0, 0, 0, 0, 0, 0, 0, -520, -520, -520, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 434 - -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, 0, -435, 0, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, 0, 0, 0, -435, -435, -435, -435, -435, -435, 0, -435, 0, 0, 0, 0, 0, 0, 0, 0, -435, 0, 0, -435, -435, 0, -435, -435, -435, -435, 0, 0, 0, -435, -435, 0, 0, 0, 0, 0, 0, 0, 0, 0, -435, -435, -435, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 435 - -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, 0, -837, 0, -837, -837, -837, -837, -837, 0, -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, 0, 0, 0, -837, -837, -837, -837, -837, -837, 0, -837, 0, 0, 0, 0, 0, 0, 0, 0, -837, 0, 0, -837, -837, 0, -837, 0, -837, -837, 0, 0, 0, -837, -837, 0, 0, 0, 0, 0, 0, 0, 0, 0, -837, -837, -837, 0, 0, 0, 0, 0, 0, 0, 0, 0, -837, 0, 0, 0, -837, - // State 436 - -560, -560, 0, 0, -560, 0, -560, 0, -560, 0, 0, -560, -560, 0, -560, -560, 0, -560, 0, 0, 0, 0, 0, -560, -560, -560, 0, -560, 0, 0, -560, 0, -560, 0, 0, 0, 0, -560, 0, 0, -560, 0, 0, 0, 0, -560, 0, -560, 0, -560, 0, -560, 0, 0, 0, 0, 0, 0, 0, 0, -560, 0, 0, -560, -560, 0, -560, 0, 0, 0, 0, 0, 0, 0, 532, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -560, -560, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 437 - -164, -164, 0, 0, -164, 0, -164, 0, -164, 0, 0, -164, -164, 0, -164, -164, 0, -164, 0, 0, 0, 0, 0, -164, -164, -164, 0, -164, 0, 0, -164, 0, -164, 0, 0, 0, 0, -164, 0, 0, -164, 0, 0, 0, 0, -164, 0, -164, 533, -164, 0, -164, 0, 0, 0, 0, 0, 0, 0, 0, -164, 0, 0, -164, -164, 0, -164, 0, 0, 0, 0, 0, 0, 0, -164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -164, -164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 438 - 0, 0, 0, 0, 0, 0, 0, -117, 0, 0, 0, 0, 0, -117, 0, 0, -117, 0, 0, 0, -117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -117, -117, -117, -117, 0, 0, 0, 0, 0, 0, 0, -117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -117, 0, 0, 0, 0, 0, 0, 0, 0, 0, -117, 0, 0, 0, -117, 0, 0, 0, 0, 0, -117, -117, 0, -117, -117, 0, -117, -117, - // State 439 - 0, 0, 0, 0, 0, 0, 0, -157, 0, 0, 0, 0, 0, -157, 0, 0, -157, 0, 0, 0, -157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -157, -157, -157, -157, 0, 0, 0, 0, 0, 0, 0, -157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -157, 0, 0, 0, -157, 0, 0, 0, 0, 0, -157, -157, 0, -157, -157, 0, -157, -157, - // State 440 - 0, 0, 0, 0, 0, 0, 0, -158, 0, 0, 0, 0, 0, -158, 0, 0, -158, 0, 0, 0, -158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -158, -158, -158, -158, 0, 0, 0, 0, 0, 0, 0, -158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -158, 0, 0, 0, -158, 0, 0, 0, 0, 0, -158, -158, 0, -158, -158, 0, -158, -158, - // State 441 - -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, 0, -246, 0, -246, -246, -246, -246, -246, 0, -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, 0, 0, 0, -246, -246, -246, -246, -246, -246, 0, -246, 0, 0, 0, 0, 0, 0, 0, 0, -246, 0, 0, -246, -246, 0, -246, 0, -246, -246, 0, 0, 0, -246, -246, 0, 0, 0, 0, 0, 0, 0, 0, 0, -246, -246, -246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 442 - 0, 0, 0, 0, 0, 0, 0, -300, 0, 0, 0, 0, 0, -300, 0, 0, -300, 0, 0, 0, -300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -300, -300, -300, -300, 0, 0, 0, 0, 0, 0, 0, -300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -300, 0, 0, 0, -300, 0, 0, 0, 0, 0, -300, -300, 0, -300, -300, 0, -300, -300, - // State 443 - 0, 0, 0, 0, 0, 0, 0, -301, 0, 0, 0, 0, 0, -301, 0, 0, -301, 0, 0, 0, -301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -301, -301, -301, -301, 0, 0, 0, 0, 0, 0, 0, -301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -301, 0, 0, 0, -301, 0, 0, 0, 0, 0, -301, -301, 0, -301, -301, 0, -301, -301, - // State 444 - 0, 0, 0, 0, 0, 0, 0, -302, 0, 0, 0, 0, 0, -302, 0, 0, -302, 0, 0, 0, -302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -302, -302, -302, -302, 0, 0, 0, 0, 0, 0, 0, -302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -302, 0, 0, 0, -302, 0, 0, 0, 0, 0, -302, -302, 0, -302, -302, 0, -302, -302, - // State 445 - 0, 0, 0, 0, 0, 0, 0, -299, 0, 0, 0, 0, 0, -299, 0, 0, -299, 0, 0, 0, -299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -299, -299, -299, -299, 0, 0, 0, 0, 0, 0, 0, -299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -299, 0, 0, 0, -299, 0, 0, 0, 0, 0, -299, -299, 0, -299, -299, 0, -299, -299, - // State 446 - 0, 0, 0, 0, 0, 0, 0, -303, 0, 0, 0, 0, 0, -303, 0, 0, -303, 0, 0, 0, -303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -303, -303, -303, -303, 0, 0, 0, 0, 0, 0, 0, -303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -303, 0, 0, 0, -303, 0, 0, 0, 0, 0, -303, -303, 0, -303, -303, 0, -303, -303, - // State 447 - 0, 0, 0, 0, 0, 0, 0, -304, 0, 0, 0, 0, 0, -304, 0, 0, -304, 0, 0, 0, -304, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -304, -304, -304, -304, 0, 0, 0, 0, 0, 0, 0, -304, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -304, 0, 0, 0, -304, 0, 0, 0, 0, 0, -304, -304, 0, -304, -304, 0, -304, -304, - // State 448 - 0, 0, 0, 0, 0, 0, 0, -305, 0, 0, 0, 0, 0, -305, 0, 0, -305, 0, 0, 0, -305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -305, -305, -305, -305, 0, 0, 0, 0, 0, 0, 0, -305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -305, 0, 0, 0, -305, 0, 0, 0, 0, 0, -305, -305, 0, -305, -305, 0, -305, -305, - // State 449 - 0, 0, 0, 0, 0, 0, 0, -307, 0, 0, 0, 0, 0, -307, 0, 0, -307, 0, 0, 0, -307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -307, -307, -307, -307, 0, 0, 0, 0, 0, 0, 0, -307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 545, 0, 0, 0, 0, 0, 0, 0, 0, 0, -307, 0, 0, 0, -307, 0, 0, 0, 0, 0, -307, -307, 0, -307, -307, 0, -307, -307, - // State 450 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 546, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 451 - 548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 452 - -94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 453 - 0, 0, 0, 0, 0, 0, 0, -127, 0, 0, 0, 0, 0, -127, 0, 0, -127, 0, 0, 0, -127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -127, -127, -127, -127, 0, 0, 0, 0, 0, 0, 0, -127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -127, 0, 0, 0, 0, 0, 0, 0, 0, 0, -127, 0, 0, 0, -127, 0, 0, 0, 0, 0, -127, -127, 0, -127, -127, 0, -127, -127, - // State 454 - 0, 0, 0, 0, 0, 0, 0, -797, 0, 0, 0, 0, 0, -797, 0, 0, -797, 0, 0, 0, -797, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -797, -797, -797, -797, 0, 0, 0, 0, 0, 0, 0, -797, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -797, 0, 0, 0, -797, 0, 0, 0, 0, 0, -797, -797, 0, -797, -797, 0, -797, -797, - // State 455 - 0, 0, 0, 0, 0, 0, 0, -798, 0, 0, 0, 0, 0, -798, 0, 0, -798, 0, 0, 0, -798, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -798, -798, -798, -798, 0, 0, 0, 0, 0, 0, 0, -798, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -798, 0, 0, 0, -798, 0, 0, 0, 0, 0, -798, -798, 0, -798, -798, 0, -798, -798, - // State 456 - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, 0, -894, 0, -894, -894, -894, -894, -894, 0, -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, 0, 0, 0, -894, -894, -894, -894, -894, -894, 0, -894, 0, 0, 0, 0, 0, 0, 0, 0, -894, 0, 0, -894, -894, 0, -894, 0, -894, -894, 0, 0, 0, -894, -894, 0, 0, 0, 0, 0, 0, 0, 0, 0, -894, -894, -894, 0, 0, 0, 0, 0, 0, 0, 0, 0, -894, 0, 0, 0, -894, - // State 457 - 0, 0, 0, 0, 0, 0, 0, -507, 0, 0, 0, 0, 0, -507, 0, 0, -507, 0, 0, 0, -507, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -507, -507, -507, -507, 0, 0, 0, 0, 0, 0, 0, -507, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -507, 0, 0, 0, -507, 0, 0, 0, 0, 0, -507, -507, 0, -507, -507, 0, -507, -507, - // State 458 - 0, 0, 0, 0, 0, 0, 0, -504, 0, 0, 0, 0, 0, -504, 0, 0, -504, 0, 0, 0, -504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -504, -504, -504, -504, 0, 0, 0, 0, 0, 0, 0, -504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -504, 0, 0, 0, -504, 0, 0, 0, 0, 0, -504, -504, 0, -504, -504, 0, -504, -504, - // State 459 - 0, 0, 0, 0, 0, 0, 0, -505, 0, 0, 0, 0, 0, -505, 0, 0, -505, 0, 0, 0, -505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -505, -505, -505, -505, 0, 0, 0, 0, 0, 0, 0, -505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -505, 0, 0, 0, -505, 0, 0, 0, 0, 0, -505, -505, 0, -505, -505, 0, -505, -505, - // State 460 - 0, 0, 0, 0, 0, 0, 0, -506, 0, 0, 0, 0, 0, -506, 0, 0, -506, 0, 0, 0, -506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -506, -506, -506, -506, 0, 0, 0, 0, 0, 0, 0, -506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -506, 0, 0, 0, -506, 0, 0, 0, 0, 0, -506, -506, 0, -506, -506, 0, -506, -506, - // State 461 - 0, 0, 0, 0, 0, 0, 0, -508, 0, 0, 0, 0, 0, -508, 0, 0, -508, 0, 0, 0, -508, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -508, -508, -508, -508, 0, 0, 0, 0, 0, 0, 0, -508, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -508, 0, 0, 0, -508, 0, 0, 0, 0, 0, -508, -508, 0, -508, -508, 0, -508, -508, - // State 462 - -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, 0, -895, 0, -895, -895, -895, -895, -895, 0, -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, 0, 0, 0, -895, -895, -895, -895, -895, -895, 0, -895, 0, 0, 0, 0, 0, 0, 0, 0, -895, 0, 0, -895, -895, 0, -895, 0, -895, -895, 0, 0, 0, -895, -895, 0, 0, 0, 0, 0, 0, 0, 0, 0, -895, -895, -895, 0, 0, 0, 0, 0, 0, 0, 0, 0, -895, 0, 0, 0, -895, - // State 463 - -392, -392, -392, -392, -392, -392, -392, 0, -392, -392, 0, -392, -392, -392, -392, -392, -392, -392, 0, 0, 0, -392, -392, -392, -392, -392, 0, -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, 0, 0, 0, 0, -392, -392, -392, -392, -392, 0, -392, 0, 0, 0, 0, 0, 0, 0, 0, -392, 0, 0, -392, -392, 0, -392, 0, -392, -392, 0, 0, 0, -392, -392, 0, 0, 0, 0, 0, 0, 0, 0, 0, -392, -392, -392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 464 - -191, 0, -191, -191, 0, -191, 0, -191, -191, -191, -191, 0, 0, -191, 0, -191, -191, 0, 0, -191, 0, -191, -191, 0, 0, -191, -510, 0, -191, -191, 0, -191, 0, -191, -191, -191, -191, 0, 0, -191, 0, 0, 0, 0, -191, -191, -191, 0, -191, -191, 0, -191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -191, 0, 0, -191, 0, -191, -191, 0, 0, 0, -191, -191, 0, 0, 0, 0, 0, 0, 0, 0, 0, -191, 0, -191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 465 - 0, 0, 0, 0, 0, 0, 0, 0, -513, 0, 0, 0, 0, 0, 0, -513, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 466 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 467 - 0, 0, 0, 0, 0, 0, 0, 0, 558, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 468 - 0, 0, 0, 0, 0, 0, 0, 0, -514, 0, 0, 0, 0, 0, 0, -514, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 469 - 0, 0, 0, 0, 0, 0, 0, 0, -550, 0, 0, 0, 0, 0, 0, -550, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 470 - 0, 0, 0, 0, 0, 0, 0, 0, 559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 471 - -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, 0, -205, 0, -205, -205, -205, -205, -205, 0, -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, 0, 0, 0, -205, -205, -205, -205, -205, -205, 0, -205, 0, 0, 0, 0, 0, 0, 0, 0, -205, 0, 0, -205, -205, 0, -205, 0, -205, -205, 0, 0, 0, -205, -205, 0, 0, 0, 0, 0, 0, 0, 0, 0, -205, -205, -205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 472 - -820, -820, 0, 0, -820, 0, -820, 0, -820, 0, 0, -820, -820, 0, -820, -820, 0, -820, 0, 0, 0, 0, 0, -820, -820, -820, 0, -820, 0, 0, -820, 0, -820, 0, 0, 0, 0, -820, 0, 0, -820, 0, 0, 0, 0, -820, 0, -820, 0, 0, 0, -820, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -820, 0, 0, 0, 0, -820, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, -820, -820, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 473 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 474 - -511, 0, 0, 0, 0, 0, 0, 0, -511, 0, 0, 0, 0, 0, 0, -511, 0, 0, 0, 0, 0, 0, 0, 0, 0, -511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -511, 0, 0, 0, 0, 0, -511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 475 - 0, 0, 0, 0, 0, 0, 0, 0, -878, 0, 0, 0, 0, 0, 0, -878, 0, 0, 0, 0, 0, 0, 0, 0, 0, -878, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -878, 0, 0, 0, 0, 0, -878, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -878, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -878, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 476 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -467, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 477 - 0, 0, 0, 0, 0, 0, 0, 0, -879, 0, 0, 0, 0, 0, 0, -879, 0, 0, 0, 0, 0, 0, 0, 0, 0, -879, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -879, 0, 0, 0, 0, 0, -879, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -879, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -879, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 478 - -512, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 479 - -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, 0, -193, 0, -193, -193, -193, -193, -193, 0, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, 0, 0, 0, -193, -193, -193, -193, -193, -193, 0, -193, 0, 0, 0, 0, 0, 0, 0, 0, -193, 0, 0, -193, -193, 0, -193, 0, -193, -193, 0, 0, 0, -193, -193, 0, 0, 0, 0, 0, 0, 0, 0, 0, -193, -193, -193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 480 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 564, 0, 0, 0, 0, 0, 0, 0, 0, 0, -729, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 481 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -920, 0, 0, 0, 0, 0, 0, 0, 0, 0, -920, 0, 0, 0, 0, 0, 0, -920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 482 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, -709, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 483 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -546, 0, 0, 0, 0, 0, 0, 0, 0, 0, -546, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 484 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 485 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -566, 0, 0, 0, 0, 0, 0, 0, 0, 0, -566, 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 486 - -516, -516, 0, 0, -516, 0, -516, 0, -516, 0, 0, -516, -516, 0, -516, -516, 0, -516, 0, 0, 0, 0, 0, -516, -516, -516, 0, -516, 0, 0, -516, 0, -516, 0, 0, 0, 0, -516, 0, 0, -516, 0, 0, 0, 0, -516, 0, -516, -516, -516, 0, -516, 0, 0, 0, 0, 0, 0, 0, 0, -516, 0, 0, -516, -516, 0, -516, 0, 0, 0, 0, 0, 0, 0, -516, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -516, -516, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 487 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -526, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -526, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 488 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 571, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 489 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 490 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -792, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 491 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 573, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 492 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 493 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -554, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -554, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 494 - -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, 0, -210, 0, -210, -210, -210, -210, -210, 0, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, 0, 0, 0, -210, -210, -210, -210, -210, -210, 0, -210, 0, 0, 0, 0, 0, 0, 0, 0, -210, 0, 0, -210, -210, 0, -210, 0, -210, -210, 0, 0, 0, -210, -210, 0, 0, 0, 0, 0, 0, 0, 0, 0, -210, -210, -210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 495 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -382, 0, 0, -382, 0, 0, -382, 0, 0, 0, 0, 0, -382, 0, 0, 0, 0, 0, - // State 496 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -378, 0, 0, -378, 0, 0, -378, 0, 0, 0, 0, 0, -378, 0, 0, 0, 0, 0, - // State 497 - -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, 0, -371, 0, -371, -371, -371, -371, -371, 0, -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, 0, 0, 0, -371, -371, -371, -371, -371, -371, 0, -371, 0, 0, 0, 0, 0, 0, 0, 0, -371, 0, 0, -371, -371, 0, -371, 0, -371, -371, 0, 0, 0, -371, -371, 0, 0, 0, 0, 0, 0, 0, 0, 0, -371, -371, -371, 0, 0, 0, 0, 0, 0, 0, 0, 0, -371, 0, 0, 0, -371, - // State 498 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -379, 0, 0, -379, 0, 0, -379, 0, 0, 0, 0, 0, -379, 0, 0, 0, 0, 0, - // State 499 - -816, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -816, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 500 - -320, 0, 0, 0, 0, 0, 0, -320, 0, -320, 0, 0, 0, -320, 0, 0, -320, 0, 0, 0, -320, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -320, 0, -320, -320, -320, -320, 0, 0, 0, 0, 0, -320, -320, -320, -320, 0, -320, -320, -320, -320, 0, 0, 0, 0, -320, -320, -320, -320, -320, 0, 0, -320, -320, -320, -320, 0, -320, -320, -320, -320, -320, -320, -320, -320, -320, 0, 0, 0, -320, -320, 0, 0, 0, 0, -320, -320, 0, -320, -320, -320, -320, -320, - // State 501 - -773, 0, 0, 0, 0, 0, 0, -773, 0, -773, 0, 0, 0, -773, 0, 0, -773, 0, 0, 0, -773, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -773, 0, -773, -773, -773, -773, 0, 0, 0, 0, 0, -773, -773, -773, -773, 0, -773, -773, -773, -773, 0, 0, 0, 0, -773, -773, -773, -773, -773, 0, 0, -773, -773, -773, -773, 0, -773, -773, -773, -773, -773, -773, -773, -773, -773, 0, 0, 0, -773, 0, 0, 0, 0, 0, -773, -773, 0, -773, -773, -773, -773, -773, - // State 502 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -329, 0, 0, 0, -329, 0, -329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 503 - -811, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -811, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 504 - -809, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -809, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 505 - -812, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -812, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 506 - -316, 0, 0, 0, 0, 0, 0, -316, 0, -316, 0, 0, 0, -316, 0, 0, -316, 0, 0, 0, -316, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -316, 0, -316, -316, -316, -316, 0, 0, 0, 0, 0, -316, -316, -316, -316, 0, -316, -316, -316, -316, 0, 0, 0, 0, -316, -316, -316, -316, -316, 0, 0, -316, -316, -316, -316, 0, -316, -316, -316, -316, -316, -316, -316, -316, -316, 0, 0, 0, -316, -316, 0, 0, 0, 0, -316, -316, 0, -316, -316, -316, -316, -316, - // State 507 - -319, 0, 0, 0, 0, 0, 0, -319, 0, -319, 0, 0, 0, -319, 0, 0, -319, 0, 0, 0, -319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -319, 0, -319, -319, -319, -319, 0, 0, 0, 0, 0, -319, -319, -319, -319, 0, -319, -319, -319, -319, 0, 0, 0, 0, -319, -319, -319, -319, -319, 0, 0, -319, -319, -319, -319, 0, -319, -319, -319, -319, -319, -319, -319, -319, -319, 0, 0, 0, -319, -319, 0, 0, 0, 0, -319, -319, 0, -319, -319, -319, -319, -319, - // State 508 - -814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 509 - -314, 0, 0, 0, 0, 0, 0, -314, 0, -314, 0, 0, 0, -314, 0, 0, -314, 0, 0, 0, -314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -314, 0, -314, -314, -314, -314, 0, 0, 0, 0, 0, -314, -314, -314, -314, 0, -314, -314, -314, -314, 0, 0, 0, 0, -314, -314, -314, -314, -314, 0, 0, -314, -314, -314, -314, 0, -314, -314, -314, -314, -314, -314, -314, -314, -314, 0, 0, 0, -314, -314, 0, 0, 0, 0, -314, -314, 0, -314, -314, -314, -314, -314, - // State 510 - -813, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -813, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 511 - -818, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -818, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 512 - -819, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -819, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 513 - -313, 0, 0, 0, 0, 0, 0, -313, 0, -313, 0, 0, 0, -313, 0, 0, -313, 0, 0, 0, -313, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -313, 0, -313, -313, -313, -313, 0, 0, 0, 0, 0, -313, -313, -313, -313, 0, -313, -313, -313, -313, 0, 0, 0, 0, -313, -313, -313, -313, -313, 0, 0, -313, -313, -313, -313, 0, -313, -313, -313, -313, -313, -313, -313, -313, -313, 0, 0, 0, -313, -313, 0, 0, 0, 0, -313, -313, 0, -313, -313, -313, -313, -313, - // State 514 - -815, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -815, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 515 - -810, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -810, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 516 - -401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 517 - 598, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 518 - -875, 0, 0, 0, -875, 0, -875, 0, 0, 0, 0, -875, -875, 0, -875, -875, 0, -875, 0, 0, 0, 0, 0, -875, -875, 105, 0, -875, 0, 0, -875, 0, -875, 0, 0, 0, 0, -875, 0, 0, -875, 0, 0, 0, 0, 0, 0, -875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 519 - -317, 0, 0, 0, 0, 0, 0, -317, 0, -317, 0, 0, 0, -317, 0, 0, -317, 0, 0, 0, -317, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -317, 0, -317, -317, -317, -317, 0, 0, 0, 0, 0, -317, -317, -317, -317, 0, -317, -317, -317, -317, 0, 0, 0, 0, -317, -317, -317, -317, -317, 0, 0, -317, -317, -317, -317, 0, -317, -317, -317, -317, -317, -317, -317, -317, -317, 0, 0, 0, -317, -317, 0, 0, 0, 0, -317, -317, 0, -317, -317, -317, -317, -317, - // State 520 - -817, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -817, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 521 - -315, 0, 0, 0, 0, 0, 0, -315, 0, -315, 0, 0, 0, -315, 0, 0, -315, 0, 0, 0, -315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -315, 0, -315, -315, -315, -315, 0, 0, 0, 0, 0, -315, -315, -315, -315, 0, -315, -315, -315, -315, 0, 0, 0, 0, -315, -315, -315, -315, -315, 0, 0, -315, -315, -315, -315, 0, -315, -315, -315, -315, -315, -315, -315, -315, -315, 0, 0, 0, -315, -315, 0, 0, 0, 0, -315, -315, 0, -315, -315, -315, -315, -315, - // State 522 - -318, 0, 0, 0, 0, 0, 0, -318, 0, -318, 0, 0, 0, -318, 0, 0, -318, 0, 0, 0, -318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -318, 0, -318, -318, -318, -318, 0, 0, 0, 0, 0, -318, -318, -318, -318, 0, -318, -318, -318, -318, 0, 0, 0, 0, -318, -318, -318, -318, -318, 0, 0, -318, -318, -318, -318, 0, -318, -318, -318, -318, -318, -318, -318, -318, -318, 0, 0, 0, -318, -318, 0, 0, 0, 0, -318, -318, 0, -318, -318, -318, -318, -318, - // State 523 - -400, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -400, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 524 - -778, 0, 0, 0, 0, 0, 0, -778, 0, -778, 0, 0, 0, -778, 0, 0, -778, 0, 0, 0, -778, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -778, 0, -778, -778, -778, -778, 0, 0, 0, 0, 0, -778, -778, -778, -778, 0, -778, -778, -778, -778, 0, 0, 0, 0, -778, -778, -778, -778, -778, 0, 0, -778, -778, -778, -778, 0, -778, -778, -778, -778, -778, -778, -778, -778, -778, 0, 0, 0, -778, 0, 0, 0, 0, 0, -778, -778, 0, -778, -778, -778, -778, -778, - // State 525 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, 0, 0, 0, 0, 0, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 526 - -396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 527 - -397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 528 - -752, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -752, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 529 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 530 - -460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 531 - 0, 0, 0, 0, 0, 0, 0, -118, 0, 0, 0, 0, 0, -118, 0, 0, -118, 0, 0, 0, -118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -118, -118, -118, -118, 0, 0, 0, 0, 0, 0, 0, -118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -118, 0, 0, 0, 0, 0, 0, 0, 0, 0, -118, 0, 0, 0, -118, 0, 0, 0, 0, 0, -118, -118, 0, -118, -118, 0, -118, -118, - // State 532 - 0, 0, 0, 0, 0, 0, 0, -128, 0, 0, 0, 0, 0, -128, 0, 0, -128, 0, 0, 0, -128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -128, -128, -128, -128, 0, 0, 0, 0, 0, 0, 0, -128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -128, 0, 0, 0, 0, 0, 0, 0, 0, 0, -128, 0, 0, 0, -128, 0, 0, 0, 0, 0, -128, -128, 0, -128, -128, 0, -128, -128, - // State 533 - 0, 0, 0, 0, 0, 0, 0, 0, 661, 0, 0, 0, 0, 0, 0, 662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 534 - 0, 0, -191, -191, 0, -191, 0, -191, -191, -191, -191, 0, 0, -191, 0, -191, -191, 0, 0, -191, 0, -191, -191, 0, 0, 0, -510, 0, -191, -191, 0, -191, 129, -191, -191, -191, -191, 0, 0, -191, 0, 0, 0, 0, -191, 0, -191, 0, -191, 0, 0, -191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -191, 0, 0, -191, 0, -191, -191, 0, 0, 0, -191, -191, 0, 0, 0, 0, 0, 0, 0, 0, 0, -191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 535 - -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, 0, -169, 0, -169, -169, -169, -169, -169, 0, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, 0, 0, 0, -169, -169, -169, -169, -169, -169, 0, -169, 0, 0, 0, 0, 0, 0, 0, 0, -169, 0, 0, -169, -169, 0, -169, 0, -169, -169, 0, 0, 0, -169, -169, 0, 0, 0, 0, 0, 0, 0, 0, 0, -169, -169, -169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 536 - -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, 0, -248, 0, -248, -248, -248, -248, -248, 0, -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, 0, 0, 0, -248, -248, -248, -248, -248, -248, 0, -248, 0, 0, 0, 0, 0, 0, 0, 0, -248, 0, 0, -248, -248, 0, -248, 0, -248, -248, 0, 0, 0, -248, -248, 0, 0, 0, 0, 0, 0, 0, 0, 0, -248, -248, -248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 537 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -849, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 538 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 539 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 540 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -840, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -840, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 541 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -852, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 542 - -768, -768, -768, -768, -768, -768, -768, 0, -768, -768, 0, -768, -768, -768, -768, -768, -768, -768, 0, 0, 0, -768, -768, -768, -768, -768, 0, -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, 0, 0, 0, 0, -768, -768, -768, -768, -768, 0, -768, 0, 0, 0, 0, 0, 0, 0, 0, -768, 0, 0, -768, -768, 0, -768, 0, -768, -768, 0, 0, 0, -768, -768, 0, 0, 0, 0, 0, 0, 0, 0, 0, -768, -768, -768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 543 - -147, -147, -147, 0, -147, 0, -147, 0, -147, 0, 0, -147, -147, 0, -147, -147, 0, -147, 0, 0, 0, 0, 0, -147, -147, -147, 0, -147, -147, 0, -147, -147, -147, -147, -147, -147, 0, -147, 0, 0, -147, 0, 0, 0, 0, -147, 0, -147, -147, -147, 0, -147, 0, 0, 0, 0, 0, 0, 0, 0, -147, 0, 0, -147, -147, 0, -147, 0, -147, -147, 0, 0, 0, -147, -147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, -147, -147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 544 - 0, 0, 0, 0, 0, 0, 0, -308, 0, 0, 0, 0, 0, -308, 0, 0, -308, 0, 0, 0, -308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -308, -308, -308, -308, 0, 0, 0, 0, 0, 0, 0, -308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -308, 0, 0, 0, -308, 0, 0, 0, 0, 0, -308, -308, 0, -308, -308, 0, -308, -308, - // State 545 - 0, 0, 0, 0, 0, 0, 0, -306, 0, 0, 0, 0, 0, -306, 0, 0, -306, 0, 0, 0, -306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -306, -306, -306, -306, 0, 0, 0, 0, 0, 0, 0, -306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -306, 0, 0, 0, -306, 0, 0, 0, 0, 0, -306, -306, 0, -306, -306, 0, -306, -306, - // State 546 - -353, -353, -353, 0, -353, 0, -353, 0, -353, 0, 0, -353, -353, 0, -353, -353, 0, -353, 0, 0, 0, 0, 0, -353, -353, -353, 0, -353, -353, 0, -353, -353, -353, -353, -353, -353, 0, -353, -353, 0, -353, 0, 0, 0, 0, -353, 37, -353, -353, -353, 0, -353, 0, 0, 0, 0, 0, 0, 0, 0, -353, 0, 0, -353, -353, 0, -353, 0, -353, -353, 0, 0, 0, -353, -353, 0, 0, 0, 0, 0, 0, 0, 0, 0, -353, -353, -353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 547 - -95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 548 - -553, -553, 0, 0, -553, 0, -553, 0, -553, 0, 0, -553, -553, 0, -553, -553, 0, -553, 0, 0, 0, 0, 0, -553, -553, -553, 0, -553, 0, 0, -553, 0, -553, 0, 0, 0, 0, -553, 0, 0, -553, 0, 0, 0, 0, 0, 0, -553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -553, -553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 549 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 550 - -858, -858, -858, -858, -858, -858, -858, 0, -858, -858, 0, -858, -858, -858, -858, -858, -858, -858, 0, 0, 0, -858, -858, -858, -858, -858, 0, -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, 0, 0, 0, 0, -858, -858, -858, -858, -858, 0, -858, 0, 0, 0, 0, 0, 0, 0, 0, -858, 0, 0, -858, -858, 0, -858, 0, -858, -858, 0, 0, 0, -858, -858, 0, 0, 0, 0, 0, 0, 0, 0, 0, -858, -858, -858, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 551 - -944, -944, -944, 0, -944, 24, -944, 0, -944, 0, 0, -944, -944, 0, -944, -944, 0, -944, 0, 0, 0, 0, 0, -944, -944, -944, 0, -944, -944, 0, -944, -944, -944, -944, -944, -944, 0, -944, -944, 0, -944, 0, 0, 0, 0, -944, -944, -944, -944, -944, 0, -944, 0, 0, 0, 0, 0, 0, 0, 0, -944, 0, 0, -944, -944, 0, -944, 0, -944, -944, 0, 0, 0, -944, -944, 0, 0, 0, 0, 0, 0, 0, 0, 0, -944, -944, -944, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 552 - 0, 0, 0, 0, 0, 0, 0, 0, 670, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 553 - 0, 0, 0, 0, 0, 0, 0, 0, -803, 0, 0, 0, 0, 0, 0, -803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -803, 0, 0, 0, 0, 0, -803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 554 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 555 - 0, 0, 0, 0, 0, 0, 0, 0, 673, 0, 0, 0, 0, 0, 0, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 556 - -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, 0, -202, 0, -202, -202, -202, -202, -202, 0, -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, 0, 0, 0, -202, -202, -202, -202, -202, -202, 0, -202, 0, 0, 0, 0, 0, 0, 0, 0, -202, 0, 0, -202, -202, 0, -202, 0, -202, -202, 0, 0, 0, -202, -202, 0, 0, 0, 0, 0, 0, 0, 0, 0, -202, -202, -202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 557 - -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, 0, -196, 0, -196, -196, -196, -196, -196, 0, -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, 0, 0, 0, -196, -196, -196, -196, -196, -196, 0, -196, 0, 0, 0, 0, 0, 0, 0, 0, -196, 0, 0, -196, -196, 0, -196, 0, -196, -196, 0, 0, 0, -196, -196, 0, 0, 0, 0, 0, 0, 0, 0, 0, -196, -196, -196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 558 - -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, 0, -206, 0, -206, -206, -206, -206, -206, 0, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, 0, 0, 0, -206, -206, -206, -206, -206, -206, 0, -206, 0, 0, 0, 0, 0, 0, 0, 0, -206, 0, 0, -206, -206, 0, -206, 0, -206, -206, 0, 0, 0, -206, -206, 0, 0, 0, 0, 0, 0, 0, 0, 0, -206, -206, -206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 559 - 0, 0, 0, 0, 0, 0, 0, 0, 679, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 560 - -948, -948, 0, 0, 0, 0, 0, 0, -948, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -948, 0, -948, 0, 0, 0, 0, -948, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -948, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 561 - -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, 0, -192, 0, -192, -192, -192, -192, -192, 0, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, 0, 0, 0, -192, -192, -192, -192, -192, -192, 0, -192, 0, 0, 0, 0, 0, 0, 0, 0, -192, 0, 0, -192, -192, 0, -192, 0, -192, -192, 0, 0, 0, -192, -192, 0, 0, 0, 0, 0, 0, 0, 0, 0, -192, -192, -192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 562 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 682, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 563 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -720, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 564 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, -724, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 565 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, -728, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 566 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -824, 0, 0, 0, 0, 0, 0, 0, 0, 0, -824, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 567 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -343, 0, 0, 0, 0, 0, 0, 0, 0, 0, -343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 568 - -465, -465, 0, 0, -465, 0, -465, 0, -465, 0, 0, -465, -465, 0, -465, -465, 0, -465, 0, 0, 0, 0, 0, -465, -465, -465, 0, -465, 0, 0, -465, 0, -465, 0, 0, 0, 0, -465, 0, 0, -465, 0, 0, 0, 0, -465, 0, -465, 0, -465, 0, -465, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -465, -465, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -465, -465, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 569 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 691, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 570 - -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, 0, -209, 0, -209, -209, -209, -209, -209, 0, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, 0, 0, 0, -209, -209, -209, -209, -209, -209, 0, -209, 0, 0, 0, 0, 0, 0, 0, 0, -209, 0, 0, -209, -209, 0, -209, 0, -209, -209, 0, 0, 0, -209, -209, 0, 0, 0, 0, 0, 0, 0, 0, 0, -209, -209, -209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 571 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 692, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 572 - -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, 0, -212, 0, -212, -212, -212, -212, -212, 0, -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, 0, 0, 0, -212, -212, -212, -212, -212, -212, 0, -212, 0, 0, 0, 0, 0, 0, 0, 0, -212, 0, 0, -212, -212, 0, -212, 0, -212, -212, 0, 0, 0, -212, -212, 0, 0, 0, 0, 0, 0, 0, 0, 0, -212, -212, -212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 573 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, -333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 574 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -383, 0, 0, -383, 0, 0, -383, 0, 0, 0, 0, 0, -383, 0, 0, 0, 0, 0, - // State 575 - -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, 0, -372, 0, -372, -372, -372, -372, -372, 0, -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, 0, 0, 0, -372, -372, -372, -372, -372, -372, 0, -372, 0, 0, 0, 0, 0, 0, 0, 0, -372, 0, 0, -372, -372, 0, -372, 0, -372, -372, 0, 0, 0, -372, -372, 0, 0, 0, 0, 0, 0, 0, 0, 0, -372, -372, -372, 0, 0, 0, 0, 0, 0, 0, 0, 0, -372, 0, 0, 0, -372, - // State 576 - -873, -873, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -873, 0, -873, 0, 0, 0, 0, -873, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -873, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 577 - -874, -874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -874, 0, -874, 0, 0, 0, 0, -874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 578 - 700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 701, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 579 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -330, 0, 0, 0, -330, 0, -330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 580 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 581 - -461, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -461, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 702, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 582 - -89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 583 - -185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -185, 0, 0, 0, 0, -185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 584 - 0, 0, 0, 0, 0, 0, 0, -262, 0, -262, 0, 0, 0, -262, 0, 0, -262, 0, 0, 0, -262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -262, -262, -262, -262, 0, 0, 0, 0, 0, 0, 0, -262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -262, 0, 0, -262, 0, 0, 0, 0, 0, 0, 0, 0, -262, -262, 0, 0, 0, -262, 0, 0, 0, 0, 0, -262, -262, 0, -262, -262, 0, -262, -262, - // State 585 - 0, 0, 0, 0, 0, 0, 0, -263, 0, -263, 0, 0, 0, -263, 0, 0, -263, 0, 0, 0, -263, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -263, -263, -263, -263, 0, 0, 0, 0, 0, 0, 0, -263, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -263, 0, 0, -263, 0, 0, 0, 0, 0, 0, 0, 0, -263, -263, 0, 0, 0, -263, 0, 0, 0, 0, 0, -263, -263, 0, -263, -263, 0, -263, -263, - // State 586 - 0, 0, 0, 0, 0, 0, 0, -268, 0, -268, 0, 0, 0, -268, 0, 0, -268, 0, 0, 0, -268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -268, -268, -268, -268, 0, 0, 0, 0, 0, 0, 0, -268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -268, 0, 0, -268, 0, 0, 0, 0, 0, 0, 0, 0, -268, -268, 0, 0, 0, -268, 0, 0, 0, 0, 0, -268, -268, 0, -268, -268, 0, -268, -268, - // State 587 - 0, 0, 0, 0, 0, 0, 0, -259, 0, -259, 0, 0, 0, -259, 0, 0, -259, 0, 0, 0, -259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -259, -259, -259, -259, 0, 0, 0, 0, 0, 0, 0, -259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -259, 0, 0, -259, 0, 0, 0, 0, 0, 0, 0, 0, -259, -259, 0, 0, 0, -259, 0, 0, 0, 0, 0, -259, -259, 0, -259, -259, 0, -259, -259, - // State 588 - 0, 0, 0, 0, 0, 0, 0, -257, 0, -257, 0, 0, 0, -257, 0, 0, -257, 0, 0, 0, -257, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -257, -257, -257, -257, 0, 0, 0, 0, 0, 0, 0, -257, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -257, 0, 0, -257, 0, 0, 0, 0, 0, 0, 0, 0, -257, -257, 0, 0, 0, -257, 0, 0, 0, 0, 0, -257, -257, 0, -257, -257, 0, -257, -257, - // State 589 - 0, 0, 0, 0, 0, 0, 0, -258, 0, -258, 0, 0, 0, -258, 0, 0, -258, 0, 0, 0, -258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -258, -258, -258, -258, 0, 0, 0, 0, 0, 0, 0, -258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -258, 0, 0, -258, 0, 0, 0, 0, 0, 0, 0, 0, -258, -258, 0, 0, 0, -258, 0, 0, 0, 0, 0, -258, -258, 0, -258, -258, 0, -258, -258, - // State 590 - 0, 0, 0, 0, 0, 0, 0, -269, 0, -269, 0, 0, 0, -269, 0, 0, -269, 0, 0, 0, -269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -269, -269, -269, -269, 0, 0, 0, 0, 0, 0, 0, -269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -269, 0, 0, -269, 0, 0, 0, 0, 0, 0, 0, 0, -269, -269, 0, 0, 0, -269, 0, 0, 0, 0, 0, -269, -269, 0, -269, -269, 0, -269, -269, - // State 591 - 0, 0, 0, 0, 0, 0, 0, -261, 0, -261, 0, 0, 0, -261, 0, 0, -261, 0, 0, 0, -261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -261, -261, -261, -261, 0, 0, 0, 0, 0, 0, 0, -261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -261, 0, 0, -261, 0, 0, 0, 0, 0, 0, 0, 0, -261, -261, 0, 0, 0, -261, 0, 0, 0, 0, 0, -261, -261, 0, -261, -261, 0, -261, -261, - // State 592 - 0, 0, 0, 0, 0, 0, 0, -266, 0, -266, 0, 0, 0, -266, 0, 0, -266, 0, 0, 0, -266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -266, -266, -266, -266, 0, 0, 0, 0, 0, 0, 0, -266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -266, 0, 0, -266, 0, 0, 0, 0, 0, 0, 0, 0, -266, -266, 0, 0, 0, -266, 0, 0, 0, 0, 0, -266, -266, 0, -266, -266, 0, -266, -266, - // State 593 - 0, 0, 0, 0, 0, 0, 0, -267, 0, -267, 0, 0, 0, -267, 0, 0, -267, 0, 0, 0, -267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -267, -267, -267, -267, 0, 0, 0, 0, 0, 0, 0, -267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -267, 0, 0, -267, 0, 0, 0, 0, 0, 0, 0, 0, -267, -267, 0, 0, 0, -267, 0, 0, 0, 0, 0, -267, -267, 0, -267, -267, 0, -267, -267, - // State 594 - 0, 0, 0, 0, 0, 0, 0, -260, 0, -260, 0, 0, 0, -260, 0, 0, -260, 0, 0, 0, -260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -260, -260, -260, -260, 0, 0, 0, 0, 0, 0, 0, -260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -260, 0, 0, -260, 0, 0, 0, 0, 0, 0, 0, 0, -260, -260, 0, 0, 0, -260, 0, 0, 0, 0, 0, -260, -260, 0, -260, -260, 0, -260, -260, - // State 595 - 0, 0, 0, 0, 0, 0, 0, -265, 0, -265, 0, 0, 0, -265, 0, 0, -265, 0, 0, 0, -265, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -265, -265, -265, -265, 0, 0, 0, 0, 0, 0, 0, -265, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -265, 0, 0, -265, 0, 0, 0, 0, 0, 0, 0, 0, -265, -265, 0, 0, 0, -265, 0, 0, 0, 0, 0, -265, -265, 0, -265, -265, 0, -265, -265, - // State 596 - 0, 0, 0, 0, 0, 0, 0, -264, 0, -264, 0, 0, 0, -264, 0, 0, -264, 0, 0, 0, -264, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -264, -264, -264, -264, 0, 0, 0, 0, 0, 0, 0, -264, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -264, 0, 0, -264, 0, 0, 0, 0, 0, 0, 0, 0, -264, -264, 0, 0, 0, -264, 0, 0, 0, 0, 0, -264, -264, 0, -264, -264, 0, -264, -264, - // State 597 - -776, 0, 0, 0, 0, 0, 0, -776, 0, -776, 0, 0, 0, -776, 0, 0, -776, 0, 0, 0, -776, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -776, 0, -776, -776, -776, -776, 0, 0, 0, 0, 0, -776, -776, -776, -776, 0, -776, -776, -776, -776, 0, 0, 0, 0, -776, -776, -776, -776, -776, 0, 0, -776, -776, -776, -776, 0, -776, -776, -776, -776, -776, -776, -776, -776, -776, 0, 0, 0, -776, 0, 0, 0, 0, 0, -776, -776, 0, -776, -776, -776, -776, -776, - // State 598 - 708, 0, 0, 0, 0, 0, 0, -140, 0, -140, 0, 0, 0, -140, 0, 0, -140, 0, 0, 0, -140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -140, -140, -140, -140, 0, 0, 0, 0, 0, -140, 0, -140, -140, 0, 0, -140, 0, -140, 0, 0, 0, 0, 0, -140, -140, 0, -140, 0, 0, -140, 0, -140, -140, 0, -140, -140, -140, 0, -140, 0, 0, -140, -140, 0, 0, 0, -140, 0, 0, 0, 0, 0, -140, -140, 0, -140, -140, -140, -140, -140, - // State 599 - 709, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 600 - -180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 601 - -361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 602 - -331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 603 - -528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 604 - -359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 605 - -362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 606 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 607 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -357, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 608 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -430, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 609 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -454, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 610 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -452, -452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -452, 0, - // State 611 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 612 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -449, -449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -449, 0, - // State 613 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -448, -448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -448, 0, - // State 614 - -530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 615 - -433, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -433, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 616 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 617 - -533, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -533, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -533, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 618 - -457, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 167, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -457, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 619 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 717, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 620 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 718, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 621 - -515, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -515, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 622 - -781, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -781, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 623 - -398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 624 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 625 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 626 - 0, 0, -945, 0, 0, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, -945, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -945, 0, 0, -945, 0, -945, -945, -945, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -945, 0, -945, -945, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -945, 0, -945, -945, 0, 0, 0, -945, -945, 0, 0, 0, 0, 0, 0, 0, 0, 0, -945, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 627 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -947, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 628 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -563, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 629 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -796, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 630 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 631 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 632 - 0, 0, -769, -769, 0, -769, 0, 0, 0, -769, 179, 0, 0, -769, 0, -769, -769, 0, 0, 0, 0, -769, -769, 0, 0, 0, 0, 0, -769, -769, 0, -769, 0, -769, -769, -769, -769, 0, 0, -769, 0, 0, 0, 0, 0, 0, -769, 0, -769, -769, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -769, 0, -769, -769, 0, 0, 0, -769, -769, 0, 0, 0, 0, 0, 0, 0, 0, 0, -769, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 633 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -771, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 634 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -519, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 635 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 636 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -861, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 637 - 0, 0, -191, -191, 0, -191, 0, -191, 0, -191, -191, 0, 0, -191, 0, -191, -191, 0, 0, -191, 0, -191, -191, 0, 0, -220, 0, 0, -191, -191, 0, -191, 0, -191, -191, -191, -191, 0, 0, -191, 0, 0, 0, 0, -191, 0, -191, 0, -191, -191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -191, 0, -191, -191, 0, 0, 0, -191, -191, 0, 0, 0, 0, 0, 0, 0, 0, 0, -191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 638 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -864, 0, 0, 0, 0, 0, 0, 0, 0, 0, -869, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -864, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 639 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -167, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 640 - 0, 0, -190, -190, 0, -190, 0, -190, 0, -190, -190, 0, 0, -190, 0, -190, -190, 0, 0, -190, 0, -190, -190, 0, 0, -219, 0, 0, -190, -190, 0, -190, 0, -190, -190, -190, -190, 0, 0, -190, 0, 0, 0, 0, -190, 0, -190, 0, -190, -190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -190, 0, -190, -190, 0, 0, 0, -190, -190, 0, 0, 0, 0, 0, 0, 0, 0, 0, -190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 641 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -863, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -863, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 642 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 643 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -395, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 644 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 645 - 0, 0, -189, -189, 0, -189, 0, -189, 0, -189, -189, 0, 0, -189, 0, -189, -189, 0, 0, -189, 0, -189, -189, 0, 0, -218, 0, 0, -189, -189, 0, -189, 0, -189, -189, -189, -189, 0, 0, -189, 0, 0, 0, 0, -189, 0, -189, 0, -189, -189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -189, 0, -189, -189, 0, 0, 0, -189, -189, 0, 0, 0, 0, 0, 0, 0, 0, 0, -189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 646 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 647 - 0, 0, 0, 0, 0, 0, 0, 0, -924, 0, 0, 0, 0, 0, 0, -924, 0, 0, 0, 0, 0, 0, 0, 0, 0, -924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 648 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -926, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 649 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -939, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 650 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -925, 0, 0, 0, 0, 0, 0, 0, 0, 0, -927, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 651 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 652 - 0, 0, -354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -354, 0, 0, -354, 0, -354, -354, -354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, -354, -354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -354, 0, -354, -354, 0, 0, 0, -354, -354, 0, 0, 0, 0, 0, 0, 0, 0, 0, -354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 653 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -356, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 654 - 0, 0, -217, -217, 0, -217, 0, -217, 0, -217, -217, 0, 0, -217, 0, -217, -217, 0, 0, -217, 0, -217, -217, 0, 0, -244, 0, 0, -217, -217, 0, -217, 0, -217, -217, -217, -217, 0, 0, -217, 0, 0, 0, 0, -217, 0, -217, 0, -217, -217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -217, 0, -217, -217, 0, 0, 0, -217, -217, 0, 0, 0, 0, 0, 0, 0, 0, 0, -217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 655 - 0, 0, -215, -215, 0, -215, 0, -215, 0, -215, -215, 0, 0, -215, 0, -215, -215, 0, 0, -215, 0, -215, -215, 0, 0, -242, 0, 0, -215, -215, 0, -215, 0, -215, -215, -215, -215, 0, 0, -215, 0, 0, 0, 0, -215, 0, -215, 0, -215, -215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -215, 0, -215, -215, 0, 0, 0, -215, -215, 0, 0, 0, 0, 0, 0, 0, 0, 0, -215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 656 - 0, 0, -216, -216, 0, -216, 0, -216, 0, -216, -216, 0, 0, -216, 0, -216, -216, 0, 0, -216, 0, -216, -216, 0, 0, -243, 0, 0, -216, -216, 0, -216, 0, -216, -216, -216, -216, 0, 0, -216, 0, 0, 0, 0, -216, 0, -216, 0, -216, -216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -216, 0, -216, -216, 0, 0, 0, -216, -216, 0, 0, 0, 0, 0, 0, 0, 0, 0, -216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 657 - 0, 0, -214, -214, 0, -214, 0, -214, 0, -214, -214, 0, 0, -214, 0, -214, -214, 0, 0, -214, 0, -214, -214, 0, 0, -241, 0, 0, -214, -214, 0, -214, 0, -214, -214, -214, -214, 0, 0, -214, 0, 0, 0, 0, -214, 0, -214, 0, -214, -214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -214, 0, -214, -214, 0, 0, 0, -214, -214, 0, 0, 0, 0, 0, 0, 0, 0, 0, -214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 658 - 0, 0, 0, 0, 0, 0, 0, 0, 737, 0, 0, 0, 0, 0, 0, 738, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 659 - -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, 0, -171, 0, -171, -171, -171, -171, -171, 0, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, 0, 0, 0, -171, -171, -171, -171, -171, -171, 0, -171, 0, 0, 0, 0, 0, 0, 0, 0, -171, 0, 0, -171, -171, 0, -171, 0, -171, -171, 0, 0, 0, -171, -171, 0, 0, 0, 0, 0, 0, 0, 0, 0, -171, -171, -171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 660 - -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, 0, -168, 0, -168, -168, -168, -168, -168, 0, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, 0, 0, 0, -168, -168, -168, -168, -168, -168, 0, -168, 0, 0, 0, 0, 0, 0, 0, 0, -168, 0, 0, -168, -168, 0, -168, 0, -168, -168, 0, 0, 0, -168, -168, 0, 0, 0, 0, 0, 0, 0, 0, 0, -168, -168, -168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 661 - 0, 0, 0, 0, 0, 0, 0, -124, -124, -124, -124, 0, 0, -124, 0, 0, -124, 0, 0, 0, -124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -124, -124, -124, -124, 0, 0, 0, 0, 0, 0, 0, -124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -124, 0, 0, -124, 0, 0, 0, 0, 0, 0, 0, 0, 0, -124, 0, 0, 0, -124, 0, 0, 0, 0, 0, -124, -124, 0, -124, -124, 0, -124, -124, - // State 662 - 0, 0, 0, 0, 0, 0, 0, 0, -422, 0, 0, 0, 0, 0, 0, -422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 663 - 0, 0, 0, 0, 0, 0, 0, 0, -425, 0, 0, 0, 0, 0, 0, -425, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 664 - 0, 0, 0, 0, 0, 0, 0, 0, -426, 0, 0, 0, 0, 0, 0, -426, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 665 - -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, 0, -247, 0, -247, -247, -247, -247, -247, 0, -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, 0, 0, 0, -247, -247, -247, -247, -247, -247, 0, -247, 0, 0, 0, 0, 0, 0, 0, 0, -247, 0, 0, -247, -247, 0, -247, 0, -247, -247, 0, 0, 0, -247, -247, 0, 0, 0, 0, 0, 0, 0, 0, 0, -247, -247, -247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 666 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -844, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -844, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 667 - -148, -148, -148, 0, -148, 0, -148, 0, -148, 0, 0, -148, -148, 0, -148, -148, 0, -148, 0, 0, 0, 0, 0, -148, -148, -148, 0, -148, -148, 0, -148, -148, -148, -148, -148, -148, 0, -148, 0, 0, -148, 0, 0, 0, 0, -148, 0, -148, -148, -148, 0, -148, 0, 0, 0, 0, 0, 0, 0, 0, -148, 0, 0, -148, -148, 0, -148, 0, -148, -148, 0, 0, 0, -148, -148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, -148, -148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 668 - -509, 0, 0, 0, 0, 0, 0, 0, -509, 0, 0, 0, 0, 0, 0, -509, 0, 0, 0, 0, 0, 0, 0, 0, 0, -509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -509, 0, 0, 0, 0, 0, -509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 669 - -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, 0, -207, 0, -207, -207, -207, -207, -207, 0, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, 0, 0, 0, -207, -207, -207, -207, -207, -207, 0, -207, 0, 0, 0, 0, 0, 0, 0, 0, -207, 0, 0, -207, -207, 0, -207, 0, -207, -207, 0, 0, 0, -207, -207, 0, 0, 0, 0, 0, 0, 0, 0, 0, -207, -207, -207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 670 - 0, 0, 0, 0, 0, 0, 0, 0, -804, 0, 0, 0, 0, 0, 0, -804, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -804, 0, 0, 0, 0, 0, -804, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -804, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -804, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 671 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 672 - -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, 0, -204, 0, -204, -204, -204, -204, -204, 0, -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, 0, 0, 0, -204, -204, -204, -204, -204, -204, 0, -204, 0, 0, 0, 0, 0, 0, 0, 0, -204, 0, 0, -204, -204, 0, -204, 0, -204, -204, 0, 0, 0, -204, -204, 0, 0, 0, 0, 0, 0, 0, 0, 0, -204, -204, -204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 673 - 0, 0, 0, 0, 0, 0, 0, 0, -69, 0, 0, 0, 0, 0, 0, -69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 674 - -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, 0, -198, 0, -198, -198, -198, -198, -198, 0, -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, 0, 0, 0, -198, -198, -198, -198, -198, -198, 0, -198, 0, 0, 0, 0, 0, 0, 0, 0, -198, 0, 0, -198, -198, 0, -198, 0, -198, -198, 0, 0, 0, -198, -198, 0, 0, 0, 0, 0, 0, 0, 0, 0, -198, -198, -198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 675 - 0, 0, 0, 0, 0, 0, 0, 0, -513, 0, 0, 0, 0, 0, 0, -513, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 676 - 0, 0, 0, 0, 0, 0, 0, 0, -551, 0, 0, 0, 0, 0, 0, -551, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 677 - -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, 0, -195, 0, -195, -195, -195, -195, -195, 0, -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, 0, 0, 0, -195, -195, -195, -195, -195, -195, 0, -195, 0, 0, 0, 0, 0, 0, 0, 0, -195, 0, 0, -195, -195, 0, -195, 0, -195, -195, 0, 0, 0, -195, -195, 0, 0, 0, 0, 0, 0, 0, 0, 0, -195, -195, -195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 678 - -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, 0, -208, 0, -208, -208, -208, -208, -208, 0, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, 0, 0, 0, -208, -208, -208, -208, -208, -208, 0, -208, 0, 0, 0, 0, 0, 0, 0, 0, -208, 0, 0, -208, -208, 0, -208, 0, -208, -208, 0, 0, 0, -208, -208, 0, 0, 0, 0, 0, 0, 0, 0, 0, -208, -208, -208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 679 - -950, -950, 0, 0, 0, 0, 0, 0, -950, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -950, 0, -950, 0, 0, 0, 0, -950, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -950, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 680 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 681 - -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, 0, -194, 0, -194, -194, -194, -194, -194, 0, -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, 0, 0, 0, -194, -194, -194, -194, -194, -194, 0, -194, 0, 0, 0, 0, 0, 0, 0, 0, -194, 0, 0, -194, -194, 0, -194, 0, -194, -194, 0, 0, 0, -194, -194, 0, 0, 0, 0, 0, 0, 0, 0, 0, -194, -194, -194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 682 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 751, 0, 0, 0, 0, 0, 0, 0, 0, 0, -706, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 683 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -547, 0, 0, 0, 0, 0, 0, 0, 0, 0, -547, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 684 - -463, -463, 0, 0, -463, 0, -463, 0, -463, 0, 0, -463, -463, 0, -463, -463, 0, -463, 0, 0, 0, 0, 0, -463, -463, -463, 0, -463, 0, 0, -463, 0, -463, 0, 0, 0, 0, -463, 0, 0, -463, 0, 0, 0, 0, -463, 0, -463, 0, -463, 0, -463, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -463, -463, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -463, -463, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 685 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 758, 0, 0, 0, 0, 0, 0, 0, 0, 0, -721, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 686 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 687 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -567, 0, 0, 0, 0, 0, 0, 0, 0, 0, -567, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 688 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 760, 0, 0, 0, 0, 0, 0, 0, 0, 0, -725, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 689 - -464, -464, 0, 0, -464, 0, -464, 0, -464, 0, 0, -464, -464, 0, -464, -464, 0, -464, 0, 0, 0, 0, 0, -464, -464, -464, 0, -464, 0, 0, -464, 0, -464, 0, 0, 0, 0, -464, 0, 0, -464, 0, 0, 0, 0, -464, 0, -464, 0, -464, 0, -464, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -464, -464, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -464, -464, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 690 - -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, 0, -211, 0, -211, -211, -211, -211, -211, 0, -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, 0, 0, 0, -211, -211, -211, -211, -211, -211, 0, -211, 0, 0, 0, 0, 0, 0, 0, 0, -211, 0, 0, -211, -211, 0, -211, 0, -211, -211, 0, 0, 0, -211, -211, 0, 0, 0, 0, 0, 0, 0, 0, 0, -211, -211, -211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 691 - -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, 0, -213, 0, -213, -213, -213, -213, -213, 0, -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, 0, 0, 0, -213, -213, -213, -213, -213, -213, 0, -213, 0, 0, 0, 0, 0, 0, 0, 0, -213, 0, 0, -213, -213, 0, -213, 0, -213, -213, 0, 0, 0, -213, -213, 0, 0, 0, 0, 0, 0, 0, 0, 0, -213, -213, -213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 692 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 693 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 694 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 695 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 696 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 763, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 697 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 764, 0, - // State 698 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -391, 0, 0, -391, 0, 0, -391, 0, 0, 0, 0, 0, -391, 0, 0, 0, 0, 0, - // State 699 - -777, 0, 0, 0, 0, 0, 0, -777, 0, -777, 0, 0, 0, -777, 0, 0, -777, 0, 0, 0, -777, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -777, 0, -777, -777, -777, -777, 0, 0, 0, 0, 0, -777, -777, -777, -777, 0, -777, -777, -777, -777, 0, 0, 0, 0, -777, -777, -777, -777, -777, 0, 0, -777, -777, -777, -777, 0, -777, -777, -777, -777, -777, -777, -777, -777, -777, 0, 0, 0, -777, 0, 0, 0, 0, 0, -777, -777, 0, -777, -777, -777, -777, -777, - // State 700 - 768, 0, 0, 0, 0, 0, 0, -141, 0, -141, 0, 0, 0, -141, 0, 0, -141, 0, 0, 0, -141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -141, -141, -141, -141, 0, 0, 0, 0, 0, -141, 0, -141, -141, 0, 0, -141, 0, -141, 0, 0, 0, 0, 0, -141, -141, 0, -141, 0, 0, -141, 0, -141, -141, 0, -141, -141, -141, 0, -141, 0, 0, -141, -141, 0, 0, 0, -141, 0, 0, 0, 0, 0, -141, -141, 0, -141, -141, -141, -141, -141, - // State 701 - -90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 702 - -186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -186, 0, 0, 0, 0, -186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 703 - -365, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -365, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 704 - -182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -182, 0, 0, 0, 0, -182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 705 - -181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -181, 0, 0, 0, 0, -181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 706 - -459, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -459, 0, 0, 0, 0, -459, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 707 - -774, 0, 0, 0, 0, 0, 0, -774, 0, -774, 0, 0, 0, -774, 0, 0, -774, 0, 0, 0, -774, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -774, 0, -774, -774, -774, -774, 0, 0, 0, 0, 0, -774, -774, -774, -774, 0, -774, -774, -774, -774, 0, 0, 0, 0, -774, -774, -774, -774, -774, 0, 0, -774, -774, -774, -774, 0, -774, -774, -774, -774, -774, -774, -774, -774, -774, 0, 0, 0, -774, 0, 0, 0, 0, 0, -774, -774, 0, -774, -774, -774, -774, -774, - // State 708 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -326, 0, 0, 0, -326, 0, -326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 709 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 710 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 711 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 712 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 216, 0, 0, 0, 0, 0, 0, 217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 713 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -455, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 714 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -453, -453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -453, 0, - // State 715 - -340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -340, 0, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, -340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 716 - 799, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 717 - 802, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 718 - 805, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 806, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 719 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 720 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 721 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -560, 0, 0, 0, 0, 0, 0, 0, 0, 0, -562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -560, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -560, 0, 0, 0, 0, 0, 0, 0, 532, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 722 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -164, 0, 0, 0, 0, 0, 0, 0, 0, 0, -166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533, -164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -164, 0, 0, 0, 0, 0, 0, 0, -164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 723 - 0, 0, -246, -246, 0, -246, 0, -246, 0, -246, -246, 0, 0, -246, 0, -246, -246, 0, 0, -246, 0, -246, -246, 0, 0, -250, 0, 0, -246, -246, 0, -246, 0, -246, -246, -246, -246, 0, 0, -246, 0, 0, 0, 0, -246, 0, -246, 0, -246, -246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -246, 0, -246, -246, 0, 0, 0, -246, -246, 0, 0, 0, 0, 0, 0, 0, 0, 0, -246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 724 - 0, 0, -392, -392, 0, -392, 0, 0, 0, -392, 0, 0, 0, -392, 0, -392, -392, 0, 0, 0, 0, -392, -392, 0, 0, -394, 0, 0, -392, -392, 0, -392, 0, -392, -392, -392, -392, 0, 0, -392, 0, 0, 0, 0, 0, 0, -392, 0, -392, -392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -392, 0, -392, -392, 0, 0, 0, -392, -392, 0, 0, 0, 0, 0, 0, 0, 0, 0, -392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 725 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, -940, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 726 - 0, 0, 0, 0, 0, 0, 0, 0, 826, 0, 0, 0, 0, 0, 0, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 727 - 0, 0, 0, 0, 0, 0, 0, 0, -550, 0, 0, 0, 0, 0, 0, -550, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 728 - 0, 0, 0, 0, 0, 0, 0, 0, 829, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 729 - 0, 0, -205, -205, 0, -205, 0, -205, 0, -205, -205, 0, 0, -205, 0, -205, -205, 0, 0, -205, 0, -205, -205, 0, 0, -232, 0, 0, -205, -205, 0, -205, 0, -205, -205, -205, -205, 0, 0, -205, 0, 0, 0, 0, -205, 0, -205, 0, -205, -205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -205, 0, -205, -205, 0, 0, 0, -205, -205, 0, 0, 0, 0, 0, 0, 0, 0, 0, -205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 730 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 831, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 731 - 0, 0, -193, -193, 0, -193, 0, -193, 0, -193, -193, 0, 0, -193, 0, -193, -193, 0, 0, -193, 0, -193, -193, 0, 0, -222, 0, 0, -193, -193, 0, -193, 0, -193, -193, -193, -193, 0, 0, -193, 0, 0, 0, 0, -193, 0, -193, 0, -193, -193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -193, 0, -193, -193, 0, 0, 0, -193, -193, 0, 0, 0, 0, 0, 0, 0, 0, 0, -193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 732 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -516, 0, 0, 0, 0, 0, 0, 0, 0, 0, -518, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -516, -516, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -516, 0, 0, 0, 0, 0, 0, 0, -516, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 733 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 834, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 734 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 836, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 735 - 0, 0, -210, -210, 0, -210, 0, -210, 0, -210, -210, 0, 0, -210, 0, -210, -210, 0, 0, -210, 0, -210, -210, 0, 0, -237, 0, 0, -210, -210, 0, -210, 0, -210, -210, -210, -210, 0, 0, -210, 0, 0, 0, 0, -210, 0, -210, 0, -210, -210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -210, 0, -210, -210, 0, 0, 0, -210, -210, 0, 0, 0, 0, 0, 0, 0, 0, 0, -210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 736 - -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, 0, -170, 0, -170, -170, -170, -170, -170, 0, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, 0, 0, 0, -170, -170, -170, -170, -170, -170, 0, -170, 0, 0, 0, 0, 0, 0, 0, 0, -170, 0, 0, -170, -170, 0, -170, 0, -170, -170, 0, 0, 0, -170, -170, 0, 0, 0, 0, 0, 0, 0, 0, 0, -170, -170, -170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 737 - 0, 0, 0, 0, 0, 0, 0, -125, -125, -125, -125, 0, 0, -125, 0, 0, -125, 0, 0, 0, -125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -125, -125, -125, -125, 0, 0, 0, 0, 0, 0, 0, -125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -125, 0, 0, -125, 0, 0, 0, 0, 0, 0, 0, 0, 0, -125, 0, 0, 0, -125, 0, 0, 0, 0, 0, -125, -125, 0, -125, -125, 0, -125, -125, - // State 738 - 0, 0, 0, 0, 0, 0, 0, 0, -424, 0, 0, 0, 0, 0, 0, -424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 739 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 740 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -842, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -842, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 741 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 742 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -843, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -843, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 743 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -805, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -805, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 744 - -862, -862, 0, 0, -862, 0, -862, 0, -862, 0, 0, -862, -862, 0, -862, -862, 0, -862, 0, 0, 0, 0, 0, -862, -862, -862, 0, -862, 0, 0, -862, 0, -862, 0, 0, 0, 0, -862, 0, 0, -862, 0, 0, 0, 0, -862, 0, -862, 0, -862, 0, -862, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -862, -862, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -862, -862, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 745 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 746 - 0, 0, 0, 0, 0, 0, 0, 0, -70, 0, 0, 0, 0, 0, 0, -70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 747 - -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, 0, -200, 0, -200, -200, -200, -200, -200, 0, -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, 0, 0, 0, -200, -200, -200, -200, -200, -200, 0, -200, 0, 0, 0, 0, 0, 0, 0, 0, -200, 0, 0, -200, -200, 0, -200, 0, -200, -200, 0, 0, 0, -200, -200, 0, 0, 0, 0, 0, 0, 0, 0, 0, -200, -200, -200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 748 - 0, 0, 0, 0, 0, 0, 0, 0, 838, 0, 0, 0, 0, 0, 0, 238, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 749 - -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, 0, -201, 0, -201, -201, -201, -201, -201, 0, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, 0, 0, 0, -201, -201, -201, -201, -201, -201, 0, -201, 0, 0, 0, 0, 0, 0, 0, 0, -201, 0, 0, -201, -201, 0, -201, 0, -201, -201, 0, 0, 0, -201, -201, 0, 0, 0, 0, 0, 0, 0, 0, 0, -201, -201, -201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 750 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -676, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 751 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, -691, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 752 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, -703, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 753 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 0, 0, 0, 0, 0, 0, -711, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 754 - -462, -462, 0, 0, -462, 0, -462, 0, -462, 0, 0, -462, -462, 0, -462, -462, 0, -462, 0, 0, 0, 0, 0, -462, -462, -462, 0, -462, 0, 0, -462, 0, -462, 0, 0, 0, 0, -462, 0, 0, -462, 0, 0, 0, 0, -462, 0, -462, 0, -462, 0, -462, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -462, -462, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -462, -462, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 755 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 843, 0, 0, 0, 0, 0, 0, 0, 0, 0, -722, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 756 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 757 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 758 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 844, 0, 0, 0, 0, 0, 0, 0, 0, 0, -726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 759 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -716, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 760 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 845, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 761 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -389, 0, 0, -389, 0, 0, -389, 0, 0, 0, 0, 0, -389, 0, 0, 0, 0, 0, - // State 762 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -390, 0, 0, -390, 0, 0, -390, 0, 0, 0, 0, 0, -390, 0, 0, 0, 0, 0, - // State 763 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -368, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -368, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 764 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 765 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 848, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 766 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -387, 0, 0, -387, 0, 0, -387, 0, 0, 0, 0, 0, -387, 0, 0, 0, 0, 0, - // State 767 - -775, 0, 0, 0, 0, 0, 0, -775, 0, -775, 0, 0, 0, -775, 0, 0, -775, 0, 0, 0, -775, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -775, 0, -775, -775, -775, -775, 0, 0, 0, 0, 0, -775, -775, -775, -775, 0, -775, -775, -775, -775, 0, 0, 0, 0, -775, -775, -775, -775, -775, 0, 0, -775, -775, -775, -775, 0, -775, -775, -775, -775, -775, -775, -775, -775, -775, 0, 0, 0, -775, 0, 0, 0, 0, 0, -775, -775, 0, -775, -775, -775, -775, -775, - // State 768 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 769 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 0, 0, 0, 0, 0, 0, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 770 - -366, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -366, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 771 - -179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 772 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 249, 0, 0, 0, 0, 0, 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 773 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 774 - -276, 0, 0, 0, 0, 0, 0, -276, 0, -276, 0, 0, 0, -276, 0, 0, -276, 0, 0, 0, -276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -276, 0, -276, -276, -276, -276, 0, 0, 0, 0, 0, -276, -276, -276, -276, 0, -276, -276, -276, -276, 0, 0, 0, 0, -276, -276, -276, -276, -276, 0, 0, -276, -276, -276, -276, 0, -276, -276, -276, -276, -276, -276, -276, -276, -276, 0, 0, 0, -276, -276, 0, 0, 0, 0, -276, -276, 0, -276, -276, -276, -276, -276, - // State 775 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -908, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -908, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 776 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 858, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 777 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -556, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -556, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 778 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 779 - 0, 0, 0, 0, 0, 0, 0, 0, -651, 0, 0, 0, 0, 0, 0, 863, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 780 - 0, 0, 0, 0, 0, 0, 0, 0, -916, 0, 0, 0, 0, 0, 0, -916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 256, 0, 0, 0, 0, 0, 0, -916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 781 - 0, 0, 0, 0, 0, 0, 0, 0, -631, 0, 0, 0, 0, 0, 0, 257, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 782 - 0, 0, 0, 0, 0, 0, 0, 0, -544, 0, 0, 0, 0, 0, 0, -544, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 783 - 0, 0, 0, 0, 0, 0, 0, 0, 864, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 784 - 0, 0, 0, 0, 0, 0, 0, 0, -564, 0, 0, 0, 0, 0, 0, -564, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 785 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -751, 0, 0, 0, 0, 0, 0, -751, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 786 - -529, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -529, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -529, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -529, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 787 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 788 - -537, 0, 0, 0, 0, 0, 0, 0, -537, 0, 0, 0, 0, 0, 0, -537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 789 - -458, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -458, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 790 - -444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 263, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 791 - -447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 792 - -80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -80, 0, 0, 0, -80, 0, 0, 0, 0, 0, 0, 0, -80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 793 - -531, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -531, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -531, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 794 - -532, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -532, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -532, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 795 - -535, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -535, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -535, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 265, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 796 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -902, 0, 0, 0, 0, 0, 0, 0, 0, 0, -902, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 797 - 873, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 798 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 799 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -903, 0, 0, 0, 0, 0, 0, 0, 0, 0, -903, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 800 - 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 801 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 802 - -780, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -780, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 803 - 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 804 - -855, 0, 0, 0, 0, 0, 0, -855, 0, -855, 0, 0, 0, -855, 0, 0, -855, 0, 0, 0, -855, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -855, 0, -855, -855, -855, -855, 0, 0, 0, 0, 0, -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, 0, 0, -855, -855, -855, -855, 0, -855, -855, -855, -855, -855, -855, -855, -855, -855, 0, 0, 0, -855, -855, 0, 0, 0, 0, -855, -855, 0, -855, -855, -855, -855, -855, - // State 805 - 877, 0, 0, 0, 0, 0, 0, -140, 0, -140, 0, 0, 0, -140, 0, 0, -140, 0, 0, 0, -140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -140, -140, -140, -140, 0, 0, 0, 0, 0, -140, 0, -140, -140, 0, 0, -140, 0, -140, 0, 0, 0, 0, 0, -140, -140, 0, -140, 0, 0, -140, 0, -140, -140, 0, -140, -140, -140, 0, -140, 0, 0, -140, -140, 0, 0, 0, -140, 0, 0, 0, 0, 0, -140, -140, 0, -140, -140, -140, -140, -140, - // State 806 - -347, 0, 0, 0, 0, 0, 0, -347, 0, -347, 0, 0, 0, -347, 0, 0, -347, 0, 0, 0, -347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -347, 0, -347, -347, -347, -347, 0, 0, 0, 0, 0, -347, -347, -347, -347, 0, -347, -347, -347, -347, 0, -347, -347, -347, -347, -347, -347, -347, -347, 0, 0, -347, -347, -347, -347, 0, -347, -347, -347, -347, -347, -347, -347, -347, -347, 0, 0, 0, -347, -347, 0, 0, 0, 0, -347, -347, 0, -347, -347, -347, -347, -347, - // State 807 - -351, 0, 0, 0, 0, 0, 0, -351, 0, -351, 0, 0, 0, -351, 0, 0, -351, 0, 0, 0, -351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -351, 0, -351, -351, -351, -351, 0, 0, 0, 0, 0, -351, -351, -351, -351, 0, -351, -351, -351, -351, 0, -351, -351, -351, -351, -351, -351, -351, -351, 0, 0, -351, -351, -351, -351, 0, -351, -351, -351, -351, -351, -351, -351, -351, -351, 0, 0, 0, -351, -351, 0, 0, 0, 0, -351, -351, 0, -351, -351, -351, -351, -351, - // State 808 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 271, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 809 - -906, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -906, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 810 - -923, 0, 0, 0, 0, 0, 0, -923, 0, -923, 0, 0, 0, -923, 0, 0, -923, 0, 0, 0, -923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -923, 0, -923, -923, -923, -923, 0, 0, 0, 0, 0, -923, -923, -923, -923, 0, -923, -923, -923, -923, 0, 889, 0, 0, -923, -923, -923, -923, -923, 0, 0, -923, -923, -923, -923, 0, -923, -923, -923, -923, -923, -923, -923, -923, -923, 0, 0, 0, -923, -923, 0, 0, 0, 0, -923, -923, 0, -923, -923, -923, -923, -923, - // State 811 - 0, 0, -248, -248, 0, -248, 0, -248, 0, -248, -248, 0, 0, -248, 0, -248, -248, 0, 0, -248, 0, -248, -248, 0, 0, -252, 0, 0, -248, -248, 0, -248, 0, -248, -248, -248, -248, 0, 0, -248, 0, 0, 0, 0, -248, 0, -248, 0, -248, -248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -248, 0, -248, -248, 0, 0, 0, -248, -248, 0, 0, 0, 0, 0, 0, 0, 0, 0, -248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 812 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 890, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 813 - 0, 0, -768, -768, 0, -768, 0, 0, 0, -768, 0, 0, 0, -768, 0, -768, -768, 0, 0, 0, 0, -768, -768, 0, 0, -770, 0, 0, -768, -768, 0, -768, 0, -768, -768, -768, -768, 0, 0, -768, 0, 0, 0, 0, 0, 0, -768, 0, -768, -768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -768, 0, -768, -768, 0, 0, 0, -768, -768, 0, 0, 0, 0, 0, 0, 0, 0, 0, -768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 814 - 0, 0, -353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -353, 0, 0, 0, 0, 0, 0, 0, 0, 0, -355, 0, 0, -353, 0, 0, -353, 0, -353, -353, -353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, -353, -353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -353, 0, -353, -353, 0, 0, 0, -353, -353, 0, 0, 0, 0, 0, 0, 0, 0, 0, -353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 815 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 816 - 0, 0, -858, -858, 0, -858, 0, 0, 0, -858, 0, 0, 0, -858, 0, -858, -858, 0, 0, 0, 0, -858, -858, 0, 0, -860, 0, 0, -858, -858, 0, -858, 0, -858, -858, -858, -858, 0, 0, -858, 0, 0, 0, 0, 0, 0, -858, 0, -858, -858, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -858, 0, -858, -858, 0, 0, 0, -858, -858, 0, 0, 0, 0, 0, 0, 0, 0, 0, -858, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 817 - 0, 0, 0, 0, 0, 0, 0, 0, -928, 0, 0, 0, 0, 0, 0, -928, 0, 0, 0, 0, 0, 0, 0, 0, 0, -928, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 818 - 0, 0, 0, 0, 0, 0, 0, 0, -74, 0, 0, 0, 0, 0, 0, -74, 0, 0, 0, 0, 0, 0, 0, 0, 0, -74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 819 - 0, 0, 0, 0, 0, 0, 0, 0, -925, 0, 0, 0, 0, 0, 0, -925, 0, 0, 0, 0, 0, 0, 0, 0, 0, -925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 820 - -943, 0, 0, 0, 0, 0, 0, -943, 0, -943, 0, 0, 0, -943, 0, 0, -943, 0, 0, 0, -943, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -943, 0, -943, -943, -943, -943, 0, 0, 0, 0, 0, -943, -943, -943, -943, 0, -943, -943, -943, -943, 0, 0, 0, 0, -943, -943, -943, -943, -943, 0, 0, -943, -943, -943, -943, 0, -943, -943, -943, -943, -943, -943, -943, -943, -943, 0, 0, 0, -943, -943, 0, 0, 0, 0, -943, -943, 0, -943, -943, -943, -943, -943, - // State 821 - 0, 0, -944, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, -944, 0, 0, 0, 0, 0, 0, 0, 0, 0, -946, 0, 0, -944, 0, 0, -944, 0, -944, -944, -944, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -944, 0, -944, -944, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -944, 0, -944, -944, 0, 0, 0, -944, -944, 0, 0, 0, 0, 0, 0, 0, 0, 0, -944, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 822 - 0, 0, 0, 0, 0, 0, 0, 0, 892, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 823 - 0, 0, 0, 0, 0, 0, 0, 0, 893, 0, 0, 0, 0, 0, 0, 275, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 824 - 0, 0, -202, -202, 0, -202, 0, -202, 0, -202, -202, 0, 0, -202, 0, -202, -202, 0, 0, -202, 0, -202, -202, 0, 0, -229, 0, 0, -202, -202, 0, -202, 0, -202, -202, -202, -202, 0, 0, -202, 0, 0, 0, 0, -202, 0, -202, 0, -202, -202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -202, 0, -202, -202, 0, 0, 0, -202, -202, 0, 0, 0, 0, 0, 0, 0, 0, 0, -202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 825 - 0, 0, -196, -196, 0, -196, 0, -196, 0, -196, -196, 0, 0, -196, 0, -196, -196, 0, 0, -196, 0, -196, -196, 0, 0, -930, 0, 0, -196, -196, 0, -196, 0, -196, -196, -196, -196, 0, 0, -196, 0, 0, 0, 0, -196, 0, -196, 0, -196, -196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -196, 0, -196, -196, 0, 0, 0, -196, -196, 0, 0, 0, 0, 0, 0, 0, 0, 0, -196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 826 - 0, 0, 0, 0, 0, 0, 0, 0, 897, 0, 0, 0, 0, 0, 0, 278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 827 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -936, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 828 - 0, 0, -206, -206, 0, -206, 0, -206, 0, -206, -206, 0, 0, -206, 0, -206, -206, 0, 0, -206, 0, -206, -206, 0, 0, -233, 0, 0, -206, -206, 0, -206, 0, -206, -206, -206, -206, 0, 0, -206, 0, 0, 0, 0, -206, 0, -206, 0, -206, -206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -206, 0, -206, -206, 0, 0, 0, -206, -206, 0, 0, 0, 0, 0, 0, 0, 0, 0, -206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 829 - 0, 0, 0, 0, 0, 0, 0, 0, 899, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 830 - 0, 0, -192, -192, 0, -192, 0, -192, 0, -192, -192, 0, 0, -192, 0, -192, -192, 0, 0, -192, 0, -192, -192, 0, 0, -221, 0, 0, -192, -192, 0, -192, 0, -192, -192, -192, -192, 0, 0, -192, 0, 0, 0, 0, -192, 0, -192, 0, -192, -192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -192, 0, -192, -192, 0, 0, 0, -192, -192, 0, 0, 0, 0, 0, 0, 0, 0, 0, -192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 831 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 832 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 833 - 0, 0, -209, -209, 0, -209, 0, -209, 0, -209, -209, 0, 0, -209, 0, -209, -209, 0, 0, -209, 0, -209, -209, 0, 0, -236, 0, 0, -209, -209, 0, -209, 0, -209, -209, -209, -209, 0, 0, -209, 0, 0, 0, 0, -209, 0, -209, 0, -209, -209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -209, 0, -209, -209, 0, 0, 0, -209, -209, 0, 0, 0, 0, 0, 0, 0, 0, 0, -209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 834 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 902, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 835 - 0, 0, -212, -212, 0, -212, 0, -212, 0, -212, -212, 0, 0, -212, 0, -212, -212, 0, 0, -212, 0, -212, -212, 0, 0, -239, 0, 0, -212, -212, 0, -212, 0, -212, -212, -212, -212, 0, 0, -212, 0, 0, 0, 0, -212, 0, -212, 0, -212, -212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -212, 0, -212, -212, 0, 0, 0, -212, -212, 0, 0, 0, 0, 0, 0, 0, 0, 0, -212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 836 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -841, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -841, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 837 - -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, 0, -203, 0, -203, -203, -203, -203, -203, 0, -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, 0, 0, 0, -203, -203, -203, -203, -203, -203, 0, -203, 0, 0, 0, 0, 0, 0, 0, 0, -203, 0, 0, -203, -203, 0, -203, 0, -203, -203, 0, 0, 0, -203, -203, 0, 0, 0, 0, 0, 0, 0, 0, 0, -203, -203, -203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 838 - -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, 0, -197, 0, -197, -197, -197, -197, -197, 0, -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, 0, 0, 0, -197, -197, -197, -197, -197, -197, 0, -197, 0, 0, 0, 0, 0, 0, 0, 0, -197, 0, 0, -197, -197, 0, -197, 0, -197, -197, 0, 0, 0, -197, -197, 0, 0, 0, 0, 0, 0, 0, 0, 0, -197, -197, -197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 839 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 906, 0, 0, 0, 0, 0, 0, 0, 0, 0, -682, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 840 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 908, 0, 0, 0, 0, 0, 0, 0, 0, 0, -694, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 841 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, -707, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 842 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -713, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 843 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -717, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 844 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -388, 0, 0, -388, 0, 0, -388, 0, 0, 0, 0, 0, -388, 0, 0, 0, 0, 0, - // State 845 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 846 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -385, 0, 0, -385, 0, 0, -385, 0, 0, 0, 0, 0, -385, 0, 0, 0, 0, 0, - // State 847 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -386, 0, 0, -386, 0, 0, -386, 0, 0, 0, 0, 0, -386, 0, 0, 0, 0, 0, - // State 848 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 286, 0, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 849 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 288, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 850 - -278, 0, 0, 0, 0, 0, 0, -278, 0, -278, 0, 0, 0, -278, 0, 0, -278, 0, 0, 0, -278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -278, 0, -278, -278, -278, -278, 0, 0, 0, 0, 0, -278, -278, -278, -278, 0, -278, -278, -278, -278, 0, 0, 0, 0, -278, -278, -278, -278, -278, 0, 0, -278, -278, -278, -278, 0, -278, -278, -278, -278, -278, -278, -278, -278, -278, 0, 0, 0, -278, -278, 0, 0, 0, 0, -278, -278, 0, -278, -278, -278, -278, -278, - // State 851 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 289, 0, 0, 0, 0, 0, 0, 290, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 852 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 291, 0, 0, 0, 0, 0, 0, 292, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 853 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 293, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 854 - -942, 0, 0, 0, 0, 0, 0, -942, 0, -942, 0, 0, 0, -942, 0, 0, -942, 0, 0, 0, -942, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -942, 0, -942, -942, -942, -942, 0, 0, 0, 0, 0, -942, -942, -942, -942, 0, -942, -942, -942, -942, 0, 0, 0, 0, -942, -942, -942, -942, -942, 0, 0, -942, -942, -942, -942, 0, -942, -942, -942, -942, -942, -942, -942, -942, -942, 0, 0, 0, -942, -942, 0, 0, 0, 0, -942, -942, 0, -942, -942, -942, -942, -942, - // State 855 - -272, 0, 0, 0, 0, 0, 0, -272, 0, -272, 0, 0, 0, -272, 0, 0, -272, 0, 0, 0, -272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -272, 0, -272, -272, -272, -272, 0, 0, 0, 0, 0, -272, -272, -272, -272, 0, -272, -272, -272, -272, 0, 0, 0, 0, -272, -272, -272, -272, -272, 0, 0, -272, -272, -272, -272, 0, -272, -272, -272, -272, -272, -272, -272, -272, -272, 0, 0, 0, -272, -272, 0, 0, 0, 0, -272, -272, 0, -272, -272, -272, -272, -272, - // State 856 - -275, 0, 0, 0, 0, 0, 0, -275, 0, -275, 0, 0, 0, -275, 0, 0, -275, 0, 0, 0, -275, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -275, 0, -275, -275, -275, -275, 0, 0, 0, 0, 0, -275, -275, -275, -275, 0, -275, -275, -275, -275, 0, 0, 0, 0, -275, -275, -275, -275, -275, 0, 0, -275, -275, -275, -275, 0, -275, -275, -275, -275, -275, -275, -275, -275, -275, 0, 0, 0, -275, -275, 0, 0, 0, 0, -275, -275, 0, -275, -275, -275, -275, -275, - // State 857 - 0, 0, 0, 0, 0, 0, 0, -912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -912, 0, 0, 0, 0, 0, 0, -912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 858 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -909, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -909, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 859 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 860 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 294, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 861 - -419, 0, 0, 0, 0, 0, 0, -419, 0, -419, 0, 0, 0, -419, 0, 0, -419, 0, 0, 0, -419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -419, 0, -419, -419, -419, -419, 0, 0, 0, 0, 0, -419, -419, -419, -419, 0, -419, -419, -419, -419, 0, 0, 0, 0, -419, -419, -419, -419, -419, 0, 0, -419, -419, -419, -419, 0, -419, -419, -419, -419, -419, -419, -419, -419, -419, 0, 0, 0, -419, -419, 0, 0, 0, 0, -419, -419, 0, -419, -419, -419, -419, -419, - // State 862 - 0, 0, 0, 0, 0, 0, 0, 0, -642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 863 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -750, 0, 0, 0, 0, 0, 0, -750, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 864 - 0, 0, 0, 0, 0, 0, 0, 0, -646, 0, 0, 0, 0, 0, 0, 298, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 865 - 0, 0, 0, 0, 0, 0, 0, 0, -650, 0, 0, 0, 0, 0, 0, 299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 866 - 0, 0, 0, 0, 0, 0, 0, 0, -823, 0, 0, 0, 0, 0, 0, -823, 0, 0, 0, 0, 0, 0, 0, 0, 0, 300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 867 - 0, 0, 0, 0, 0, 0, 0, 0, -342, 0, 0, 0, 0, 0, 0, -342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 868 - 0, 0, 0, 0, 0, 0, 0, 0, 937, 0, 0, 0, 0, 0, 0, 302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 869 - -81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -81, 0, 0, 0, -81, 0, 0, 0, 0, 0, 0, 0, -81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 870 - -439, 0, 0, 0, 0, 0, 0, -439, 0, -439, 0, 0, 0, -439, 0, 0, -439, 0, 0, 0, -439, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -439, 0, -439, -439, -439, -439, 0, 0, 0, 0, 0, -439, -439, -439, -439, 0, -439, -439, -439, -439, 303, 938, 0, 0, -439, -439, -439, -439, -439, 0, 0, -439, -439, -439, -439, 0, -439, -439, -439, -439, -439, -439, -439, -439, -439, 0, 0, 0, -439, -439, 0, 0, 0, 0, -439, -439, 0, -439, -439, -439, -439, -439, - // State 871 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 304, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 872 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 873 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 874 - -856, 0, 0, 0, 0, 0, 0, -856, 0, -856, 0, 0, 0, -856, 0, 0, -856, 0, 0, 0, -856, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -856, 0, -856, -856, -856, -856, 0, 0, 0, 0, 0, -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, 0, 0, -856, -856, -856, -856, 0, -856, -856, -856, -856, -856, -856, -856, -856, -856, 0, 0, 0, -856, -856, 0, 0, 0, 0, -856, -856, 0, -856, -856, -856, -856, -856, - // State 875 - 942, 0, 0, 0, 0, 0, 0, -141, 0, -141, 0, 0, 0, -141, 0, 0, -141, 0, 0, 0, -141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -141, -141, -141, -141, 0, 0, 0, 0, 0, -141, 0, -141, -141, 0, 0, -141, 0, -141, 0, 0, 0, 0, 0, -141, -141, 0, -141, 0, 0, -141, 0, -141, -141, 0, -141, -141, -141, 0, -141, 0, 0, -141, -141, 0, 0, 0, -141, 0, 0, 0, 0, 0, -141, -141, 0, -141, -141, -141, -141, -141, - // State 876 - -853, 0, 0, 0, 0, 0, 0, -853, 0, -853, 0, 0, 0, -853, 0, 0, -853, 0, 0, 0, -853, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -853, 0, -853, -853, -853, -853, 0, 0, 0, 0, 0, -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, 0, 0, -853, -853, -853, -853, 0, -853, -853, -853, -853, -853, -853, -853, -853, -853, 0, 0, 0, -853, -853, 0, 0, 0, 0, -853, -853, 0, -853, -853, -853, -853, -853, - // State 877 - -348, 0, 0, 0, 0, 0, 0, -348, 0, -348, 0, 0, 0, -348, 0, 0, -348, 0, 0, 0, -348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -348, 0, -348, -348, -348, -348, 0, 0, 0, 0, 0, -348, -348, -348, -348, 0, -348, -348, -348, -348, 0, -348, -348, -348, -348, -348, -348, -348, -348, 0, 0, -348, -348, -348, -348, 0, -348, -348, -348, -348, -348, -348, -348, -348, -348, 0, 0, 0, -348, -348, 0, 0, 0, 0, -348, -348, 0, -348, -348, -348, -348, -348, - // State 878 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 879 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 311, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 880 - -352, 0, 0, 0, 0, 0, 0, -352, 0, -352, 0, 0, 0, -352, 0, 0, -352, 0, 0, 0, -352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -352, 0, -352, -352, -352, -352, 0, 0, 0, 0, 0, -352, -352, -352, -352, 0, -352, -352, -352, -352, 0, -352, -352, -352, -352, -352, -352, -352, -352, 0, 0, -352, -352, -352, -352, 0, -352, -352, -352, -352, -352, -352, -352, -352, -352, 0, 0, 0, -352, -352, 0, 0, 0, 0, -352, -352, 0, -352, -352, -352, -352, -352, - // State 881 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 882 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 883 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 313, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 884 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 885 - 0, 0, 0, 0, 0, 0, 0, -829, 0, -829, 0, 0, 0, -829, 0, 0, -829, 0, 0, 0, -829, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -829, 0, -829, -829, -829, -829, 0, 0, 0, 0, 0, -829, -829, -829, -829, 0, -829, -829, -829, -829, 0, 0, 0, 0, -829, -829, -829, -829, -829, 0, 0, -829, -829, -829, -829, 0, -829, -829, -829, -829, -829, -829, -829, -829, -829, 0, 0, 0, -829, -829, 0, 0, 0, 0, -829, -829, 0, -829, -829, -829, -829, -829, - // State 886 - 947, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 948, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 887 - -905, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -905, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 888 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 317, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 889 - 0, 0, -247, -247, 0, -247, 0, -247, 0, -247, -247, 0, 0, -247, 0, -247, -247, 0, 0, -247, 0, -247, -247, 0, 0, -251, 0, 0, -247, -247, 0, -247, 0, -247, -247, -247, -247, 0, 0, -247, 0, 0, 0, 0, -247, 0, -247, 0, -247, -247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -247, 0, -247, -247, 0, 0, 0, -247, -247, 0, 0, 0, 0, 0, 0, 0, 0, 0, -247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 890 - 0, 0, 0, 0, 0, 0, 0, 0, -75, 0, 0, 0, 0, 0, 0, -75, 0, 0, 0, 0, 0, 0, 0, 0, 0, -75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 891 - 0, 0, -207, -207, 0, -207, 0, -207, 0, -207, -207, 0, 0, -207, 0, -207, -207, 0, 0, -207, 0, -207, -207, 0, 0, -234, 0, 0, -207, -207, 0, -207, 0, -207, -207, -207, -207, 0, 0, -207, 0, 0, 0, 0, -207, 0, -207, 0, -207, -207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -207, 0, -207, -207, 0, 0, 0, -207, -207, 0, 0, 0, 0, 0, 0, 0, 0, 0, -207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 892 - 0, 0, -204, -204, 0, -204, 0, -204, 0, -204, -204, 0, 0, -204, 0, -204, -204, 0, 0, -204, 0, -204, -204, 0, 0, -231, 0, 0, -204, -204, 0, -204, 0, -204, -204, -204, -204, 0, 0, -204, 0, 0, 0, 0, -204, 0, -204, 0, -204, -204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -204, 0, -204, -204, 0, 0, 0, -204, -204, 0, 0, 0, 0, 0, 0, 0, 0, 0, -204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 893 - 0, 0, -198, -198, 0, -198, 0, -198, 0, -198, -198, 0, 0, -198, 0, -198, -198, 0, 0, -198, 0, -198, -198, 0, 0, -225, 0, 0, -198, -198, 0, -198, 0, -198, -198, -198, -198, 0, 0, -198, 0, 0, 0, 0, -198, 0, -198, 0, -198, -198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -198, 0, -198, -198, 0, 0, 0, -198, -198, 0, 0, 0, 0, 0, 0, 0, 0, 0, -198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 894 - 0, 0, 0, 0, 0, 0, 0, 0, -551, 0, 0, 0, 0, 0, 0, -551, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 895 - 0, 0, -195, -195, 0, -195, 0, -195, 0, -195, -195, 0, 0, -195, 0, -195, -195, 0, 0, -195, 0, -195, -195, 0, 0, -929, 0, 0, -195, -195, 0, -195, 0, -195, -195, -195, -195, 0, 0, -195, 0, 0, 0, 0, -195, 0, -195, 0, -195, -195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -195, 0, -195, -195, 0, 0, 0, -195, -195, 0, 0, 0, 0, 0, 0, 0, 0, 0, -195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 896 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -938, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 897 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -932, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 898 - 0, 0, -208, -208, 0, -208, 0, -208, 0, -208, -208, 0, 0, -208, 0, -208, -208, 0, 0, -208, 0, -208, -208, 0, 0, -235, 0, 0, -208, -208, 0, -208, 0, -208, -208, -208, -208, 0, 0, -208, 0, 0, 0, 0, -208, 0, -208, 0, -208, -208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -208, 0, -208, -208, 0, 0, 0, -208, -208, 0, 0, 0, 0, 0, 0, 0, 0, 0, -208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 899 - 0, 0, -194, -194, 0, -194, 0, -194, 0, -194, -194, 0, 0, -194, 0, -194, -194, 0, 0, -194, 0, -194, -194, 0, 0, -223, 0, 0, -194, -194, 0, -194, 0, -194, -194, -194, -194, 0, 0, -194, 0, 0, 0, 0, -194, 0, -194, 0, -194, -194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -194, 0, -194, -194, 0, 0, 0, -194, -194, 0, 0, 0, 0, 0, 0, 0, 0, 0, -194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 900 - 0, 0, -211, -211, 0, -211, 0, -211, 0, -211, -211, 0, 0, -211, 0, -211, -211, 0, 0, -211, 0, -211, -211, 0, 0, -238, 0, 0, -211, -211, 0, -211, 0, -211, -211, -211, -211, 0, 0, -211, 0, 0, 0, 0, -211, 0, -211, 0, -211, -211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -211, 0, -211, -211, 0, 0, 0, -211, -211, 0, 0, 0, 0, 0, 0, 0, 0, 0, -211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 901 - 0, 0, -213, -213, 0, -213, 0, -213, 0, -213, -213, 0, 0, -213, 0, -213, -213, 0, 0, -213, 0, -213, -213, 0, 0, -240, 0, 0, -213, -213, 0, -213, 0, -213, -213, -213, -213, 0, 0, -213, 0, 0, 0, 0, -213, 0, -213, 0, -213, -213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -213, 0, -213, -213, 0, 0, 0, -213, -213, 0, 0, 0, 0, 0, 0, 0, 0, 0, -213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 902 - 0, 0, 0, 0, 0, 0, 0, 0, -324, 0, 0, 0, 0, 0, 0, -324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -324, 0, 0, 0, 0, 0, -324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -324, 0, 0, -324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 903 - -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, 0, -199, 0, -199, -199, -199, -199, -199, 0, -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, 0, 0, 0, -199, -199, -199, -199, -199, -199, 0, -199, 0, 0, 0, 0, 0, 0, 0, 0, -199, 0, 0, -199, -199, 0, -199, 0, -199, -199, 0, 0, 0, -199, -199, 0, 0, 0, 0, 0, 0, 0, 0, 0, -199, -199, -199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 904 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 962, 0, 0, 0, 0, 0, 0, 0, 0, 0, -685, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 905 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 906 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 963, 0, 0, 0, 0, 0, 0, 0, 0, 0, -697, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 907 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -664, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 908 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 964, 0, 0, 0, 0, 0, 0, 0, 0, 0, -708, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 909 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 910 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 323, 0, 0, 0, 0, 0, 0, 0, 0, 0, -692, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 911 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, -704, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 912 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -384, 0, 0, -384, 0, 0, -384, 0, 0, 0, 0, 0, -384, 0, 0, 0, 0, 0, - // State 913 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 325, 0, 0, 0, 0, 0, 0, 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 914 - -274, 0, 0, 0, 0, 0, 0, -274, 0, -274, 0, 0, 0, -274, 0, 0, -274, 0, 0, 0, -274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -274, 0, -274, -274, -274, -274, 0, 0, 0, 0, 0, -274, -274, -274, -274, 0, -274, -274, -274, -274, 0, 0, 0, 0, -274, -274, -274, -274, -274, 0, 0, -274, -274, -274, -274, 0, -274, -274, -274, -274, -274, -274, -274, -274, -274, 0, 0, 0, -274, -274, 0, 0, 0, 0, -274, -274, 0, -274, -274, -274, -274, -274, - // State 915 - -277, 0, 0, 0, 0, 0, 0, -277, 0, -277, 0, 0, 0, -277, 0, 0, -277, 0, 0, 0, -277, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -277, 0, -277, -277, -277, -277, 0, 0, 0, 0, 0, -277, -277, -277, -277, 0, -277, -277, -277, -277, 0, 0, 0, 0, -277, -277, -277, -277, -277, 0, 0, -277, -277, -277, -277, 0, -277, -277, -277, -277, -277, -277, -277, -277, -277, 0, 0, 0, -277, -277, 0, 0, 0, 0, -277, -277, 0, -277, -277, -277, -277, -277, - // State 916 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 917 - -421, 0, 0, 0, 0, 0, 0, -421, 0, -421, 0, 0, 0, -421, 0, 0, -421, 0, 0, 0, -421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -421, 0, -421, -421, -421, -421, 0, 0, 0, 0, 0, -421, -421, -421, -421, 0, -421, -421, -421, -421, 0, 0, 0, 0, -421, -421, -421, -421, -421, 0, 0, -421, -421, -421, -421, 0, -421, -421, -421, -421, -421, -421, -421, -421, -421, 0, 0, 0, -421, -421, 0, 0, 0, 0, -421, -421, 0, -421, -421, -421, -421, -421, - // State 918 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 919 - -411, 0, 0, 0, 0, 0, 0, -411, 0, -411, 0, 0, 0, -411, 0, 0, -411, 0, 0, 0, -411, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -411, 0, -411, -411, -411, -411, 0, 0, 0, 0, 0, -411, -411, -411, -411, 0, -411, -411, -411, -411, 0, 0, 0, 0, -411, -411, -411, -411, -411, 0, 0, -411, -411, -411, -411, 0, -411, -411, -411, -411, -411, -411, -411, -411, -411, 0, 0, 0, -411, -411, 0, 0, 0, 0, -411, -411, 0, -411, -411, -411, -411, -411, - // State 920 - -271, 0, 0, 0, 0, 0, 0, -271, 0, -271, 0, 0, 0, -271, 0, 0, -271, 0, 0, 0, -271, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -271, 0, -271, -271, -271, -271, 0, 0, 0, 0, 0, -271, -271, -271, -271, 0, -271, -271, -271, -271, 0, 0, 0, 0, -271, -271, -271, -271, -271, 0, 0, -271, -271, -271, -271, 0, -271, -271, -271, -271, -271, -271, -271, -271, -271, 0, 0, 0, -271, -271, 0, 0, 0, 0, -271, -271, 0, -271, -271, -271, -271, -271, - // State 921 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -907, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -907, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 922 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 923 - 0, 0, 0, 0, 0, 0, 0, -911, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -911, 0, 0, 0, 0, 0, 0, -911, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 924 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 925 - -418, 0, 0, 0, 0, 0, 0, -418, 0, -418, 0, 0, 0, -418, 0, 0, -418, 0, 0, 0, -418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -418, 0, -418, -418, -418, -418, 0, 0, 0, 0, 0, -418, -418, -418, -418, 0, -418, -418, -418, -418, 0, 0, 0, 0, -418, -418, -418, -418, -418, 0, 0, -418, -418, -418, -418, 0, -418, -418, -418, -418, -418, -418, -418, -418, -418, 0, 0, 0, -418, -418, 0, 0, 0, 0, -418, -418, 0, -418, -418, -418, -418, -418, - // State 926 - 0, 0, 0, 0, 0, 0, 0, 0, -915, 0, 0, 0, 0, 0, 0, -915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 927 - 0, 0, 0, 0, 0, 0, 0, 0, -628, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 928 - 0, 0, 0, 0, 0, 0, 0, 0, -545, 0, 0, 0, 0, 0, 0, -545, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 929 - 0, 0, 0, 0, 0, 0, 0, 0, -643, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 930 - 0, 0, 0, 0, 0, 0, 0, 0, -18, 0, 0, 0, 0, 0, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 931 - 0, 0, 0, 0, 0, 0, 0, 0, -565, 0, 0, 0, 0, 0, 0, -565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 932 - 0, 0, 0, 0, 0, 0, 0, 0, -647, 0, 0, 0, 0, 0, 0, 987, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 933 - -405, 0, 0, 0, 0, 0, 0, -405, 0, -405, 0, 0, 0, -405, 0, 0, -405, 0, 0, 0, -405, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -405, 0, -405, -405, -405, -405, 0, 0, 0, 0, 0, -405, -405, -405, -405, 0, -405, -405, -405, -405, 0, 989, 0, 0, -405, -405, -405, -405, -405, 0, 0, -405, -405, -405, -405, 0, -405, -405, -405, -405, -405, -405, -405, -405, -405, 0, 0, 0, -405, -405, 0, 0, 0, 0, -405, -405, 0, -405, -405, -405, -405, -405, - // State 934 - -536, 0, 0, 0, 0, 0, 0, 0, -536, 0, 0, 0, 0, 0, 0, -536, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -536, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 935 - -539, 0, 0, 0, 0, 0, 0, 0, -539, 0, 0, 0, 0, 0, 0, -539, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -539, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 936 - -446, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -446, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 937 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 938 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 939 - -534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 940 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -493, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -493, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 941 - -854, 0, 0, 0, 0, 0, 0, -854, 0, -854, 0, 0, 0, -854, 0, 0, -854, 0, 0, 0, -854, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -854, 0, -854, -854, -854, -854, 0, 0, 0, 0, 0, -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, 0, 0, -854, -854, -854, -854, 0, -854, -854, -854, -854, -854, -854, -854, -854, -854, 0, 0, 0, -854, -854, 0, 0, 0, 0, -854, -854, 0, -854, -854, -854, -854, -854, - // State 942 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 943 - -345, 0, 0, 0, 0, 0, 0, -345, 0, -345, 0, 0, 0, -345, 0, 0, -345, 0, 0, 0, -345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -345, 0, -345, -345, -345, -345, 0, 0, 0, 0, 0, -345, -345, -345, -345, 0, -345, -345, -345, -345, 0, -345, -345, -345, -345, -345, -345, -345, -345, 0, 0, -345, -345, -345, -345, 0, -345, -345, -345, -345, -345, -345, -345, -345, -345, 0, 0, 0, -345, -345, 0, 0, 0, 0, -345, -345, 0, -345, -345, -345, -345, -345, - // State 944 - -891, 0, 0, 0, 0, 0, 0, -891, 0, -891, 0, 0, 0, -891, 0, 0, -891, 0, 0, 0, -891, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -891, 0, -891, -891, -891, -891, 0, 0, 0, 0, 0, -891, -891, -891, -891, 0, -891, -891, -891, -891, 0, 0, 0, 0, -891, -891, -891, -891, -891, 0, 0, -891, -891, -891, -891, 0, -891, -891, -891, -891, -891, -891, -891, -891, -891, 0, 0, 0, -891, -891, 0, 0, 0, 0, -891, -891, 0, -891, -891, -891, -891, -891, - // State 945 - 1022, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1023, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 946 - 0, 0, 0, 0, 0, 0, 0, -827, 0, -827, 0, 0, 0, -827, 0, 0, -827, 0, 0, 0, -827, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -827, 0, -827, -827, -827, -827, 0, 0, 0, 0, 0, -827, -827, -827, -827, 0, -827, -827, -827, -827, 0, 0, 0, 0, -827, -827, -827, -827, -827, 0, 0, -827, -827, -827, -827, 0, -827, -827, -827, -827, -827, -827, -827, -827, -827, 0, 0, 0, -827, -827, 0, 0, 0, 0, -827, -827, 0, -827, -827, -827, -827, -827, - // State 947 - 1024, 0, 0, 0, 0, 0, 0, -140, 0, -140, 0, 0, 0, -140, 0, 0, -140, 0, 0, 0, -140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -140, -140, -140, -140, 0, 0, 0, 0, 0, -140, 0, -140, -140, 0, 0, -140, 0, -140, 0, 0, 0, 0, 0, -140, -140, 0, -140, 0, 0, -140, 0, -140, -140, 0, -140, -140, -140, 0, -140, 0, 0, -140, -140, 0, 0, 0, -140, 0, 0, 0, 0, 0, -140, -140, 0, -140, -140, -140, -140, -140, - // State 948 - 0, 0, 0, 0, 0, 0, 0, -830, 0, -830, 0, 0, 0, -830, 0, 0, -830, 0, 0, 0, -830, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -830, 0, -830, -830, -830, -830, 0, 0, 0, 0, 0, -830, -830, -830, -830, 0, -830, -830, -830, -830, 0, 0, 0, 0, -830, -830, -830, -830, -830, 0, 0, -830, -830, -830, -830, 0, -830, -830, -830, -830, -830, -830, -830, -830, -830, 0, 0, 0, -830, -830, 0, 0, 0, 0, -830, -830, 0, -830, -830, -830, -830, -830, - // State 949 - 1026, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1027, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 950 - -857, 0, 0, 0, 0, 0, 0, -857, 0, -857, 0, 0, 0, -857, 0, 0, -857, 0, 0, 0, -857, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -857, 0, -857, -857, -857, -857, 0, 0, 0, 0, 0, -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, 0, 0, -857, -857, -857, -857, 0, -857, -857, -857, -857, -857, -857, -857, -857, -857, 0, 0, 0, -857, -857, 0, 0, 0, 0, -857, -857, 0, -857, -857, -857, -857, -857, - // State 951 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -862, 0, 0, 0, 0, 0, 0, 0, 0, 0, -867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -862, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 952 - 0, 0, -200, -200, 0, -200, 0, -200, 0, -200, -200, 0, 0, -200, 0, -200, -200, 0, 0, -200, 0, -200, -200, 0, 0, -227, 0, 0, -200, -200, 0, -200, 0, -200, -200, -200, -200, 0, 0, -200, 0, 0, 0, 0, -200, 0, -200, 0, -200, -200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -200, 0, -200, -200, 0, 0, 0, -200, -200, 0, 0, 0, 0, 0, 0, 0, 0, 0, -200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 953 - 0, 0, 0, 0, 0, 0, 0, 0, 1029, 0, 0, 0, 0, 0, 0, 351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 954 - 0, 0, -201, -201, 0, -201, 0, -201, 0, -201, -201, 0, 0, -201, 0, -201, -201, 0, 0, -201, 0, -201, -201, 0, 0, -228, 0, 0, -201, -201, 0, -201, 0, -201, -201, -201, -201, 0, 0, -201, 0, 0, 0, 0, -201, 0, -201, 0, -201, -201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -201, 0, -201, -201, 0, 0, 0, -201, -201, 0, 0, 0, 0, 0, 0, 0, 0, 0, -201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 955 - 0, 0, 0, 0, 0, 0, 0, 0, 1031, 0, 0, 0, 0, 0, 0, 352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 956 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -935, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 957 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -934, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 958 - 0, 0, 0, 0, 0, 0, 0, 0, -325, 0, 0, 0, 0, 0, 0, -325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -325, 0, 0, 0, 0, 0, -325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -325, 0, 0, -325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 959 - 0, 0, 0, 0, 0, 0, 0, 0, -321, 0, 0, 0, 0, 0, 0, -321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -321, 0, 0, 0, 0, 0, -321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -321, 0, 0, -321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 960 - 0, 0, 0, 0, 0, 0, 0, 0, -360, 0, 0, 0, 0, 0, 0, -360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -360, 0, 0, 0, 0, 0, -360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -360, 0, 0, -360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 961 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 962 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 963 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 964 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 353, 0, 0, 0, 0, 0, 0, 0, 0, 0, -693, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 965 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 354, 0, 0, 0, 0, 0, 0, 0, 0, 0, -705, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 966 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1036, 0, 0, 0, 0, 0, 0, 0, 0, 0, -683, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 967 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1038, 0, 0, 0, 0, 0, 0, 0, 0, 0, -695, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 968 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 969 - -413, 0, 0, 0, 0, 0, 0, -413, 0, -413, 0, 0, 0, -413, 0, 0, -413, 0, 0, 0, -413, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -413, 0, -413, -413, -413, -413, 0, 0, 0, 0, 0, -413, -413, -413, -413, 0, -413, -413, -413, -413, 0, 0, 0, 0, -413, -413, -413, -413, -413, 0, 0, -413, -413, -413, -413, 0, -413, -413, -413, -413, -413, -413, -413, -413, -413, 0, 0, 0, -413, -413, 0, 0, 0, 0, -413, -413, 0, -413, -413, -413, -413, -413, - // State 970 - -273, 0, 0, 0, 0, 0, 0, -273, 0, -273, 0, 0, 0, -273, 0, 0, -273, 0, 0, 0, -273, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -273, 0, -273, -273, -273, -273, 0, 0, 0, 0, 0, -273, -273, -273, -273, 0, -273, -273, -273, -273, 0, 0, 0, 0, -273, -273, -273, -273, -273, 0, 0, -273, -273, -273, -273, 0, -273, -273, -273, -273, -273, -273, -273, -273, -273, 0, 0, 0, -273, -273, 0, 0, 0, 0, -273, -273, 0, -273, -273, -273, -273, -273, - // State 971 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 356, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 972 - -420, 0, 0, 0, 0, 0, 0, -420, 0, -420, 0, 0, 0, -420, 0, 0, -420, 0, 0, 0, -420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -420, 0, -420, -420, -420, -420, 0, 0, 0, 0, 0, -420, -420, -420, -420, 0, -420, -420, -420, -420, 0, 0, 0, 0, -420, -420, -420, -420, -420, 0, 0, -420, -420, -420, -420, 0, -420, -420, -420, -420, -420, -420, -420, -420, -420, 0, 0, 0, -420, -420, 0, 0, 0, 0, -420, -420, 0, -420, -420, -420, -420, -420, - // State 973 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 357, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 974 - -410, 0, 0, 0, 0, 0, 0, -410, 0, -410, 0, 0, 0, -410, 0, 0, -410, 0, 0, 0, -410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -410, 0, -410, -410, -410, -410, 0, 0, 0, 0, 0, -410, -410, -410, -410, 0, -410, -410, -410, -410, 0, 0, 0, 0, -410, -410, -410, -410, -410, 0, 0, -410, -410, -410, -410, 0, -410, -410, -410, -410, -410, -410, -410, -410, -410, 0, 0, 0, -410, -410, 0, 0, 0, 0, -410, -410, 0, -410, -410, -410, -410, -410, - // State 975 - -403, 0, 0, 0, 0, 0, 0, -403, 0, -403, 0, 0, 0, -403, 0, 0, -403, 0, 0, 0, -403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -403, 0, -403, -403, -403, -403, 0, 0, 0, 0, 0, -403, -403, -403, -403, 0, -403, -403, -403, -403, 0, 1043, 0, 0, -403, -403, -403, -403, -403, 0, 0, -403, -403, -403, -403, 0, -403, -403, -403, -403, -403, -403, -403, -403, -403, 0, 0, 0, -403, -403, 0, 0, 0, 0, -403, -403, 0, -403, -403, -403, -403, -403, - // State 976 - -415, 0, 0, 0, 0, 0, 0, -415, 0, -415, 0, 0, 0, -415, 0, 0, -415, 0, 0, 0, -415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -415, 0, -415, -415, -415, -415, 0, 0, 0, 0, 0, -415, -415, -415, -415, 0, -415, -415, -415, -415, 0, 0, 0, 0, -415, -415, -415, -415, -415, 0, 0, -415, -415, -415, -415, 0, -415, -415, -415, -415, -415, -415, -415, -415, -415, 0, 0, 0, -415, -415, 0, 0, 0, 0, -415, -415, 0, -415, -415, -415, -415, -415, - // State 977 - 0, 0, 0, 0, 0, 0, 0, 0, -598, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 978 - 0, 0, 0, 0, 0, 0, 0, 0, -613, 0, 0, 0, 0, 0, 0, 358, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 979 - 0, 0, 0, 0, 0, 0, 0, 0, -625, 0, 0, 0, 0, 0, 0, 359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 980 - 0, 0, 0, 0, 0, 0, 0, 0, -633, 0, 0, 0, 0, 0, 0, 360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 981 - 0, 0, 0, 0, 0, 0, 0, 0, -644, 0, 0, 0, 0, 0, 0, 1048, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 982 - 0, 0, 0, 0, 0, 0, 0, 0, -19, 0, 0, 0, 0, 0, 0, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 983 - 0, 0, 0, 0, 0, 0, 0, 0, -634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 984 - 0, 0, 0, 0, 0, 0, 0, 0, -648, 0, 0, 0, 0, 0, 0, 1049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 985 - 0, 0, 0, 0, 0, 0, 0, 0, -822, 0, 0, 0, 0, 0, 0, -822, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 986 - 0, 0, 0, 0, 0, 0, 0, 0, -638, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 987 - 0, 0, 0, 0, 0, 0, 0, 0, -341, 0, 0, 0, 0, 0, 0, -341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 988 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 989 - -445, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -445, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 990 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 364, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 991 - -436, 0, 0, 0, 0, 0, 0, -436, 0, -436, 0, 0, 0, -436, 0, 0, -436, 0, 0, 0, -436, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -436, 0, -436, -436, -436, -436, 0, 0, 0, 0, 0, -436, -436, -436, -436, 0, -436, -436, -436, -436, 0, 0, 0, 0, -436, -436, -436, -436, -436, 0, 0, -436, -436, -436, -436, 0, -436, -436, -436, -436, -436, -436, -436, -436, -436, 0, 0, 0, -436, -436, 0, 0, 0, 0, -436, -436, 0, -436, -436, -436, -436, -436, - // State 992 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -494, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -494, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 993 - -500, 0, 0, 0, 0, 0, 0, -500, 0, -500, 0, 0, 0, -500, 0, 0, -500, 0, 0, 0, -500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -500, 0, -500, -500, -500, -500, 0, 0, 0, 0, 0, -500, -500, -500, -500, 0, -500, -500, -500, -500, 0, 0, 0, 0, -500, -500, -500, -500, -500, 0, 0, -500, -500, -500, -500, 0, -500, -500, -500, -500, -500, -500, -500, -500, -500, 0, 0, 0, -500, -500, 0, 0, 0, 0, -500, -500, 0, -500, -500, -500, -500, -500, - // State 994 - 0, 0, 0, 0, 0, 0, 0, 0, -474, 0, 0, 0, 0, 0, 0, -474, 0, 0, 0, 0, 0, 0, 0, 0, 0, -474, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -474, 0, 0, 0, -474, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -474, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -474, 0, -474, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 995 - 0, 0, 0, 0, 0, 0, 0, 0, -753, 0, 0, 0, 0, 0, 0, -753, 0, 0, 0, 0, 0, 0, 0, 0, 0, -753, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -753, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -753, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -753, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 996 - 0, 0, 0, 0, 0, 0, 0, 0, -282, 0, 0, 0, 0, 0, 0, -282, 0, 0, 0, 0, 0, 0, 0, 0, 0, -282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -282, 0, 0, 0, -282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -282, 0, -282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 997 - 0, 0, 0, 0, 0, 0, 0, 0, -287, 0, 0, 0, 0, 0, 0, -287, 0, 0, 0, 0, 0, 0, 0, 0, 0, -287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -287, 0, 0, 0, -287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -287, 0, -287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 998 - 0, 0, 0, 0, 0, 0, 0, 0, -558, 0, 0, 0, 0, 0, 0, -558, 0, 0, 0, 0, 0, 0, 0, 0, 0, -558, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -558, 0, 0, 0, -558, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -558, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 365, 0, -558, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 999 - 0, 0, 0, 0, 0, 0, 0, -497, -270, 0, 0, 0, 0, 0, 0, -270, 0, 0, 0, -497, 0, 0, 0, 0, 0, -270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -270, 0, 0, 0, -270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -270, 0, -270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1000 - 0, 0, 0, 0, 0, 0, 0, 0, -281, 0, 0, 0, 0, 0, 0, -281, 0, 0, 0, 0, 0, 0, 0, 0, 0, -281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -281, 0, 0, 0, -281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -281, 0, -281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1001 - 0, 0, 0, 0, 0, 0, 0, 0, -286, 0, 0, 0, 0, 0, 0, -286, 0, 0, 0, 0, 0, 0, 0, 0, 0, -286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -286, 0, 0, 0, -286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -286, 0, -286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1002 - 0, 0, 0, 0, 0, 0, 0, 0, -523, 0, 0, 0, 0, -523, 0, -523, -523, 0, 0, 0, 0, 0, 0, 0, 0, -523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -523, 0, 0, 0, -523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -523, 0, -523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1003 - 0, 0, 0, 0, 0, 0, 0, 0, -524, 0, 0, 0, 0, -524, 0, -524, -524, 0, 0, 0, 0, 0, 0, 0, 0, -524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -524, 0, 0, 0, -524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -524, 0, -524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1004 - 0, 0, 0, 0, 0, 0, 0, 0, -754, 0, 0, 0, 0, 0, 0, -754, 0, 0, 0, 0, 0, 0, 0, 0, 0, -754, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -754, 0, 0, 0, 370, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -754, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -754, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1005 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 371, 0, 0, 0, 0, 0, 0, 0, 0, 0, -767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1006 - 0, 0, 0, 0, 0, 0, 0, 0, -285, 0, 0, 0, 0, 0, 0, -285, 0, 0, 0, 0, 0, 0, 0, 0, 0, -285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -285, 0, 0, 0, -285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -285, 0, -285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1007 - 0, 0, 0, 0, 0, 0, 0, 0, -283, 0, 0, 0, 0, 0, 0, -283, 0, 0, 0, 0, 0, 0, 0, 0, 0, -283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -283, 0, 0, 0, -283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -283, 0, -283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1008 - 0, 0, 0, 0, 0, 0, 0, 0, -559, 0, 0, 0, 0, 0, 0, -559, 0, 0, 0, 0, 0, 0, 0, 0, 0, -559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -559, 0, 0, 0, -559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 374, 0, -559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1009 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 375, 0, 0, 0, 0, 0, 0, 0, 0, 0, -766, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -766, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1010 - 0, 0, 0, 0, 0, 0, 0, 0, -284, 0, 0, 0, 0, 0, 0, -284, 0, 0, 0, 0, 0, 0, 0, 0, 0, -284, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -284, 0, 0, 0, -284, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -284, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -284, 0, -284, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1011 - 0, 0, 0, 0, 0, 0, 0, 0, -472, 0, 0, 0, 0, 0, 0, -472, 0, 0, 0, 0, 0, 0, 0, 0, 0, -472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -472, 0, 0, 0, -472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -472, 0, -472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1012 - 0, 0, 0, 0, 0, 0, 0, 0, -470, 0, 0, 0, 0, 0, 0, -470, 0, 0, 0, 0, 0, 0, 0, 0, 0, -470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -470, 0, 0, 0, -470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -470, 0, -470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1013 - 0, 0, 0, 0, 0, 0, 0, 0, -471, 0, 0, 0, 0, 0, 0, -471, 0, 0, 0, 0, 0, 0, 0, 0, 0, -471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -471, 0, 0, 0, -471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -471, 0, -471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1014 - -503, 0, 0, 0, 0, 0, 0, -503, 0, -503, 0, 0, 0, -503, 0, 0, -503, 0, 0, 0, -503, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -503, 0, -503, -503, -503, -503, 0, 0, 0, 0, 0, -503, -503, -503, -503, 0, -503, -503, -503, -503, 0, 0, 0, 0, -503, -503, -503, -503, -503, 0, 0, -503, -503, -503, -503, 0, -503, -503, -503, -503, -503, -503, -503, -503, -503, 0, 0, 0, -503, -503, 0, 0, 0, 0, -503, -503, 0, -503, -503, -503, -503, -503, - // State 1015 - -884, 0, 0, 0, 0, 0, 0, -884, 0, -884, 0, 0, 0, -884, 0, 0, -884, 0, 0, 0, -884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -884, 0, -884, -884, -884, -884, 0, 0, 0, 0, 0, -884, -884, -884, -884, 0, -884, -884, -884, -884, 0, 0, 0, 1078, -884, -884, -884, -884, -884, 0, 0, -884, -884, -884, -884, 0, -884, -884, -884, -884, -884, -884, -884, -884, -884, 0, 0, 0, -884, -884, 0, 0, 0, 0, -884, -884, 0, -884, -884, -884, -884, -884, - // State 1016 - -885, 0, 0, 0, 0, 0, 0, -885, 0, -885, 0, 0, 0, -885, 0, 0, -885, 0, 0, 0, -885, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -885, 0, -885, -885, -885, -885, 0, 0, 0, 0, 0, -885, -885, -885, -885, 0, -885, -885, -885, -885, 0, 0, 0, 0, -885, -885, -885, -885, -885, 0, 0, -885, -885, -885, -885, 0, -885, -885, -885, -885, -885, -885, -885, -885, -885, 0, 0, 0, -885, -885, 0, 0, 0, 0, -885, -885, 0, -885, -885, -885, -885, -885, - // State 1017 - -888, 0, 0, 0, 0, 0, 0, -888, 0, -888, 0, 0, 0, -888, 0, 0, -888, 0, 0, 0, -888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -888, 0, -888, -888, -888, -888, 0, 0, 0, 0, 0, -888, -888, -888, -888, 0, -888, -888, -888, -888, 0, 0, 0, 1079, -888, -888, -888, -888, -888, 0, 0, -888, -888, -888, -888, 0, -888, -888, -888, -888, -888, -888, -888, -888, -888, 0, 0, 0, -888, -888, 0, 0, 0, 0, -888, -888, 0, -888, -888, -888, -888, -888, - // State 1018 - -889, 0, 0, 0, 0, 0, 0, -889, 0, -889, 0, 0, 0, -889, 0, 0, -889, 0, 0, 0, -889, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -889, 0, -889, -889, -889, -889, 0, 0, 0, 0, 0, -889, -889, -889, -889, 0, -889, -889, -889, -889, 0, 0, 0, 0, -889, -889, -889, -889, -889, 0, 0, -889, -889, -889, -889, 0, -889, -889, -889, -889, -889, -889, -889, -889, -889, 0, 0, 0, -889, -889, 0, 0, 0, 0, -889, -889, 0, -889, -889, -889, -889, -889, - // State 1019 - -344, 0, 0, 0, 0, 0, 0, -344, 0, -344, 0, 0, 0, -344, 0, 0, -344, 0, 0, 0, -344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -344, 0, -344, -344, -344, -344, 0, 0, 0, 0, 0, -344, -344, -344, -344, 0, -344, -344, -344, -344, 0, -344, -344, -344, -344, -344, -344, -344, -344, 0, 0, -344, -344, -344, -344, 0, -344, -344, -344, -344, -344, -344, -344, -344, -344, 0, 0, 0, -344, -344, 0, 0, 0, 0, -344, -344, 0, -344, -344, -344, -344, -344, - // State 1020 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 380, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1021 - 0, 0, 0, 0, 0, 0, 0, -828, 0, -828, 0, 0, 0, -828, 0, 0, -828, 0, 0, 0, -828, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -828, 0, -828, -828, -828, -828, 0, 0, 0, 0, 0, -828, -828, -828, -828, 0, -828, -828, -828, -828, 0, 0, 0, 0, -828, -828, -828, -828, -828, 0, 0, -828, -828, -828, -828, 0, -828, -828, -828, -828, -828, -828, -828, -828, -828, 0, 0, 0, -828, -828, 0, 0, 0, 0, -828, -828, 0, -828, -828, -828, -828, -828, - // State 1022 - 1082, 0, 0, 0, 0, 0, 0, -141, 0, -141, 0, 0, 0, -141, 0, 0, -141, 0, 0, 0, -141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -141, -141, -141, -141, 0, 0, 0, 0, 0, -141, 0, -141, -141, 0, 0, -141, 0, -141, 0, 0, 0, 0, 0, -141, -141, 0, -141, 0, 0, -141, 0, -141, -141, 0, -141, -141, -141, 0, -141, 0, 0, -141, -141, 0, 0, 0, -141, 0, 0, 0, 0, 0, -141, -141, 0, -141, -141, -141, -141, -141, - // State 1023 - 0, 0, 0, 0, 0, 0, 0, -825, 0, -825, 0, 0, 0, -825, 0, 0, -825, 0, 0, 0, -825, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -825, 0, -825, -825, -825, -825, 0, 0, 0, 0, 0, -825, -825, -825, -825, 0, -825, -825, -825, -825, 0, 0, 0, 0, -825, -825, -825, -825, -825, 0, 0, -825, -825, -825, -825, 0, -825, -825, -825, -825, -825, -825, -825, -825, -825, 0, 0, 0, -825, -825, 0, 0, 0, 0, -825, -825, 0, -825, -825, -825, -825, -825, - // State 1024 - 1083, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1084, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1025 - 0, 0, 0, 0, 0, 0, 0, -833, 0, -833, 0, 0, 0, -833, 0, 0, -833, 0, 0, 0, -833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -833, 0, -833, -833, -833, -833, 0, 0, 0, 0, 0, -833, -833, -833, -833, 0, -833, -833, -833, -833, 0, 0, 0, 0, -833, -833, -833, -833, -833, 0, 0, -833, -833, -833, -833, 0, -833, -833, -833, -833, -833, -833, -833, -833, -833, 0, 0, 0, -833, -833, 0, 0, 0, 0, -833, -833, 0, -833, -833, -833, -833, -833, - // State 1026 - 1085, 0, 0, 0, 0, 0, 0, -140, 0, -140, 0, 0, 0, -140, 0, 0, -140, 0, 0, 0, -140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -140, -140, -140, -140, 0, 0, 0, 0, 0, -140, 0, -140, -140, 0, 0, -140, 0, -140, 0, 0, 0, 0, 0, -140, -140, 0, -140, 0, 0, -140, 0, -140, -140, 0, -140, -140, -140, 0, -140, 0, 0, -140, -140, 0, 0, 0, -140, 0, 0, 0, 0, 0, -140, -140, 0, -140, -140, -140, -140, -140, - // State 1027 - -922, 0, 0, 0, 0, 0, 0, -922, 0, -922, 0, 0, 0, -922, 0, 0, -922, 0, 0, 0, -922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -922, 0, -922, -922, -922, -922, 0, 0, 0, 0, 0, -922, -922, -922, -922, 0, -922, -922, -922, -922, 0, 0, 0, 0, -922, -922, -922, -922, -922, 0, 0, -922, -922, -922, -922, 0, -922, -922, -922, -922, -922, -922, -922, -922, -922, 0, 0, 0, -922, -922, 0, 0, 0, 0, -922, -922, 0, -922, -922, -922, -922, -922, - // State 1028 - 0, 0, -203, -203, 0, -203, 0, -203, 0, -203, -203, 0, 0, -203, 0, -203, -203, 0, 0, -203, 0, -203, -203, 0, 0, -230, 0, 0, -203, -203, 0, -203, 0, -203, -203, -203, -203, 0, 0, -203, 0, 0, 0, 0, -203, 0, -203, 0, -203, -203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -203, 0, -203, -203, 0, 0, 0, -203, -203, 0, 0, 0, 0, 0, 0, 0, 0, 0, -203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1029 - 0, 0, -197, -197, 0, -197, 0, -197, 0, -197, -197, 0, 0, -197, 0, -197, -197, 0, 0, -197, 0, -197, -197, 0, 0, -224, 0, 0, -197, -197, 0, -197, 0, -197, -197, -197, -197, 0, 0, -197, 0, 0, 0, 0, -197, 0, -197, 0, -197, -197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -197, 0, -197, -197, 0, 0, 0, -197, -197, 0, 0, 0, 0, 0, 0, 0, 0, 0, -197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1030 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -937, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1031 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -931, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1032 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, -684, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1033 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, -696, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1034 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, -686, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1035 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1036 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, -698, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1037 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -665, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1038 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1039 - -412, 0, 0, 0, 0, 0, 0, -412, 0, -412, 0, 0, 0, -412, 0, 0, -412, 0, 0, 0, -412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -412, 0, -412, -412, -412, -412, 0, 0, 0, 0, 0, -412, -412, -412, -412, 0, -412, -412, -412, -412, 0, 0, 0, 0, -412, -412, -412, -412, -412, 0, 0, -412, -412, -412, -412, 0, -412, -412, -412, -412, -412, -412, -412, -412, -412, 0, 0, 0, -412, -412, 0, 0, 0, 0, -412, -412, 0, -412, -412, -412, -412, -412, - // State 1040 - -417, 0, 0, 0, 0, 0, 0, -417, 0, -417, 0, 0, 0, -417, 0, 0, -417, 0, 0, 0, -417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -417, 0, -417, -417, -417, -417, 0, 0, 0, 0, 0, -417, -417, -417, -417, 0, -417, -417, -417, -417, 0, 0, 0, 0, -417, -417, -417, -417, -417, 0, 0, -417, -417, -417, -417, 0, -417, -417, -417, -417, -417, -417, -417, -417, -417, 0, 0, 0, -417, -417, 0, 0, 0, 0, -417, -417, 0, -417, -417, -417, -417, -417, - // State 1041 - -407, 0, 0, 0, 0, 0, 0, -407, 0, -407, 0, 0, 0, -407, 0, 0, -407, 0, 0, 0, -407, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -407, 0, -407, -407, -407, -407, 0, 0, 0, 0, 0, -407, -407, -407, -407, 0, -407, -407, -407, -407, 0, 0, 0, 0, -407, -407, -407, -407, -407, 0, 0, -407, -407, -407, -407, 0, -407, -407, -407, -407, -407, -407, -407, -407, -407, 0, 0, 0, -407, -407, 0, 0, 0, 0, -407, -407, 0, -407, -407, -407, -407, -407, - // State 1042 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 382, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1043 - -414, 0, 0, 0, 0, 0, 0, -414, 0, -414, 0, 0, 0, -414, 0, 0, -414, 0, 0, 0, -414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -414, 0, -414, -414, -414, -414, 0, 0, 0, 0, 0, -414, -414, -414, -414, 0, -414, -414, -414, -414, 0, 0, 0, 0, -414, -414, -414, -414, -414, 0, 0, -414, -414, -414, -414, 0, -414, -414, -414, -414, -414, -414, -414, -414, -414, 0, 0, 0, -414, -414, 0, 0, 0, 0, -414, -414, 0, -414, -414, -414, -414, -414, - // State 1044 - 0, 0, 0, 0, 0, 0, 0, 0, -604, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1045 - 0, 0, 0, 0, 0, 0, 0, 0, -616, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1046 - 0, 0, 0, 0, 0, 0, 0, 0, -629, 0, 0, 0, 0, 0, 0, 1102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1047 - 0, 0, 0, 0, 0, 0, 0, 0, -635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1048 - 0, 0, 0, 0, 0, 0, 0, 0, -639, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1049 - -538, 0, 0, 0, 0, 0, 0, 0, -538, 0, 0, 0, 0, 0, 0, -538, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -538, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1050 - -438, 0, 0, 0, 0, 0, 0, -438, 0, -438, 0, 0, 0, -438, 0, 0, -438, 0, 0, 0, -438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -438, 0, -438, -438, -438, -438, 0, 0, 0, 0, 0, -438, -438, -438, -438, 0, -438, -438, -438, -438, 0, 0, 0, 0, -438, -438, -438, -438, -438, 0, 0, -438, -438, -438, -438, 0, -438, -438, -438, -438, -438, -438, -438, -438, -438, 0, 0, 0, -438, -438, 0, 0, 0, 0, -438, -438, 0, -438, -438, -438, -438, -438, - // State 1051 - -111, 0, 0, 0, 0, 0, 0, -111, 0, -111, 0, 0, 0, -111, 0, 0, -111, 0, 0, 0, -111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -111, 0, -111, -111, -111, -111, 0, 0, 0, 0, 0, -111, -111, -111, -111, 0, -111, -111, -111, -111, -111, -111, 0, 0, -111, -111, -111, -111, -111, 0, 0, -111, -111, -111, -111, 0, -111, -111, -111, -111, -111, -111, -111, -111, -111, 0, 0, 0, -111, -111, 0, 0, 0, 0, -111, -111, 0, -111, -111, -111, -111, -111, - // State 1052 - -501, 0, 0, 0, 0, 0, 0, -501, 0, -501, 0, 0, 0, -501, 0, 0, -501, 0, 0, 0, -501, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -501, 0, -501, -501, -501, -501, 0, 0, 0, 0, 0, -501, -501, -501, -501, 0, -501, -501, -501, -501, 0, 0, 0, 0, -501, -501, -501, -501, -501, 0, 0, -501, -501, -501, -501, 0, -501, -501, -501, -501, -501, -501, -501, -501, -501, 0, 0, 0, -501, -501, 0, 0, 0, 0, -501, -501, 0, -501, -501, -501, -501, -501, - // State 1053 - 0, 0, 0, 0, 0, 0, 0, 0, -279, 0, 0, 0, 0, 0, 0, -279, 0, 0, 0, 0, 0, 0, 0, 0, 0, -279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -279, 0, 0, 0, -279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -279, 0, -279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1054 - 0, 0, 0, 0, 0, 0, 0, 0, -280, 0, 0, 0, 0, 0, 0, -280, 0, 0, 0, 0, 0, 0, 0, 0, 0, -280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -280, 0, 0, 0, -280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -280, 0, -280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1055 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 387, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1056 - 0, 0, 0, 0, 0, 0, 0, 0, -892, 0, 0, 0, 0, 0, 0, -892, 0, 0, 0, 0, 0, 0, 0, 0, 0, -892, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -892, 0, 0, 0, -892, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -892, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -892, 0, -892, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -892, - // State 1057 - 0, 0, 0, 0, 0, 0, 0, 0, -893, 0, 0, 0, 0, 0, 0, -893, 0, 0, 0, 0, 0, 0, 0, 0, 0, -893, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -893, 0, 0, 0, -893, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -893, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -893, 0, -893, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -893, - // State 1058 - 0, 0, 0, 0, 0, 0, 0, 0, 1124, 0, 0, 0, 0, 0, 0, 1125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1059 - 0, 0, 0, 0, 0, 0, 0, 0, -783, 0, 0, 0, 0, 0, 0, -783, 0, 0, 0, 0, 0, 0, 0, 0, 0, -783, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -783, 0, 0, 0, -783, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -783, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -783, 0, -783, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1060 - 0, 0, 0, 0, 0, 0, 0, 0, -821, 0, 0, 0, 0, 0, 0, -821, 0, 0, 0, 0, 0, 0, 0, 0, 0, -821, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -821, 0, 0, 0, -821, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -821, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -821, 0, -821, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1061 - 0, 0, 0, 0, 0, 0, 0, 0, -525, 0, 0, 0, 0, -525, 0, -525, -525, 0, 0, 0, 0, 0, 0, 0, 0, -525, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -525, 0, 0, 0, -525, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -525, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -525, 0, -525, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1062 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1063 - 0, 0, 0, 0, 0, 0, 0, 0, -788, 0, 0, 0, 0, 0, 0, -788, 0, 0, 0, 0, 0, 0, 0, 0, 0, -788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -788, 0, 0, 0, -788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -788, 0, -788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1064 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -480, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1065 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -497, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1066 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1067 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -542, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -542, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1068 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1069 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 368, 0, 0, 0, 0, 0, -477, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1070 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 389, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1071 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -478, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1072 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1073 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -481, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1074 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -482, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1075 - 0, 0, 0, 0, 0, 0, 0, 0, -484, 0, 0, 0, 0, 0, 0, -484, 0, 0, 0, 0, 0, 0, 0, 0, 0, -484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -484, 0, 0, 0, -484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -484, 0, -484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1076 - -502, 0, 0, 0, 0, 0, 0, -502, 0, -502, 0, 0, 0, -502, 0, 0, -502, 0, 0, 0, -502, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -502, 0, -502, -502, -502, -502, 0, 0, 0, 0, 0, -502, -502, -502, -502, 0, -502, -502, -502, -502, 0, 0, 0, 0, -502, -502, -502, -502, -502, 0, 0, -502, -502, -502, -502, 0, -502, -502, -502, -502, -502, -502, -502, -502, -502, 0, 0, 0, -502, -502, 0, 0, 0, 0, -502, -502, 0, -502, -502, -502, -502, -502, - // State 1077 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 390, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1078 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 391, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1079 - -349, 0, 0, 0, 0, 0, 0, -349, 0, -349, 0, 0, 0, -349, 0, 0, -349, 0, 0, 0, -349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -349, 0, -349, -349, -349, -349, 0, 0, 0, 0, 0, -349, -349, -349, -349, 0, -349, -349, -349, -349, 0, -349, -349, -349, -349, -349, -349, -349, -349, 0, 0, -349, -349, -349, -349, 0, -349, -349, -349, -349, -349, -349, -349, -349, -349, 0, 0, 0, -349, -349, 0, 0, 0, 0, -349, -349, 0, -349, -349, -349, -349, -349, - // State 1080 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1081 - 0, 0, 0, 0, 0, 0, 0, -826, 0, -826, 0, 0, 0, -826, 0, 0, -826, 0, 0, 0, -826, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -826, 0, -826, -826, -826, -826, 0, 0, 0, 0, 0, -826, -826, -826, -826, 0, -826, -826, -826, -826, 0, 0, 0, 0, -826, -826, -826, -826, -826, 0, 0, -826, -826, -826, -826, 0, -826, -826, -826, -826, -826, -826, -826, -826, -826, 0, 0, 0, -826, -826, 0, 0, 0, 0, -826, -826, 0, -826, -826, -826, -826, -826, - // State 1082 - 0, 0, 0, 0, 0, 0, 0, -834, 0, -834, 0, 0, 0, -834, 0, 0, -834, 0, 0, 0, -834, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -834, 0, -834, -834, -834, -834, 0, 0, 0, 0, 0, -834, -834, -834, -834, 0, -834, -834, -834, -834, 0, 0, 0, 0, -834, -834, -834, -834, -834, 0, 0, -834, -834, -834, -834, 0, -834, -834, -834, -834, -834, -834, -834, -834, -834, 0, 0, 0, -834, -834, 0, 0, 0, 0, -834, -834, 0, -834, -834, -834, -834, -834, - // State 1083 - 1133, 0, 0, 0, 0, 0, 0, -141, 0, -141, 0, 0, 0, -141, 0, 0, -141, 0, 0, 0, -141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -141, -141, -141, -141, 0, 0, 0, 0, 0, -141, 0, -141, -141, 0, 0, -141, 0, -141, 0, 0, 0, 0, 0, -141, -141, 0, -141, 0, 0, -141, 0, -141, -141, 0, -141, -141, -141, 0, -141, 0, 0, -141, -141, 0, 0, 0, -141, 0, 0, 0, 0, 0, -141, -141, 0, -141, -141, -141, -141, -141, - // State 1084 - 0, 0, 0, 0, 0, 0, 0, -831, 0, -831, 0, 0, 0, -831, 0, 0, -831, 0, 0, 0, -831, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -831, 0, -831, -831, -831, -831, 0, 0, 0, 0, 0, -831, -831, -831, -831, 0, -831, -831, -831, -831, 0, 0, 0, 0, -831, -831, -831, -831, -831, 0, 0, -831, -831, -831, -831, 0, -831, -831, -831, -831, -831, -831, -831, -831, -831, 0, 0, 0, -831, -831, 0, 0, 0, 0, -831, -831, 0, -831, -831, -831, -831, -831, - // State 1085 - 0, 0, -199, -199, 0, -199, 0, -199, 0, -199, -199, 0, 0, -199, 0, -199, -199, 0, 0, -199, 0, -199, -199, 0, 0, -226, 0, 0, -199, -199, 0, -199, 0, -199, -199, -199, -199, 0, 0, -199, 0, 0, 0, 0, -199, 0, -199, 0, -199, -199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -199, 0, -199, -199, 0, 0, 0, -199, -199, 0, 0, 0, 0, 0, 0, 0, 0, 0, -199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1086 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -933, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1087 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1134, 0, 0, 0, 0, 0, 0, 0, 0, 0, -687, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1088 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1089 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1135, 0, 0, 0, 0, 0, 0, 0, 0, 0, -699, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1090 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1091 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1092 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1093 - -409, 0, 0, 0, 0, 0, 0, -409, 0, -409, 0, 0, 0, -409, 0, 0, -409, 0, 0, 0, -409, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -409, 0, -409, -409, -409, -409, 0, 0, 0, 0, 0, -409, -409, -409, -409, 0, -409, -409, -409, -409, 0, 0, 0, 0, -409, -409, -409, -409, -409, 0, 0, -409, -409, -409, -409, 0, -409, -409, -409, -409, -409, -409, -409, -409, -409, 0, 0, 0, -409, -409, 0, 0, 0, 0, -409, -409, 0, -409, -409, -409, -409, -409, - // State 1094 - -416, 0, 0, 0, 0, 0, 0, -416, 0, -416, 0, 0, 0, -416, 0, 0, -416, 0, 0, 0, -416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -416, 0, -416, -416, -416, -416, 0, 0, 0, 0, 0, -416, -416, -416, -416, 0, -416, -416, -416, -416, 0, 0, 0, 0, -416, -416, -416, -416, -416, 0, 0, -416, -416, -416, -416, 0, -416, -416, -416, -416, -416, -416, -416, -416, -416, 0, 0, 0, -416, -416, 0, 0, 0, 0, -416, -416, 0, -416, -416, -416, -416, -416, - // State 1095 - -406, 0, 0, 0, 0, 0, 0, -406, 0, -406, 0, 0, 0, -406, 0, 0, -406, 0, 0, 0, -406, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -406, 0, -406, -406, -406, -406, 0, 0, 0, 0, 0, -406, -406, -406, -406, 0, -406, -406, -406, -406, 0, 0, 0, 0, -406, -406, -406, -406, -406, 0, 0, -406, -406, -406, -406, 0, -406, -406, -406, -406, -406, -406, -406, -406, -406, 0, 0, 0, -406, -406, 0, 0, 0, 0, -406, -406, 0, -406, -406, -406, -406, -406, - // State 1096 - 0, 0, 0, 0, 0, 0, 0, 0, -607, 0, 0, 0, 0, 0, 0, 1138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1097 - 0, 0, 0, 0, 0, 0, 0, 0, -574, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1098 - 0, 0, 0, 0, 0, 0, 0, 0, -619, 0, 0, 0, 0, 0, 0, 1139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1099 - 0, 0, 0, 0, 0, 0, 0, 0, -586, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1100 - 0, 0, 0, 0, 0, 0, 0, 0, -630, 0, 0, 0, 0, 0, 0, 1140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1101 - 0, 0, 0, 0, 0, 0, 0, 0, -599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1102 - 0, 0, 0, 0, 0, 0, 0, 0, -614, 0, 0, 0, 0, 0, 0, 395, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1103 - 0, 0, 0, 0, 0, 0, 0, 0, -626, 0, 0, 0, 0, 0, 0, 396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1104 - -404, 0, 0, 0, 0, 0, 0, -404, 0, -404, 0, 0, 0, -404, 0, 0, -404, 0, 0, 0, -404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -404, 0, -404, -404, -404, -404, 0, 0, 0, 0, 0, -404, -404, -404, -404, 0, -404, -404, -404, -404, 0, 0, 0, 0, -404, -404, -404, -404, -404, 0, 0, -404, -404, -404, -404, 0, -404, -404, -404, -404, -404, -404, -404, -404, -404, 0, 0, 0, -404, -404, 0, 0, 0, 0, -404, -404, 0, -404, -404, -404, -404, -404, - // State 1105 - -112, 0, 0, 0, 0, 0, 0, -112, 0, -112, 0, 0, 0, -112, 0, 0, -112, 0, 0, 0, -112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -112, 0, -112, -112, -112, -112, 0, 0, 0, 0, 0, -112, -112, -112, -112, 0, -112, -112, -112, -112, -112, -112, 0, 0, -112, -112, -112, -112, -112, 0, 0, -112, -112, -112, -112, 0, -112, -112, -112, -112, -112, -112, -112, -112, -112, 0, 0, 0, -112, -112, 0, 0, 0, 0, -112, -112, 0, -112, -112, -112, -112, -112, - // State 1106 - 0, 0, 0, 0, 0, 0, 0, 0, -896, 0, 0, 0, 0, 0, 0, -896, 0, 0, 0, 0, 0, 0, 0, 0, 0, -896, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -896, 0, 0, 0, -896, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -896, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -896, 0, -896, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1107 - 0, 0, 0, 0, 0, 0, 0, -497, -270, 0, 0, 0, 0, 0, 0, -270, 0, 0, 0, -497, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1108 - 0, 0, 0, 0, 0, 0, 0, 0, -540, 0, 0, 0, 0, 0, 0, -540, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1109 - 0, 0, 0, 0, 0, 0, 0, 0, 1145, 0, 0, 0, 0, 0, 0, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1110 - 0, 0, 0, 0, 0, 0, 0, 0, 1146, 0, 0, 0, 0, 0, 0, 399, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1111 - 0, 0, 0, 0, 0, 0, 0, 0, -548, 0, 0, 0, 0, 0, 0, -548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1112 - 0, 0, 0, 0, 0, 0, 0, 0, -763, 0, 0, 0, 0, 0, 0, -763, 0, 0, 0, 0, 0, 0, 0, 0, 0, -763, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -763, 0, 0, 0, -763, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -763, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -763, 0, -763, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1113 - 0, 0, 0, 0, 0, 0, 0, -498, -498, 0, 0, 0, 0, 0, 0, -498, 0, 0, 0, -498, 0, 0, 0, 0, 0, -498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -498, 0, 0, 0, -498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -498, 0, -498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1114 - 0, 0, 0, 0, 0, 0, 0, -499, -499, 0, 0, 0, 0, 0, 0, -499, 0, 0, 0, -499, 0, 0, 0, 0, 0, -499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -499, 0, 0, 0, -499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -499, 0, -499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1115 - 0, 0, 0, 0, 0, 0, 0, 0, -159, 0, 0, 0, 0, 0, 0, -159, 0, 0, 0, 0, 0, 0, 0, 0, 0, -159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -159, 0, 0, 0, -159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -159, 0, -159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1116 - 0, 0, 0, 0, 0, 0, 0, 0, -178, 0, 0, 0, 0, 0, 0, -178, 0, 0, 0, 0, 0, 0, 0, 0, 0, -178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1117 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -898, 0, 0, 0, 0, 0, 0, 0, 0, 0, -898, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -898, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1118 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -492, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -492, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1119 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -434, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1120 - 0, 0, 0, 0, 0, 0, 0, 0, -897, 0, 0, 0, 0, 0, 0, -897, 0, 0, 0, 0, 0, 0, 0, 0, 0, -897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -897, 0, 0, 0, -897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -897, 0, -897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1121 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -899, 0, 0, 0, 0, 0, 0, 0, 0, 0, -899, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -899, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1122 - 0, 0, 0, 0, 0, 0, 0, 0, 1148, 0, 0, 0, 0, 0, 0, 1149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1123 - 0, 0, 0, 0, 0, 0, 0, 0, -782, 0, 0, 0, 0, 0, 0, -782, 0, 0, 0, 0, 0, 0, 0, 0, 0, -782, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -782, 0, 0, 0, -782, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -782, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -782, 0, -782, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1124 - 0, 0, 0, 0, 0, 0, 0, -135, 1150, -135, 0, 0, 0, 0, 0, 0, -135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -135, -135, -135, -135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -135, 0, 0, 0, 0, 0, 0, 0, 0, 0, -135, -135, 0, 0, -135, 0, -135, -135, - // State 1125 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1126 - 0, 0, 0, 0, 0, 0, 0, 0, -790, 0, 0, 0, 0, 0, 0, -790, 0, 0, 0, 0, 0, 0, 0, 0, 0, -790, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -790, 0, 0, 0, -790, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -790, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -790, 0, -790, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1127 - 0, 0, 0, 0, 0, 0, 0, -135, 0, -135, 0, 0, 0, 0, 0, 0, -135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -135, -135, -135, -135, -135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -135, 0, 0, 0, 0, 0, 0, 0, 0, 0, -135, -135, 0, 0, -135, 0, -135, -135, - // State 1128 - 0, 0, 0, 0, 0, 0, 0, 0, -787, 0, 0, 0, 0, 0, 0, -787, 0, 0, 0, 0, 0, 0, 0, 0, 0, -787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -787, 0, 0, 0, -787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -787, 0, -787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1129 - 0, 0, 0, 0, 0, 0, 0, 0, -486, 0, 0, 0, 0, 0, 0, -486, 0, 0, 0, 0, 0, 0, 0, 0, 0, -486, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -486, 0, 0, 0, -486, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -486, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -486, 0, -486, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1130 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1131 - -346, 0, 0, 0, 0, 0, 0, -346, 0, -346, 0, 0, 0, -346, 0, 0, -346, 0, 0, 0, -346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -346, 0, -346, -346, -346, -346, 0, 0, 0, 0, 0, -346, -346, -346, -346, 0, -346, -346, -346, -346, 0, -346, -346, -346, -346, -346, -346, -346, -346, 0, 0, -346, -346, -346, -346, 0, -346, -346, -346, -346, -346, -346, -346, -346, -346, 0, 0, 0, -346, -346, 0, 0, 0, 0, -346, -346, 0, -346, -346, -346, -346, -346, - // State 1132 - 0, 0, 0, 0, 0, 0, 0, -832, 0, -832, 0, 0, 0, -832, 0, 0, -832, 0, 0, 0, -832, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -832, 0, -832, -832, -832, -832, 0, 0, 0, 0, 0, -832, -832, -832, -832, 0, -832, -832, -832, -832, 0, 0, 0, 0, -832, -832, -832, -832, -832, 0, 0, -832, -832, -832, -832, 0, -832, -832, -832, -832, -832, -832, -832, -832, -832, 0, 0, 0, -832, -832, 0, 0, 0, 0, -832, -832, 0, -832, -832, -832, -832, -832, - // State 1133 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1134 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -669, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1135 - -408, 0, 0, 0, 0, 0, 0, -408, 0, -408, 0, 0, 0, -408, 0, 0, -408, 0, 0, 0, -408, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -408, 0, -408, -408, -408, -408, 0, 0, 0, 0, 0, -408, -408, -408, -408, 0, -408, -408, -408, -408, 0, 0, 0, 0, -408, -408, -408, -408, -408, 0, 0, -408, -408, -408, -408, 0, -408, -408, -408, -408, -408, -408, -408, -408, -408, 0, 0, 0, -408, -408, 0, 0, 0, 0, -408, -408, 0, -408, -408, -408, -408, -408, - // State 1136 - -402, 0, 0, 0, 0, 0, 0, -402, 0, -402, 0, 0, 0, -402, 0, 0, -402, 0, 0, 0, -402, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -402, 0, -402, -402, -402, -402, 0, 0, 0, 0, 0, -402, -402, -402, -402, 0, -402, -402, -402, -402, 0, 0, 0, 0, -402, -402, -402, -402, -402, 0, 0, -402, -402, -402, -402, 0, -402, -402, -402, -402, -402, -402, -402, -402, -402, 0, 0, 0, -402, -402, 0, 0, 0, 0, -402, -402, 0, -402, -402, -402, -402, -402, - // State 1137 - 0, 0, 0, 0, 0, 0, 0, 0, -577, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1138 - 0, 0, 0, 0, 0, 0, 0, 0, -589, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1139 - 0, 0, 0, 0, 0, 0, 0, 0, -600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1140 - 0, 0, 0, 0, 0, 0, 0, 0, -615, 0, 0, 0, 0, 0, 0, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1141 - 0, 0, 0, 0, 0, 0, 0, 0, -627, 0, 0, 0, 0, 0, 0, 402, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1142 - 0, 0, 0, 0, 0, 0, 0, 0, -605, 0, 0, 0, 0, 0, 0, 1164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1143 - 0, 0, 0, 0, 0, 0, 0, 0, -617, 0, 0, 0, 0, 0, 0, 1166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1144 - 0, 0, 0, 0, 0, 0, 0, 0, -762, 0, 0, 0, 0, 0, 0, -762, 0, 0, 0, 0, 0, 0, 0, 0, 0, -762, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -762, 0, 0, 0, -762, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -762, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -762, 0, -762, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1145 - 0, 0, 0, 0, 0, 0, 0, 0, -760, 0, 0, 0, 0, 0, 0, -760, 0, 0, 0, 0, 0, 0, 0, 0, 0, -760, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -760, 0, 0, 0, -760, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -760, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -760, 0, -760, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1146 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -491, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -491, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1147 - 0, 0, 0, 0, 0, 0, 0, 0, -786, 0, 0, 0, 0, 0, 0, -786, 0, 0, 0, 0, 0, 0, 0, 0, 0, -786, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -786, 0, 0, 0, -786, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -786, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -786, 0, -786, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1148 - 0, 0, 0, 0, 0, 0, 0, -136, 1174, -136, 0, 0, 0, 0, 0, 0, -136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -136, -136, -136, -136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -136, 0, 0, 0, 0, 0, 0, 0, 0, 0, -136, -136, 0, 0, -136, 0, -136, -136, - // State 1149 - 0, 0, 0, 0, 0, 0, 0, 0, -784, 0, 0, 0, 0, 0, 0, -784, 0, 0, 0, 0, 0, 0, 0, 0, 0, -784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -784, 0, 0, 0, -784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -784, 0, -784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1150 - 0, 0, 0, 0, 0, 0, 0, -136, 0, -136, 0, 0, 0, 0, 0, 0, -136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -136, -136, -136, -136, -136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -136, 0, 0, 0, 0, 0, 0, 0, 0, 0, -136, -136, 0, 0, -136, 0, -136, -136, - // State 1151 - 0, 0, 0, 0, 0, 0, 0, 0, -789, 0, 0, 0, 0, 0, 0, -789, 0, 0, 0, 0, 0, 0, 0, 0, 0, -789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -789, 0, 0, 0, -789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -789, 0, -789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1152 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1153 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1154 - 0, 0, 0, 0, 0, 0, 0, 0, -485, 0, 0, 0, 0, 0, 0, -485, 0, 0, 0, 0, 0, 0, 0, 0, 0, -485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -485, 0, 0, 0, -485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -485, 0, -485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1155 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1156 - 0, 0, 0, 0, 0, 0, 0, 0, -488, 0, 0, 0, 0, 0, 0, -488, 0, 0, 0, 0, 0, 0, 0, 0, 0, -488, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -488, 0, 0, 0, -488, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -488, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -488, 0, -488, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1157 - -883, 0, 0, 0, 0, 0, 0, -883, 0, -883, 0, 0, 0, -883, 0, 0, -883, 0, 0, 0, -883, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -883, 0, -883, -883, -883, -883, 0, 0, 0, 0, 0, -883, -883, -883, -883, 0, -883, -883, -883, -883, 0, 0, 0, 0, -883, -883, -883, -883, -883, 0, 0, -883, -883, -883, -883, 0, -883, -883, -883, -883, -883, -883, -883, -883, -883, 0, 0, 0, -883, -883, 0, 0, 0, 0, -883, -883, 0, -883, -883, -883, -883, -883, - // State 1158 - -887, 0, 0, 0, 0, 0, 0, -887, 0, -887, 0, 0, 0, -887, 0, 0, -887, 0, 0, 0, -887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -887, 0, -887, -887, -887, -887, 0, 0, 0, 0, 0, -887, -887, -887, -887, 0, -887, -887, -887, -887, 0, 0, 0, 0, -887, -887, -887, -887, -887, 0, 0, -887, -887, -887, -887, 0, -887, -887, -887, -887, -887, -887, -887, -887, -887, 0, 0, 0, -887, -887, 0, 0, 0, 0, -887, -887, 0, -887, -887, -887, -887, -887, - // State 1159 - -350, 0, 0, 0, 0, 0, 0, -350, 0, -350, 0, 0, 0, -350, 0, 0, -350, 0, 0, 0, -350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -350, 0, -350, -350, -350, -350, 0, 0, 0, 0, 0, -350, -350, -350, -350, 0, -350, -350, -350, -350, 0, -350, -350, -350, -350, -350, -350, -350, -350, 0, 0, -350, -350, -350, -350, 0, -350, -350, -350, -350, -350, -350, -350, -350, -350, 0, 0, 0, -350, -350, 0, 0, 0, 0, -350, -350, 0, -350, -350, -350, -350, -350, - // State 1160 - 0, 0, 0, 0, 0, 0, 0, 0, -606, 0, 0, 0, 0, 0, 0, 1178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1161 - 0, 0, 0, 0, 0, 0, 0, 0, -618, 0, 0, 0, 0, 0, 0, 1180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1162 - 0, 0, 0, 0, 0, 0, 0, 0, -608, 0, 0, 0, 0, 0, 0, 1181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1163 - 0, 0, 0, 0, 0, 0, 0, 0, -575, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1164 - 0, 0, 0, 0, 0, 0, 0, 0, -620, 0, 0, 0, 0, 0, 0, 1182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1165 - 0, 0, 0, 0, 0, 0, 0, 0, -587, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1166 - 0, 0, 0, 0, 0, 0, 0, 0, -495, 0, 0, 0, 0, 0, 0, -495, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1167 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1168 - 0, 0, 0, 0, 0, 0, 0, 0, -541, 0, 0, 0, 0, 0, 0, -541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1169 - 0, 0, 0, 0, 0, 0, 0, 0, -761, 0, 0, 0, 0, 0, 0, -761, 0, 0, 0, 0, 0, 0, 0, 0, 0, -761, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -761, 0, 0, 0, -761, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -761, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -761, 0, -761, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1170 - 0, 0, 0, 0, 0, 0, 0, 0, 1183, 0, 0, 0, 0, 0, 0, 403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1171 - 0, 0, 0, 0, 0, 0, 0, 0, -549, 0, 0, 0, 0, 0, 0, -549, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1172 - 0, 0, 0, 0, 0, 0, 0, 0, -759, 0, 0, 0, 0, 0, 0, -759, 0, 0, 0, 0, 0, 0, 0, 0, 0, -759, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -759, 0, 0, 0, -759, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -759, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -759, 0, -759, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1173 - 0, 0, 0, 0, 0, 0, 0, 0, -785, 0, 0, 0, 0, 0, 0, -785, 0, 0, 0, 0, 0, 0, 0, 0, 0, -785, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -785, 0, 0, 0, -785, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -785, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -785, 0, -785, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1174 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1175 - 0, 0, 0, 0, 0, 0, 0, 0, -487, 0, 0, 0, 0, 0, 0, -487, 0, 0, 0, 0, 0, 0, 0, 0, 0, -487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -487, 0, 0, 0, -487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -487, 0, -487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1176 - 0, 0, 0, 0, 0, 0, 0, 0, -609, 0, 0, 0, 0, 0, 0, 1186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1177 - 0, 0, 0, 0, 0, 0, 0, 0, -576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1178 - 0, 0, 0, 0, 0, 0, 0, 0, -621, 0, 0, 0, 0, 0, 0, 1187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1179 - 0, 0, 0, 0, 0, 0, 0, 0, -588, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1180 - 0, 0, 0, 0, 0, 0, 0, 0, -578, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1181 - 0, 0, 0, 0, 0, 0, 0, 0, -590, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1182 - 0, 0, 0, 0, 0, 0, 0, 0, -758, 0, 0, 0, 0, 0, 0, -758, 0, 0, 0, 0, 0, 0, 0, 0, 0, -758, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -758, 0, 0, 0, -758, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -758, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -758, 0, -758, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1183 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1184 - 0, 0, 0, 0, 0, 0, 0, 0, -490, 0, 0, 0, 0, 0, 0, -490, 0, 0, 0, 0, 0, 0, 0, 0, 0, -490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -490, 0, 0, 0, -490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -490, 0, -490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1185 - 0, 0, 0, 0, 0, 0, 0, 0, -579, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1186 - 0, 0, 0, 0, 0, 0, 0, 0, -591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1187 - 0, 0, 0, 0, 0, 0, 0, 0, -757, 0, 0, 0, 0, 0, 0, -757, 0, 0, 0, 0, 0, 0, 0, 0, 0, -757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -757, 0, 0, 0, -757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -757, 0, -757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // State 1188 - 0, 0, 0, 0, 0, 0, 0, 0, -489, 0, 0, 0, 0, 0, 0, -489, 0, 0, 0, 0, 0, 0, 0, 0, 0, -489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -489, 0, 0, 0, -489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -489, 0, -489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - ]; - fn __action(state: i16, integer: usize) -> i16 { - __ACTION[(state as usize) * 101 + integer] - } - const __EOF_ACTION: &[i16] = &[ - // State 0 - 0, - // State 1 - 0, - // State 2 - -772, - // State 3 - 0, - // State 4 - 0, - // State 5 - -794, - // State 6 - -254, - // State 7 - -310, - // State 8 - -881, - // State 9 - -161, - // State 10 - -835, - // State 11 - -175, - // State 12 - -836, - // State 13 - 0, - // State 14 - 0, - // State 15 - 0, - // State 16 - 0, - // State 17 - 0, - // State 18 - 0, - // State 19 - 0, - // State 20 - 0, - // State 21 - 0, - // State 22 - -880, - // State 23 - 0, - // State 24 - 0, - // State 25 - 0, - // State 26 - 0, - // State 27 - 0, - // State 28 - 0, - // State 29 - -309, - // State 30 - 0, - // State 31 - 0, - // State 32 - -431, - // State 33 - 0, - // State 34 - 0, - // State 35 - 0, - // State 36 - 0, - // State 37 - 0, - // State 38 - 0, - // State 39 - 0, - // State 40 - 0, - // State 41 - 0, - // State 42 - -253, - // State 43 - 0, - // State 44 - 0, - // State 45 - 0, - // State 46 - 0, - // State 47 - 0, - // State 48 - 0, - // State 49 - 0, - // State 50 - 0, - // State 51 - 0, - // State 52 - 0, - // State 53 - 0, - // State 54 - 0, - // State 55 - 0, - // State 56 - 0, - // State 57 - 0, - // State 58 - 0, - // State 59 - 0, - // State 60 - 0, - // State 61 - 0, - // State 62 - 0, - // State 63 - 0, - // State 64 - 0, - // State 65 - 0, - // State 66 - 0, - // State 67 - 0, - // State 68 - 0, - // State 69 - 0, - // State 70 - 0, - // State 71 - 0, - // State 72 - 0, - // State 73 - -160, - // State 74 - -174, - // State 75 - 0, - // State 76 - 0, - // State 77 - 0, - // State 78 - 0, - // State 79 - 0, - // State 80 - 0, - // State 81 - -793, - // State 82 - 0, - // State 83 - 0, - // State 84 - 0, - // State 85 - 0, - // State 86 - 0, - // State 87 - 0, - // State 88 - 0, - // State 89 - 0, - // State 90 - 0, - // State 91 - 0, - // State 92 - 0, - // State 93 - 0, - // State 94 - 0, - // State 95 - 0, - // State 96 - 0, - // State 97 - 0, - // State 98 - 0, - // State 99 - 0, - // State 100 - 0, - // State 101 - 0, - // State 102 - 0, - // State 103 - 0, - // State 104 - 0, - // State 105 - 0, - // State 106 - 0, - // State 107 - 0, - // State 108 - 0, - // State 109 - 0, - // State 110 - 0, - // State 111 - 0, - // State 112 - 0, - // State 113 - 0, - // State 114 - 0, - // State 115 - 0, - // State 116 - 0, - // State 117 - 0, - // State 118 - 0, - // State 119 - 0, - // State 120 - 0, - // State 121 - 0, - // State 122 - 0, - // State 123 - 0, - // State 124 - 0, - // State 125 - 0, - // State 126 - 0, - // State 127 - 0, - // State 128 - 0, - // State 129 - 0, - // State 130 - 0, - // State 131 - 0, - // State 132 - 0, - // State 133 - 0, - // State 134 - 0, - // State 135 - 0, - // State 136 - 0, - // State 137 - 0, - // State 138 - 0, - // State 139 - 0, - // State 140 - 0, - // State 141 - 0, - // State 142 - 0, - // State 143 - 0, - // State 144 - 0, - // State 145 - 0, - // State 146 - 0, - // State 147 - 0, - // State 148 - 0, - // State 149 - 0, - // State 150 - 0, - // State 151 - 0, - // State 152 - 0, - // State 153 - 0, - // State 154 - 0, - // State 155 - 0, - // State 156 - 0, - // State 157 - 0, - // State 158 - 0, - // State 159 - 0, - // State 160 - 0, - // State 161 - 0, - // State 162 - 0, - // State 163 - 0, - // State 164 - 0, - // State 165 - 0, - // State 166 - 0, - // State 167 - 0, - // State 168 - 0, - // State 169 - 0, - // State 170 - 0, - // State 171 - 0, - // State 172 - 0, - // State 173 - 0, - // State 174 - 0, - // State 175 - 0, - // State 176 - 0, - // State 177 - 0, - // State 178 - 0, - // State 179 - 0, - // State 180 - 0, - // State 181 - 0, - // State 182 - 0, - // State 183 - 0, - // State 184 - 0, - // State 185 - 0, - // State 186 - 0, - // State 187 - 0, - // State 188 - 0, - // State 189 - 0, - // State 190 - 0, - // State 191 - 0, - // State 192 - 0, - // State 193 - 0, - // State 194 - 0, - // State 195 - 0, - // State 196 - 0, - // State 197 - 0, - // State 198 - 0, - // State 199 - 0, - // State 200 - 0, - // State 201 - 0, - // State 202 - 0, - // State 203 - 0, - // State 204 - 0, - // State 205 - 0, - // State 206 - 0, - // State 207 - 0, - // State 208 - 0, - // State 209 - 0, - // State 210 - 0, - // State 211 - 0, - // State 212 - 0, - // State 213 - 0, - // State 214 - 0, - // State 215 - 0, - // State 216 - 0, - // State 217 - 0, - // State 218 - 0, - // State 219 - 0, - // State 220 - 0, - // State 221 - 0, - // State 222 - -437, - // State 223 - -886, - // State 224 - -890, - // State 225 - 0, - // State 226 - 0, - // State 227 - 0, - // State 228 - 0, - // State 229 - 0, - // State 230 - 0, - // State 231 - 0, - // State 232 - 0, - // State 233 - 0, - // State 234 - 0, - // State 235 - 0, - // State 236 - 0, - // State 237 - 0, - // State 238 - 0, - // State 239 - 0, - // State 240 - 0, - // State 241 - 0, - // State 242 - 0, - // State 243 - 0, - // State 244 - 0, - // State 245 - 0, - // State 246 - 0, - // State 247 - 0, - // State 248 - 0, - // State 249 - 0, - // State 250 - 0, - // State 251 - 0, - // State 252 - 0, - // State 253 - 0, - // State 254 - 0, - // State 255 - 0, - // State 256 - 0, - // State 257 - 0, - // State 258 - 0, - // State 259 - 0, - // State 260 - 0, - // State 261 - 0, - // State 262 - 0, - // State 263 - 0, - // State 264 - 0, - // State 265 - 0, - // State 266 - 0, - // State 267 - 0, - // State 268 - 0, - // State 269 - 0, - // State 270 - 0, - // State 271 - 0, - // State 272 - 0, - // State 273 - 0, - // State 274 - 0, - // State 275 - 0, - // State 276 - 0, - // State 277 - 0, - // State 278 - 0, - // State 279 - 0, - // State 280 - 0, - // State 281 - 0, - // State 282 - 0, - // State 283 - 0, - // State 284 - 0, - // State 285 - 0, - // State 286 - 0, - // State 287 - 0, - // State 288 - 0, - // State 289 - 0, - // State 290 - 0, - // State 291 - 0, - // State 292 - 0, - // State 293 - 0, - // State 294 - 0, - // State 295 - 0, - // State 296 - 0, - // State 297 - 0, - // State 298 - 0, - // State 299 - 0, - // State 300 - 0, - // State 301 - 0, - // State 302 - 0, - // State 303 - 0, - // State 304 - 0, - // State 305 - 0, - // State 306 - 0, - // State 307 - 0, - // State 308 - 0, - // State 309 - 0, - // State 310 - 0, - // State 311 - 0, - // State 312 - 0, - // State 313 - 0, - // State 314 - 0, - // State 315 - 0, - // State 316 - 0, - // State 317 - 0, - // State 318 - 0, - // State 319 - 0, - // State 320 - 0, - // State 321 - 0, - // State 322 - 0, - // State 323 - 0, - // State 324 - 0, - // State 325 - 0, - // State 326 - 0, - // State 327 - 0, - // State 328 - 0, - // State 329 - 0, - // State 330 - 0, - // State 331 - 0, - // State 332 - 0, - // State 333 - 0, - // State 334 - 0, - // State 335 - 0, - // State 336 - 0, - // State 337 - 0, - // State 338 - 0, - // State 339 - 0, - // State 340 - 0, - // State 341 - 0, - // State 342 - 0, - // State 343 - 0, - // State 344 - 0, - // State 345 - 0, - // State 346 - 0, - // State 347 - 0, - // State 348 - 0, - // State 349 - 0, - // State 350 - 0, - // State 351 - 0, - // State 352 - 0, - // State 353 - 0, - // State 354 - 0, - // State 355 - 0, - // State 356 - 0, - // State 357 - 0, - // State 358 - 0, - // State 359 - 0, - // State 360 - 0, - // State 361 - 0, - // State 362 - 0, - // State 363 - 0, - // State 364 - 0, - // State 365 - 0, - // State 366 - 0, - // State 367 - 0, - // State 368 - 0, - // State 369 - 0, - // State 370 - 0, - // State 371 - 0, - // State 372 - 0, - // State 373 - 0, - // State 374 - 0, - // State 375 - 0, - // State 376 - 0, - // State 377 - 0, - // State 378 - 0, - // State 379 - 0, - // State 380 - 0, - // State 381 - 0, - // State 382 - 0, - // State 383 - 0, - // State 384 - 0, - // State 385 - 0, - // State 386 - 0, - // State 387 - 0, - // State 388 - 0, - // State 389 - 0, - // State 390 - 0, - // State 391 - 0, - // State 392 - 0, - // State 393 - 0, - // State 394 - 0, - // State 395 - 0, - // State 396 - 0, - // State 397 - 0, - // State 398 - 0, - // State 399 - 0, - // State 400 - 0, - // State 401 - 0, - // State 402 - 0, - // State 403 - -951, - // State 404 - -945, - // State 405 - -561, - // State 406 - -245, - // State 407 - -769, - // State 408 - -517, - // State 409 - -839, - // State 410 - -859, - // State 411 - -191, - // State 412 - -864, - // State 413 - -165, - // State 414 - -190, - // State 415 - -432, - // State 416 - -863, - // State 417 - -393, - // State 418 - -876, - // State 419 - -189, - // State 420 - -838, - // State 421 - -875, - // State 422 - -552, - // State 423 - -354, - // State 424 - 0, - // State 425 - 0, - // State 426 - -217, - // State 427 - -215, - // State 428 - -216, - // State 429 - -214, - // State 430 - 0, - // State 431 - -522, - // State 432 - -521, - // State 433 - -520, - // State 434 - -435, - // State 435 - -837, - // State 436 - -560, - // State 437 - -164, - // State 438 - 0, - // State 439 - 0, - // State 440 - 0, - // State 441 - -246, - // State 442 - 0, - // State 443 - 0, - // State 444 - 0, - // State 445 - 0, - // State 446 - 0, - // State 447 - 0, - // State 448 - 0, - // State 449 - 0, - // State 450 - 0, - // State 451 - -882, - // State 452 - -94, - // State 453 - 0, - // State 454 - 0, - // State 455 - 0, - // State 456 - -894, - // State 457 - 0, - // State 458 - 0, - // State 459 - 0, - // State 460 - 0, - // State 461 - 0, - // State 462 - -895, - // State 463 - -392, - // State 464 - 0, - // State 465 - 0, - // State 466 - 0, - // State 467 - 0, - // State 468 - 0, - // State 469 - 0, - // State 470 - 0, - // State 471 - -205, - // State 472 - -820, - // State 473 - 0, - // State 474 - 0, - // State 475 - 0, - // State 476 - 0, - // State 477 - 0, - // State 478 - 0, - // State 479 - -193, - // State 480 - 0, - // State 481 - 0, - // State 482 - 0, - // State 483 - 0, - // State 484 - 0, - // State 485 - 0, - // State 486 - -516, - // State 487 - 0, - // State 488 - 0, - // State 489 - 0, - // State 490 - 0, - // State 491 - 0, - // State 492 - 0, - // State 493 - 0, - // State 494 - -210, - // State 495 - 0, - // State 496 - 0, - // State 497 - -371, - // State 498 - 0, - // State 499 - 0, - // State 500 - -320, - // State 501 - -773, - // State 502 - 0, - // State 503 - 0, - // State 504 - 0, - // State 505 - 0, - // State 506 - -316, - // State 507 - -319, - // State 508 - 0, - // State 509 - -314, - // State 510 - 0, - // State 511 - 0, - // State 512 - 0, - // State 513 - -313, - // State 514 - 0, - // State 515 - 0, - // State 516 - 0, - // State 517 - 0, - // State 518 - 0, - // State 519 - -317, - // State 520 - 0, - // State 521 - -315, - // State 522 - -318, - // State 523 - 0, - // State 524 - -778, - // State 525 - 0, - // State 526 - 0, - // State 527 - 0, - // State 528 - 0, - // State 529 - 0, - // State 530 - 0, - // State 531 - 0, - // State 532 - 0, - // State 533 - 0, - // State 534 - 0, - // State 535 - -169, - // State 536 - -248, - // State 537 - 0, - // State 538 - 0, - // State 539 - 0, - // State 540 - 0, - // State 541 - 0, - // State 542 - -768, - // State 543 - -147, - // State 544 - 0, - // State 545 - 0, - // State 546 - -353, - // State 547 - -95, - // State 548 - -553, - // State 549 - 0, - // State 550 - -858, - // State 551 - -944, - // State 552 - 0, - // State 553 - 0, - // State 554 - 0, - // State 555 - 0, - // State 556 - -202, - // State 557 - -196, - // State 558 - -206, - // State 559 - 0, - // State 560 - 0, - // State 561 - -192, - // State 562 - 0, - // State 563 - 0, - // State 564 - 0, - // State 565 - 0, - // State 566 - 0, - // State 567 - 0, - // State 568 - -465, - // State 569 - 0, - // State 570 - -209, - // State 571 - 0, - // State 572 - -212, - // State 573 - 0, - // State 574 - 0, - // State 575 - -372, - // State 576 - 0, - // State 577 - 0, - // State 578 - 0, - // State 579 - 0, - // State 580 - 0, - // State 581 - 0, - // State 582 - 0, - // State 583 - 0, - // State 584 - 0, - // State 585 - 0, - // State 586 - 0, - // State 587 - 0, - // State 588 - 0, - // State 589 - 0, - // State 590 - 0, - // State 591 - 0, - // State 592 - 0, - // State 593 - 0, - // State 594 - 0, - // State 595 - 0, - // State 596 - 0, - // State 597 - -776, - // State 598 - 0, - // State 599 - 0, - // State 600 - 0, - // State 601 - 0, - // State 602 - 0, - // State 603 - 0, - // State 604 - 0, - // State 605 - 0, - // State 606 - 0, - // State 607 - 0, - // State 608 - 0, - // State 609 - 0, - // State 610 - 0, - // State 611 - 0, - // State 612 - 0, - // State 613 - 0, - // State 614 - 0, - // State 615 - 0, - // State 616 - 0, - // State 617 - 0, - // State 618 - 0, - // State 619 - 0, - // State 620 - 0, - // State 621 - 0, - // State 622 - 0, - // State 623 - 0, - // State 624 - 0, - // State 625 - 0, - // State 626 - 0, - // State 627 - 0, - // State 628 - 0, - // State 629 - 0, - // State 630 - 0, - // State 631 - 0, - // State 632 - 0, - // State 633 - 0, - // State 634 - 0, - // State 635 - 0, - // State 636 - 0, - // State 637 - 0, - // State 638 - 0, - // State 639 - 0, - // State 640 - 0, - // State 641 - 0, - // State 642 - 0, - // State 643 - 0, - // State 644 - 0, - // State 645 - 0, - // State 646 - 0, - // State 647 - 0, - // State 648 - 0, - // State 649 - 0, - // State 650 - 0, - // State 651 - 0, - // State 652 - 0, - // State 653 - 0, - // State 654 - 0, - // State 655 - 0, - // State 656 - 0, - // State 657 - 0, - // State 658 - 0, - // State 659 - -171, - // State 660 - -168, - // State 661 - 0, - // State 662 - 0, - // State 663 - 0, - // State 664 - 0, - // State 665 - -247, - // State 666 - 0, - // State 667 - -148, - // State 668 - 0, - // State 669 - -207, - // State 670 - 0, - // State 671 - 0, - // State 672 - -204, - // State 673 - 0, - // State 674 - -198, - // State 675 - 0, - // State 676 - 0, - // State 677 - -195, - // State 678 - -208, - // State 679 - 0, - // State 680 - 0, - // State 681 - -194, - // State 682 - 0, - // State 683 - 0, - // State 684 - -463, - // State 685 - 0, - // State 686 - 0, - // State 687 - 0, - // State 688 - 0, - // State 689 - -464, - // State 690 - -211, - // State 691 - -213, - // State 692 - 0, - // State 693 - 0, - // State 694 - 0, - // State 695 - 0, - // State 696 - 0, - // State 697 - 0, - // State 698 - 0, - // State 699 - -777, - // State 700 - 0, - // State 701 - 0, - // State 702 - 0, - // State 703 - 0, - // State 704 - 0, - // State 705 - 0, - // State 706 - 0, - // State 707 - -774, - // State 708 - 0, - // State 709 - 0, - // State 710 - 0, - // State 711 - 0, - // State 712 - 0, - // State 713 - 0, - // State 714 - 0, - // State 715 - 0, - // State 716 - 0, - // State 717 - 0, - // State 718 - 0, - // State 719 - 0, - // State 720 - 0, - // State 721 - 0, - // State 722 - 0, - // State 723 - 0, - // State 724 - 0, - // State 725 - 0, - // State 726 - 0, - // State 727 - 0, - // State 728 - 0, - // State 729 - 0, - // State 730 - 0, - // State 731 - 0, - // State 732 - 0, - // State 733 - 0, - // State 734 - 0, - // State 735 - 0, - // State 736 - -170, - // State 737 - 0, - // State 738 - 0, - // State 739 - 0, - // State 740 - 0, - // State 741 - 0, - // State 742 - 0, - // State 743 - 0, - // State 744 - -862, - // State 745 - 0, - // State 746 - 0, - // State 747 - -200, - // State 748 - 0, - // State 749 - -201, - // State 750 - 0, - // State 751 - 0, - // State 752 - 0, - // State 753 - 0, - // State 754 - -462, - // State 755 - 0, - // State 756 - 0, - // State 757 - 0, - // State 758 - 0, - // State 759 - 0, - // State 760 - 0, - // State 761 - 0, - // State 762 - 0, - // State 763 - 0, - // State 764 - 0, - // State 765 - 0, - // State 766 - 0, - // State 767 - -775, - // State 768 - 0, - // State 769 - 0, - // State 770 - 0, - // State 771 - 0, - // State 772 - 0, - // State 773 - 0, - // State 774 - -276, - // State 775 - 0, - // State 776 - 0, - // State 777 - 0, - // State 778 - 0, - // State 779 - 0, - // State 780 - 0, - // State 781 - 0, - // State 782 - 0, - // State 783 - 0, - // State 784 - 0, - // State 785 - 0, - // State 786 - 0, - // State 787 - 0, - // State 788 - 0, - // State 789 - 0, - // State 790 - 0, - // State 791 - 0, - // State 792 - 0, - // State 793 - 0, - // State 794 - 0, - // State 795 - 0, - // State 796 - 0, - // State 797 - 0, - // State 798 - 0, - // State 799 - 0, - // State 800 - 0, - // State 801 - 0, - // State 802 - 0, - // State 803 - 0, - // State 804 - -855, - // State 805 - 0, - // State 806 - -347, - // State 807 - -351, - // State 808 - 0, - // State 809 - 0, - // State 810 - -923, - // State 811 - 0, - // State 812 - 0, - // State 813 - 0, - // State 814 - 0, - // State 815 - 0, - // State 816 - 0, - // State 817 - 0, - // State 818 - 0, - // State 819 - 0, - // State 820 - -943, - // State 821 - 0, - // State 822 - 0, - // State 823 - 0, - // State 824 - 0, - // State 825 - 0, - // State 826 - 0, - // State 827 - 0, - // State 828 - 0, - // State 829 - 0, - // State 830 - 0, - // State 831 - 0, - // State 832 - 0, - // State 833 - 0, - // State 834 - 0, - // State 835 - 0, - // State 836 - 0, - // State 837 - -203, - // State 838 - -197, - // State 839 - 0, - // State 840 - 0, - // State 841 - 0, - // State 842 - 0, - // State 843 - 0, - // State 844 - 0, - // State 845 - 0, - // State 846 - 0, - // State 847 - 0, - // State 848 - 0, - // State 849 - 0, - // State 850 - -278, - // State 851 - 0, - // State 852 - 0, - // State 853 - 0, - // State 854 - -942, - // State 855 - -272, - // State 856 - -275, - // State 857 - 0, - // State 858 - 0, - // State 859 - 0, - // State 860 - 0, - // State 861 - -419, - // State 862 - 0, - // State 863 - 0, - // State 864 - 0, - // State 865 - 0, - // State 866 - 0, - // State 867 - 0, - // State 868 - 0, - // State 869 - 0, - // State 870 - -439, - // State 871 - 0, - // State 872 - 0, - // State 873 - 0, - // State 874 - -856, - // State 875 - 0, - // State 876 - -853, - // State 877 - -348, - // State 878 - 0, - // State 879 - 0, - // State 880 - -352, - // State 881 - 0, - // State 882 - 0, - // State 883 - 0, - // State 884 - 0, - // State 885 - 0, - // State 886 - 0, - // State 887 - 0, - // State 888 - 0, - // State 889 - 0, - // State 890 - 0, - // State 891 - 0, - // State 892 - 0, - // State 893 - 0, - // State 894 - 0, - // State 895 - 0, - // State 896 - 0, - // State 897 - 0, - // State 898 - 0, - // State 899 - 0, - // State 900 - 0, - // State 901 - 0, - // State 902 - 0, - // State 903 - -199, - // State 904 - 0, - // State 905 - 0, - // State 906 - 0, - // State 907 - 0, - // State 908 - 0, - // State 909 - 0, - // State 910 - 0, - // State 911 - 0, - // State 912 - 0, - // State 913 - 0, - // State 914 - -274, - // State 915 - -277, - // State 916 - 0, - // State 917 - -421, - // State 918 - 0, - // State 919 - -411, - // State 920 - -271, - // State 921 - 0, - // State 922 - 0, - // State 923 - 0, - // State 924 - 0, - // State 925 - -418, - // State 926 - 0, - // State 927 - 0, - // State 928 - 0, - // State 929 - 0, - // State 930 - 0, - // State 931 - 0, - // State 932 - 0, - // State 933 - -405, - // State 934 - 0, - // State 935 - 0, - // State 936 - 0, - // State 937 - 0, - // State 938 - 0, - // State 939 - 0, - // State 940 - 0, - // State 941 - -854, - // State 942 - 0, - // State 943 - -345, - // State 944 - -891, - // State 945 - 0, - // State 946 - 0, - // State 947 - 0, - // State 948 - 0, - // State 949 - 0, - // State 950 - -857, - // State 951 - 0, - // State 952 - 0, - // State 953 - 0, - // State 954 - 0, - // State 955 - 0, - // State 956 - 0, - // State 957 - 0, - // State 958 - 0, - // State 959 - 0, - // State 960 - 0, - // State 961 - 0, - // State 962 - 0, - // State 963 - 0, - // State 964 - 0, - // State 965 - 0, - // State 966 - 0, - // State 967 - 0, - // State 968 - 0, - // State 969 - -413, - // State 970 - -273, - // State 971 - 0, - // State 972 - -420, - // State 973 - 0, - // State 974 - -410, - // State 975 - -403, - // State 976 - -415, - // State 977 - 0, - // State 978 - 0, - // State 979 - 0, - // State 980 - 0, - // State 981 - 0, - // State 982 - 0, - // State 983 - 0, - // State 984 - 0, - // State 985 - 0, - // State 986 - 0, - // State 987 - 0, - // State 988 - 0, - // State 989 - 0, - // State 990 - 0, - // State 991 - -436, - // State 992 - 0, - // State 993 - -500, - // State 994 - 0, - // State 995 - 0, - // State 996 - 0, - // State 997 - 0, - // State 998 - 0, - // State 999 - 0, - // State 1000 - 0, - // State 1001 - 0, - // State 1002 - 0, - // State 1003 - 0, - // State 1004 - 0, - // State 1005 - 0, - // State 1006 - 0, - // State 1007 - 0, - // State 1008 - 0, - // State 1009 - 0, - // State 1010 - 0, - // State 1011 - 0, - // State 1012 - 0, - // State 1013 - 0, - // State 1014 - -503, - // State 1015 - -884, - // State 1016 - -885, - // State 1017 - -888, - // State 1018 - -889, - // State 1019 - -344, - // State 1020 - 0, - // State 1021 - 0, - // State 1022 - 0, - // State 1023 - 0, - // State 1024 - 0, - // State 1025 - 0, - // State 1026 - 0, - // State 1027 - -922, - // State 1028 - 0, - // State 1029 - 0, - // State 1030 - 0, - // State 1031 - 0, - // State 1032 - 0, - // State 1033 - 0, - // State 1034 - 0, - // State 1035 - 0, - // State 1036 - 0, - // State 1037 - 0, - // State 1038 - 0, - // State 1039 - -412, - // State 1040 - -417, - // State 1041 - -407, - // State 1042 - 0, - // State 1043 - -414, - // State 1044 - 0, - // State 1045 - 0, - // State 1046 - 0, - // State 1047 - 0, - // State 1048 - 0, - // State 1049 - 0, - // State 1050 - -438, - // State 1051 - -111, - // State 1052 - -501, - // State 1053 - 0, - // State 1054 - 0, - // State 1055 - 0, - // State 1056 - 0, - // State 1057 - 0, - // State 1058 - 0, - // State 1059 - 0, - // State 1060 - 0, - // State 1061 - 0, - // State 1062 - 0, - // State 1063 - 0, - // State 1064 - 0, - // State 1065 - 0, - // State 1066 - 0, - // State 1067 - 0, - // State 1068 - 0, - // State 1069 - 0, - // State 1070 - 0, - // State 1071 - 0, - // State 1072 - 0, - // State 1073 - 0, - // State 1074 - 0, - // State 1075 - 0, - // State 1076 - -502, - // State 1077 - 0, - // State 1078 - 0, - // State 1079 - -349, - // State 1080 - 0, - // State 1081 - 0, - // State 1082 - 0, - // State 1083 - 0, - // State 1084 - 0, - // State 1085 - 0, - // State 1086 - 0, - // State 1087 - 0, - // State 1088 - 0, - // State 1089 - 0, - // State 1090 - 0, - // State 1091 - 0, - // State 1092 - 0, - // State 1093 - -409, - // State 1094 - -416, - // State 1095 - -406, - // State 1096 - 0, - // State 1097 - 0, - // State 1098 - 0, - // State 1099 - 0, - // State 1100 - 0, - // State 1101 - 0, - // State 1102 - 0, - // State 1103 - 0, - // State 1104 - -404, - // State 1105 - -112, - // State 1106 - 0, - // State 1107 - 0, - // State 1108 - 0, - // State 1109 - 0, - // State 1110 - 0, - // State 1111 - 0, - // State 1112 - 0, - // State 1113 - 0, - // State 1114 - 0, - // State 1115 - 0, - // State 1116 - 0, - // State 1117 - 0, - // State 1118 - 0, - // State 1119 - 0, - // State 1120 - 0, - // State 1121 - 0, - // State 1122 - 0, - // State 1123 - 0, - // State 1124 - 0, - // State 1125 - 0, - // State 1126 - 0, - // State 1127 - 0, - // State 1128 - 0, - // State 1129 - 0, - // State 1130 - 0, - // State 1131 - -346, - // State 1132 - 0, - // State 1133 - 0, - // State 1134 - 0, - // State 1135 - -408, - // State 1136 - -402, - // State 1137 - 0, - // State 1138 - 0, - // State 1139 - 0, - // State 1140 - 0, - // State 1141 - 0, - // State 1142 - 0, - // State 1143 - 0, - // State 1144 - 0, - // State 1145 - 0, - // State 1146 - 0, - // State 1147 - 0, - // State 1148 - 0, - // State 1149 - 0, - // State 1150 - 0, - // State 1151 - 0, - // State 1152 - 0, - // State 1153 - 0, - // State 1154 - 0, - // State 1155 - 0, - // State 1156 - 0, - // State 1157 - -883, - // State 1158 - -887, - // State 1159 - -350, - // State 1160 - 0, - // State 1161 - 0, - // State 1162 - 0, - // State 1163 - 0, - // State 1164 - 0, - // State 1165 - 0, - // State 1166 - 0, - // State 1167 - 0, - // State 1168 - 0, - // State 1169 - 0, - // State 1170 - 0, - // State 1171 - 0, - // State 1172 - 0, - // State 1173 - 0, - // State 1174 - 0, - // State 1175 - 0, - // State 1176 - 0, - // State 1177 - 0, - // State 1178 - 0, - // State 1179 - 0, - // State 1180 - 0, - // State 1181 - 0, - // State 1182 - 0, - // State 1183 - 0, - // State 1184 - 0, - // State 1185 - 0, - // State 1186 - 0, - // State 1187 - 0, - // State 1188 - 0, - ]; - fn __goto(state: i16, nt: usize) -> i16 { - match nt { - 10 => match state { - 218 => 865, - 294 => 978, - 295 => 979, - 296 => 980, - 360 => 1102, - 361 => 1103, - 382 => 1140, - 383 => 1141, - _ => 864, - }, - 13 => match state { - 44 => 565, - 138 => 751, - 139 => 752, - 140 => 753, - 241 => 910, - 242 => 911, - 281 => 964, - 282 => 965, - _ => 564, - }, - 22 => match state { - 137 => 748, - 189 => 823, - 275 => 953, - _ => 555, - }, - 25 => match state { - 190 => 826, - 276 => 955, - _ => 725, - }, - 29 => 715, - 35 => 581, - 38 => 451, - 49 => 870, - 53 => match state { - 72 | 107 => 114, - _ => 3, - }, - 58 => 75, - 60 => match state { - 72 | 107 => 115, - _ => 4, - }, - 65 => match state { - 345 => 376, - _ => 375, - }, - 68 => match state { - 22 => 52, - 226 => 271, - 272 => 315, - _ => 170, - }, - 73 => match state { - 118 => 179, - _ => 29, - }, - 80 => match state { - 116 => 175, - 338 | 377 => 368, - _ => 24, - }, - 81 => match state { - 346 | 388 => 1064, - _ => 994, - }, - 82 => match state { - 36 => 551, - 72 | 107 => 626, - 187 => 821, - _ => 404, - }, - 83 => 627, - 84 => match state { - 3 => 436, - 114 => 721, - _ => 405, - }, - 85 => 628, - 86 => match state { - 108 => 711, - 117 => 723, - 148 => 768, - 153 => 773, - 205 => 849, - _ => 441, - }, - 88 => match state { - 34 => 81, - 72 | 107 => 116, - 182 => 230, - _ => 5, - }, - 89 => 629, - 90 => 995, - 91 => 499, - 92 => match state { - 101 => 702, - 150 => 770, - _ => 583, - }, - 94 => 101, - 96 => 406, - 97 => 630, - 98 => match state { - 17 => 42, - 72 | 107 => 117, - 125 => 193, - _ => 6, - }, - 99 => 631, - 100 => match state { - 72 | 107 => 632, - _ => 407, - }, - 101 => 633, - 102 => 102, - 103 => 996, - 104 => 500, - 105 => 997, - 106 => match state { - 364 => 1106, - 373 => 1120, - _ => 998, - }, - 109 => match state { - 41 => 562, - 47 => 569, - 48 => 571, - 76 => 662, - 188 => 822, - 192 => 831, - 194 => 832, - 195 => 834, - _ => 552, - }, - 111 => match state { - 29 | 179 => 80, - _ => 30, - }, - 112 => 408, - 113 => 634, - 114 => match state { - 226 => 885, - 272 => 948, - _ => 501, - }, - 115 => match state { - 279 | 319 => 958, - _ => 902, - }, - 117 => match state { - 278 => 319, - _ => 279, - }, - 118 => match state { - 53 => 579, - _ => 502, - }, - 120 => 53, - 121 => 503, - 122 => match state { - 95 => 692, - _ => 487, - }, - 123 => match state { - 127 => 194, - 95 => 693, - _ => 47, - }, - 124 => match state { - 127 => 733, - _ => 488, - }, - 126 => match state { - 65 => 617, - 110 => 713, - 166 => 795, - _ => 609, - }, - 127 => match state { - 256 => 927, - 257 => 929, - 259 => 932, - 297 => 981, - 298 => 984, - 329 => 1044, - 330 => 1045, - 331 => 1046, - 357 => 1096, - 358 => 1098, - 359 => 1100, - 384 => 1142, - 385 => 1143, - 392 => 1160, - 393 => 1161, - 394 => 1162, - 395 => 1164, - 400 => 1176, - 401 => 1178, - _ => 779, - }, - 128 => match state { - 89 => 682, - 91 => 685, - 93 => 688, - 142 => 755, - 143 => 758, - 199 => 839, - 200 => 840, - 201 => 841, - 238 => 904, - 239 => 906, - 240 => 908, - 283 => 966, - 284 => 967, - 320 => 1032, - 321 => 1033, - 322 => 1034, - 323 => 1036, - 352 => 1087, - 353 => 1089, - _ => 480, - }, - 129 => match state { - 223 => 877, - _ => 806, - }, - 130 => 223, - 131 => match state { - 224 => 880, - _ => 807, - }, - 132 => 224, - 133 => match state { - 22 | 52 | 112 | 154 | 164 | 170 | 173 | 186 | 206 | 210..=212 | 216 | 226 | 244..=245 | 247 | 249..=250 | 254 | 260 | 269..=272 | 286..=287 | 289 | 291..=293 | 303 | 309..=313 | 315..=316 | 325..=328 | 333..=334 | 348 | 354..=356 | 362..=363 | 371 | 379..=381 | 386 | 389..=391 => 54, - 72 | 107 => 118, - 15 => 472, - 30 => 543, - 39 => 559, - 49 => 573, - 60..=61 | 84 | 106 | 135 | 158 | 160 => 601, - 80 => 667, - 184 => 817, - 191 => 829, - _ => 7, - }, - 134 => 635, - 135 => match state { - 84 => 671, - 106 => 709, - 135 => 745, - _ => 606, - }, - 136 => 602, - 137 => 959, - 138 => match state { - 158 | 160 => 786, - _ => 603, - }, - 139 => 504, - 140 => match state { - 146 => 203, - _ => 144, - }, - 142 => 409, - 143 => 764, - 144 => match state { - 144 => 760, - 146 => 765, - 203 => 845, - _ => 696, - }, - 146 => match state { - 50 | 202 => 574, - _ => 495, - }, - 148 => match state { - 145 => 202, - _ => 50, - }, - 149 => 496, - 150 => match state { - 13 => 463, - 28 => 542, - 35 => 550, - 121 => 724, - 178 => 813, - 183 => 816, - _ => 410, - }, - 151 => 636, - 152 => 505, - 153 => 506, - 154 => 507, - 155 => match state { - 75 => 658, - _ => 533, - }, - 157 => 607, - 158 => match state { - 1 => 8, - 40 => 560, - 51 | 102..=103 => 576, - 69 => 623, - 159 => 787, - 209 => 853, - _ => 55, - }, - 159 => 508, - 160 => 1055, - 161 => match state { - 58 => 108, - 59 => 109, - 99 => 148, - 100 => 149, - 105 => 152, - 147 => 204, - 14 | 16 | 20 | 27 | 56 | 64 | 66 | 71 | 85..=86 | 88 | 96 | 123..=124 | 127 | 129 | 131 | 136 | 167..=168 | 177 | 198 | 232..=233 | 237 | 263 | 274 | 302 | 317 | 350 | 372 => 464, - 18 | 89 | 91 | 93 | 142..=143 | 199..=201 | 238..=240 | 283..=284 | 320..=323 | 352..=353 => 481, - 25 | 75 => 534, - 26 => 536, - 44 | 139 | 242 | 282 => 566, - 45 => 567, - 63 | 67 => 614, - 70 => 624, - 72 | 107 => 637, - 155 | 252 => 775, - 157 | 256..=257 | 259 | 297..=298 | 329..=331 | 357..=359 | 384..=385 | 392..=395 | 400..=401 => 780, - 161 | 220 => 788, - 162 => 792, - 163 => 793, - 165 => 794, - 176 => 811, - 213 => 858, - 214 => 859, - 218 | 295 | 361 | 383 => 866, - 219 => 867, - 221 => 869, - 261 => 934, - 262 | 301 => 935, - 264 => 939, - 306 | 342 | 345 | 364 | 370 | 373..=376 | 387 | 396 => 999, - 314 => 1020, - 332 => 1049, - 343 => 1060, - 346 | 388 => 1065, - 349 => 1080, - 365 | 398 => 1107, - 366 => 1113, - 367 => 1114, - 369 => 1116, - 378 => 1130, - 397 | 402 => 1167, - 399 => 1174, - _ => 411, - }, - 162 => 509, - 165 => 789, - 166 => match state { - 110 => 714, - _ => 610, - }, - 168 => 110, - 169 => 611, - 170 => 510, - 171 => 704, - 172 => 511, - 173 => 512, - 174 => match state { - 72 | 107 => 638, - _ => 412, - }, - 175 => match state { - 124 => 730, - _ => 473, - }, - 177 => 1000, - 178 => 1066, - 179 => 1001, - 180 => match state { - 265..=266 | 304 | 307 => 940, - _ => 992, - }, - 181 => match state { - 266 => 308, - 304 => 335, - 307 => 347, - _ => 305, - }, - 182 => match state { - 397 | 402 => 1168, - _ => 1108, - }, - 183 => match state { - 388 => 1153, - _ => 1067, - }, - 184 => match state { - 346 | 388 => 1068, - _ => 336, - }, - 185 => match state { - 346 | 388 => 1069, - _ => 337, - }, - 186 => 513, - 187 => match state { - 120 => 183, - _ => 35, - }, - 188 => match state { - 14 | 123 => 465, - 86 | 233 => 675, - _ => 474, - }, - 189 => 466, - 190 => match state { - 14 => 37, - 20 => 48, - 25 | 75 => 76, - 123 => 188, - 127 => 195, - 56 => 599, - 64 => 616, - 71 => 625, - 263 => 938, - 302 => 990, - 372 => 1119, - _ => 475, - }, - 191 => match state { - 86 => 137, - 123 => 189, - 233 => 275, - _ => 38, - }, - 192 => 514, - 193 => match state { - 4 => 437, - 19 => 486, - 115 => 722, - 126 => 732, - _ => 413, - }, - 194 => 639, - 195 => match state { - 72 | 107 => 640, - 306 | 342 | 344..=346 | 364..=365 | 368 | 370 | 373..=376 | 387..=388 | 396 | 398 => 1002, - _ => 414, - }, - 196 => match state { - 344 => 1061, - 368 => 1115, - _ => 1003, - }, - 197 => match state { - 346 | 388 => 377, - _ => 338, - }, - 198 => 489, - 199 => match state { - 60 => 604, - _ => 608, - }, - 200 => match state { - 67 => 621, - _ => 615, - }, - 201 => 618, - 202 => match state { - 220 => 868, - _ => 790, - }, - 203 => match state { - 398 => 1170, - _ => 1109, - }, - 204 => 1070, - 205 => 781, - 206 => 482, - 207 => 1110, - 208 => match state { - 123 => 726, - _ => 467, - }, - 209 => 415, - 210 => match state { - 20 | 127 => 490, - _ => 476, - }, - 211 => 776, - 212 => 1004, - 213 => match state { - 197 => 236, - 235 => 278, - 33 => 549, - 72 | 107 => 641, - 181 => 815, - 280 => 960, - _ => 416, - }, - 214 => 642, - 215 => match state { - 157 => 782, - 256 => 928, - 297..=298 | 357..=359 | 394..=395 | 400..=401 => 982, - _ => 930, - }, - 216 => match state { - 18 => 483, - 89 => 683, - 142..=143 | 238..=240 | 322..=323 | 352..=353 => 756, - _ => 686, - }, - 219 => 783, - 220 => 484, - 224 => match state { - 149 => 769, - 152 => 772, - 156 => 778, - 204 => 848, - 207 => 851, - 208 => 852, - 243 => 913, - _ => 712, - }, - 225 => 515, - 226 => match state { - 342 => 1058, - 345 => 1062, - 365 => 1111, - 370 => 1117, - 374 => 1121, - 375 => 1122, - 376 => 1125, - 387 => 1152, - 396 => 1166, - 398 => 1171, - _ => 1005, - }, - 228 => match state { - 337 => 1054, - _ => 1053, - }, - 229 => 339, - 230 => 417, - 231 => 643, - 232 => 22, - 233 => 516, - 234 => 1006, - 235 => match state { - 127 => 734, - _ => 491, - }, - 236 => match state { - 23 => 73, - 72 | 107 => 119, - 174 => 228, - _ => 9, - }, - 237 => 644, - 238 => match state { - 119 => 182, - _ => 34, - }, - 239 => match state { - 83 => 670, - _ => 553, - }, - 240 => 83, - 241 => match state { - 130 => 740, - 132 => 742, - 196 => 836, - _ => 666, - }, - 243 => match state { - 22 => 517, - 52 => 578, - 170 => 803, - 226 => 886, - 271 => 945, - 272 => 949, - 315 => 1024, - _ => 718, - }, - 244 => match state { - 14 | 86 | 123 | 233 => 468, - 16 | 20 | 27 | 66 | 85 | 88 | 96 | 124 | 127 | 129 | 131 | 136 | 167..=168 | 177 | 198 | 232 | 237 | 274 | 317 | 350 => 477, - 60..=61 | 84 | 106 | 135 | 158 | 160 => 605, - _ => 418, - }, - 245 => 1007, - 246 => match state { - 256 => 294, - 331 => 360, - 359 => 382, - _ => 217, - }, - 247 => match state { - 89 => 138, - 201 => 241, - 240 => 281, - _ => 43, - }, - 248 => 272, - 249 => match state { - 72 | 107 => 645, - 346 | 388 => 1071, - _ => 419, - }, - 250 => match state { - 306 | 342 | 345 | 364..=365 | 370 | 373..=376 | 387 | 396 | 398 => 340, - 340 => 1056, - 341 => 1057, - _ => 420, - }, - 251 => match state { - 10 => 456, - 12 => 462, - _ => 10, - }, - 252 => match state { - 129 => 739, - 131 => 741, - _ => 537, - }, - 253 => match state { - 177 => 812, - _ => 538, - }, - 254 => match state { - 164 => 222, - 154 => 774, - 173 => 810, - 186 => 820, - 206 => 850, - 210 => 854, - 211 => 855, - 212 => 856, - 216 => 861, - 244 => 914, - 245 => 915, - 247 => 917, - 249 => 919, - 250 => 920, - 254 => 925, - 260 => 933, - 269 => 943, - 270 => 944, - 286 => 969, - 287 => 970, - 289 => 972, - 291 => 974, - 292 => 975, - 293 => 976, - 303 => 991, - 309 => 1015, - 310 => 1016, - 311 => 1017, - 312 => 1018, - 313 => 1019, - 316 => 1027, - 325 => 1039, - 326 => 1040, - 327 => 1041, - 328 => 1043, - 333 => 1050, - 334 => 1051, - 348 => 1079, - 354 => 1093, - 355 => 1094, - 356 => 1095, - 362 => 1104, - 363 => 1105, - 371 => 1118, - 379 => 1131, - 380 => 1135, - 381 => 1136, - 386 => 1146, - 389 => 1157, - 390 => 1158, - 391 => 1159, - _ => 171, - }, - 255 => match state { - 24 => 74, - 72 | 107 => 120, - 175 => 229, - _ => 11, - }, - 256 => 646, - 257 => match state { - 79 => 132, - 104 => 150, - 130 => 196, - 1 | 32 | 40 | 51 | 69 | 102..=103 | 159 | 209 | 299 => 421, - 14 => 469, - 16 | 25 | 56 | 64 | 66 | 71 | 75 | 85 | 88 | 96 | 124 | 136 | 167..=168 | 198 | 232 | 237 | 263 | 274 | 302 | 317 | 350 | 372 => 478, - 20 | 127 => 492, - 27 | 129 | 131 | 177 => 539, - 46 => 568, - 57 => 600, - 68 => 622, - 72 | 107 | 185 | 231 | 234 | 277 | 318 | 351 => 647, - 77 => 663, - 78 => 664, - 82 => 668, - 86 => 676, - 87 => 679, - 90 => 684, - 92 => 687, - 94 => 689, - 95 => 694, - 97 => 695, - 123 => 727, - 128 => 738, - 133 => 743, - 134 => 744, - 141 => 754, - 151 => 771, - 169 => 802, - 172 => 809, - 215 => 860, - 225 | 267 => 884, - 227 => 887, - 233 => 894, - 246 => 916, - 248 => 918, - 251 => 921, - 253 => 924, - 255 => 926, - 258 => 931, - 268 => 942, - 273 => 951, - 285 => 968, - 288 => 971, - 290 => 973, - 300 => 987, - 324 => 1038, - _ => 518, - }, - 259 => 648, - 262 => match state { - 102 => 703, - 103 => 705, - _ => 98, - }, - 263 => match state { - 32 => 548, - 299 => 985, - _ => 422, - }, - 265 => match state { - 16 => 41, - 124 => 192, - 20 | 127 => 493, - 66 => 619, - 85 | 198 | 232 | 317 => 673, - 88 | 96 => 680, - 136 | 237 | 274 | 350 => 746, - 167 => 796, - 168 => 799, - _ => 540, - }, - 266 => 403, - 267 => 519, - 268 => 341, - 269 => 12, - 270 => 1008, - 271 => 1009, - 272 => 541, - 273 => 620, - 274 => 113, - 275 => 520, - 276 => match state { - 252 => 922, - _ => 777, - }, - 277 => match state { - 109 => 156, - 148 => 205, - 149 => 207, - 152 => 208, - 204 => 243, - 113 => 720, - _ => 153, - }, - 279 => 784, - 280 => match state { - 72 | 107 => 121, - _ => 13, - }, - 281 => 485, - 282 => 1010, - 283 => 521, - 284 => match state { - 72 | 107 => 122, - 231 | 277 | 351 => 890, - _ => 818, - }, - 285 => 649, - 286 => match state { - 123 => 190, - 233 => 276, - 72 | 107 => 650, - _ => 819, - }, - 287 => match state { - 107 => 710, - _ => 651, - }, - 289 => 522, - 290 => match state { - 31 => 546, - 72 | 107 => 652, - 180 => 814, - _ => 423, - }, - 291 => 653, - 292 => match state { - 14 => 470, - 51 | 102..=103 => 577, - 123 => 728, - _ => 523, - }, - _ => 0, - } - } - const __TERMINAL: &[&str] = &[ - r###""\n""###, - r###""!""###, - r###""!=""###, - r###""%""###, - r###""%=""###, - r###""&""###, - r###""&=""###, - r###""(""###, - r###"")""###, - r###""*""###, - r###""**""###, - r###""**=""###, - r###""*=""###, - r###""+""###, - r###""+=""###, - r###"",""###, - r###""-""###, - r###""-=""###, - r###""->""###, - r###"".""###, - r###""...""###, - r###""/""###, - r###""//""###, - r###""//=""###, - r###""/=""###, - r###"":""###, - r###"":=""###, - r###"";""###, - r###""<""###, - r###""<<""###, - r###""<<=""###, - r###""<=""###, - r###""=""###, - r###""==""###, - r###"">""###, - r###"">=""###, - r###"">>""###, - r###"">>=""###, - r###""?""###, - r###""@""###, - r###""@=""###, - r###""False""###, - r###""None""###, - r###""True""###, - r###""[""###, - r###""]""###, - r###""^""###, - r###""^=""###, - r###""and""###, - r###""as""###, - r###""assert""###, - r###""async""###, - r###""await""###, - r###""break""###, - r###""case""###, - r###""class""###, - r###""continue""###, - r###""def""###, - r###""del""###, - r###""elif""###, - r###""else""###, - r###""except""###, - r###""finally""###, - r###""for""###, - r###""from""###, - r###""global""###, - r###""if""###, - r###""import""###, - r###""in""###, - r###""is""###, - r###""lambda""###, - r###""match""###, - r###""nonlocal""###, - r###""not""###, - r###""or""###, - r###""pass""###, - r###""raise""###, - r###""return""###, - r###""try""###, - r###""type""###, - r###""while""###, - r###""with""###, - r###""yield""###, - r###""{""###, - r###""|""###, - r###""|=""###, - r###""}""###, - r###""~""###, - r###"Dedent"###, - r###"FStringEnd"###, - r###"Indent"###, - r###"StartExpression"###, - r###"StartModule"###, - r###"complex"###, - r###"float"###, - r###"fstring_middle"###, - r###"fstring_start"###, - r###"int"###, - r###"ipy_escape_command"###, - r###"name"###, - r###"string"###, - ]; - fn __expected_tokens(__state: i16) -> alloc::vec::Vec { - __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { - let next_state = __action(__state, index); - if next_state == 0 { - None - } else { - Some(alloc::string::ToString::to_string(terminal)) - } - }).collect() - } - fn __expected_tokens_from_states< - '__0, - >( - __states: &[i16], - _: core::marker::PhantomData<()>, - ) -> alloc::vec::Vec - { - __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { - if __accepts(None, __states, Some(index), core::marker::PhantomData::<()>) { - Some(alloc::string::ToString::to_string(terminal)) - } else { - None - } - }).collect() - } - pub(crate) struct __StateMachine<'__0> - where - { - source_code: &'__0 str, - mode: Mode, - __phantom: core::marker::PhantomData<()>, - } - impl<'__0> __state_machine::ParserDefinition for __StateMachine<'__0> - where - { - type Location = TextSize; - type Error = LexicalError; - type Token = token::Tok; - type TokenIndex = usize; - type Symbol = __Symbol<>; - type Success = ast::Mod; - type StateIndex = i16; - type Action = i16; - type ReduceIndex = i16; - type NonterminalIndex = usize; - - #[inline] - fn start_location(&self) -> Self::Location { - Default::default() - } - - #[inline] - fn start_state(&self) -> Self::StateIndex { - 0 - } - - #[inline] - fn token_to_index(&self, token: &Self::Token) -> Option { - __token_to_integer(token, core::marker::PhantomData::<()>) - } - - #[inline] - fn action(&self, state: i16, integer: usize) -> i16 { - __action(state, integer) - } - - #[inline] - fn error_action(&self, state: i16) -> i16 { - __action(state, 101 - 1) - } - - #[inline] - fn eof_action(&self, state: i16) -> i16 { - __EOF_ACTION[state as usize] - } - - #[inline] - fn goto(&self, state: i16, nt: usize) -> i16 { - __goto(state, nt) - } - - fn token_to_symbol(&self, token_index: usize, token: Self::Token) -> Self::Symbol { - __token_to_symbol(token_index, token, core::marker::PhantomData::<()>) - } - - fn expected_tokens(&self, state: i16) -> alloc::vec::Vec { - __expected_tokens(state) - } - - fn expected_tokens_from_states(&self, states: &[i16]) -> alloc::vec::Vec { - __expected_tokens_from_states(states, core::marker::PhantomData::<()>) - } - - #[inline] - fn uses_error_recovery(&self) -> bool { - false - } - - #[inline] - fn error_recovery_symbol( - &self, - recovery: __state_machine::ErrorRecovery, - ) -> Self::Symbol { - panic!("error recovery not enabled for this grammar") - } - - fn reduce( - &mut self, - action: i16, - start_location: Option<&Self::Location>, - states: &mut alloc::vec::Vec, - symbols: &mut alloc::vec::Vec<__state_machine::SymbolTriple>, - ) -> Option<__state_machine::ParseResult> { - __reduce( - self.source_code, - self.mode, - action, - start_location, - states, - symbols, - core::marker::PhantomData::<()>, - ) - } - - fn simulate_reduce(&self, action: i16) -> __state_machine::SimulatedReduce { - __simulate_reduce(action, core::marker::PhantomData::<()>) - } - } - fn __token_to_integer< - >( - __token: &token::Tok, - _: core::marker::PhantomData<()>, - ) -> Option - { - match *__token { - token::Tok::Newline if true => Some(0), - token::Tok::Exclamation if true => Some(1), - token::Tok::NotEqual if true => Some(2), - token::Tok::Percent if true => Some(3), - token::Tok::PercentEqual if true => Some(4), - token::Tok::Amper if true => Some(5), - token::Tok::AmperEqual if true => Some(6), - token::Tok::Lpar if true => Some(7), - token::Tok::Rpar if true => Some(8), - token::Tok::Star if true => Some(9), - token::Tok::DoubleStar if true => Some(10), - token::Tok::DoubleStarEqual if true => Some(11), - token::Tok::StarEqual if true => Some(12), - token::Tok::Plus if true => Some(13), - token::Tok::PlusEqual if true => Some(14), - token::Tok::Comma if true => Some(15), - token::Tok::Minus if true => Some(16), - token::Tok::MinusEqual if true => Some(17), - token::Tok::Rarrow if true => Some(18), - token::Tok::Dot if true => Some(19), - token::Tok::Ellipsis if true => Some(20), - token::Tok::Slash if true => Some(21), - token::Tok::DoubleSlash if true => Some(22), - token::Tok::DoubleSlashEqual if true => Some(23), - token::Tok::SlashEqual if true => Some(24), - token::Tok::Colon if true => Some(25), - token::Tok::ColonEqual if true => Some(26), - token::Tok::Semi if true => Some(27), - token::Tok::Less if true => Some(28), - token::Tok::LeftShift if true => Some(29), - token::Tok::LeftShiftEqual if true => Some(30), - token::Tok::LessEqual if true => Some(31), - token::Tok::Equal if true => Some(32), - token::Tok::EqEqual if true => Some(33), - token::Tok::Greater if true => Some(34), - token::Tok::GreaterEqual if true => Some(35), - token::Tok::RightShift if true => Some(36), - token::Tok::RightShiftEqual if true => Some(37), - token::Tok::Question if true => Some(38), - token::Tok::At if true => Some(39), - token::Tok::AtEqual if true => Some(40), - token::Tok::False if true => Some(41), - token::Tok::None if true => Some(42), - token::Tok::True if true => Some(43), - token::Tok::Lsqb if true => Some(44), - token::Tok::Rsqb if true => Some(45), - token::Tok::CircumFlex if true => Some(46), - token::Tok::CircumflexEqual if true => Some(47), - token::Tok::And if true => Some(48), - token::Tok::As if true => Some(49), - token::Tok::Assert if true => Some(50), - token::Tok::Async if true => Some(51), - token::Tok::Await if true => Some(52), - token::Tok::Break if true => Some(53), - token::Tok::Case if true => Some(54), - token::Tok::Class if true => Some(55), - token::Tok::Continue if true => Some(56), - token::Tok::Def if true => Some(57), - token::Tok::Del if true => Some(58), - token::Tok::Elif if true => Some(59), - token::Tok::Else if true => Some(60), - token::Tok::Except if true => Some(61), - token::Tok::Finally if true => Some(62), - token::Tok::For if true => Some(63), - token::Tok::From if true => Some(64), - token::Tok::Global if true => Some(65), - token::Tok::If if true => Some(66), - token::Tok::Import if true => Some(67), - token::Tok::In if true => Some(68), - token::Tok::Is if true => Some(69), - token::Tok::Lambda if true => Some(70), - token::Tok::Match if true => Some(71), - token::Tok::Nonlocal if true => Some(72), - token::Tok::Not if true => Some(73), - token::Tok::Or if true => Some(74), - token::Tok::Pass if true => Some(75), - token::Tok::Raise if true => Some(76), - token::Tok::Return if true => Some(77), - token::Tok::Try if true => Some(78), - token::Tok::Type if true => Some(79), - token::Tok::While if true => Some(80), - token::Tok::With if true => Some(81), - token::Tok::Yield if true => Some(82), - token::Tok::Lbrace if true => Some(83), - token::Tok::Vbar if true => Some(84), - token::Tok::VbarEqual if true => Some(85), - token::Tok::Rbrace if true => Some(86), - token::Tok::Tilde if true => Some(87), - token::Tok::Dedent if true => Some(88), - token::Tok::FStringEnd if true => Some(89), - token::Tok::Indent if true => Some(90), - token::Tok::StartExpression if true => Some(91), - token::Tok::StartModule if true => Some(92), - token::Tok::Complex { real: _, imag: _ } if true => Some(93), - token::Tok::Float { value: _ } if true => Some(94), - token::Tok::FStringMiddle { value: _, kind: _ } if true => Some(95), - token::Tok::FStringStart(_) if true => Some(96), - token::Tok::Int { value: _ } if true => Some(97), - token::Tok::IpyEscapeCommand { kind: _, value: _ } if true => Some(98), - token::Tok::Name { name: _ } if true => Some(99), - token::Tok::String { value: _, kind: _ } if true => Some(100), - _ => None, - } - } - fn __token_to_symbol< - >( - __token_index: usize, - __token: token::Tok, - _: core::marker::PhantomData<()>, - ) -> __Symbol<> - { - match __token_index { - 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 => __Symbol::Variant0(__token), - 93 => match __token { - token::Tok::Complex { real: __tok0, imag: __tok1 } if true => __Symbol::Variant1((__tok0, __tok1)), - _ => unreachable!(), - }, - 94 => match __token { - token::Tok::Float { value: __tok0 } if true => __Symbol::Variant2(__tok0), - _ => unreachable!(), - }, - 95 | 100 => match __token { - token::Tok::FStringMiddle { value: __tok0, kind: __tok1 } | token::Tok::String { value: __tok0, kind: __tok1 } if true => __Symbol::Variant3((__tok0, __tok1)), - _ => unreachable!(), - }, - 96 => match __token { - token::Tok::FStringStart(__tok0) if true => __Symbol::Variant4(__tok0), - _ => unreachable!(), - }, - 97 => match __token { - token::Tok::Int { value: __tok0 } if true => __Symbol::Variant5(__tok0), - _ => unreachable!(), - }, - 98 => match __token { - token::Tok::IpyEscapeCommand { kind: __tok0, value: __tok1 } if true => __Symbol::Variant6((__tok0, __tok1)), - _ => unreachable!(), - }, - 99 => match __token { - token::Tok::Name { name: __tok0 } if true => __Symbol::Variant7(__tok0), - _ => unreachable!(), - }, - _ => unreachable!(), - } - } - fn __simulate_reduce< - '__0, - >( - __reduce_index: i16, - _: core::marker::PhantomData<()>, - ) -> __state_machine::SimulatedReduce<__StateMachine<'__0>> - { - match __reduce_index { - 0 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 0, - } - } - 1 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 0, - } - } - 2 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 1, - } - } - 3 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 1, - } - } - 4 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 2, - } - } - 5 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 2, - } - } - 6 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 3, - } - } - 7 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 3, - } - } - 8 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 4, - } - } - 9 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 5, - } - } - 10 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 5, - } - } - 11 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 6, - } - } - 12 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 7, - } - } - 13 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 7, - } - } - 14 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 8, - } - } - 15 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 9, - } - } - 16 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 9, - } - } - 17 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 10, - } - } - 18 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 10, - } - } - 19 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 11, - } - } - 20 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 12, - } - } - 21 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 12, - } - } - 22 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 13, - } - } - 23 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 13, - } - } - 24 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 14, - } - } - 25 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 14, - } - } - 26 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 14, - } - } - 27 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 14, - } - } - 28 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 14, - } - } - 29 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 14, - } - } - 30 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 14, - } - } - 31 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 14, - } - } - 32 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 14, - } - } - 33 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 15, - } - } - 34 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 15, - } - } - 35 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 15, - } - } - 36 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 15, - } - } - 37 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 15, - } - } - 38 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 15, - } - } - 39 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 15, - } - } - 40 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 15, - } - } - 41 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 15, - } - } - 42 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 15, - } - } - 43 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 16, - } - } - 44 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 16, - } - } - 45 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 16, - } - } - 46 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 16, - } - } - 47 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 16, - } - } - 48 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 16, - } - } - 49 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 16, - } - } - 50 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 16, - } - } - 51 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 16, - } - } - 52 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 17, - } - } - 53 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 17, - } - } - 54 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 17, - } - } - 55 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 17, - } - } - 56 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 17, - } - } - 57 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 17, - } - } - 58 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 17, - } - } - 59 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 17, - } - } - 60 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 17, - } - } - 61 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 17, - } - } - 62 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 18, - } - } - 63 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 19, - } - } - 64 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 19, - } - } - 65 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 20, - } - } - 66 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 21, - } - } - 67 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 21, - } - } - 68 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 22, - } - } - 69 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 22, - } - } - 70 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 23, - } - } - 71 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 24, - } - } - 72 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 24, - } - } - 73 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 25, - } - } - 74 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 25, - } - } - 75 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 26, - } - } - 76 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 27, - } - } - 77 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 27, - } - } - 78 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 28, - } - } - 79 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 29, - } - } - 80 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 29, - } - } - 81 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 30, - } - } - 82 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 31, - } - } - 83 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 31, - } - } - 84 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 32, - } - } - 85 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 33, - } - } - 86 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 33, - } - } - 87 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 34, - } - } - 88 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 35, - } - } - 89 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 35, - } - } - 90 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 36, - } - } - 91 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 37, - } - } - 92 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 37, - } - } - 93 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 38, - } - } - 94 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 38, - } - } - 95 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 39, - } - } - 96 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 40, - } - } - 97 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 40, - } - } - 98 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 41, - } - } - 99 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 42, - } - } - 100 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 42, - } - } - 101 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 43, - } - } - 102 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 44, - } - } - 103 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 44, - } - } - 104 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 45, - } - } - 105 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 46, - } - } - 106 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 46, - } - } - 107 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 47, - } - } - 108 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 48, - } - } - 109 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 48, - } - } - 110 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 49, - } - } - 111 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 49, - } - } - 112 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 50, - } - } - 113 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 51, - } - } - 114 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 51, - } - } - 115 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 52, - } - } - 116 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 53, - } - } - 117 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 53, - } - } - 118 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 54, - } - } - 119 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 55, - } - } - 120 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 56, - } - } - 121 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 57, - } - } - 122 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 57, - } - } - 123 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 58, - } - } - 124 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 58, - } - } - 125 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 59, - } - } - 126 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 60, - } - } - 127 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 60, - } - } - 128 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 61, - } - } - 129 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 62, - } - } - 130 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 62, - } - } - 131 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 63, - } - } - 132 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 64, - } - } - 133 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 64, - } - } - 134 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 65, - } - } - 135 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 65, - } - } - 136 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 66, - } - } - 137 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 67, - } - } - 138 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 67, - } - } - 139 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 68, - } - } - 140 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 68, - } - } - 141 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 69, - } - } - 142 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 70, - } - } - 143 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 71, - } - } - 144 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 71, - } - } - 145 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 72, - } - } - 146 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 73, - } - } - 147 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 73, - } - } - 148 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 74, - } - } - 149 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 75, - } - } - 150 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 75, - } - } - 151 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 76, - } - } - 152 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 77, - } - } - 153 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 77, - } - } - 154 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 78, - } - } - 155 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 79, - } - } - 156 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 80, - } - } - 157 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 80, - } - } - 158 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 81, - } - } - 159 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 82, - } - } - 160 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 82, - } - } - 161 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 83, - } - } - 162 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 83, - } - } - 163 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 84, - } - } - 164 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 84, - } - } - 165 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 85, - } - } - 166 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 85, - } - } - 167 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 86, - } - } - 168 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 86, - } - } - 169 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 86, - } - } - 170 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 86, - } - } - 171 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 87, - } - } - 172 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 87, - } - } - 173 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 88, - } - } - 174 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 88, - } - } - 175 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 89, - } - } - 176 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 89, - } - } - 177 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 90, - } - } - 178 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 91, - } - } - 179 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 91, - } - } - 180 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 92, - } - } - 181 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 92, - } - } - 182 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 93, - } - } - 183 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 93, - } - } - 184 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 94, - } - } - 185 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 94, - } - } - 186 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 95, - } - } - 187 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 95, - } - } - 188 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 96, - } - } - 189 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 96, - } - } - 190 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 96, - } - } - 191 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 96, - } - } - 192 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 96, - } - } - 193 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 96, - } - } - 194 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 96, - } - } - 195 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 96, - } - } - 196 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 96, - } - } - 197 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 96, - } - } - 198 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 96, - } - } - 199 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 96, - } - } - 200 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 96, - } - } - 201 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 96, - } - } - 202 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 96, - } - } - 203 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 96, - } - } - 204 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 96, - } - } - 205 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 96, - } - } - 206 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 96, - } - } - 207 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 96, - } - } - 208 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 96, - } - } - 209 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 96, - } - } - 210 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 96, - } - } - 211 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 96, - } - } - 212 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 96, - } - } - 213 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 96, - } - } - 214 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 96, - } - } - 215 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 96, - } - } - 216 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 96, - } - } - 217 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 97, - } - } - 218 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 97, - } - } - 219 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 97, - } - } - 220 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 97, - } - } - 221 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 97, - } - } - 222 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 97, - } - } - 223 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 97, - } - } - 224 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 97, - } - } - 225 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 97, - } - } - 226 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 97, - } - } - 227 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 97, - } - } - 228 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 97, - } - } - 229 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 97, - } - } - 230 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 97, - } - } - 231 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 97, - } - } - 232 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 97, - } - } - 233 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 97, - } - } - 234 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 97, - } - } - 235 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 97, - } - } - 236 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 97, - } - } - 237 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 97, - } - } - 238 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 97, - } - } - 239 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 97, - } - } - 240 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 97, - } - } - 241 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 97, - } - } - 242 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 97, - } - } - 243 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 97, - } - } - 244 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 98, - } - } - 245 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 98, - } - } - 246 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 98, - } - } - 247 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 98, - } - } - 248 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 99, - } - } - 249 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 99, - } - } - 250 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 99, - } - } - 251 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 99, - } - } - 252 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 100, - } - } - 253 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 100, - } - } - 254 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 101, - } - } - 255 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 101, - } - } - 256 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 102, - } - } - 257 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 102, - } - } - 258 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 102, - } - } - 259 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 102, - } - } - 260 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 102, - } - } - 261 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 102, - } - } - 262 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 102, - } - } - 263 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 102, - } - } - 264 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 102, - } - } - 265 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 102, - } - } - 266 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 102, - } - } - 267 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 102, - } - } - 268 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 102, - } - } - 269 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 103, - } - } - 270 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 104, - } - } - 271 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 104, - } - } - 272 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 104, - } - } - 273 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 104, - } - } - 274 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 104, - } - } - 275 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 104, - } - } - 276 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 104, - } - } - 277 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 104, - } - } - 278 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 105, - } - } - 279 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 105, - } - } - 280 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 106, - } - } - 281 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 106, - } - } - 282 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 106, - } - } - 283 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 106, - } - } - 284 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 106, - } - } - 285 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 106, - } - } - 286 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 106, - } - } - 287 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 107, - } - } - 288 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 107, - } - } - 289 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 107, - } - } - 290 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 107, - } - } - 291 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 108, - } - } - 292 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 108, - } - } - 293 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 108, - } - } - 294 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 108, - } - } - 295 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 109, - } - } - 296 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 110, - } - } - 297 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 110, - } - } - 298 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 111, - } - } - 299 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 111, - } - } - 300 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 111, - } - } - 301 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 111, - } - } - 302 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 111, - } - } - 303 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 111, - } - } - 304 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 111, - } - } - 305 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 111, - } - } - 306 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 111, - } - } - 307 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 111, - } - } - 308 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 112, - } - } - 309 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 112, - } - } - 310 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 113, - } - } - 311 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 113, - } - } - 312 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 114, - } - } - 313 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 114, - } - } - 314 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 114, - } - } - 315 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 114, - } - } - 316 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 114, - } - } - 317 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 114, - } - } - 318 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 114, - } - } - 319 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 114, - } - } - 320 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 115, - } - } - 321 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 116, - } - } - 322 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 116, - } - } - 323 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 117, - } - } - 324 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 117, - } - } - 325 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 118, - } - } - 326 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 119, - } - } - 327 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 119, - } - } - 328 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 120, - } - } - 329 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 120, - } - } - 330 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 121, - } - } - 331 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 122, - } - } - 332 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 122, - } - } - 333 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 123, - } - } - 334 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 124, - } - } - 335 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 124, - } - } - 336 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 125, - } - } - 337 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 125, - } - } - 338 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 126, - } - } - 339 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 126, - } - } - 340 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 127, - } - } - 341 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 127, - } - } - 342 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 128, - } - } - 343 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 129, - } - } - 344 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 129, - } - } - 345 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 129, - } - } - 346 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 130, - } - } - 347 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 130, - } - } - 348 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 131, - } - } - 349 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 131, - } - } - 350 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 132, - } - } - 351 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 132, - } - } - 352 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 133, - } - } - 353 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 133, - } - } - 354 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 134, - } - } - 355 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 134, - } - } - 356 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 135, - } - } - 357 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 136, - } - } - 358 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 136, - } - } - 359 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 137, - } - } - 360 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 138, - } - } - 361 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 138, - } - } - 362 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 139, - } - } - 363 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 139, - } - } - 364 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 139, - } - } - 365 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 139, - } - } - 366 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 139, - } - } - 367 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 140, - } - } - 368 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 141, - } - } - 369 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 141, - } - } - 370 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 142, - } - } - 371 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 142, - } - } - 372 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 143, - } - } - 373 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 143, - } - } - 374 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 144, - } - } - 375 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 145, - } - } - 376 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 145, - } - } - 377 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 146, - } - } - 378 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 146, - } - } - 379 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 147, - } - } - 380 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 147, - } - } - 381 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 148, - } - } - 382 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 148, - } - } - 383 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 149, - } - } - 384 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 149, - } - } - 385 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 149, - } - } - 386 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 149, - } - } - 387 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 149, - } - } - 388 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 149, - } - } - 389 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 149, - } - } - 390 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 149, - } - } - 391 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 150, - } - } - 392 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 150, - } - } - 393 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 151, - } - } - 394 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 151, - } - } - 395 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 152, - } - } - 396 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 152, - } - } - 397 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 152, - } - } - 398 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 152, - } - } - 399 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 152, - } - } - 400 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 152, - } - } - 401 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 10, - nonterminal_produced: 153, - } - } - 402 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 153, - } - } - 403 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 153, - } - } - 404 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 153, - } - } - 405 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 154, - } - } - 406 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 154, - } - } - 407 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 10, - nonterminal_produced: 154, - } - } - 408 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 154, - } - } - 409 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 154, - } - } - 410 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 154, - } - } - 411 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 154, - } - } - 412 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 154, - } - } - 413 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 154, - } - } - 414 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 154, - } - } - 415 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 154, - } - } - 416 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 154, - } - } - 417 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 154, - } - } - 418 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 154, - } - } - 419 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 154, - } - } - 420 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 154, - } - } - 421 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 155, - } - } - 422 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 155, - } - } - 423 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 155, - } - } - 424 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 155, - } - } - 425 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 155, - } - } - 426 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 156, - } - } - 427 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 156, - } - } - 428 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 157, - } - } - 429 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 157, - } - } - 430 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 158, - } - } - 431 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 158, - } - } - 432 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 159, - } - } - 433 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 160, - } - } - 434 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 161, - } - } - 435 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 162, - } - } - 436 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 162, - } - } - 437 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 162, - } - } - 438 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 162, - } - } - 439 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 163, - } - } - 440 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 163, - } - } - 441 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 164, - } - } - 442 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 164, - } - } - 443 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 165, - } - } - 444 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 165, - } - } - 445 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 165, - } - } - 446 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 165, - } - } - 447 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 166, - } - } - 448 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 166, - } - } - 449 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 167, - } - } - 450 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 167, - } - } - 451 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 168, - } - } - 452 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 168, - } - } - 453 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 169, - } - } - 454 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 169, - } - } - 455 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 169, - } - } - 456 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 170, - } - } - 457 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 170, - } - } - 458 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 171, - } - } - 459 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 172, - } - } - 460 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 173, - } - } - 461 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 174, - } - } - 462 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 174, - } - } - 463 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 174, - } - } - 464 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 174, - } - } - 465 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 175, - } - } - 466 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 175, - } - } - 467 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 176, - } - } - 468 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 176, - } - } - 469 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 177, - } - } - 470 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 177, - } - } - 471 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 177, - } - } - 472 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 177, - } - } - 473 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 177, - } - } - 474 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 177, - } - } - 475 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 177, - } - } - 476 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 178, - } - } - 477 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 178, - } - } - 478 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 178, - } - } - 479 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 178, - } - } - 480 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 178, - } - } - 481 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 178, - } - } - 482 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 178, - } - } - 483 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 179, - } - } - 484 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 179, - } - } - 485 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 179, - } - } - 486 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 179, - } - } - 487 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 179, - } - } - 488 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 179, - } - } - 489 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 179, - } - } - 490 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 180, - } - } - 491 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 180, - } - } - 492 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 181, - } - } - 493 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 181, - } - } - 494 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 182, - } - } - 495 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 183, - } - } - 496 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 184, - } - } - 497 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 185, - } - } - 498 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 185, - } - } - 499 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 186, - } - } - 500 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 186, - } - } - 501 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 186, - } - } - 502 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 186, - } - } - 503 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 187, - } - } - 504 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 187, - } - } - 505 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 187, - } - } - 506 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 187, - } - } - 507 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 187, - } - } - 508 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 188, - } - } - 509 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 189, - } - } - 510 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 190, - } - } - 511 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 190, - } - } - 512 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 191, - } - } - 513 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 191, - } - } - 514 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 192, - } - } - 515 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 193, - } - } - 516 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 193, - } - } - 517 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 194, - } - } - 518 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 194, - } - } - 519 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 195, - } - } - 520 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 195, - } - } - 521 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 195, - } - } - 522 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 196, - } - } - 523 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 197, - } - } - 524 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 197, - } - } - 525 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 198, - } - } - 526 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 198, - } - } - 527 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 199, - } - } - 528 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 199, - } - } - 529 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 200, - } - } - 530 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 200, - } - } - 531 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 201, - } - } - 532 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 201, - } - } - 533 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 201, - } - } - 534 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 201, - } - } - 535 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 202, - } - } - 536 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 202, - } - } - 537 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 202, - } - } - 538 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 202, - } - } - 539 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 203, - } - } - 540 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 203, - } - } - 541 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 204, - } - } - 542 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 204, - } - } - 543 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 205, - } - } - 544 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 205, - } - } - 545 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 206, - } - } - 546 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 206, - } - } - 547 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 207, - } - } - 548 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 207, - } - } - 549 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 208, - } - } - 550 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 208, - } - } - 551 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 209, - } - } - 552 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 209, - } - } - 553 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 210, - } - } - 554 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 210, - } - } - 555 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 211, - } - } - 556 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 211, - } - } - 557 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 212, - } - } - 558 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 212, - } - } - 559 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 213, - } - } - 560 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 213, - } - } - 561 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 214, - } - } - 562 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 214, - } - } - 563 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 215, - } - } - 564 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 215, - } - } - 565 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 216, - } - } - 566 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 216, - } - } - 567 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 217, - } - } - 568 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 217, - } - } - 569 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 217, - } - } - 570 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 218, - } - } - 571 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 218, - } - } - 572 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 218, - } - } - 573 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 219, - } - } - 574 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 219, - } - } - 575 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 219, - } - } - 576 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 219, - } - } - 577 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 219, - } - } - 578 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 10, - nonterminal_produced: 219, - } - } - 579 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 219, - } - } - 580 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 219, - } - } - 581 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 219, - } - } - 582 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 219, - } - } - 583 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 219, - } - } - 584 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 219, - } - } - 585 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 219, - } - } - 586 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 219, - } - } - 587 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 219, - } - } - 588 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 219, - } - } - 589 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 219, - } - } - 590 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 10, - nonterminal_produced: 219, - } - } - 591 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 219, - } - } - 592 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 219, - } - } - 593 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 219, - } - } - 594 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 219, - } - } - 595 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 219, - } - } - 596 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 219, - } - } - 597 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 219, - } - } - 598 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 219, - } - } - 599 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 219, - } - } - 600 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 219, - } - } - 601 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 219, - } - } - 602 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 219, - } - } - 603 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 219, - } - } - 604 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 219, - } - } - 605 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 219, - } - } - 606 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 219, - } - } - 607 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 219, - } - } - 608 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 219, - } - } - 609 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 219, - } - } - 610 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 219, - } - } - 611 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 219, - } - } - 612 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 219, - } - } - 613 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 219, - } - } - 614 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 219, - } - } - 615 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 219, - } - } - 616 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 219, - } - } - 617 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 219, - } - } - 618 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 219, - } - } - 619 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 219, - } - } - 620 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 219, - } - } - 621 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 219, - } - } - 622 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 219, - } - } - 623 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 219, - } - } - 624 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 219, - } - } - 625 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 219, - } - } - 626 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 219, - } - } - 627 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 219, - } - } - 628 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 219, - } - } - 629 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 219, - } - } - 630 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 219, - } - } - 631 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 219, - } - } - 632 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 219, - } - } - 633 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 219, - } - } - 634 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 219, - } - } - 635 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 219, - } - } - 636 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 219, - } - } - 637 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 219, - } - } - 638 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 219, - } - } - 639 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 219, - } - } - 640 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 219, - } - } - 641 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 219, - } - } - 642 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 219, - } - } - 643 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 219, - } - } - 644 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 219, - } - } - 645 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 219, - } - } - 646 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 219, - } - } - 647 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 219, - } - } - 648 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 219, - } - } - 649 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 219, - } - } - 650 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 219, - } - } - 651 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 220, - } - } - 652 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 220, - } - } - 653 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 220, - } - } - 654 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 220, - } - } - 655 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 220, - } - } - 656 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 10, - nonterminal_produced: 220, - } - } - 657 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 220, - } - } - 658 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 220, - } - } - 659 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 220, - } - } - 660 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 220, - } - } - 661 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 220, - } - } - 662 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 220, - } - } - 663 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 220, - } - } - 664 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 220, - } - } - 665 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 220, - } - } - 666 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 220, - } - } - 667 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 220, - } - } - 668 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 10, - nonterminal_produced: 220, - } - } - 669 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 220, - } - } - 670 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 220, - } - } - 671 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 220, - } - } - 672 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 220, - } - } - 673 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 220, - } - } - 674 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 220, - } - } - 675 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 220, - } - } - 676 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 220, - } - } - 677 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 220, - } - } - 678 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 220, - } - } - 679 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 220, - } - } - 680 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 220, - } - } - 681 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 220, - } - } - 682 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 220, - } - } - 683 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 220, - } - } - 684 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 220, - } - } - 685 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 220, - } - } - 686 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 220, - } - } - 687 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 220, - } - } - 688 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 220, - } - } - 689 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 220, - } - } - 690 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 220, - } - } - 691 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 220, - } - } - 692 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 220, - } - } - 693 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 220, - } - } - 694 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 220, - } - } - 695 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 220, - } - } - 696 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 220, - } - } - 697 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, - nonterminal_produced: 220, - } - } - 698 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 220, - } - } - 699 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 220, - } - } - 700 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 220, - } - } - 701 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 220, - } - } - 702 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 220, - } - } - 703 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 220, - } - } - 704 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 220, - } - } - 705 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 220, - } - } - 706 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 220, - } - } - 707 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 220, - } - } - 708 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 220, - } - } - 709 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 220, - } - } - 710 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 220, - } - } - 711 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 220, - } - } - 712 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 220, - } - } - 713 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 220, - } - } - 714 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 220, - } - } - 715 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 220, - } - } - 716 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 220, - } - } - 717 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 220, - } - } - 718 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 220, - } - } - 719 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 220, - } - } - 720 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 220, - } - } - 721 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 220, - } - } - 722 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 220, - } - } - 723 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 220, - } - } - 724 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 220, - } - } - 725 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 220, - } - } - 726 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 220, - } - } - 727 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 220, - } - } - 728 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 220, - } - } - 729 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 221, - } - } - 730 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 221, - } - } - 731 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 222, - } - } - 732 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 222, - } - } - 733 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 222, - } - } - 734 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 222, - } - } - 735 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 222, - } - } - 736 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 222, - } - } - 737 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 222, - } - } - 738 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 222, - } - } - 739 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 222, - } - } - 740 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 223, - } - } - 741 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 223, - } - } - 742 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 223, - } - } - 743 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 223, - } - } - 744 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 223, - } - } - 745 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 223, - } - } - 746 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 223, - } - } - 747 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 223, - } - } - 748 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 223, - } - } - 749 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 224, - } - } - 750 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 224, - } - } - 751 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 225, - } - } - 752 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 226, - } - } - 753 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 226, - } - } - 754 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 227, - } - } - 755 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 227, - } - } - 756 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 228, - } - } - 757 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 228, - } - } - 758 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 228, - } - } - 759 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 228, - } - } - 760 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 228, - } - } - 761 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 228, - } - } - 762 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 228, - } - } - 763 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 229, - } - } - 764 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 229, - } - } - 765 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 229, - } - } - 766 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 229, - } - } - 767 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 230, - } - } - 768 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 230, - } - } - 769 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 231, - } - } - 770 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 231, - } - } - 771 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 232, - } - } - 772 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 232, - } - } - 773 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 232, - } - } - 774 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 232, - } - } - 775 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 232, - } - } - 776 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 232, - } - } - 777 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 232, - } - } - 778 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 233, - } - } - 779 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 233, - } - } - 780 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 233, - } - } - 781 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 234, - } - } - 782 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 234, - } - } - 783 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 234, - } - } - 784 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 234, - } - } - 785 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 234, - } - } - 786 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 234, - } - } - 787 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 234, - } - } - 788 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 234, - } - } - 789 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 234, - } - } - 790 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 235, - } - } - 791 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 235, - } - } - 792 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 236, - } - } - 793 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 236, - } - } - 794 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 237, - } - } - 795 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 237, - } - } - 796 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 238, - } - } - 797 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 238, - } - } - 798 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 239, - } - } - 799 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 239, - } - } - 800 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 239, - } - } - 801 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 239, - } - } - 802 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 240, - } - } - 803 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 240, - } - } - 804 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 241, - } - } - 805 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 241, - } - } - 806 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 242, - } - } - 807 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 242, - } - } - 808 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 243, - } - } - 809 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 243, - } - } - 810 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 243, - } - } - 811 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 243, - } - } - 812 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 243, - } - } - 813 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 243, - } - } - 814 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 243, - } - } - 815 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 243, - } - } - 816 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 243, - } - } - 817 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 243, - } - } - 818 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 243, - } - } - 819 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 244, - } - } - 820 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 245, - } - } - 821 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 246, - } - } - 822 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 246, - } - } - 823 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 247, - } - } - 824 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 248, - } - } - 825 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 248, - } - } - 826 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 248, - } - } - 827 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 248, - } - } - 828 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 248, - } - } - 829 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 248, - } - } - 830 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 248, - } - } - 831 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 248, - } - } - 832 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 248, - } - } - 833 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 248, - } - } - 834 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 249, - } - } - 835 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 249, - } - } - 836 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 250, - } - } - 837 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 251, - } - } - 838 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 251, - } - } - 839 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 252, - } - } - 840 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 252, - } - } - 841 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 252, - } - } - 842 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 252, - } - } - 843 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 252, - } - } - 844 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 252, - } - } - 845 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 252, - } - } - 846 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 252, - } - } - 847 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 252, - } - } - 848 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 253, - } - } - 849 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 253, - } - } - 850 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 253, - } - } - 851 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 253, - } - } - 852 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 254, - } - } - 853 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 254, - } - } - 854 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 254, - } - } - 855 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 254, - } - } - 856 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 254, - } - } - 857 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 255, - } - } - 858 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 255, - } - } - 859 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 256, - } - } - 860 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 256, - } - } - 861 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 257, - } - } - 862 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 257, - } - } - 863 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 257, - } - } - 864 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 258, - } - } - 865 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 258, - } - } - 866 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 259, - } - } - 867 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 259, - } - } - 868 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 259, - } - } - 869 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 260, - } - } - 870 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 261, - } - } - 871 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 261, - } - } - 872 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 262, - } - } - 873 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 262, - } - } - 874 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 263, - } - } - 875 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 263, - } - } - 876 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 264, - } - } - 877 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 265, - } - } - 878 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 265, - } - } - 879 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 266, - } - } - 880 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 266, - } - } - 881 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 266, - } - } - 882 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 10, - nonterminal_produced: 267, - } - } - 883 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 267, - } - } - 884 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 267, - } - } - 885 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 267, - } - } - 886 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 10, - nonterminal_produced: 267, - } - } - 887 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 267, - } - } - 888 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 267, - } - } - 889 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 267, - } - } - 890 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 267, - } - } - 891 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 268, - } - } - 892 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 268, - } - } - 893 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 269, - } - } - 894 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 269, - } - } - 895 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 270, - } - } - 896 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 270, - } - } - 897 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 271, - } - } - 898 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 271, - } - } - 899 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 272, - } - } - 900 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 272, - } - } - 901 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 273, - } - } - 902 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 273, - } - } - 903 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 274, - } - } - 904 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 275, - } - } - 905 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 275, - } - } - 906 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 276, - } - } - 907 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 276, - } - } - 908 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 276, - } - } - 909 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 276, - } - } - 910 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 277, - } - } - 911 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 277, - } - } - 912 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 278, - } - } - 913 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 278, - } - } - 914 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 279, - } - } - 915 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 279, - } - } - 916 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 280, - } - } - 917 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 280, - } - } - 918 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 280, - } - } - 919 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 281, - } - } - 920 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 282, - } - } - 921 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 283, - } - } - 922 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 283, - } - } - 923 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 284, - } - } - 924 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 284, - } - } - 925 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 285, - } - } - 926 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 285, - } - } - 927 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 286, - } - } - 928 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 287, - } - } - 929 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 287, - } - } - 930 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 287, - } - } - 931 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 287, - } - } - 932 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 287, - } - } - 933 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 287, - } - } - 934 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 287, - } - } - 935 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 287, - } - } - 936 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 287, - } - } - 937 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 287, - } - } - 938 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 287, - } - } - 939 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 287, - } - } - 940 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 288, - } - } - 941 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 289, - } - } - 942 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 289, - } - } - 943 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 290, - } - } - 944 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 290, - } - } - 945 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 291, - } - } - 946 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 291, - } - } - 947 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 292, - } - } - 948 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 292, - } - } - 949 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 292, - } - } - 950 => __state_machine::SimulatedReduce::Accept, - 951 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 294, - } - } - 952 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 294, - } - } - _ => panic!("invalid reduction index {}", __reduce_index) - } - } - pub(crate) struct TopParser { - _priv: (), - } - - impl TopParser { - pub(crate) fn new() -> TopParser { - TopParser { - _priv: (), - } - } - - #[allow(dead_code)] - pub(crate) fn parse< - __TOKEN: __ToTriple<>, - __TOKENS: IntoIterator, - >( - &self, - source_code: &str, - mode: Mode, - __tokens0: __TOKENS, - ) -> Result> - { - let __tokens = __tokens0.into_iter(); - let mut __tokens = __tokens.map(|t| __ToTriple::to_triple(t)); - __state_machine::Parser::drive( - __StateMachine { - source_code, - mode, - __phantom: core::marker::PhantomData::<()>, - }, - __tokens, - ) - } - } - fn __accepts< - '__0, - >( - __error_state: Option, - __states: &[i16], - __opt_integer: Option, - _: core::marker::PhantomData<()>, - ) -> bool - { - let mut __states = __states.to_vec(); - __states.extend(__error_state); - loop { - let mut __states_len = __states.len(); - let __top = __states[__states_len - 1]; - let __action = match __opt_integer { - None => __EOF_ACTION[__top as usize], - Some(__integer) => __action(__top, __integer), - }; - if __action == 0 { return false; } - if __action > 0 { return true; } - let (__to_pop, __nt) = match __simulate_reduce(-(__action + 1), core::marker::PhantomData::<()>) { - __state_machine::SimulatedReduce::Reduce { - states_to_pop, nonterminal_produced - } => (states_to_pop, nonterminal_produced), - __state_machine::SimulatedReduce::Accept => return true, - }; - __states_len -= __to_pop; - __states.truncate(__states_len); - let __top = __states[__states_len - 1]; - let __next_state = __goto(__top, __nt); - __states.push(__next_state); - } - } - pub(crate) fn __reduce< - >( - source_code: &str, - mode: Mode, - __action: i16, - __lookahead_start: Option<&TextSize>, - __states: &mut alloc::vec::Vec, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> Option>> - { - let (__pop_states, __nonterminal) = match __action { - 0 => { - __reduce0(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 1 => { - __reduce1(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 2 => { - __reduce2(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 3 => { - __reduce3(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 4 => { - __reduce4(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 5 => { - __reduce5(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 6 => { - __reduce6(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 7 => { - __reduce7(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 8 => { - __reduce8(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 9 => { - __reduce9(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 10 => { - __reduce10(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 11 => { - __reduce11(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 12 => { - __reduce12(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 13 => { - __reduce13(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 14 => { - __reduce14(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 15 => { - __reduce15(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 16 => { - __reduce16(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 17 => { - __reduce17(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 18 => { - __reduce18(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 19 => { - __reduce19(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 20 => { - __reduce20(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 21 => { - __reduce21(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 22 => { - __reduce22(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 23 => { - __reduce23(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 24 => { - // ("," >) = ",", StarTypedParameter, ",", DoubleStarTypedParameter => ActionFn(956); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action956::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (4, 14) - } - 25 => { - // ("," >) = ",", StarTypedParameter, ("," >)+, ",", DoubleStarTypedParameter => ActionFn(957); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action957::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (5, 14) - } - 26 => { - // ("," >) = ",", StarTypedParameter => ActionFn(958); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action958::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (2, 14) - } - 27 => { - // ("," >) = ",", StarTypedParameter, ("," >)+ => ActionFn(959); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action959::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (3, 14) - } - 28 => { - // ("," >) = ",", "*", ",", DoubleStarTypedParameter => ActionFn(960); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action960::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (4, 14) - } - 29 => { - // ("," >) = ",", "*", ("," >)+, ",", DoubleStarTypedParameter => ActionFn(961); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action961::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (5, 14) - } - 30 => { - // ("," >) = ",", "*" => ActionFn(962); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action962::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (2, 14) - } - 31 => { - // ("," >) = ",", "*", ("," >)+ => ActionFn(963); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action963::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (3, 14) - } - 32 => { - // ("," >) = ",", DoubleStarTypedParameter => ActionFn(964); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action964::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (2, 14) - } - 33 => { - // ("," >)? = ",", StarTypedParameter, ",", DoubleStarTypedParameter => ActionFn(983); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action983::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (4, 15) - } - 34 => { - // ("," >)? = ",", StarTypedParameter, ("," >)+, ",", DoubleStarTypedParameter => ActionFn(984); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action984::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (5, 15) - } - 35 => { - // ("," >)? = ",", StarTypedParameter => ActionFn(985); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action985::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (2, 15) - } - 36 => { - // ("," >)? = ",", StarTypedParameter, ("," >)+ => ActionFn(986); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action986::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (3, 15) - } - 37 => { - // ("," >)? = ",", "*", ",", DoubleStarTypedParameter => ActionFn(987); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action987::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (4, 15) - } - 38 => { - // ("," >)? = ",", "*", ("," >)+, ",", DoubleStarTypedParameter => ActionFn(988); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action988::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (5, 15) - } - 39 => { - // ("," >)? = ",", "*" => ActionFn(989); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action989::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (2, 15) - } - 40 => { - // ("," >)? = ",", "*", ("," >)+ => ActionFn(990); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action990::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (3, 15) - } - 41 => { - // ("," >)? = ",", DoubleStarTypedParameter => ActionFn(991); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action991::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (2, 15) - } - 42 => { - __reduce42(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 43 => { - // ("," >) = ",", StarUntypedParameter, ",", DoubleStarUntypedParameter => ActionFn(1013); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1013::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (4, 16) - } - 44 => { - // ("," >) = ",", StarUntypedParameter, ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(1014); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1014::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (5, 16) - } - 45 => { - // ("," >) = ",", StarUntypedParameter => ActionFn(1015); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1015::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (2, 16) - } - 46 => { - // ("," >) = ",", StarUntypedParameter, ("," >)+ => ActionFn(1016); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1016::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (3, 16) - } - 47 => { - // ("," >) = ",", "*", ",", DoubleStarUntypedParameter => ActionFn(1017); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1017::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (4, 16) - } - 48 => { - // ("," >) = ",", "*", ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(1018); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1018::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (5, 16) - } - 49 => { - // ("," >) = ",", "*" => ActionFn(1019); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1019::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (2, 16) - } - 50 => { - // ("," >) = ",", "*", ("," >)+ => ActionFn(1020); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1020::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (3, 16) - } - 51 => { - // ("," >) = ",", DoubleStarUntypedParameter => ActionFn(1021); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1021::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (2, 16) - } - 52 => { - // ("," >)? = ",", StarUntypedParameter, ",", DoubleStarUntypedParameter => ActionFn(1040); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1040::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (4, 17) - } - 53 => { - // ("," >)? = ",", StarUntypedParameter, ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(1041); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1041::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (5, 17) - } - 54 => { - // ("," >)? = ",", StarUntypedParameter => ActionFn(1042); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1042::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (2, 17) - } - 55 => { - // ("," >)? = ",", StarUntypedParameter, ("," >)+ => ActionFn(1043); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1043::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (3, 17) - } - 56 => { - // ("," >)? = ",", "*", ",", DoubleStarUntypedParameter => ActionFn(1044); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1044::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (4, 17) - } - 57 => { - // ("," >)? = ",", "*", ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(1045); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1045::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (5, 17) - } - 58 => { - // ("," >)? = ",", "*" => ActionFn(1046); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1046::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (2, 17) - } - 59 => { - // ("," >)? = ",", "*", ("," >)+ => ActionFn(1047); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant12(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1047::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (3, 17) - } - 60 => { - // ("," >)? = ",", DoubleStarUntypedParameter => ActionFn(1048); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1048::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (2, 17) - } - 61 => { - __reduce61(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 62 => { - __reduce62(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 63 => { - __reduce63(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 64 => { - __reduce64(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 65 => { - __reduce65(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 66 => { - __reduce66(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 67 => { - __reduce67(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 68 => { - __reduce68(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 69 => { - __reduce69(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 70 => { - __reduce70(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 71 => { - __reduce71(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 72 => { - __reduce72(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 73 => { - __reduce73(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 74 => { - __reduce74(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 75 => { - __reduce75(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 76 => { - __reduce76(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 77 => { - __reduce77(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 78 => { - __reduce78(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 79 => { - __reduce79(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 80 => { - __reduce80(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 81 => { - __reduce81(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 82 => { - __reduce82(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 83 => { - __reduce83(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 84 => { - __reduce84(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 85 => { - __reduce85(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 86 => { - __reduce86(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 87 => { - __reduce87(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 88 => { - __reduce88(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 89 => { - __reduce89(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 90 => { - __reduce90(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 91 => { - __reduce91(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 92 => { - __reduce92(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 93 => { - __reduce93(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 94 => { - __reduce94(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 95 => { - __reduce95(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 96 => { - __reduce96(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 97 => { - __reduce97(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 98 => { - __reduce98(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 99 => { - __reduce99(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 100 => { - __reduce100(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 101 => { - __reduce101(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 102 => { - __reduce102(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 103 => { - __reduce103(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 104 => { - __reduce104(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 105 => { - __reduce105(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 106 => { - __reduce106(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 107 => { - __reduce107(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 108 => { - __reduce108(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 109 => { - __reduce109(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 110 => { - __reduce110(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 111 => { - __reduce111(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 112 => { - __reduce112(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 113 => { - __reduce113(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 114 => { - __reduce114(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 115 => { - __reduce115(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 116 => { - __reduce116(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 117 => { - __reduce117(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 118 => { - __reduce118(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 119 => { - __reduce119(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 120 => { - __reduce120(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 121 => { - __reduce121(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 122 => { - __reduce122(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 123 => { - __reduce123(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 124 => { - __reduce124(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 125 => { - __reduce125(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 126 => { - __reduce126(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 127 => { - __reduce127(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 128 => { - __reduce128(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 129 => { - __reduce129(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 130 => { - __reduce130(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 131 => { - __reduce131(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 132 => { - __reduce132(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 133 => { - __reduce133(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 134 => { - __reduce134(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 135 => { - __reduce135(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 136 => { - __reduce136(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 137 => { - __reduce137(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 138 => { - __reduce138(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 139 => { - __reduce139(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 140 => { - __reduce140(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 141 => { - __reduce141(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 142 => { - __reduce142(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 143 => { - __reduce143(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 144 => { - __reduce144(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 145 => { - __reduce145(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 146 => { - __reduce146(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 147 => { - __reduce147(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 148 => { - __reduce148(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 149 => { - __reduce149(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 150 => { - __reduce150(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 151 => { - __reduce151(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 152 => { - __reduce152(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 153 => { - __reduce153(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 154 => { - __reduce154(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 155 => { - __reduce155(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 156 => { - __reduce156(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 157 => { - __reduce157(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 158 => { - __reduce158(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 159 => { - __reduce159(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 160 => { - __reduce160(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 161 => { - __reduce161(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 162 => { - __reduce162(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 163 => { - __reduce163(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 164 => { - __reduce164(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 165 => { - __reduce165(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 166 => { - __reduce166(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 167 => { - // Arguments = "(", FunctionArgument, ")" => ActionFn(1532); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant31(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1532::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant50(__nt), __end)); - (3, 86) - } - 168 => { - // Arguments = "(", ")" => ActionFn(1533); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1533::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant50(__nt), __end)); - (2, 86) - } - 169 => { - // Arguments = "(", ( ",")+, FunctionArgument, ")" => ActionFn(1534); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant31(__symbols); - let __sym1 = __pop_Variant32(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1534::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant50(__nt), __end)); - (4, 86) - } - 170 => { - // Arguments = "(", ( ",")+, ")" => ActionFn(1535); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant32(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1535::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant50(__nt), __end)); - (3, 86) - } - 171 => { - __reduce171(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 172 => { - __reduce172(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 173 => { - __reduce173(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 174 => { - __reduce174(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 175 => { - __reduce175(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 176 => { - __reduce176(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 177 => { - // AsPattern = OrPattern, "as", Identifier => ActionFn(1226); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1226::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (3, 90) - } - 178 => { - __reduce178(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 179 => { - __reduce179(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 180 => { - __reduce180(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 181 => { - __reduce181(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 182 => { - __reduce182(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 183 => { - __reduce183(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 184 => { - __reduce184(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 185 => { - __reduce185(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 186 => { - __reduce186(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 187 => { - __reduce187(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 188 => { - __reduce188(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 189 => { - __reduce189(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 190 => { - __reduce190(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 191 => { - __reduce191(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 192 => { - __reduce192(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 193 => { - __reduce193(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 194 => { - __reduce194(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 195 => { - __reduce195(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 196 => { - // Atom<"all"> = "(", OneOrMore>, ",", NamedOrStarExpr, ",", ")" => ActionFn(1235); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1235::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (6, 96) - } - 197 => { - // Atom<"all"> = "(", NamedOrStarExpr, ",", ")" => ActionFn(1236); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1236::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 96) - } - 198 => { - // Atom<"all"> = "(", OneOrMore>, ",", NamedOrStarExpr, ("," )+, ",", ")" => ActionFn(1237); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant17(__symbols); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1237::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (7, 96) - } - 199 => { - // Atom<"all"> = "(", NamedOrStarExpr, ("," )+, ",", ")" => ActionFn(1238); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant17(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1238::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (5, 96) - } - 200 => { - // Atom<"all"> = "(", OneOrMore>, ",", NamedOrStarExpr, ")" => ActionFn(1239); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1239::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (5, 96) - } - 201 => { - // Atom<"all"> = "(", NamedOrStarExpr, ")" => ActionFn(1240); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1240::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 96) - } - 202 => { - // Atom<"all"> = "(", OneOrMore>, ",", NamedOrStarExpr, ("," )+, ")" => ActionFn(1241); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant17(__symbols); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1241::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (6, 96) - } - 203 => { - // Atom<"all"> = "(", NamedOrStarExpr, ("," )+, ")" => ActionFn(1242); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant17(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1242::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 96) - } - 204 => { - __reduce204(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 205 => { - __reduce205(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 206 => { - __reduce206(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 207 => { - // Atom<"all"> = "(", "**", Expression<"all">, ")" => ActionFn(1246); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1246::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 96) - } - 208 => { - __reduce208(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 209 => { - __reduce209(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 210 => { - __reduce210(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 211 => { - __reduce211(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 212 => { - __reduce212(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 213 => { - __reduce213(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 214 => { - __reduce214(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 215 => { - __reduce215(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 216 => { - __reduce216(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 217 => { - __reduce217(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 218 => { - __reduce218(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 219 => { - __reduce219(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 220 => { - __reduce220(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 221 => { - __reduce221(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 222 => { - __reduce222(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 223 => { - // Atom<"no-withitems"> = "(", OneOrMore>, ",", NamedOrStarExpr, ",", ")" => ActionFn(1259); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1259::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (6, 97) - } - 224 => { - // Atom<"no-withitems"> = "(", NamedOrStarExpr, ",", ")" => ActionFn(1260); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1260::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 97) - } - 225 => { - // Atom<"no-withitems"> = "(", OneOrMore>, ",", NamedOrStarExpr, ("," )+, ",", ")" => ActionFn(1261); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant17(__symbols); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1261::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (7, 97) - } - 226 => { - // Atom<"no-withitems"> = "(", NamedOrStarExpr, ("," )+, ",", ")" => ActionFn(1262); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant17(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1262::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (5, 97) - } - 227 => { - // Atom<"no-withitems"> = "(", OneOrMore>, ",", NamedOrStarExpr, ")" => ActionFn(1263); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1263::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (5, 97) - } - 228 => { - // Atom<"no-withitems"> = "(", NamedOrStarExpr, ")" => ActionFn(1264); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1264::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 97) - } - 229 => { - // Atom<"no-withitems"> = "(", OneOrMore>, ",", NamedOrStarExpr, ("," )+, ")" => ActionFn(1265); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant17(__symbols); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1265::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (6, 97) - } - 230 => { - // Atom<"no-withitems"> = "(", NamedOrStarExpr, ("," )+, ")" => ActionFn(1266); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant17(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1266::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 97) - } - 231 => { - __reduce231(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 232 => { - __reduce232(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 233 => { - __reduce233(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 234 => { - // Atom<"no-withitems"> = "(", "**", Expression<"all">, ")" => ActionFn(1270); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1270::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 97) - } - 235 => { - __reduce235(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 236 => { - __reduce236(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 237 => { - __reduce237(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 238 => { - __reduce238(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 239 => { - __reduce239(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 240 => { - __reduce240(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 241 => { - __reduce241(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 242 => { - __reduce242(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 243 => { - __reduce243(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 244 => { - __reduce244(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 245 => { - __reduce245(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 246 => { - __reduce246(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 247 => { - __reduce247(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 248 => { - __reduce248(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 249 => { - __reduce249(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 250 => { - __reduce250(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 251 => { - __reduce251(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 252 => { - __reduce252(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 253 => { - __reduce253(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 254 => { - __reduce254(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 255 => { - __reduce255(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 256 => { - __reduce256(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 257 => { - __reduce257(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 258 => { - __reduce258(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 259 => { - __reduce259(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 260 => { - __reduce260(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 261 => { - __reduce261(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 262 => { - __reduce262(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 263 => { - __reduce263(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 264 => { - __reduce264(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 265 => { - __reduce265(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 266 => { - __reduce266(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 267 => { - __reduce267(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 268 => { - __reduce268(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 269 => { - __reduce269(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 270 => { - __reduce270(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 271 => { - __reduce271(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 272 => { - __reduce272(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 273 => { - __reduce273(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 274 => { - __reduce274(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 275 => { - __reduce275(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 276 => { - __reduce276(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 277 => { - __reduce277(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 278 => { - __reduce278(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 279 => { - __reduce279(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 280 => { - __reduce280(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 281 => { - __reduce281(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 282 => { - __reduce282(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 283 => { - __reduce283(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 284 => { - __reduce284(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 285 => { - __reduce285(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 286 => { - __reduce286(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 287 => { - __reduce287(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 288 => { - __reduce288(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 289 => { - __reduce289(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 290 => { - __reduce290(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 291 => { - __reduce291(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 292 => { - __reduce292(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 293 => { - __reduce293(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 294 => { - __reduce294(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 295 => { - __reduce295(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 296 => { - __reduce296(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 297 => { - __reduce297(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 298 => { - __reduce298(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 299 => { - __reduce299(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 300 => { - __reduce300(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 301 => { - __reduce301(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 302 => { - __reduce302(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 303 => { - __reduce303(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 304 => { - __reduce304(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 305 => { - __reduce305(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 306 => { - __reduce306(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 307 => { - __reduce307(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 308 => { - __reduce308(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 309 => { - __reduce309(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 310 => { - __reduce310(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 311 => { - __reduce311(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 312 => { - __reduce312(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 313 => { - __reduce313(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 314 => { - __reduce314(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 315 => { - __reduce315(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 316 => { - __reduce316(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 317 => { - __reduce317(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 318 => { - __reduce318(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 319 => { - __reduce319(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 320 => { - __reduce320(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 321 => { - __reduce321(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 322 => { - __reduce322(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 323 => { - __reduce323(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 324 => { - __reduce324(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 325 => { - __reduce325(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 326 => { - __reduce326(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 327 => { - __reduce327(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 328 => { - __reduce328(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 329 => { - __reduce329(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 330 => { - __reduce330(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 331 => { - __reduce331(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 332 => { - __reduce332(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 333 => { - __reduce333(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 334 => { - __reduce334(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 335 => { - __reduce335(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 336 => { - __reduce336(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 337 => { - __reduce337(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 338 => { - __reduce338(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 339 => { - __reduce339(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 340 => { - __reduce340(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 341 => { - __reduce341(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 342 => { - __reduce342(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 343 => { - __reduce343(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 344 => { - __reduce344(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 345 => { - __reduce345(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 346 => { - __reduce346(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 347 => { - __reduce347(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 348 => { - __reduce348(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 349 => { - __reduce349(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 350 => { - __reduce350(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 351 => { - __reduce351(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 352 => { - __reduce352(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 353 => { - __reduce353(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 354 => { - __reduce354(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 355 => { - __reduce355(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 356 => { - __reduce356(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 357 => { - __reduce357(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 358 => { - __reduce358(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 359 => { - __reduce359(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 360 => { - __reduce360(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 361 => { - __reduce361(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 362 => { - // ExpressionStatement = GenericList => ActionFn(1745); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1745::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 139) - } - 363 => { - // ExpressionStatement = GenericList, AssignSuffix+ => ActionFn(1746); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant17(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1746::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (2, 139) - } - 364 => { - // ExpressionStatement = GenericList, AugAssign, TestListOrYieldExpr => ActionFn(1747); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant49(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1747::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (3, 139) - } - 365 => { - // ExpressionStatement = Test<"all">, ":", Test<"all">, AssignSuffix => ActionFn(1526); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1526::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (4, 139) - } - 366 => { - // ExpressionStatement = Test<"all">, ":", Test<"all"> => ActionFn(1527); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1527::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (3, 139) - } - 367 => { - // FStringConversion = "!", name => ActionFn(790); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant7(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action790::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant65(__nt), __end)); - (2, 140) - } - 368 => { - __reduce368(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 369 => { - __reduce369(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 370 => { - __reduce370(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 371 => { - __reduce371(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 372 => { - __reduce372(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 373 => { - __reduce373(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 374 => { - __reduce374(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 375 => { - __reduce375(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 376 => { - __reduce376(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 377 => { - __reduce377(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 378 => { - // FStringMiddlePattern = fstring_middle => ActionFn(1306); - let __sym0 = __pop_Variant3(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1306::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant70(__nt), __end)); - (1, 146) - } - 379 => { - __reduce379(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 380 => { - __reduce380(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 381 => { - __reduce381(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 382 => { - __reduce382(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 383 => { - // FStringReplacementField = "{", TestListOrYieldExpr, "=", FStringConversion, FStringFormatSpecSuffix, "}" => ActionFn(1570); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant68(__symbols); - let __sym3 = __pop_Variant65(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1570::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant70(__nt), __end)); - (6, 149) - } - 384 => { - // FStringReplacementField = "{", TestListOrYieldExpr, "=", FStringConversion, "}" => ActionFn(1571); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant65(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1571::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant70(__nt), __end)); - (5, 149) - } - 385 => { - // FStringReplacementField = "{", TestListOrYieldExpr, "=", FStringFormatSpecSuffix, "}" => ActionFn(1572); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant68(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1572::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant70(__nt), __end)); - (5, 149) - } - 386 => { - // FStringReplacementField = "{", TestListOrYieldExpr, "=", "}" => ActionFn(1573); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1573::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant70(__nt), __end)); - (4, 149) - } - 387 => { - // FStringReplacementField = "{", TestListOrYieldExpr, FStringConversion, FStringFormatSpecSuffix, "}" => ActionFn(1574); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant68(__symbols); - let __sym2 = __pop_Variant65(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1574::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant70(__nt), __end)); - (5, 149) - } - 388 => { - // FStringReplacementField = "{", TestListOrYieldExpr, FStringConversion, "}" => ActionFn(1575); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant65(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1575::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant70(__nt), __end)); - (4, 149) - } - 389 => { - // FStringReplacementField = "{", TestListOrYieldExpr, FStringFormatSpecSuffix, "}" => ActionFn(1576); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant68(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1576::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant70(__nt), __end)); - (4, 149) - } - 390 => { - // FStringReplacementField = "{", TestListOrYieldExpr, "}" => ActionFn(1577); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1577::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant70(__nt), __end)); - (3, 149) - } - 391 => { - __reduce391(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 392 => { - __reduce392(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 393 => { - __reduce393(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 394 => { - __reduce394(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 395 => { - __reduce395(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 396 => { - __reduce396(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 397 => { - __reduce397(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 398 => { - __reduce398(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 399 => { - __reduce399(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 400 => { - __reduce400(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 401 => { - __reduce401(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 402 => { - __reduce402(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 403 => { - __reduce403(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 404 => { - __reduce404(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 405 => { - __reduce405(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 406 => { - __reduce406(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 407 => { - __reduce407(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 408 => { - __reduce408(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 409 => { - __reduce409(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 410 => { - __reduce410(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 411 => { - __reduce411(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 412 => { - __reduce412(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 413 => { - __reduce413(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 414 => { - __reduce414(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 415 => { - __reduce415(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 416 => { - __reduce416(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 417 => { - __reduce417(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 418 => { - __reduce418(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 419 => { - __reduce419(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 420 => { - __reduce420(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 421 => { - __reduce421(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 422 => { - __reduce422(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 423 => { - __reduce423(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 424 => { - __reduce424(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 425 => { - __reduce425(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 426 => { - __reduce426(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 427 => { - __reduce427(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 428 => { - __reduce428(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 429 => { - __reduce429(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 430 => { - __reduce430(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 431 => { - __reduce431(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 432 => { - __reduce432(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 433 => { - __reduce433(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 434 => { - __reduce434(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 435 => { - __reduce435(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 436 => { - __reduce436(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 437 => { - __reduce437(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 438 => { - __reduce438(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 439 => { - __reduce439(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 440 => { - __reduce440(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 441 => { - __reduce441(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 442 => { - __reduce442(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 443 => { - __reduce443(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 444 => { - __reduce444(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 445 => { - __reduce445(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 446 => { - __reduce446(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 447 => { - __reduce447(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 448 => { - __reduce448(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 449 => { - __reduce449(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 450 => { - __reduce450(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 451 => { - __reduce451(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 452 => { - __reduce452(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 453 => { - __reduce453(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 454 => { - __reduce454(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 455 => { - __reduce455(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 456 => { - __reduce456(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 457 => { - __reduce457(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 458 => { - // IpyEscapeCommandExpr = ipy_escape_command => ActionFn(1335); - let __sym0 = __pop_Variant6(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1335::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 171) - } - 459 => { - // IpyEscapeCommandStatement = ipy_escape_command => ActionFn(1336); - let __sym0 = __pop_Variant6(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1336::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 172) - } - 460 => { - // IpyHelpEndEscapeCommandStatement = Expression<"all">, ("?")+ => ActionFn(1337); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant22(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1337::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (2, 173) - } - 461 => { - // LambdaDef = "lambda", ParameterList, ":", fstring_middle, Test<"all"> => ActionFn(1774); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant15(__symbols); - let __sym3 = __pop_Variant3(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant46(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1774::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (5, 174) - } - 462 => { - // LambdaDef = "lambda", ParameterList, ":", Test<"all"> => ActionFn(1775); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant46(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1775::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 174) - } - 463 => { - // LambdaDef = "lambda", ":", fstring_middle, Test<"all"> => ActionFn(1776); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant3(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1776::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 174) - } - 464 => { - // LambdaDef = "lambda", ":", Test<"all"> => ActionFn(1777); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1777::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 174) - } - 465 => { - __reduce465(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 466 => { - __reduce466(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 467 => { - __reduce467(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 468 => { - __reduce468(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 469 => { - __reduce469(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 470 => { - __reduce470(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 471 => { - __reduce471(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 472 => { - __reduce472(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 473 => { - __reduce473(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 474 => { - __reduce474(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 475 => { - // LiteralPattern = TwoOrMore => ActionFn(1345); - let __sym0 = __pop_Variant97(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1345::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 177) - } - 476 => { - __reduce476(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 477 => { - __reduce477(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 478 => { - __reduce478(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 479 => { - __reduce479(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 480 => { - __reduce480(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 481 => { - __reduce481(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 482 => { - __reduce482(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 483 => { - __reduce483(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 484 => { - __reduce484(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 485 => { - __reduce485(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 486 => { - __reduce486(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 487 => { - __reduce487(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 488 => { - __reduce488(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 489 => { - __reduce489(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 490 => { - __reduce490(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 491 => { - __reduce491(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 492 => { - __reduce492(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 493 => { - __reduce493(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 494 => { - __reduce494(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 495 => { - __reduce495(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 496 => { - __reduce496(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 497 => { - __reduce497(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 498 => { - __reduce498(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 499 => { - __reduce499(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 500 => { - __reduce500(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 501 => { - __reduce501(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 502 => { - __reduce502(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 503 => { - __reduce503(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 504 => { - __reduce504(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 505 => { - __reduce505(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 506 => { - __reduce506(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 507 => { - __reduce507(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 508 => { - __reduce508(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 509 => { - __reduce509(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 510 => { - __reduce510(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 511 => { - __reduce511(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 512 => { - __reduce512(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 513 => { - __reduce513(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 514 => { - __reduce514(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 515 => { - __reduce515(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 516 => { - __reduce516(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 517 => { - __reduce517(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 518 => { - __reduce518(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 519 => { - __reduce519(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 520 => { - __reduce520(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 521 => { - __reduce521(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 522 => { - __reduce522(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 523 => { - __reduce523(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 524 => { - __reduce524(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 525 => { - __reduce525(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 526 => { - __reduce526(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 527 => { - __reduce527(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 528 => { - __reduce528(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 529 => { - __reduce529(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 530 => { - __reduce530(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 531 => { - __reduce531(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 532 => { - __reduce532(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 533 => { - __reduce533(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 534 => { - __reduce534(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 535 => { - __reduce535(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 536 => { - __reduce536(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 537 => { - __reduce537(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 538 => { - __reduce538(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 539 => { - __reduce539(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 540 => { - __reduce540(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 541 => { - __reduce541(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 542 => { - __reduce542(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 543 => { - __reduce543(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 544 => { - __reduce544(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 545 => { - __reduce545(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 546 => { - __reduce546(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 547 => { - __reduce547(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 548 => { - __reduce548(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 549 => { - __reduce549(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 550 => { - __reduce550(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 551 => { - __reduce551(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 552 => { - __reduce552(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 553 => { - __reduce553(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 554 => { - __reduce554(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 555 => { - __reduce555(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 556 => { - __reduce556(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 557 => { - __reduce557(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 558 => { - __reduce558(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 559 => { - __reduce559(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 560 => { - __reduce560(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 561 => { - __reduce561(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 562 => { - __reduce562(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 563 => { - __reduce563(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 564 => { - __reduce564(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 565 => { - __reduce565(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 566 => { - __reduce566(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 567 => { - __reduce567(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 568 => { - __reduce568(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 569 => { - __reduce569(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 570 => { - __reduce570(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 571 => { - __reduce571(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 572 => { - __reduce572(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 573 => { - // ParameterList = OneOrMore>, ",", StarTypedParameter, ",", DoubleStarTypedParameter, "," => ActionFn(1596); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1596::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 219) - } - 574 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarTypedParameter, ",", DoubleStarTypedParameter, "," => ActionFn(1597); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant9(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1597::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 219) - } - 575 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarTypedParameter, ",", DoubleStarTypedParameter, "," => ActionFn(1598); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = match super::__action1598::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (9, 219) - } - 576 => { - // ParameterList = OneOrMore>, ",", StarTypedParameter, ("," >)+, ",", DoubleStarTypedParameter, "," => ActionFn(1599); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1599::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 219) - } - 577 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarTypedParameter, ("," >)+, ",", DoubleStarTypedParameter, "," => ActionFn(1600); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = match super::__action1600::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (9, 219) - } - 578 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarTypedParameter, ("," >)+, ",", DoubleStarTypedParameter, "," => ActionFn(1601); - assert!(__symbols.len() >= 10); - let __sym9 = __pop_Variant0(__symbols); - let __sym8 = __pop_Variant9(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym9.2; - let __nt = match super::__action1601::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (10, 219) - } - 579 => { - // ParameterList = OneOrMore>, ",", StarTypedParameter, "," => ActionFn(1602); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1602::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 219) - } - 580 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarTypedParameter, "," => ActionFn(1603); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1603::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 219) - } - 581 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarTypedParameter, "," => ActionFn(1604); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1604::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 219) - } - 582 => { - // ParameterList = OneOrMore>, ",", StarTypedParameter, ("," >)+, "," => ActionFn(1605); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1605::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 219) - } - 583 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarTypedParameter, ("," >)+, "," => ActionFn(1606); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1606::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 219) - } - 584 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarTypedParameter, ("," >)+, "," => ActionFn(1607); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1607::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 219) - } - 585 => { - // ParameterList = OneOrMore>, ",", "*", ",", DoubleStarTypedParameter, "," => ActionFn(1608); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1608::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 219) - } - 586 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", ",", DoubleStarTypedParameter, "," => ActionFn(1609); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant9(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1609::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 219) - } - 587 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", ",", DoubleStarTypedParameter, "," => ActionFn(1610); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = match super::__action1610::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (9, 219) - } - 588 => { - // ParameterList = OneOrMore>, ",", "*", ("," >)+, ",", DoubleStarTypedParameter, "," => ActionFn(1611); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1611::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 219) - } - 589 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", ("," >)+, ",", DoubleStarTypedParameter, "," => ActionFn(1612); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = match super::__action1612::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (9, 219) - } - 590 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", ("," >)+, ",", DoubleStarTypedParameter, "," => ActionFn(1613); - assert!(__symbols.len() >= 10); - let __sym9 = __pop_Variant0(__symbols); - let __sym8 = __pop_Variant9(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym9.2; - let __nt = match super::__action1613::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (10, 219) - } - 591 => { - // ParameterList = OneOrMore>, ",", "*", "," => ActionFn(1614); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1614::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 219) - } - 592 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", "," => ActionFn(1615); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1615::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 219) - } - 593 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", "," => ActionFn(1616); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1616::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 219) - } - 594 => { - // ParameterList = OneOrMore>, ",", "*", ("," >)+, "," => ActionFn(1617); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1617::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 219) - } - 595 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", ("," >)+, "," => ActionFn(1618); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1618::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 219) - } - 596 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", ("," >)+, "," => ActionFn(1619); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1619::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 219) - } - 597 => { - // ParameterList = OneOrMore>, ",", DoubleStarTypedParameter, "," => ActionFn(1620); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1620::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 219) - } - 598 => { - // ParameterList = OneOrMore>, ",", "/", ",", DoubleStarTypedParameter, "," => ActionFn(1621); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1621::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 219) - } - 599 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", DoubleStarTypedParameter, "," => ActionFn(1622); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1622::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 219) - } - 600 => { - // ParameterList = OneOrMore>, "," => ActionFn(1623); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1623::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (2, 219) - } - 601 => { - // ParameterList = OneOrMore>, ",", "/", "," => ActionFn(1624); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1624::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 219) - } - 602 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, "," => ActionFn(1625); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1625::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 219) - } - 603 => { - // ParameterList = OneOrMore>, ",", StarTypedParameter, ",", DoubleStarTypedParameter => ActionFn(1626); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1626::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 219) - } - 604 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarTypedParameter, ",", DoubleStarTypedParameter => ActionFn(1627); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant9(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1627::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 219) - } - 605 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarTypedParameter, ",", DoubleStarTypedParameter => ActionFn(1628); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1628::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 219) - } - 606 => { - // ParameterList = OneOrMore>, ",", StarTypedParameter, ("," >)+, ",", DoubleStarTypedParameter => ActionFn(1629); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1629::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 219) - } - 607 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarTypedParameter, ("," >)+, ",", DoubleStarTypedParameter => ActionFn(1630); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1630::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 219) - } - 608 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarTypedParameter, ("," >)+, ",", DoubleStarTypedParameter => ActionFn(1631); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant9(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = match super::__action1631::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (9, 219) - } - 609 => { - // ParameterList = OneOrMore>, ",", StarTypedParameter => ActionFn(1632); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1632::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 219) - } - 610 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarTypedParameter => ActionFn(1633); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1633::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 219) - } - 611 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarTypedParameter => ActionFn(1634); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1634::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 219) - } - 612 => { - // ParameterList = OneOrMore>, ",", StarTypedParameter, ("," >)+ => ActionFn(1635); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1635::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 219) - } - 613 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarTypedParameter, ("," >)+ => ActionFn(1636); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1636::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 219) - } - 614 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarTypedParameter, ("," >)+ => ActionFn(1637); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1637::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 219) - } - 615 => { - // ParameterList = OneOrMore>, ",", "*", ",", DoubleStarTypedParameter => ActionFn(1638); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1638::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 219) - } - 616 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", ",", DoubleStarTypedParameter => ActionFn(1639); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant9(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1639::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 219) - } - 617 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", ",", DoubleStarTypedParameter => ActionFn(1640); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1640::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 219) - } - 618 => { - // ParameterList = OneOrMore>, ",", "*", ("," >)+, ",", DoubleStarTypedParameter => ActionFn(1641); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1641::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 219) - } - 619 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", ("," >)+, ",", DoubleStarTypedParameter => ActionFn(1642); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1642::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 219) - } - 620 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", ("," >)+, ",", DoubleStarTypedParameter => ActionFn(1643); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant9(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = match super::__action1643::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (9, 219) - } - 621 => { - // ParameterList = OneOrMore>, ",", "*" => ActionFn(1644); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1644::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 219) - } - 622 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*" => ActionFn(1645); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1645::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 219) - } - 623 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*" => ActionFn(1646); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1646::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 219) - } - 624 => { - // ParameterList = OneOrMore>, ",", "*", ("," >)+ => ActionFn(1647); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1647::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 219) - } - 625 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", ("," >)+ => ActionFn(1648); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1648::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 219) - } - 626 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", ("," >)+ => ActionFn(1649); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1649::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 219) - } - 627 => { - // ParameterList = OneOrMore>, ",", DoubleStarTypedParameter => ActionFn(1650); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1650::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 219) - } - 628 => { - // ParameterList = OneOrMore>, ",", "/", ",", DoubleStarTypedParameter => ActionFn(1651); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1651::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 219) - } - 629 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", DoubleStarTypedParameter => ActionFn(1652); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1652::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 219) - } - 630 => { - // ParameterList = OneOrMore> => ActionFn(1653); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1653::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (1, 219) - } - 631 => { - // ParameterList = OneOrMore>, ",", "/" => ActionFn(1654); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1654::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 219) - } - 632 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+ => ActionFn(1655); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1655::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 219) - } - 633 => { - // ParameterList = StarTypedParameter, ",", DoubleStarTypedParameter, "," => ActionFn(1395); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1395::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 219) - } - 634 => { - // ParameterList = StarTypedParameter, ("," >)+, ",", DoubleStarTypedParameter, "," => ActionFn(1396); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1396::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 219) - } - 635 => { - // ParameterList = StarTypedParameter, "," => ActionFn(1397); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1397::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (2, 219) - } - 636 => { - // ParameterList = StarTypedParameter, ("," >)+, "," => ActionFn(1398); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1398::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 219) - } - 637 => { - // ParameterList = "*", ",", DoubleStarTypedParameter, "," => ActionFn(1399); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1399::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 219) - } - 638 => { - // ParameterList = "*", ("," >)+, ",", DoubleStarTypedParameter, "," => ActionFn(1400); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1400::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 219) - } - 639 => { - // ParameterList = "*", "," => ActionFn(1401); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1401::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (2, 219) - } - 640 => { - // ParameterList = "*", ("," >)+, "," => ActionFn(1402); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1402::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 219) - } - 641 => { - // ParameterList = DoubleStarTypedParameter, "," => ActionFn(1403); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1403::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (2, 219) - } - 642 => { - // ParameterList = StarTypedParameter, ",", DoubleStarTypedParameter => ActionFn(1404); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1404::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 219) - } - 643 => { - // ParameterList = StarTypedParameter, ("," >)+, ",", DoubleStarTypedParameter => ActionFn(1405); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1405::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 219) - } - 644 => { - // ParameterList = StarTypedParameter => ActionFn(1406); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1406::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (1, 219) - } - 645 => { - // ParameterList = StarTypedParameter, ("," >)+ => ActionFn(1407); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1407::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (2, 219) - } - 646 => { - // ParameterList = "*", ",", DoubleStarTypedParameter => ActionFn(1408); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1408::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 219) - } - 647 => { - // ParameterList = "*", ("," >)+, ",", DoubleStarTypedParameter => ActionFn(1409); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1409::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 219) - } - 648 => { - // ParameterList = "*" => ActionFn(1410); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1410::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (1, 219) - } - 649 => { - // ParameterList = "*", ("," >)+ => ActionFn(1411); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1411::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (2, 219) - } - 650 => { - // ParameterList = DoubleStarTypedParameter => ActionFn(1412); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1412::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (1, 219) - } - 651 => { - // ParameterList = OneOrMore>, ",", StarUntypedParameter, ",", DoubleStarUntypedParameter, "," => ActionFn(1656); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1656::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 220) - } - 652 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarUntypedParameter, ",", DoubleStarUntypedParameter, "," => ActionFn(1657); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant9(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1657::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 220) - } - 653 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarUntypedParameter, ",", DoubleStarUntypedParameter, "," => ActionFn(1658); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = match super::__action1658::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (9, 220) - } - 654 => { - // ParameterList = OneOrMore>, ",", StarUntypedParameter, ("," >)+, ",", DoubleStarUntypedParameter, "," => ActionFn(1659); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1659::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 220) - } - 655 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarUntypedParameter, ("," >)+, ",", DoubleStarUntypedParameter, "," => ActionFn(1660); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = match super::__action1660::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (9, 220) - } - 656 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarUntypedParameter, ("," >)+, ",", DoubleStarUntypedParameter, "," => ActionFn(1661); - assert!(__symbols.len() >= 10); - let __sym9 = __pop_Variant0(__symbols); - let __sym8 = __pop_Variant9(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym9.2; - let __nt = match super::__action1661::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (10, 220) - } - 657 => { - // ParameterList = OneOrMore>, ",", StarUntypedParameter, "," => ActionFn(1662); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1662::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 220) - } - 658 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarUntypedParameter, "," => ActionFn(1663); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1663::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 220) - } - 659 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarUntypedParameter, "," => ActionFn(1664); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1664::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 220) - } - 660 => { - // ParameterList = OneOrMore>, ",", StarUntypedParameter, ("," >)+, "," => ActionFn(1665); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1665::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 220) - } - 661 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarUntypedParameter, ("," >)+, "," => ActionFn(1666); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1666::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 220) - } - 662 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarUntypedParameter, ("," >)+, "," => ActionFn(1667); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1667::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 220) - } - 663 => { - // ParameterList = OneOrMore>, ",", "*", ",", DoubleStarUntypedParameter, "," => ActionFn(1668); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1668::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 220) - } - 664 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", ",", DoubleStarUntypedParameter, "," => ActionFn(1669); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant9(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1669::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 220) - } - 665 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", ",", DoubleStarUntypedParameter, "," => ActionFn(1670); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = match super::__action1670::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (9, 220) - } - 666 => { - // ParameterList = OneOrMore>, ",", "*", ("," >)+, ",", DoubleStarUntypedParameter, "," => ActionFn(1671); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1671::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 220) - } - 667 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", ("," >)+, ",", DoubleStarUntypedParameter, "," => ActionFn(1672); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = match super::__action1672::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (9, 220) - } - 668 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", ("," >)+, ",", DoubleStarUntypedParameter, "," => ActionFn(1673); - assert!(__symbols.len() >= 10); - let __sym9 = __pop_Variant0(__symbols); - let __sym8 = __pop_Variant9(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym9.2; - let __nt = match super::__action1673::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (10, 220) - } - 669 => { - // ParameterList = OneOrMore>, ",", "*", "," => ActionFn(1674); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1674::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 220) - } - 670 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", "," => ActionFn(1675); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1675::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 220) - } - 671 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", "," => ActionFn(1676); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1676::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 220) - } - 672 => { - // ParameterList = OneOrMore>, ",", "*", ("," >)+, "," => ActionFn(1677); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1677::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 220) - } - 673 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", ("," >)+, "," => ActionFn(1678); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1678::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 220) - } - 674 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", ("," >)+, "," => ActionFn(1679); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1679::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 220) - } - 675 => { - // ParameterList = OneOrMore>, ",", DoubleStarUntypedParameter, "," => ActionFn(1680); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1680::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 220) - } - 676 => { - // ParameterList = OneOrMore>, ",", "/", ",", DoubleStarUntypedParameter, "," => ActionFn(1681); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1681::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 220) - } - 677 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", DoubleStarUntypedParameter, "," => ActionFn(1682); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1682::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 220) - } - 678 => { - // ParameterList = OneOrMore>, "," => ActionFn(1683); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1683::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (2, 220) - } - 679 => { - // ParameterList = OneOrMore>, ",", "/", "," => ActionFn(1684); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1684::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 220) - } - 680 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, "," => ActionFn(1685); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1685::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 220) - } - 681 => { - // ParameterList = OneOrMore>, ",", StarUntypedParameter, ",", DoubleStarUntypedParameter => ActionFn(1686); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1686::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 220) - } - 682 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarUntypedParameter, ",", DoubleStarUntypedParameter => ActionFn(1687); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant9(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1687::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 220) - } - 683 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarUntypedParameter, ",", DoubleStarUntypedParameter => ActionFn(1688); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1688::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 220) - } - 684 => { - // ParameterList = OneOrMore>, ",", StarUntypedParameter, ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(1689); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1689::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 220) - } - 685 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarUntypedParameter, ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(1690); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1690::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 220) - } - 686 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarUntypedParameter, ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(1691); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant9(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = match super::__action1691::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (9, 220) - } - 687 => { - // ParameterList = OneOrMore>, ",", StarUntypedParameter => ActionFn(1692); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1692::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 220) - } - 688 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarUntypedParameter => ActionFn(1693); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1693::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 220) - } - 689 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarUntypedParameter => ActionFn(1694); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1694::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 220) - } - 690 => { - // ParameterList = OneOrMore>, ",", StarUntypedParameter, ("," >)+ => ActionFn(1695); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1695::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 220) - } - 691 => { - // ParameterList = OneOrMore>, ",", "/", ",", StarUntypedParameter, ("," >)+ => ActionFn(1696); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1696::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 220) - } - 692 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", StarUntypedParameter, ("," >)+ => ActionFn(1697); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1697::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 220) - } - 693 => { - // ParameterList = OneOrMore>, ",", "*", ",", DoubleStarUntypedParameter => ActionFn(1698); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1698::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 220) - } - 694 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", ",", DoubleStarUntypedParameter => ActionFn(1699); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant9(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1699::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 220) - } - 695 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", ",", DoubleStarUntypedParameter => ActionFn(1700); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1700::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 220) - } - 696 => { - // ParameterList = OneOrMore>, ",", "*", ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(1701); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1701::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 220) - } - 697 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(1702); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant9(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = match super::__action1702::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (8, 220) - } - 698 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(1703); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant9(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = match super::__action1703::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (9, 220) - } - 699 => { - // ParameterList = OneOrMore>, ",", "*" => ActionFn(1704); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1704::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 220) - } - 700 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*" => ActionFn(1705); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1705::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 220) - } - 701 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*" => ActionFn(1706); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1706::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 220) - } - 702 => { - // ParameterList = OneOrMore>, ",", "*", ("," >)+ => ActionFn(1707); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1707::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 220) - } - 703 => { - // ParameterList = OneOrMore>, ",", "/", ",", "*", ("," >)+ => ActionFn(1708); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant12(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1708::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 220) - } - 704 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", "*", ("," >)+ => ActionFn(1709); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant12(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = match super::__action1709::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (7, 220) - } - 705 => { - // ParameterList = OneOrMore>, ",", DoubleStarUntypedParameter => ActionFn(1710); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1710::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 220) - } - 706 => { - // ParameterList = OneOrMore>, ",", "/", ",", DoubleStarUntypedParameter => ActionFn(1711); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant9(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1711::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 220) - } - 707 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(1712); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant9(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = match super::__action1712::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (6, 220) - } - 708 => { - // ParameterList = OneOrMore> => ActionFn(1713); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1713::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (1, 220) - } - 709 => { - // ParameterList = OneOrMore>, ",", "/" => ActionFn(1714); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1714::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 220) - } - 710 => { - // ParameterList = OneOrMore>, ",", "/", ("," >)+ => ActionFn(1715); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1715::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 220) - } - 711 => { - // ParameterList = StarUntypedParameter, ",", DoubleStarUntypedParameter, "," => ActionFn(1433); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1433::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 220) - } - 712 => { - // ParameterList = StarUntypedParameter, ("," >)+, ",", DoubleStarUntypedParameter, "," => ActionFn(1434); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1434::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 220) - } - 713 => { - // ParameterList = StarUntypedParameter, "," => ActionFn(1435); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1435::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (2, 220) - } - 714 => { - // ParameterList = StarUntypedParameter, ("," >)+, "," => ActionFn(1436); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1436::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 220) - } - 715 => { - // ParameterList = "*", ",", DoubleStarUntypedParameter, "," => ActionFn(1437); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1437::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 220) - } - 716 => { - // ParameterList = "*", ("," >)+, ",", DoubleStarUntypedParameter, "," => ActionFn(1438); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = match super::__action1438::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (5, 220) - } - 717 => { - // ParameterList = "*", "," => ActionFn(1439); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1439::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (2, 220) - } - 718 => { - // ParameterList = "*", ("," >)+, "," => ActionFn(1440); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1440::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 220) - } - 719 => { - // ParameterList = DoubleStarUntypedParameter, "," => ActionFn(1441); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1441::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (2, 220) - } - 720 => { - // ParameterList = StarUntypedParameter, ",", DoubleStarUntypedParameter => ActionFn(1442); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1442::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 220) - } - 721 => { - // ParameterList = StarUntypedParameter, ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(1443); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1443::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 220) - } - 722 => { - // ParameterList = StarUntypedParameter => ActionFn(1444); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1444::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (1, 220) - } - 723 => { - // ParameterList = StarUntypedParameter, ("," >)+ => ActionFn(1445); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1445::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (2, 220) - } - 724 => { - // ParameterList = "*", ",", DoubleStarUntypedParameter => ActionFn(1446); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1446::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 220) - } - 725 => { - // ParameterList = "*", ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(1447); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action1447::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (4, 220) - } - 726 => { - // ParameterList = "*" => ActionFn(1448); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1448::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (1, 220) - } - 727 => { - // ParameterList = "*", ("," >)+ => ActionFn(1449); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1449::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (2, 220) - } - 728 => { - // ParameterList = DoubleStarUntypedParameter => ActionFn(1450); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1450::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (1, 220) - } - 729 => { - __reduce729(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 730 => { - __reduce730(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 731 => { - // ParameterListStarArgs = StarTypedParameter, ",", DoubleStarTypedParameter => ActionFn(873); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action873::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (3, 222) - } - 732 => { - // ParameterListStarArgs = StarTypedParameter, ("," >)+, ",", DoubleStarTypedParameter => ActionFn(874); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action874::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (4, 222) - } - 733 => { - // ParameterListStarArgs = StarTypedParameter => ActionFn(875); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action875::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (1, 222) - } - 734 => { - // ParameterListStarArgs = StarTypedParameter, ("," >)+ => ActionFn(876); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action876::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (2, 222) - } - 735 => { - // ParameterListStarArgs = "*", ",", DoubleStarTypedParameter => ActionFn(877); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action877::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (3, 222) - } - 736 => { - // ParameterListStarArgs = "*", ("," >)+, ",", DoubleStarTypedParameter => ActionFn(878); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action878::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (4, 222) - } - 737 => { - // ParameterListStarArgs = "*" => ActionFn(879); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action879::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (1, 222) - } - 738 => { - // ParameterListStarArgs = "*", ("," >)+ => ActionFn(880); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action880::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (2, 222) - } - 739 => { - // ParameterListStarArgs = DoubleStarTypedParameter => ActionFn(881); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action881::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (1, 222) - } - 740 => { - // ParameterListStarArgs = StarUntypedParameter, ",", DoubleStarUntypedParameter => ActionFn(882); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action882::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (3, 223) - } - 741 => { - // ParameterListStarArgs = StarUntypedParameter, ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(883); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action883::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (4, 223) - } - 742 => { - // ParameterListStarArgs = StarUntypedParameter => ActionFn(884); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action884::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (1, 223) - } - 743 => { - // ParameterListStarArgs = StarUntypedParameter, ("," >)+ => ActionFn(885); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action885::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (2, 223) - } - 744 => { - // ParameterListStarArgs = "*", ",", DoubleStarUntypedParameter => ActionFn(886); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant9(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action886::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (3, 223) - } - 745 => { - // ParameterListStarArgs = "*", ("," >)+, ",", DoubleStarUntypedParameter => ActionFn(887); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant9(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = match super::__action887::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (4, 223) - } - 746 => { - // ParameterListStarArgs = "*" => ActionFn(888); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action888::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (1, 223) - } - 747 => { - // ParameterListStarArgs = "*", ("," >)+ => ActionFn(889); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant12(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action889::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (2, 223) - } - 748 => { - // ParameterListStarArgs = DoubleStarUntypedParameter => ActionFn(1012); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1012::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (1, 223) - } - 749 => { - // Parameters = "(", ParameterList, ")" => ActionFn(1451); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant46(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = match super::__action1451::<>(source_code, mode, __sym0, __sym1, __sym2) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (3, 224) - } - 750 => { - // Parameters = "(", ")" => ActionFn(1452); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = match super::__action1452::<>(source_code, mode, __sym0, __sym1) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (2, 224) - } - 751 => { - __reduce751(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 752 => { - __reduce752(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 753 => { - __reduce753(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 754 => { - __reduce754(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 755 => { - __reduce755(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 756 => { - __reduce756(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 757 => { - __reduce757(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 758 => { - __reduce758(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 759 => { - __reduce759(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 760 => { - __reduce760(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 761 => { - __reduce761(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 762 => { - __reduce762(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 763 => { - __reduce763(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 764 => { - __reduce764(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 765 => { - __reduce765(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 766 => { - __reduce766(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 767 => { - __reduce767(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 768 => { - __reduce768(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 769 => { - __reduce769(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 770 => { - __reduce770(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 771 => { - __reduce771(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 772 => { - __reduce772(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 773 => { - __reduce773(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 774 => { - __reduce774(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 775 => { - __reduce775(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 776 => { - __reduce776(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 777 => { - __reduce777(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 778 => { - __reduce778(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 779 => { - __reduce779(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 780 => { - __reduce780(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 781 => { - __reduce781(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 782 => { - __reduce782(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 783 => { - __reduce783(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 784 => { - __reduce784(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 785 => { - __reduce785(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 786 => { - __reduce786(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 787 => { - __reduce787(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 788 => { - __reduce788(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 789 => { - __reduce789(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 790 => { - __reduce790(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 791 => { - __reduce791(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 792 => { - __reduce792(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 793 => { - __reduce793(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 794 => { - __reduce794(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 795 => { - __reduce795(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 796 => { - __reduce796(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 797 => { - __reduce797(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 798 => { - __reduce798(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 799 => { - __reduce799(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 800 => { - __reduce800(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 801 => { - __reduce801(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 802 => { - __reduce802(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 803 => { - __reduce803(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 804 => { - __reduce804(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 805 => { - __reduce805(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 806 => { - __reduce806(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 807 => { - __reduce807(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 808 => { - __reduce808(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 809 => { - __reduce809(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 810 => { - __reduce810(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 811 => { - __reduce811(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 812 => { - __reduce812(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 813 => { - __reduce813(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 814 => { - __reduce814(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 815 => { - __reduce815(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 816 => { - __reduce816(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 817 => { - __reduce817(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 818 => { - __reduce818(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 819 => { - __reduce819(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 820 => { - __reduce820(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 821 => { - __reduce821(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 822 => { - __reduce822(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 823 => { - __reduce823(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 824 => { - __reduce824(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 825 => { - __reduce825(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 826 => { - __reduce826(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 827 => { - __reduce827(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 828 => { - __reduce828(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 829 => { - __reduce829(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 830 => { - __reduce830(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 831 => { - __reduce831(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 832 => { - __reduce832(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 833 => { - __reduce833(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 834 => { - __reduce834(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 835 => { - // String = TwoOrMore => ActionFn(1484); - let __sym0 = __pop_Variant97(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1484::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (1, 249) - } - 836 => { - // StringLiteral = string => ActionFn(1485); - let __sym0 = __pop_Variant3(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = match super::__action1485::<>(source_code, mode, __sym0) { - Ok(v) => v, - Err(e) => return Some(Err(e)), - }; - __symbols.push((__start, __Symbol::Variant67(__nt), __end)); - (1, 250) - } - 837 => { - __reduce837(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 838 => { - __reduce838(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 839 => { - __reduce839(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 840 => { - __reduce840(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 841 => { - __reduce841(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 842 => { - __reduce842(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 843 => { - __reduce843(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 844 => { - __reduce844(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 845 => { - __reduce845(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 846 => { - __reduce846(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 847 => { - __reduce847(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 848 => { - __reduce848(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 849 => { - __reduce849(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 850 => { - __reduce850(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 851 => { - __reduce851(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 852 => { - __reduce852(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 853 => { - __reduce853(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 854 => { - __reduce854(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 855 => { - __reduce855(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 856 => { - __reduce856(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 857 => { - __reduce857(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 858 => { - __reduce858(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 859 => { - __reduce859(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 860 => { - __reduce860(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 861 => { - __reduce861(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 862 => { - __reduce862(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 863 => { - __reduce863(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 864 => { - __reduce864(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 865 => { - __reduce865(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 866 => { - __reduce866(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 867 => { - __reduce867(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 868 => { - __reduce868(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 869 => { - __reduce869(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 870 => { - __reduce870(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 871 => { - __reduce871(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 872 => { - __reduce872(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 873 => { - __reduce873(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 874 => { - __reduce874(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 875 => { - __reduce875(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 876 => { - __reduce876(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 877 => { - __reduce877(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 878 => { - __reduce878(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 879 => { - __reduce879(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 880 => { - __reduce880(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 881 => { - __reduce881(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 882 => { - __reduce882(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 883 => { - __reduce883(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 884 => { - __reduce884(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 885 => { - __reduce885(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 886 => { - __reduce886(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 887 => { - __reduce887(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 888 => { - __reduce888(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 889 => { - __reduce889(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 890 => { - __reduce890(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 891 => { - __reduce891(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 892 => { - __reduce892(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 893 => { - __reduce893(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 894 => { - __reduce894(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 895 => { - __reduce895(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 896 => { - __reduce896(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 897 => { - __reduce897(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 898 => { - __reduce898(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 899 => { - __reduce899(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 900 => { - __reduce900(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 901 => { - __reduce901(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 902 => { - __reduce902(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 903 => { - __reduce903(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 904 => { - __reduce904(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 905 => { - __reduce905(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 906 => { - __reduce906(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 907 => { - __reduce907(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 908 => { - __reduce908(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 909 => { - __reduce909(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 910 => { - __reduce910(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 911 => { - __reduce911(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 912 => { - __reduce912(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 913 => { - __reduce913(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 914 => { - __reduce914(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 915 => { - __reduce915(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 916 => { - __reduce916(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 917 => { - __reduce917(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 918 => { - __reduce918(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 919 => { - __reduce919(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 920 => { - __reduce920(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 921 => { - __reduce921(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 922 => { - __reduce922(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 923 => { - __reduce923(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 924 => { - __reduce924(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 925 => { - __reduce925(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 926 => { - __reduce926(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 927 => { - __reduce927(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 928 => { - __reduce928(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 929 => { - __reduce929(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 930 => { - __reduce930(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 931 => { - __reduce931(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 932 => { - __reduce932(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 933 => { - __reduce933(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 934 => { - __reduce934(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 935 => { - __reduce935(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 936 => { - __reduce936(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 937 => { - __reduce937(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 938 => { - __reduce938(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 939 => { - __reduce939(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 940 => { - __reduce940(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 941 => { - __reduce941(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 942 => { - __reduce942(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 943 => { - __reduce943(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 944 => { - __reduce944(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 945 => { - __reduce945(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 946 => { - __reduce946(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 947 => { - __reduce947(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 948 => { - __reduce948(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 949 => { - __reduce949(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 950 => { - // __Top = Top => ActionFn(0); - let __sym0 = __pop_Variant96(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action0::<>(source_code, mode, __sym0); - return Some(Ok(__nt)); - } - 951 => { - __reduce951(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - 952 => { - __reduce952(source_code, mode, __lookahead_start, __symbols, core::marker::PhantomData::<()>) - } - _ => panic!("invalid action code {}", __action) - }; - let __states_len = __states.len(); - __states.truncate(__states_len - __pop_states); - let __state = *__states.last().unwrap(); - let __next_state = __goto(__state, __nonterminal); - __states.push(__next_state); - None - } - #[inline(never)] - fn __symbol_type_mismatch() -> ! { - panic!("symbol type mismatch") - } - fn __pop_Variant3< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (Box, AnyStringKind), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant6< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (IpyEscapeKind, Box), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant31< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (Option<(TextSize, TextSize, Option)>, ast::Expr), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant31(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant13< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (Option>, Vec, Option>), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant13(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant59< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (Option>, crate::parser::ParenthesizedExpr), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant59(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant77< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (Option, Option), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant77(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant65< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (TextSize, ast::ConversionFlag), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant65(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant29< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (TextSize, ast::Suite), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant29(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant27< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (TextSize, crate::parser::ParenthesizedExpr, ast::Suite), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant27(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant88< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (Vec, Vec), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant88(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant42< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (ast::CmpOp, crate::parser::ParenthesizedExpr), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant42(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant81< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (ast::Expr, ast::Pattern), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant81(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant39< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (crate::parser::ParenthesizedExpr, ast::Identifier), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant39(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant60< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (crate::parser::ParenthesizedExpr, crate::parser::ParenthesizedExpr), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant60(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant1< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (f64, f64), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant20< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, (token::Tok, ast::Identifier), TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant20(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant4< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, AnyStringKind, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant7< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Box, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant5< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Int, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant93< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Option, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant93(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant67< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, StringType, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant67(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant48< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, TextSize, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant48(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant52< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant52(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant61< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec<(Option>, crate::parser::ParenthesizedExpr)>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant61(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant85< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant85(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant97< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant97(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant74< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant74(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant54< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant54(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant83< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant83(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant86< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant86(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant53< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant53(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant84< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant84(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant95< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant95(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant87< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant87(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant40< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant40(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant33< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant33(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant32< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant32(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant28< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant28(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant43< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant43(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant21< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec<(token::Tok, ast::Identifier)>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant21(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant92< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant92(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant58< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant58(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant64< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant64(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant71< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant71(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant79< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant79(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant12< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant12(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant36< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant36(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant38< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant38(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant19< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant19(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant17< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant17(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant22< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant22(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant76< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, alloc::vec::Vec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant76(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant73< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Alias, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant73(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant50< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Arguments, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant50(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant56< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::CmpOp, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant56(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant91< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Comprehension, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant91(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant57< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Decorator, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant57(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant63< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::ExceptHandler, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant63(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant44< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Expr, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant44(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant70< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::FStringElement, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant70(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant68< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::FStringFormatSpec, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant68(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant23< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Identifier, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant23(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant78< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::MatchCase, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant78(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant96< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Mod, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant96(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant82< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Number, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant82(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant49< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Operator, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant49(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant9< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Parameter, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant9(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant11< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::ParameterWithDefault, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant11(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant46< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Parameters, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant46(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant35< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Pattern, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant35(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant90< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::PatternArguments, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant90(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant80< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::PatternKeyword, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant80(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant37< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Stmt, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant37(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant25< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::Suite, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant25(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant98< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::TypeParam, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant98(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant99< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::TypeParams, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant99(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant101< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::UnaryOp, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant101(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant18< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, ast::WithItem, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant18(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant102< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option<(Box, AnyStringKind)>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant102(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant72< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant72(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant14< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option<(Option>, Vec, Option>)>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant14(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant66< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option<(TextSize, ast::ConversionFlag)>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant66(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant30< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option<(TextSize, ast::Suite)>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant30(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant94< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant94(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant62< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option>, crate::parser::ParenthesizedExpr)>>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant62(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant55< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant55(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant41< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant41(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant34< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option>, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant34(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant51< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant51(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant45< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant45(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant69< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant69(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant24< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant24(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant10< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant10(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant47< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant47(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant89< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant89(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant26< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant26(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant100< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant100(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant16< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant16(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant8< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, core::option::Option, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant8(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant15< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, crate::parser::ParenthesizedExpr, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant15(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant2< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, f64, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant0< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, token::Tok, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant0(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant75< - >( - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)> - ) -> (TextSize, u32, TextSize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant75(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - pub(crate) fn __reduce0< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ","? = "," => ActionFn(381); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action381::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 0) - } - pub(crate) fn __reduce1< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ","? = => ActionFn(382); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action382::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (0, 0) - } - pub(crate) fn __reduce2< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ";"? = ";" => ActionFn(405); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action405::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 1) - } - pub(crate) fn __reduce3< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ";"? = => ActionFn(406); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action406::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (0, 1) - } - pub(crate) fn __reduce4< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // "="? = "=" => ActionFn(272); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action272::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 2) - } - pub(crate) fn __reduce5< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // "="? = => ActionFn(273); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action273::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (0, 2) - } - pub(crate) fn __reduce6< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // "async"? = "async" => ActionFn(334); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action334::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 3) - } - pub(crate) fn __reduce7< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // "async"? = => ActionFn(335); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action335::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (0, 3) - } - pub(crate) fn __reduce8< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," ) = ",", DoubleStarTypedParameter => ActionFn(492); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action492::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (2, 4) - } - pub(crate) fn __reduce9< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," )? = ",", DoubleStarTypedParameter => ActionFn(676); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action676::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); - (2, 5) - } - pub(crate) fn __reduce10< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," )? = => ActionFn(491); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action491::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); - (0, 5) - } - pub(crate) fn __reduce11< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," ) = ",", DoubleStarUntypedParameter => ActionFn(481); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action481::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (2, 6) - } - pub(crate) fn __reduce12< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," )? = ",", DoubleStarUntypedParameter => ActionFn(681); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action681::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); - (2, 7) - } - pub(crate) fn __reduce13< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," )? = => ActionFn(480); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action480::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); - (0, 7) - } - pub(crate) fn __reduce14< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >) = ",", ParameterDef => ActionFn(495); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant11(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action495::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (2, 8) - } - pub(crate) fn __reduce15< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)* = => ActionFn(493); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action493::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); - (0, 9) - } - pub(crate) fn __reduce16< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)* = ("," >)+ => ActionFn(494); - let __sym0 = __pop_Variant12(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action494::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); - (1, 9) - } - pub(crate) fn __reduce17< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)+ = ",", ParameterDef => ActionFn(686); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant11(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action686::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); - (2, 10) - } - pub(crate) fn __reduce18< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)+ = ("," >)+, ",", ParameterDef => ActionFn(687); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant11(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant12(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action687::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); - (3, 10) - } - pub(crate) fn __reduce19< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >) = ",", ParameterDef => ActionFn(484); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant11(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action484::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (2, 11) - } - pub(crate) fn __reduce20< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)* = => ActionFn(482); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action482::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); - (0, 12) - } - pub(crate) fn __reduce21< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)* = ("," >)+ => ActionFn(483); - let __sym0 = __pop_Variant12(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action483::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); - (1, 12) - } - pub(crate) fn __reduce22< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)+ = ",", ParameterDef => ActionFn(698); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant11(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action698::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); - (2, 13) - } - pub(crate) fn __reduce23< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)+ = ("," >)+, ",", ParameterDef => ActionFn(699); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant11(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant12(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action699::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); - (3, 13) - } - pub(crate) fn __reduce42< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)? = => ActionFn(438); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action438::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (0, 15) - } - pub(crate) fn __reduce61< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)? = => ActionFn(446); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action446::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (0, 17) - } - pub(crate) fn __reduce62< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >) = ",", Test<"all"> => ActionFn(375); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action375::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 18) - } - pub(crate) fn __reduce63< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)? = ",", Test<"all"> => ActionFn(1069); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1069::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (2, 19) - } - pub(crate) fn __reduce64< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)? = => ActionFn(374); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action374::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (0, 19) - } - pub(crate) fn __reduce65< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," ) = ",", TestOrStarNamedExpr => ActionFn(566); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action566::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 20) - } - pub(crate) fn __reduce66< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," )* = => ActionFn(564); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action564::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (0, 21) - } - pub(crate) fn __reduce67< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," )* = ("," )+ => ActionFn(565); - let __sym0 = __pop_Variant17(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action565::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (1, 21) - } - pub(crate) fn __reduce68< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," )+ = ",", TestOrStarNamedExpr => ActionFn(1072); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1072::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (2, 22) - } - pub(crate) fn __reduce69< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," )+ = ("," )+, ",", TestOrStarNamedExpr => ActionFn(1073); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant17(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1073::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (3, 22) - } - pub(crate) fn __reduce70< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >) = ",", WithItem<"all"> => ActionFn(318); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant18(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action318::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant18(__nt), __end)); - (2, 23) - } - pub(crate) fn __reduce71< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)* = => ActionFn(316); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action316::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant19(__nt), __end)); - (0, 24) - } - pub(crate) fn __reduce72< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)* = ("," >)+ => ActionFn(317); - let __sym0 = __pop_Variant19(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action317::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant19(__nt), __end)); - (1, 24) - } - pub(crate) fn __reduce73< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)+ = ",", WithItem<"all"> => ActionFn(1082); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant18(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1082::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant19(__nt), __end)); - (2, 25) - } - pub(crate) fn __reduce74< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("," >)+ = ("," >)+, ",", WithItem<"all"> => ActionFn(1083); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant18(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant19(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1083::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant19(__nt), __end)); - (3, 25) - } - pub(crate) fn __reduce75< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("->" >) = "->", Test<"all"> => ActionFn(305); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action305::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 26) - } - pub(crate) fn __reduce76< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("->" >)? = "->", Test<"all"> => ActionFn(1088); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1088::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (2, 27) - } - pub(crate) fn __reduce77< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("->" >)? = => ActionFn(304); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action304::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (0, 27) - } - pub(crate) fn __reduce78< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("." Identifier) = ".", Identifier => ActionFn(380); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action380::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant20(__nt), __end)); - (2, 28) - } - pub(crate) fn __reduce79< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("." Identifier)+ = ".", Identifier => ActionFn(1093); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1093::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant21(__nt), __end)); - (2, 29) - } - pub(crate) fn __reduce80< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("." Identifier)+ = ("." Identifier)+, ".", Identifier => ActionFn(1094); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant21(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1094::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant21(__nt), __end)); - (3, 29) - } - pub(crate) fn __reduce81< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (":" >) = ":", Test<"all"> => ActionFn(297); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action297::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 30) - } - pub(crate) fn __reduce82< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (":" >)? = ":", Test<"all"> => ActionFn(1095); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1095::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (2, 31) - } - pub(crate) fn __reduce83< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (":" >)? = => ActionFn(296); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action296::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (0, 31) - } - pub(crate) fn __reduce84< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (":" ) = ":", TestOrStarExpr => ActionFn(294); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action294::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 32) - } - pub(crate) fn __reduce85< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (":" )? = ":", TestOrStarExpr => ActionFn(1102); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1102::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (2, 33) - } - pub(crate) fn __reduce86< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (":" )? = => ActionFn(293); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action293::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (0, 33) - } - pub(crate) fn __reduce87< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("?") = "?" => ActionFn(370); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action370::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant0(__nt), __end)); - (1, 34) - } - pub(crate) fn __reduce88< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("?")+ = "?" => ActionFn(1105); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1105::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant22(__nt), __end)); - (1, 35) - } - pub(crate) fn __reduce89< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("?")+ = ("?")+, "?" => ActionFn(1106); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant22(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1106::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant22(__nt), __end)); - (2, 35) - } - pub(crate) fn __reduce90< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("\n") = "\n" => ActionFn(412); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action412::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant0(__nt), __end)); - (1, 36) - } - pub(crate) fn __reduce91< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("\n")* = => ActionFn(410); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action410::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant22(__nt), __end)); - (0, 37) - } - pub(crate) fn __reduce92< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("\n")* = ("\n")+ => ActionFn(411); - let __sym0 = __pop_Variant22(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action411::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant22(__nt), __end)); - (1, 37) - } - pub(crate) fn __reduce93< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("\n")+ = "\n" => ActionFn(1107); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1107::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant22(__nt), __end)); - (1, 38) - } - pub(crate) fn __reduce94< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("\n")+ = ("\n")+, "\n" => ActionFn(1108); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant22(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1108::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant22(__nt), __end)); - (2, 38) - } - pub(crate) fn __reduce95< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("as" ) = "as", Identifier => ActionFn(423); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action423::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant23(__nt), __end)); - (2, 39) - } - pub(crate) fn __reduce96< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("as" )? = "as", Identifier => ActionFn(1111); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1111::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant24(__nt), __end)); - (2, 40) - } - pub(crate) fn __reduce97< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("as" )? = => ActionFn(422); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action422::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant24(__nt), __end)); - (0, 40) - } - pub(crate) fn __reduce98< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("else" ":" ) = "else", ":", Suite => ActionFn(338); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action338::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (3, 41) - } - pub(crate) fn __reduce99< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("else" ":" )? = "else", ":", Suite => ActionFn(1116); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1116::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant26(__nt), __end)); - (3, 42) - } - pub(crate) fn __reduce100< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("else" ":" )? = => ActionFn(337); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action337::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant26(__nt), __end)); - (0, 42) - } - pub(crate) fn __reduce101< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("finally" ":" ) = "finally", ":", Suite => ActionFn(331); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action331::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (3, 43) - } - pub(crate) fn __reduce102< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("finally" ":" )? = "finally", ":", Suite => ActionFn(1127); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1127::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant26(__nt), __end)); - (3, 44) - } - pub(crate) fn __reduce103< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("finally" ":" )? = => ActionFn(330); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action330::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant26(__nt), __end)); - (0, 44) - } - pub(crate) fn __reduce104< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("from" >) = "from", Test<"all"> => ActionFn(395); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action395::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 45) - } - pub(crate) fn __reduce105< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("from" >)? = "from", Test<"all"> => ActionFn(1137); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1137::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (2, 46) - } - pub(crate) fn __reduce106< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ("from" >)? = => ActionFn(394); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action394::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (0, 46) - } - pub(crate) fn __reduce107< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (<@L> "elif" ":" ) = "elif", NamedExpressionTest, ":", Suite => ActionFn(711); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant25(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action711::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant27(__nt), __end)); - (4, 47) - } - pub(crate) fn __reduce108< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (<@L> "elif" ":" )* = => ActionFn(342); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action342::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant28(__nt), __end)); - (0, 48) - } - pub(crate) fn __reduce109< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (<@L> "elif" ":" )* = (<@L> "elif" ":" )+ => ActionFn(343); - let __sym0 = __pop_Variant28(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action343::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant28(__nt), __end)); - (1, 48) - } - pub(crate) fn __reduce110< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (<@L> "elif" ":" )+ = "elif", NamedExpressionTest, ":", Suite => ActionFn(1140); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant25(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1140::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant28(__nt), __end)); - (4, 49) - } - pub(crate) fn __reduce111< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (<@L> "elif" ":" )+ = (<@L> "elif" ":" )+, "elif", NamedExpressionTest, ":", Suite => ActionFn(1141); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant25(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant28(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1141::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant28(__nt), __end)); - (5, 49) - } - pub(crate) fn __reduce112< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (<@L> "else" ":" ) = "else", ":", Suite => ActionFn(712); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action712::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant29(__nt), __end)); - (3, 50) - } - pub(crate) fn __reduce113< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (<@L> "else" ":" )? = "else", ":", Suite => ActionFn(1144); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1144::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant30(__nt), __end)); - (3, 51) - } - pub(crate) fn __reduce114< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (<@L> "else" ":" )? = => ActionFn(340); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action340::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant30(__nt), __end)); - (0, 51) - } - pub(crate) fn __reduce115< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (> "or") = AndTest<"all">, "or" => ActionFn(459); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action459::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 52) - } - pub(crate) fn __reduce116< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (> "or")+ = AndTest<"all">, "or" => ActionFn(1149); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1149::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (2, 53) - } - pub(crate) fn __reduce117< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (> "or")+ = (> "or")+, AndTest<"all">, "or" => ActionFn(1150); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant17(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1150::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (3, 53) - } - pub(crate) fn __reduce118< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // () = DoubleStarTypedParameter => ActionFn(489); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action489::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (1, 54) - } - pub(crate) fn __reduce119< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // () = DoubleStarUntypedParameter => ActionFn(478); - let __sym0 = __pop_Variant9(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action478::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (1, 55) - } - pub(crate) fn __reduce120< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ",") = FunctionArgument, "," => ActionFn(468); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant31(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action468::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant31(__nt), __end)); - (2, 56) - } - pub(crate) fn __reduce121< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ",")* = => ActionFn(466); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action466::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant32(__nt), __end)); - (0, 57) - } - pub(crate) fn __reduce122< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ",")* = ( ",")+ => ActionFn(467); - let __sym0 = __pop_Variant32(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action467::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant32(__nt), __end)); - (1, 57) - } - pub(crate) fn __reduce123< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ",")+ = FunctionArgument, "," => ActionFn(1151); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant31(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1151::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant32(__nt), __end)); - (2, 58) - } - pub(crate) fn __reduce124< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ",")+ = ( ",")+, FunctionArgument, "," => ActionFn(1152); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant31(__symbols); - let __sym0 = __pop_Variant32(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1152::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant32(__nt), __end)); - (3, 58) - } - pub(crate) fn __reduce125< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (> "and") = NotTest<"all">, "and" => ActionFn(473); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action473::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 59) - } - pub(crate) fn __reduce126< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (> "and")+ = NotTest<"all">, "and" => ActionFn(1155); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1155::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (2, 60) - } - pub(crate) fn __reduce127< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (> "and")+ = (> "and")+, NotTest<"all">, "and" => ActionFn(1156); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant17(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1156::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (3, 60) - } - pub(crate) fn __reduce128< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (>> ",") = OneOrMore>, "," => ActionFn(569); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action569::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (2, 61) - } - pub(crate) fn __reduce129< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (>> ",")? = OneOrMore>, "," => ActionFn(1157); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1157::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant34(__nt), __end)); - (2, 62) - } - pub(crate) fn __reduce130< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (>> ",")? = => ActionFn(568); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action568::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant34(__nt), __end)); - (0, 62) - } - pub(crate) fn __reduce131< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ",") = Pattern, "," => ActionFn(356); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action356::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (2, 63) - } - pub(crate) fn __reduce132< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ",")* = => ActionFn(428); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action428::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant36(__nt), __end)); - (0, 64) - } - pub(crate) fn __reduce133< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ",")* = ( ",")+ => ActionFn(429); - let __sym0 = __pop_Variant36(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action429::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant36(__nt), __end)); - (1, 64) - } - pub(crate) fn __reduce134< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ",")+ = Pattern, "," => ActionFn(1174); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1174::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant36(__nt), __end)); - (2, 65) - } - pub(crate) fn __reduce135< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ",")+ = ( ",")+, Pattern, "," => ActionFn(1175); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant35(__symbols); - let __sym0 = __pop_Variant36(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1175::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant36(__nt), __end)); - (3, 65) - } - pub(crate) fn __reduce136< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ";") = SmallStatement, ";" => ActionFn(409); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action409::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (2, 66) - } - pub(crate) fn __reduce137< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ";")* = => ActionFn(407); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action407::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant38(__nt), __end)); - (0, 67) - } - pub(crate) fn __reduce138< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ";")* = ( ";")+ => ActionFn(408); - let __sym0 = __pop_Variant38(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action408::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant38(__nt), __end)); - (1, 67) - } - pub(crate) fn __reduce139< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ";")+ = SmallStatement, ";" => ActionFn(1178); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1178::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant38(__nt), __end)); - (2, 68) - } - pub(crate) fn __reduce140< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ";")+ = ( ";")+, SmallStatement, ";" => ActionFn(1179); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant37(__symbols); - let __sym0 = __pop_Variant38(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1179::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant38(__nt), __end)); - (3, 68) - } - pub(crate) fn __reduce141< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (> "as" ) = Test<"all">, "as", Identifier => ActionFn(326); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action326::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant39(__nt), __end)); - (3, 69) - } - pub(crate) fn __reduce142< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ",") = OneOrMore>, "," => ActionFn(1198); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1198::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (2, 70) - } - pub(crate) fn __reduce143< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ",")? = OneOrMore>, "," => ActionFn(1201); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1201::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant41(__nt), __end)); - (2, 71) - } - pub(crate) fn __reduce144< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ( ",")? = => ActionFn(322); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action322::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant41(__nt), __end)); - (0, 71) - } - pub(crate) fn __reduce145< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (CompOp Expression<"all">) = CompOp, Expression<"all"> => ActionFn(514); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant56(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action514::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant42(__nt), __end)); - (2, 72) - } - pub(crate) fn __reduce146< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (CompOp Expression<"all">)+ = CompOp, Expression<"all"> => ActionFn(1210); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant56(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1210::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant43(__nt), __end)); - (2, 73) - } - pub(crate) fn __reduce147< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (CompOp Expression<"all">)+ = (CompOp Expression<"all">)+, CompOp, Expression<"all"> => ActionFn(1211); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant56(__symbols); - let __sym0 = __pop_Variant43(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1211::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant43(__nt), __end)); - (3, 73) - } - pub(crate) fn __reduce148< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (Guard) = Guard => ActionFn(363); - let __sym0 = __pop_Variant44(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action363::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (1, 74) - } - pub(crate) fn __reduce149< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (Guard)? = Guard => ActionFn(1212); - let __sym0 = __pop_Variant44(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1212::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant45(__nt), __end)); - (1, 75) - } - pub(crate) fn __reduce150< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (Guard)? = => ActionFn(362); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action362::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant45(__nt), __end)); - (0, 75) - } - pub(crate) fn __reduce151< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (ParameterList) = ParameterList => ActionFn(300); - let __sym0 = __pop_Variant46(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action300::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant46(__nt), __end)); - (1, 76) - } - pub(crate) fn __reduce152< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (ParameterList)? = ParameterList => ActionFn(1215); - let __sym0 = __pop_Variant46(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1215::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant47(__nt), __end)); - (1, 77) - } - pub(crate) fn __reduce153< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // (ParameterList)? = => ActionFn(299); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action299::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant47(__nt), __end)); - (0, 77) - } - pub(crate) fn __reduce154< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // @L = => ActionFn(414); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action414::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant48(__nt), __end)); - (0, 78) - } - pub(crate) fn __reduce155< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // @R = => ActionFn(413); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action413::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant48(__nt), __end)); - (0, 79) - } - pub(crate) fn __reduce156< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AddOp = "+" => ActionFn(198); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action198::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 80) - } - pub(crate) fn __reduce157< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AddOp = "-" => ActionFn(199); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action199::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 80) - } - pub(crate) fn __reduce158< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AddOpExpr = NumberExpr, AddOp, NumberAtom => ActionFn(1218); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant49(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1218::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 81) - } - pub(crate) fn __reduce159< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AndExpression<"all"> = AndExpression<"all">, "&", ShiftExpression<"all"> => ActionFn(1219); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1219::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 82) - } - pub(crate) fn __reduce160< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AndExpression<"all"> = ShiftExpression<"all"> => ActionFn(501); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action501::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 82) - } - pub(crate) fn __reduce161< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AndExpression<"no-withitems"> = AndExpression<"all">, "&", ShiftExpression<"all"> => ActionFn(1220); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1220::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 83) - } - pub(crate) fn __reduce162< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AndExpression<"no-withitems"> = ShiftExpression<"no-withitems"> => ActionFn(532); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action532::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 83) - } - pub(crate) fn __reduce163< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AndTest<"all"> = (> "and")+, NotTest<"all"> => ActionFn(1221); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant17(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1221::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 84) - } - pub(crate) fn __reduce164< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AndTest<"all"> = NotTest<"all"> => ActionFn(461); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action461::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 84) - } - pub(crate) fn __reduce165< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AndTest<"no-withitems"> = (> "and")+, NotTest<"all"> => ActionFn(1222); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant17(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1222::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 85) - } - pub(crate) fn __reduce166< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AndTest<"no-withitems"> = NotTest<"no-withitems"> => ActionFn(505); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action505::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 85) - } - pub(crate) fn __reduce171< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Arguments? = Arguments => ActionFn(290); - let __sym0 = __pop_Variant50(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action290::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant51(__nt), __end)); - (1, 87) - } - pub(crate) fn __reduce172< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Arguments? = => ActionFn(291); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action291::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant51(__nt), __end)); - (0, 87) - } - pub(crate) fn __reduce173< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ArithmeticExpression<"all"> = ArithmeticExpression<"all">, AddOp, Term<"all"> => ActionFn(1224); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant49(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1224::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 88) - } - pub(crate) fn __reduce174< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ArithmeticExpression<"all"> = Term<"all"> => ActionFn(518); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action518::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 88) - } - pub(crate) fn __reduce175< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ArithmeticExpression<"no-withitems"> = ArithmeticExpression<"all">, AddOp, Term<"all"> => ActionFn(1225); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant49(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1225::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 89) - } - pub(crate) fn __reduce176< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ArithmeticExpression<"no-withitems"> = Term<"no-withitems"> => ActionFn(542); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action542::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 89) - } - pub(crate) fn __reduce178< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AssertStatement = "assert", Test<"all">, ",", Test<"all"> => ActionFn(1227); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1227::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (4, 91) - } - pub(crate) fn __reduce179< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AssertStatement = "assert", Test<"all"> => ActionFn(1228); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1228::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (2, 91) - } - pub(crate) fn __reduce180< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AssignSuffix = "=", TestListOrYieldExpr => ActionFn(29); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action29::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 92) - } - pub(crate) fn __reduce181< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AssignSuffix = "=", IpyEscapeCommandExpr => ActionFn(30); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action30::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 92) - } - pub(crate) fn __reduce182< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AssignSuffix* = => ActionFn(403); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action403::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (0, 93) - } - pub(crate) fn __reduce183< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AssignSuffix* = AssignSuffix+ => ActionFn(404); - let __sym0 = __pop_Variant17(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action404::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (1, 93) - } - pub(crate) fn __reduce184< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AssignSuffix+ = AssignSuffix => ActionFn(419); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action419::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (1, 94) - } - pub(crate) fn __reduce185< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AssignSuffix+ = AssignSuffix+, AssignSuffix => ActionFn(420); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant17(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action420::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (2, 94) - } - pub(crate) fn __reduce186< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AssignSuffix? = AssignSuffix => ActionFn(398); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action398::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (1, 95) - } - pub(crate) fn __reduce187< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AssignSuffix? = => ActionFn(399); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action399::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (0, 95) - } - pub(crate) fn __reduce188< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = String => ActionFn(543); - let __sym0 = __pop_Variant44(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action543::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 96) - } - pub(crate) fn __reduce189< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = Number => ActionFn(1229); - let __sym0 = __pop_Variant82(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1229::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 96) - } - pub(crate) fn __reduce190< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = Identifier => ActionFn(1230); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1230::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 96) - } - pub(crate) fn __reduce191< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "[", ListLiteralValues, "]" => ActionFn(1592); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1592::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 96) - } - pub(crate) fn __reduce192< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "[", "]" => ActionFn(1593); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1593::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 96) - } - pub(crate) fn __reduce193< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "[", TestOrStarNamedExpr, CompFor, "]" => ActionFn(1232); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant54(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1232::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 96) - } - pub(crate) fn __reduce194< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "(", OneOrMore>, ",", ")" => ActionFn(1233); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1233::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 96) - } - pub(crate) fn __reduce195< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "(", OneOrMore>, ")" => ActionFn(1234); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1234::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 96) - } - pub(crate) fn __reduce204< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "(", ")" => ActionFn(1243); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1243::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 96) - } - pub(crate) fn __reduce205< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "(", YieldExpr, ")" => ActionFn(1244); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1244::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 96) - } - pub(crate) fn __reduce206< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "(", NamedExpressionTest, CompFor, ")" => ActionFn(1245); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant54(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1245::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 96) - } - pub(crate) fn __reduce208< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "{", DictLiteralValues, "}" => ActionFn(1562); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant61(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1562::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 96) - } - pub(crate) fn __reduce209< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "{", "}" => ActionFn(1563); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1563::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 96) - } - pub(crate) fn __reduce210< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "{", DictEntry, CompFor, "}" => ActionFn(1248); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant54(__symbols); - let __sym1 = __pop_Variant60(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1248::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 96) - } - pub(crate) fn __reduce211< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "{", SetLiteralValues, "}" => ActionFn(1249); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1249::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 96) - } - pub(crate) fn __reduce212< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "{", NamedExpressionTest, CompFor, "}" => ActionFn(1250); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant54(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1250::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 96) - } - pub(crate) fn __reduce213< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "True" => ActionFn(1251); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1251::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 96) - } - pub(crate) fn __reduce214< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "False" => ActionFn(1252); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1252::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 96) - } - pub(crate) fn __reduce215< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "None" => ActionFn(1253); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1253::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 96) - } - pub(crate) fn __reduce216< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"all"> = "..." => ActionFn(1254); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1254::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 96) - } - pub(crate) fn __reduce217< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = String => ActionFn(586); - let __sym0 = __pop_Variant44(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action586::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 97) - } - pub(crate) fn __reduce218< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = Number => ActionFn(1255); - let __sym0 = __pop_Variant82(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1255::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 97) - } - pub(crate) fn __reduce219< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = Identifier => ActionFn(1256); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1256::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 97) - } - pub(crate) fn __reduce220< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "[", ListLiteralValues, "]" => ActionFn(1594); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1594::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 97) - } - pub(crate) fn __reduce221< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "[", "]" => ActionFn(1595); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1595::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 97) - } - pub(crate) fn __reduce222< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "[", TestOrStarNamedExpr, CompFor, "]" => ActionFn(1258); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant54(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1258::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 97) - } - pub(crate) fn __reduce231< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "(", ")" => ActionFn(1267); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1267::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 97) - } - pub(crate) fn __reduce232< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "(", YieldExpr, ")" => ActionFn(1268); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1268::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 97) - } - pub(crate) fn __reduce233< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "(", NamedExpressionTest, CompFor, ")" => ActionFn(1269); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant54(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1269::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 97) - } - pub(crate) fn __reduce235< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "{", DictLiteralValues, "}" => ActionFn(1564); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant61(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1564::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 97) - } - pub(crate) fn __reduce236< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "{", "}" => ActionFn(1565); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1565::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 97) - } - pub(crate) fn __reduce237< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "{", DictEntry, CompFor, "}" => ActionFn(1272); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant54(__symbols); - let __sym1 = __pop_Variant60(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1272::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 97) - } - pub(crate) fn __reduce238< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "{", SetLiteralValues, "}" => ActionFn(1273); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1273::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 97) - } - pub(crate) fn __reduce239< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "{", NamedExpressionTest, CompFor, "}" => ActionFn(1274); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant54(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1274::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 97) - } - pub(crate) fn __reduce240< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "True" => ActionFn(1275); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1275::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 97) - } - pub(crate) fn __reduce241< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "False" => ActionFn(1276); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1276::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 97) - } - pub(crate) fn __reduce242< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "None" => ActionFn(1277); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1277::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 97) - } - pub(crate) fn __reduce243< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Atom<"no-withitems"> = "..." => ActionFn(1278); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1278::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 97) - } - pub(crate) fn __reduce244< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AtomExpr2<"all"> = Atom<"all"> => ActionFn(535); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action535::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 98) - } - pub(crate) fn __reduce245< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AtomExpr2<"all"> = AtomExpr2<"all">, Arguments => ActionFn(1279); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant50(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1279::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 98) - } - pub(crate) fn __reduce246< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AtomExpr2<"all"> = AtomExpr2<"all">, "[", SubscriptList, "]" => ActionFn(1280); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1280::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 98) - } - pub(crate) fn __reduce247< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AtomExpr2<"all"> = AtomExpr2<"all">, ".", Identifier => ActionFn(1281); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1281::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 98) - } - pub(crate) fn __reduce248< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AtomExpr2<"no-withitems"> = Atom<"no-withitems"> => ActionFn(582); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action582::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 99) - } - pub(crate) fn __reduce249< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AtomExpr2<"no-withitems"> = AtomExpr2<"all">, Arguments => ActionFn(1282); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant50(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1282::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 99) - } - pub(crate) fn __reduce250< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AtomExpr2<"no-withitems"> = AtomExpr2<"all">, "[", SubscriptList, "]" => ActionFn(1283); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1283::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 99) - } - pub(crate) fn __reduce251< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AtomExpr2<"no-withitems"> = AtomExpr2<"all">, ".", Identifier => ActionFn(1284); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1284::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 99) - } - pub(crate) fn __reduce252< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AtomExpr<"all"> = "await", AtomExpr2<"all"> => ActionFn(1285); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1285::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 100) - } - pub(crate) fn __reduce253< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AtomExpr<"all"> = AtomExpr2<"all"> => ActionFn(534); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action534::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 100) - } - pub(crate) fn __reduce254< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AtomExpr<"no-withitems"> = "await", AtomExpr2<"all"> => ActionFn(1286); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1286::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 101) - } - pub(crate) fn __reduce255< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AtomExpr<"no-withitems"> = AtomExpr2<"no-withitems"> => ActionFn(581); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action581::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 101) - } - pub(crate) fn __reduce256< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AugAssign = "+=" => ActionFn(40); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action40::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 102) - } - pub(crate) fn __reduce257< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AugAssign = "-=" => ActionFn(41); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action41::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 102) - } - pub(crate) fn __reduce258< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AugAssign = "*=" => ActionFn(42); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action42::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 102) - } - pub(crate) fn __reduce259< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AugAssign = "@=" => ActionFn(43); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action43::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 102) - } - pub(crate) fn __reduce260< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AugAssign = "/=" => ActionFn(44); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action44::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 102) - } - pub(crate) fn __reduce261< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AugAssign = "%=" => ActionFn(45); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action45::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 102) - } - pub(crate) fn __reduce262< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AugAssign = "&=" => ActionFn(46); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action46::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 102) - } - pub(crate) fn __reduce263< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AugAssign = "|=" => ActionFn(47); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action47::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 102) - } - pub(crate) fn __reduce264< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AugAssign = "^=" => ActionFn(48); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action48::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 102) - } - pub(crate) fn __reduce265< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AugAssign = "<<=" => ActionFn(49); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action49::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 102) - } - pub(crate) fn __reduce266< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AugAssign = ">>=" => ActionFn(50); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action50::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 102) - } - pub(crate) fn __reduce267< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AugAssign = "**=" => ActionFn(51); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action51::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 102) - } - pub(crate) fn __reduce268< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // AugAssign = "//=" => ActionFn(52); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action52::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 102) - } - pub(crate) fn __reduce269< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CapturePattern = Identifier => ActionFn(1287); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1287::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 103) - } - pub(crate) fn __reduce270< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClassDef = "class", Identifier, TypeParams, Arguments, ":", Suite => ActionFn(1748); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant25(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant50(__symbols); - let __sym2 = __pop_Variant99(__symbols); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1748::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (6, 104) - } - pub(crate) fn __reduce271< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClassDef = "class", Identifier, Arguments, ":", Suite => ActionFn(1749); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant25(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant50(__symbols); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1749::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (5, 104) - } - pub(crate) fn __reduce272< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClassDef = Decorator+, "class", Identifier, TypeParams, Arguments, ":", Suite => ActionFn(1750); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant50(__symbols); - let __sym3 = __pop_Variant99(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1750::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 104) - } - pub(crate) fn __reduce273< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClassDef = Decorator+, "class", Identifier, Arguments, ":", Suite => ActionFn(1751); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant25(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant50(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1751::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (6, 104) - } - pub(crate) fn __reduce274< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClassDef = "class", Identifier, TypeParams, ":", Suite => ActionFn(1752); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant25(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant99(__symbols); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1752::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (5, 104) - } - pub(crate) fn __reduce275< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClassDef = "class", Identifier, ":", Suite => ActionFn(1753); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant25(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1753::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (4, 104) - } - pub(crate) fn __reduce276< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClassDef = Decorator+, "class", Identifier, TypeParams, ":", Suite => ActionFn(1754); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant25(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant99(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1754::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (6, 104) - } - pub(crate) fn __reduce277< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClassDef = Decorator+, "class", Identifier, ":", Suite => ActionFn(1755); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant25(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1755::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (5, 104) - } - pub(crate) fn __reduce278< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClassPattern = MatchName, PatternArguments => ActionFn(1288); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant90(__symbols); - let __sym0 = __pop_Variant44(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1288::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (2, 105) - } - pub(crate) fn __reduce279< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClassPattern = MatchNameOrAttr, PatternArguments => ActionFn(1289); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant90(__symbols); - let __sym0 = __pop_Variant44(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1289::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (2, 105) - } - pub(crate) fn __reduce280< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClosedPattern = LiteralPattern => ActionFn(98); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action98::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 106) - } - pub(crate) fn __reduce281< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClosedPattern = CapturePattern => ActionFn(99); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action99::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 106) - } - pub(crate) fn __reduce282< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClosedPattern = StarPattern => ActionFn(100); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action100::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 106) - } - pub(crate) fn __reduce283< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClosedPattern = ValuePattern => ActionFn(101); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action101::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 106) - } - pub(crate) fn __reduce284< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClosedPattern = SequencePattern => ActionFn(102); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action102::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 106) - } - pub(crate) fn __reduce285< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClosedPattern = MappingPattern => ActionFn(103); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action103::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 106) - } - pub(crate) fn __reduce286< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ClosedPattern = ClassPattern => ActionFn(104); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action104::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 106) - } - pub(crate) fn __reduce287< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Comma = FunctionArgument => ActionFn(1528); - let __sym0 = __pop_Variant31(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1528::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant52(__nt), __end)); - (1, 107) - } - pub(crate) fn __reduce288< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Comma = => ActionFn(1529); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action1529::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant52(__nt), __end)); - (0, 107) - } - pub(crate) fn __reduce289< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Comma = ( ",")+, FunctionArgument => ActionFn(1530); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant31(__symbols); - let __sym0 = __pop_Variant32(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1530::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant52(__nt), __end)); - (2, 107) - } - pub(crate) fn __reduce290< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Comma = ( ",")+ => ActionFn(1531); - let __sym0 = __pop_Variant32(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1531::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant52(__nt), __end)); - (1, 107) - } - pub(crate) fn __reduce291< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Comma = Pattern => ActionFn(1536); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1536::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant53(__nt), __end)); - (1, 108) - } - pub(crate) fn __reduce292< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Comma = => ActionFn(1537); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action1537::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant53(__nt), __end)); - (0, 108) - } - pub(crate) fn __reduce293< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Comma = ( ",")+, Pattern => ActionFn(1538); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant35(__symbols); - let __sym0 = __pop_Variant36(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1538::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant53(__nt), __end)); - (2, 108) - } - pub(crate) fn __reduce294< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Comma = ( ",")+ => ActionFn(1539); - let __sym0 = __pop_Variant36(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1539::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant53(__nt), __end)); - (1, 108) - } - pub(crate) fn __reduce295< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompFor = SingleForComprehension+ => ActionFn(238); - let __sym0 = __pop_Variant92(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action238::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant54(__nt), __end)); - (1, 109) - } - pub(crate) fn __reduce296< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompFor? = CompFor => ActionFn(251); - let __sym0 = __pop_Variant54(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action251::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant55(__nt), __end)); - (1, 110) - } - pub(crate) fn __reduce297< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompFor? = => ActionFn(252); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action252::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant55(__nt), __end)); - (0, 110) - } - pub(crate) fn __reduce298< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompOp = "==" => ActionFn(186); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action186::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant56(__nt), __end)); - (1, 111) - } - pub(crate) fn __reduce299< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompOp = "!=" => ActionFn(187); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action187::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant56(__nt), __end)); - (1, 111) - } - pub(crate) fn __reduce300< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompOp = "<" => ActionFn(188); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action188::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant56(__nt), __end)); - (1, 111) - } - pub(crate) fn __reduce301< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompOp = "<=" => ActionFn(189); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action189::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant56(__nt), __end)); - (1, 111) - } - pub(crate) fn __reduce302< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompOp = ">" => ActionFn(190); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action190::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant56(__nt), __end)); - (1, 111) - } - pub(crate) fn __reduce303< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompOp = ">=" => ActionFn(191); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action191::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant56(__nt), __end)); - (1, 111) - } - pub(crate) fn __reduce304< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompOp = "in" => ActionFn(192); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action192::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant56(__nt), __end)); - (1, 111) - } - pub(crate) fn __reduce305< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompOp = "not", "in" => ActionFn(193); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action193::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant56(__nt), __end)); - (2, 111) - } - pub(crate) fn __reduce306< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompOp = "is" => ActionFn(194); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action194::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant56(__nt), __end)); - (1, 111) - } - pub(crate) fn __reduce307< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompOp = "is", "not" => ActionFn(195); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action195::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant56(__nt), __end)); - (2, 111) - } - pub(crate) fn __reduce308< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Comparison<"all"> = Expression<"all">, (CompOp Expression<"all">)+ => ActionFn(1290); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant43(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1290::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 112) - } - pub(crate) fn __reduce309< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Comparison<"all"> = Expression<"all"> => ActionFn(511); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action511::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 112) - } - pub(crate) fn __reduce310< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Comparison<"no-withitems"> = Expression<"all">, (CompOp Expression<"all">)+ => ActionFn(1291); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant43(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1291::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 113) - } - pub(crate) fn __reduce311< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Comparison<"no-withitems"> = Expression<"no-withitems"> => ActionFn(522); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action522::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 113) - } - pub(crate) fn __reduce312< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompoundStatement = MatchStatement => ActionFn(77); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action77::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 114) - } - pub(crate) fn __reduce313< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompoundStatement = IfStatement => ActionFn(78); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action78::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 114) - } - pub(crate) fn __reduce314< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompoundStatement = WhileStatement => ActionFn(79); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action79::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 114) - } - pub(crate) fn __reduce315< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompoundStatement = ForStatement => ActionFn(80); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action80::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 114) - } - pub(crate) fn __reduce316< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompoundStatement = TryStatement => ActionFn(81); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action81::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 114) - } - pub(crate) fn __reduce317< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompoundStatement = WithStatement => ActionFn(82); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action82::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 114) - } - pub(crate) fn __reduce318< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompoundStatement = FuncDef => ActionFn(83); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action83::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 114) - } - pub(crate) fn __reduce319< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // CompoundStatement = ClassDef => ActionFn(84); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action84::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 114) - } - pub(crate) fn __reduce320< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ComprehensionIf = "if", ExpressionNoCond => ActionFn(241); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action241::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 115) - } - pub(crate) fn __reduce321< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ComprehensionIf* = => ActionFn(254); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action254::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (0, 116) - } - pub(crate) fn __reduce322< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ComprehensionIf* = ComprehensionIf+ => ActionFn(255); - let __sym0 = __pop_Variant17(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action255::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (1, 116) - } - pub(crate) fn __reduce323< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ComprehensionIf+ = ComprehensionIf => ActionFn(462); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action462::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (1, 117) - } - pub(crate) fn __reduce324< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ComprehensionIf+ = ComprehensionIf+, ComprehensionIf => ActionFn(463); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant17(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action463::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); - (2, 117) - } - pub(crate) fn __reduce325< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Decorator = "@", NamedExpressionTest, "\n" => ActionFn(1292); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1292::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant57(__nt), __end)); - (3, 118) - } - pub(crate) fn __reduce326< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Decorator* = => ActionFn(308); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action308::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant58(__nt), __end)); - (0, 119) - } - pub(crate) fn __reduce327< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Decorator* = Decorator+ => ActionFn(309); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action309::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant58(__nt), __end)); - (1, 119) - } - pub(crate) fn __reduce328< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Decorator+ = Decorator => ActionFn(435); - let __sym0 = __pop_Variant57(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action435::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant58(__nt), __end)); - (1, 120) - } - pub(crate) fn __reduce329< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Decorator+ = Decorator+, Decorator => ActionFn(436); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant57(__symbols); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action436::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant58(__nt), __end)); - (2, 120) - } - pub(crate) fn __reduce330< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // DelStatement = "del", ExpressionList2 => ActionFn(1293); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1293::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (2, 121) - } - pub(crate) fn __reduce331< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // DictElement = DictEntry => ActionFn(229); - let __sym0 = __pop_Variant60(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action229::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant59(__nt), __end)); - (1, 122) - } - pub(crate) fn __reduce332< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // DictElement = "**", Expression<"all"> => ActionFn(230); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action230::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant59(__nt), __end)); - (2, 122) - } - pub(crate) fn __reduce333< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // DictEntry = Test<"all">, ":", Test<"all"> => ActionFn(228); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action228::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant60(__nt), __end)); - (3, 123) - } - pub(crate) fn __reduce334< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // DictLiteralValues = OneOrMore, "," => ActionFn(610); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant61(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action610::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant61(__nt), __end)); - (2, 124) - } - pub(crate) fn __reduce335< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // DictLiteralValues = OneOrMore => ActionFn(611); - let __sym0 = __pop_Variant61(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action611::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant61(__nt), __end)); - (1, 124) - } - pub(crate) fn __reduce336< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // DictLiteralValues? = DictLiteralValues => ActionFn(562); - let __sym0 = __pop_Variant61(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action562::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant62(__nt), __end)); - (1, 125) - } - pub(crate) fn __reduce337< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // DictLiteralValues? = => ActionFn(563); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action563::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant62(__nt), __end)); - (0, 125) - } - pub(crate) fn __reduce338< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // DottedName = name => ActionFn(1294); - let __sym0 = __pop_Variant7(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1294::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant23(__nt), __end)); - (1, 126) - } - pub(crate) fn __reduce339< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // DottedName = name, ("." Identifier)+ => ActionFn(1295); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant21(__symbols); - let __sym0 = __pop_Variant7(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1295::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant23(__nt), __end)); - (2, 126) - } - pub(crate) fn __reduce340< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // DoubleStarTypedParameter = "**", Identifier, ":", Test<"all"> => ActionFn(1296); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1296::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (4, 127) - } - pub(crate) fn __reduce341< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // DoubleStarTypedParameter = "**", Identifier => ActionFn(1297); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1297::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (2, 127) - } - pub(crate) fn __reduce342< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // DoubleStarUntypedParameter = "**", Identifier => ActionFn(1298); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1298::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (2, 128) - } - pub(crate) fn __reduce343< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExceptClause = "except", Test<"all">, ":", Suite => ActionFn(1720); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant25(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1720::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant63(__nt), __end)); - (4, 129) - } - pub(crate) fn __reduce344< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExceptClause = "except", ":", Suite => ActionFn(1721); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1721::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant63(__nt), __end)); - (3, 129) - } - pub(crate) fn __reduce345< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExceptClause = "except", Test<"all">, "as", Identifier, ":", Suite => ActionFn(1196); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant25(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant23(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1196::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant63(__nt), __end)); - (6, 129) - } - pub(crate) fn __reduce346< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExceptClause+ = ExceptClause => ActionFn(332); - let __sym0 = __pop_Variant63(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action332::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant64(__nt), __end)); - (1, 130) - } - pub(crate) fn __reduce347< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExceptClause+ = ExceptClause+, ExceptClause => ActionFn(333); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant63(__symbols); - let __sym0 = __pop_Variant64(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action333::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant64(__nt), __end)); - (2, 130) - } - pub(crate) fn __reduce348< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExceptStarClause = "except", "*", Test<"all">, ":", Suite => ActionFn(783); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant25(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action783::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant63(__nt), __end)); - (5, 131) - } - pub(crate) fn __reduce349< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExceptStarClause = "except", "*", Test<"all">, "as", Identifier, ":", Suite => ActionFn(1197); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant23(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1197::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant63(__nt), __end)); - (7, 131) - } - pub(crate) fn __reduce350< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExceptStarClause+ = ExceptStarClause => ActionFn(327); - let __sym0 = __pop_Variant63(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action327::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant64(__nt), __end)); - (1, 132) - } - pub(crate) fn __reduce351< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExceptStarClause+ = ExceptStarClause+, ExceptStarClause => ActionFn(328); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant63(__symbols); - let __sym0 = __pop_Variant64(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action328::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant64(__nt), __end)); - (2, 132) - } - pub(crate) fn __reduce352< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Expression<"all"> = Expression<"all">, "|", XorExpression<"all"> => ActionFn(1299); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1299::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 133) - } - pub(crate) fn __reduce353< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Expression<"all"> = XorExpression<"all"> => ActionFn(372); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action372::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 133) - } - pub(crate) fn __reduce354< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Expression<"no-withitems"> = Expression<"all">, "|", XorExpression<"all"> => ActionFn(1300); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1300::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 134) - } - pub(crate) fn __reduce355< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Expression<"no-withitems"> = XorExpression<"no-withitems"> => ActionFn(524); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action524::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 134) - } - pub(crate) fn __reduce356< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExpressionList = GenericList => ActionFn(234); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action234::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 135) - } - pub(crate) fn __reduce357< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExpressionList2 = OneOrMore, "," => ActionFn(612); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action612::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (2, 136) - } - pub(crate) fn __reduce358< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExpressionList2 = OneOrMore => ActionFn(613); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action613::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (1, 136) - } - pub(crate) fn __reduce359< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExpressionNoCond = OrTest<"all"> => ActionFn(240); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action240::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 137) - } - pub(crate) fn __reduce360< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExpressionOrStarExpression = Expression<"all"> => ActionFn(232); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action232::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 138) - } - pub(crate) fn __reduce361< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ExpressionOrStarExpression = StarExpr => ActionFn(233); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action233::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 138) - } - pub(crate) fn __reduce368< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringConversion? = FStringConversion => ActionFn(270); - let __sym0 = __pop_Variant65(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action270::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant66(__nt), __end)); - (1, 141) - } - pub(crate) fn __reduce369< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringConversion? = => ActionFn(271); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action271::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant66(__nt), __end)); - (0, 141) - } - pub(crate) fn __reduce370< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringExpr = fstring_start, FStringEnd => ActionFn(1578); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant4(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1578::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant67(__nt), __end)); - (2, 142) - } - pub(crate) fn __reduce371< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringExpr = fstring_start, FStringMiddlePattern+, FStringEnd => ActionFn(1579); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant71(__symbols); - let __sym0 = __pop_Variant4(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1579::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant67(__nt), __end)); - (3, 142) - } - pub(crate) fn __reduce372< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringFormatSpec = => ActionFn(1580); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action1580::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant68(__nt), __end)); - (0, 143) - } - pub(crate) fn __reduce373< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringFormatSpec = FStringMiddlePattern+ => ActionFn(1581); - let __sym0 = __pop_Variant71(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1581::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant68(__nt), __end)); - (1, 143) - } - pub(crate) fn __reduce374< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringFormatSpecSuffix = ":", FStringFormatSpec => ActionFn(223); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant68(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action223::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant68(__nt), __end)); - (2, 144) - } - pub(crate) fn __reduce375< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringFormatSpecSuffix? = FStringFormatSpecSuffix => ActionFn(268); - let __sym0 = __pop_Variant68(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action268::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant69(__nt), __end)); - (1, 145) - } - pub(crate) fn __reduce376< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringFormatSpecSuffix? = => ActionFn(269); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action269::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant69(__nt), __end)); - (0, 145) - } - pub(crate) fn __reduce377< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringMiddlePattern = FStringReplacementField => ActionFn(220); - let __sym0 = __pop_Variant70(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action220::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant70(__nt), __end)); - (1, 146) - } - pub(crate) fn __reduce379< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringMiddlePattern* = => ActionFn(274); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action274::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant71(__nt), __end)); - (0, 147) - } - pub(crate) fn __reduce380< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringMiddlePattern* = FStringMiddlePattern+ => ActionFn(275); - let __sym0 = __pop_Variant71(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action275::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant71(__nt), __end)); - (1, 147) - } - pub(crate) fn __reduce381< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringMiddlePattern+ = FStringMiddlePattern => ActionFn(453); - let __sym0 = __pop_Variant70(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action453::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant71(__nt), __end)); - (1, 148) - } - pub(crate) fn __reduce382< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FStringMiddlePattern+ = FStringMiddlePattern+, FStringMiddlePattern => ActionFn(454); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant70(__symbols); - let __sym0 = __pop_Variant71(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action454::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant71(__nt), __end)); - (2, 148) - } - pub(crate) fn __reduce391< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Factor<"all"> = UnaryOp, Factor<"all"> => ActionFn(1309); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant101(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1309::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 150) - } - pub(crate) fn __reduce392< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Factor<"all"> = Power<"all"> => ActionFn(526); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action526::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 150) - } - pub(crate) fn __reduce393< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Factor<"no-withitems"> = UnaryOp, Factor<"all"> => ActionFn(1310); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant101(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1310::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 151) - } - pub(crate) fn __reduce394< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Factor<"no-withitems"> = Power<"no-withitems"> => ActionFn(575); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action575::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 151) - } - pub(crate) fn __reduce395< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FlowStatement = "break" => ActionFn(1311); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1311::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 152) - } - pub(crate) fn __reduce396< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FlowStatement = "continue" => ActionFn(1312); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1312::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 152) - } - pub(crate) fn __reduce397< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FlowStatement = "return", GenericList => ActionFn(1741); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1741::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (2, 152) - } - pub(crate) fn __reduce398< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FlowStatement = "return" => ActionFn(1742); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1742::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 152) - } - pub(crate) fn __reduce399< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FlowStatement = YieldExpr => ActionFn(1314); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1314::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 152) - } - pub(crate) fn __reduce400< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FlowStatement = RaiseStatement => ActionFn(57); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action57::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 152) - } - pub(crate) fn __reduce401< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ForStatement = "async", "for", ExpressionList, "in", GenericList, ":", Suite, "else", ":", Suite => ActionFn(1732); - assert!(__symbols.len() >= 10); - let __sym9 = __pop_Variant25(__symbols); - let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant15(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym9.2; - let __nt = super::__action1732::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (10, 153) - } - pub(crate) fn __reduce402< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ForStatement = "async", "for", ExpressionList, "in", GenericList, ":", Suite => ActionFn(1733); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant15(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1733::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 153) - } - pub(crate) fn __reduce403< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ForStatement = "for", ExpressionList, "in", GenericList, ":", Suite, "else", ":", Suite => ActionFn(1734); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant25(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant25(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = super::__action1734::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (9, 153) - } - pub(crate) fn __reduce404< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ForStatement = "for", ExpressionList, "in", GenericList, ":", Suite => ActionFn(1735); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant25(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1735::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (6, 153) - } - pub(crate) fn __reduce405< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = "async", "def", Identifier, TypeParams, Parameters, "->", Test<"all">, ":", Suite => ActionFn(1756); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant25(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant15(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant46(__symbols); - let __sym3 = __pop_Variant99(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = super::__action1756::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (9, 154) - } - pub(crate) fn __reduce406< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = "async", "def", Identifier, Parameters, "->", Test<"all">, ":", Suite => ActionFn(1757); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant25(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant15(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant46(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = super::__action1757::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (8, 154) - } - pub(crate) fn __reduce407< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = Decorator+, "async", "def", Identifier, TypeParams, Parameters, "->", Test<"all">, ":", Suite => ActionFn(1758); - assert!(__symbols.len() >= 10); - let __sym9 = __pop_Variant25(__symbols); - let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant15(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant46(__symbols); - let __sym4 = __pop_Variant99(__symbols); - let __sym3 = __pop_Variant23(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym9.2; - let __nt = super::__action1758::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (10, 154) - } - pub(crate) fn __reduce408< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = Decorator+, "async", "def", Identifier, Parameters, "->", Test<"all">, ":", Suite => ActionFn(1759); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant25(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant15(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant46(__symbols); - let __sym3 = __pop_Variant23(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = super::__action1759::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (9, 154) - } - pub(crate) fn __reduce409< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = "async", "def", Identifier, TypeParams, Parameters, ":", Suite => ActionFn(1760); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant46(__symbols); - let __sym3 = __pop_Variant99(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1760::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 154) - } - pub(crate) fn __reduce410< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = "async", "def", Identifier, Parameters, ":", Suite => ActionFn(1761); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant25(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant46(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1761::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (6, 154) - } - pub(crate) fn __reduce411< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = Decorator+, "async", "def", Identifier, TypeParams, Parameters, ":", Suite => ActionFn(1762); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant25(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant46(__symbols); - let __sym4 = __pop_Variant99(__symbols); - let __sym3 = __pop_Variant23(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = super::__action1762::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (8, 154) - } - pub(crate) fn __reduce412< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = Decorator+, "async", "def", Identifier, Parameters, ":", Suite => ActionFn(1763); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant46(__symbols); - let __sym3 = __pop_Variant23(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1763::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 154) - } - pub(crate) fn __reduce413< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = "def", Identifier, TypeParams, Parameters, "->", Test<"all">, ":", Suite => ActionFn(1764); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant25(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant15(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant46(__symbols); - let __sym2 = __pop_Variant99(__symbols); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = super::__action1764::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (8, 154) - } - pub(crate) fn __reduce414< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = "def", Identifier, Parameters, "->", Test<"all">, ":", Suite => ActionFn(1765); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant15(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant46(__symbols); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1765::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 154) - } - pub(crate) fn __reduce415< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = Decorator+, "def", Identifier, TypeParams, Parameters, "->", Test<"all">, ":", Suite => ActionFn(1766); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant25(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant15(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant46(__symbols); - let __sym3 = __pop_Variant99(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym8.2; - let __nt = super::__action1766::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (9, 154) - } - pub(crate) fn __reduce416< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = Decorator+, "def", Identifier, Parameters, "->", Test<"all">, ":", Suite => ActionFn(1767); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant25(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant15(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant46(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = super::__action1767::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (8, 154) - } - pub(crate) fn __reduce417< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = "def", Identifier, TypeParams, Parameters, ":", Suite => ActionFn(1768); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant25(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant46(__symbols); - let __sym2 = __pop_Variant99(__symbols); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1768::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (6, 154) - } - pub(crate) fn __reduce418< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = "def", Identifier, Parameters, ":", Suite => ActionFn(1769); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant25(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant46(__symbols); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1769::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (5, 154) - } - pub(crate) fn __reduce419< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = Decorator+, "def", Identifier, TypeParams, Parameters, ":", Suite => ActionFn(1770); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant46(__symbols); - let __sym3 = __pop_Variant99(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1770::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 154) - } - pub(crate) fn __reduce420< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FuncDef = Decorator+, "def", Identifier, Parameters, ":", Suite => ActionFn(1771); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant25(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant46(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant58(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1771::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (6, 154) - } - pub(crate) fn __reduce421< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FunctionArgument = NamedExpressionTest, CompFor => ActionFn(1544); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant54(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1544::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant31(__nt), __end)); - (2, 155) - } - pub(crate) fn __reduce422< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FunctionArgument = NamedExpressionTest => ActionFn(1545); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1545::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant31(__nt), __end)); - (1, 155) - } - pub(crate) fn __reduce423< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FunctionArgument = Identifier, "=", Test<"all"> => ActionFn(1316); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1316::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant31(__nt), __end)); - (3, 155) - } - pub(crate) fn __reduce424< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FunctionArgument = "*", Test<"all"> => ActionFn(1317); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1317::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant31(__nt), __end)); - (2, 155) - } - pub(crate) fn __reduce425< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FunctionArgument = "**", Test<"all"> => ActionFn(1318); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1318::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant31(__nt), __end)); - (2, 155) - } - pub(crate) fn __reduce426< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FunctionArgument? = FunctionArgument => ActionFn(464); - let __sym0 = __pop_Variant31(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action464::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant72(__nt), __end)); - (1, 156) - } - pub(crate) fn __reduce427< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // FunctionArgument? = => ActionFn(465); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action465::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant72(__nt), __end)); - (0, 156) - } - pub(crate) fn __reduce428< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // GenericList = OneOrMore, "," => ActionFn(1319); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1319::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 157) - } - pub(crate) fn __reduce429< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // GenericList = OneOrMore => ActionFn(1320); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1320::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 157) - } - pub(crate) fn __reduce430< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // GenericList = OneOrMore, "," => ActionFn(1321); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1321::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 158) - } - pub(crate) fn __reduce431< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // GenericList = OneOrMore => ActionFn(1322); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1322::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 158) - } - pub(crate) fn __reduce432< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // GlobalStatement = "global", OneOrMore => ActionFn(1323); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant83(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1323::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (2, 159) - } - pub(crate) fn __reduce433< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Guard = "if", NamedExpressionTest => ActionFn(89); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action89::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (2, 160) - } - pub(crate) fn __reduce434< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Identifier = name => ActionFn(1324); - let __sym0 = __pop_Variant7(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1324::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant23(__nt), __end)); - (1, 161) - } - pub(crate) fn __reduce435< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // IfStatement = "if", NamedExpressionTest, ":", Suite, "else", ":", Suite => ActionFn(1145); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant25(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1145::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 162) - } - pub(crate) fn __reduce436< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // IfStatement = "if", NamedExpressionTest, ":", Suite => ActionFn(1146); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant25(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1146::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (4, 162) - } - pub(crate) fn __reduce437< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // IfStatement = "if", NamedExpressionTest, ":", Suite, (<@L> "elif" ":" )+, "else", ":", Suite => ActionFn(1147); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant25(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant28(__symbols); - let __sym3 = __pop_Variant25(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = super::__action1147::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (8, 162) - } - pub(crate) fn __reduce438< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // IfStatement = "if", NamedExpressionTest, ":", Suite, (<@L> "elif" ":" )+ => ActionFn(1148); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant28(__symbols); - let __sym3 = __pop_Variant25(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1148::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (5, 162) - } - pub(crate) fn __reduce439< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportAsAlias = DottedName, "as", Identifier => ActionFn(1325); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1325::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant73(__nt), __end)); - (3, 163) - } - pub(crate) fn __reduce440< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportAsAlias = DottedName => ActionFn(1326); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1326::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant73(__nt), __end)); - (1, 163) - } - pub(crate) fn __reduce441< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportAsAlias = Identifier, "as", Identifier => ActionFn(1327); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1327::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant73(__nt), __end)); - (3, 164) - } - pub(crate) fn __reduce442< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportAsAlias = Identifier => ActionFn(1328); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1328::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant73(__nt), __end)); - (1, 164) - } - pub(crate) fn __reduce443< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportAsNames = OneOrMore> => ActionFn(1329); - let __sym0 = __pop_Variant74(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1329::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant74(__nt), __end)); - (1, 165) - } - pub(crate) fn __reduce444< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportAsNames = "(", OneOrMore>, ",", ")" => ActionFn(1330); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant74(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1330::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant74(__nt), __end)); - (4, 165) - } - pub(crate) fn __reduce445< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportAsNames = "(", OneOrMore>, ")" => ActionFn(1331); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant74(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1331::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant74(__nt), __end)); - (3, 165) - } - pub(crate) fn __reduce446< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportAsNames = "*" => ActionFn(1332); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1332::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant74(__nt), __end)); - (1, 165) - } - pub(crate) fn __reduce447< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportDots = "..." => ActionFn(64); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action64::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant75(__nt), __end)); - (1, 166) - } - pub(crate) fn __reduce448< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportDots = "." => ActionFn(65); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action65::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant75(__nt), __end)); - (1, 166) - } - pub(crate) fn __reduce449< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportDots* = => ActionFn(388); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action388::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant76(__nt), __end)); - (0, 167) - } - pub(crate) fn __reduce450< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportDots* = ImportDots+ => ActionFn(389); - let __sym0 = __pop_Variant76(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action389::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant76(__nt), __end)); - (1, 167) - } - pub(crate) fn __reduce451< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportDots+ = ImportDots => ActionFn(386); - let __sym0 = __pop_Variant75(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action386::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant76(__nt), __end)); - (1, 168) - } - pub(crate) fn __reduce452< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportDots+ = ImportDots+, ImportDots => ActionFn(387); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant75(__symbols); - let __sym0 = __pop_Variant76(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action387::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant76(__nt), __end)); - (2, 168) - } - pub(crate) fn __reduce453< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportFromLocation = DottedName => ActionFn(1590); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1590::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant77(__nt), __end)); - (1, 169) - } - pub(crate) fn __reduce454< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportFromLocation = ImportDots+, DottedName => ActionFn(1591); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant76(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1591::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant77(__nt), __end)); - (2, 169) - } - pub(crate) fn __reduce455< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportFromLocation = ImportDots+ => ActionFn(63); - let __sym0 = __pop_Variant76(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action63::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant77(__nt), __end)); - (1, 169) - } - pub(crate) fn __reduce456< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportStatement = "import", OneOrMore> => ActionFn(1333); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant74(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1333::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (2, 170) - } - pub(crate) fn __reduce457< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ImportStatement = "from", ImportFromLocation, "import", ImportAsNames => ActionFn(1334); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant74(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant77(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1334::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (4, 170) - } - pub(crate) fn __reduce465< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ListLiteralValues = OneOrMore, "," => ActionFn(620); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action620::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (2, 175) - } - pub(crate) fn __reduce466< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ListLiteralValues = OneOrMore => ActionFn(621); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action621::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (1, 175) - } - pub(crate) fn __reduce467< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ListLiteralValues? = ListLiteralValues => ActionFn(570); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action570::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant34(__nt), __end)); - (1, 176) - } - pub(crate) fn __reduce468< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ListLiteralValues? = => ActionFn(571); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action571::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant34(__nt), __end)); - (0, 176) - } - pub(crate) fn __reduce469< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // LiteralPattern = "None" => ActionFn(1339); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1339::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 177) - } - pub(crate) fn __reduce470< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // LiteralPattern = "True" => ActionFn(1340); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1340::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 177) - } - pub(crate) fn __reduce471< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // LiteralPattern = "False" => ActionFn(1341); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1341::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 177) - } - pub(crate) fn __reduce472< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // LiteralPattern = NumberExpr => ActionFn(1342); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1342::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 177) - } - pub(crate) fn __reduce473< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // LiteralPattern = AddOpExpr => ActionFn(1343); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1343::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 177) - } - pub(crate) fn __reduce474< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // LiteralPattern = StringLiteral => ActionFn(1344); - let __sym0 = __pop_Variant67(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1344::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 177) - } - pub(crate) fn __reduce476< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingKey = MatchNameOrAttr => ActionFn(127); - let __sym0 = __pop_Variant44(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action127::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (1, 178) - } - pub(crate) fn __reduce477< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingKey = String => ActionFn(128); - let __sym0 = __pop_Variant44(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action128::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (1, 178) - } - pub(crate) fn __reduce478< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingKey = NumberExpr => ActionFn(129); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action129::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (1, 178) - } - pub(crate) fn __reduce479< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingKey = AddOpExpr => ActionFn(130); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action130::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (1, 178) - } - pub(crate) fn __reduce480< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingKey = "None" => ActionFn(1346); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1346::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (1, 178) - } - pub(crate) fn __reduce481< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingKey = "True" => ActionFn(1347); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1347::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (1, 178) - } - pub(crate) fn __reduce482< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingKey = "False" => ActionFn(1348); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1348::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (1, 178) - } - pub(crate) fn __reduce483< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingPattern = "{", "}" => ActionFn(1349); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1349::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (2, 179) - } - pub(crate) fn __reduce484< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingPattern = "{", OneOrMore, ",", "}" => ActionFn(1350); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant85(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1350::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (4, 179) - } - pub(crate) fn __reduce485< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingPattern = "{", OneOrMore, "}" => ActionFn(1351); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant85(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1351::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (3, 179) - } - pub(crate) fn __reduce486< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingPattern = "{", "**", Identifier, ",", "}" => ActionFn(1352); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1352::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (5, 179) - } - pub(crate) fn __reduce487< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingPattern = "{", "**", Identifier, "}" => ActionFn(1353); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1353::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (4, 179) - } - pub(crate) fn __reduce488< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingPattern = "{", OneOrMore, ",", "**", Identifier, ",", "}" => ActionFn(1354); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant23(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant85(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1354::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (7, 179) - } - pub(crate) fn __reduce489< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MappingPattern = "{", OneOrMore, ",", "**", Identifier, "}" => ActionFn(1355); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant23(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant85(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1355::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (6, 179) - } - pub(crate) fn __reduce490< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MatchCase = "case", Patterns, Guard, ":", Suite => ActionFn(1213); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant25(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant44(__symbols); - let __sym1 = __pop_Variant35(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1213::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant78(__nt), __end)); - (5, 180) - } - pub(crate) fn __reduce491< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MatchCase = "case", Patterns, ":", Suite => ActionFn(1214); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant25(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant35(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1214::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant78(__nt), __end)); - (4, 180) - } - pub(crate) fn __reduce492< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MatchCase+ = MatchCase => ActionFn(366); - let __sym0 = __pop_Variant78(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action366::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant79(__nt), __end)); - (1, 181) - } - pub(crate) fn __reduce493< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MatchCase+ = MatchCase+, MatchCase => ActionFn(367); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant78(__symbols); - let __sym0 = __pop_Variant79(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action367::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant79(__nt), __end)); - (2, 181) - } - pub(crate) fn __reduce494< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MatchKeywordEntry = Identifier, "=", Pattern => ActionFn(1356); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant35(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1356::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant80(__nt), __end)); - (3, 182) - } - pub(crate) fn __reduce495< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MatchMappingEntry = MappingKey, ":", Pattern => ActionFn(134); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant35(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant44(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action134::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant81(__nt), __end)); - (3, 183) - } - pub(crate) fn __reduce496< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MatchName = Identifier => ActionFn(1357); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1357::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (1, 184) - } - pub(crate) fn __reduce497< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MatchNameOrAttr = MatchName, ".", Identifier => ActionFn(1358); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant44(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1358::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (3, 185) - } - pub(crate) fn __reduce498< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MatchNameOrAttr = MatchNameOrAttr, ".", Identifier => ActionFn(1359); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant44(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1359::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (3, 185) - } - pub(crate) fn __reduce499< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MatchStatement = "match", TestOrStarNamedExpr, ":", "\n", Indent, MatchCase+, Dedent => ActionFn(851); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant79(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action851::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 186) - } - pub(crate) fn __reduce500< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MatchStatement = "match", TestOrStarNamedExpr, ",", ":", "\n", Indent, MatchCase+, Dedent => ActionFn(1360); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant79(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = super::__action1360::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (8, 186) - } - pub(crate) fn __reduce501< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MatchStatement = "match", TwoOrMoreSep, ",", ":", "\n", Indent, MatchCase+, Dedent => ActionFn(1361); - assert!(__symbols.len() >= 8); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant79(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym7.2; - let __nt = super::__action1361::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (8, 186) - } - pub(crate) fn __reduce502< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MatchStatement = "match", TwoOrMoreSep, ":", "\n", Indent, MatchCase+, Dedent => ActionFn(1362); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant79(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1362::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 186) - } - pub(crate) fn __reduce503< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MulOp = "*" => ActionFn(200); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action200::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 187) - } - pub(crate) fn __reduce504< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MulOp = "/" => ActionFn(201); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action201::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 187) - } - pub(crate) fn __reduce505< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MulOp = "//" => ActionFn(202); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action202::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 187) - } - pub(crate) fn __reduce506< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MulOp = "%" => ActionFn(203); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action203::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 187) - } - pub(crate) fn __reduce507< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // MulOp = "@" => ActionFn(204); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action204::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 187) - } - pub(crate) fn __reduce508< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NamedExpression = NamedExpressionName, ":=", Test<"all"> => ActionFn(1363); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1363::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 188) - } - pub(crate) fn __reduce509< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NamedExpressionName = Identifier => ActionFn(1364); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1364::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 189) - } - pub(crate) fn __reduce510< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NamedExpressionTest = NamedExpression => ActionFn(181); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action181::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 190) - } - pub(crate) fn __reduce511< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NamedExpressionTest = Test<"all"> => ActionFn(182); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action182::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 190) - } - pub(crate) fn __reduce512< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NamedOrStarExpr = NamedExpression => ActionFn(36); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action36::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 191) - } - pub(crate) fn __reduce513< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NamedOrStarExpr = StarExpr => ActionFn(37); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action37::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 191) - } - pub(crate) fn __reduce514< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NonlocalStatement = "nonlocal", OneOrMore => ActionFn(1365); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant83(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1365::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (2, 192) - } - pub(crate) fn __reduce515< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NotTest<"all"> = "not", NotTest<"all"> => ActionFn(1366); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1366::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 193) - } - pub(crate) fn __reduce516< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NotTest<"all"> = Comparison<"all"> => ActionFn(475); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action475::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 193) - } - pub(crate) fn __reduce517< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NotTest<"no-withitems"> = "not", NotTest<"all"> => ActionFn(1367); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1367::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 194) - } - pub(crate) fn __reduce518< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NotTest<"no-withitems"> = Comparison<"no-withitems"> => ActionFn(516); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action516::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 194) - } - pub(crate) fn __reduce519< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Number = int => ActionFn(247); - let __sym0 = __pop_Variant5(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action247::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant82(__nt), __end)); - (1, 195) - } - pub(crate) fn __reduce520< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Number = float => ActionFn(248); - let __sym0 = __pop_Variant2(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action248::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant82(__nt), __end)); - (1, 195) - } - pub(crate) fn __reduce521< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Number = complex => ActionFn(249); - let __sym0 = __pop_Variant1(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action249::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant82(__nt), __end)); - (1, 195) - } - pub(crate) fn __reduce522< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NumberAtom = Number => ActionFn(1368); - let __sym0 = __pop_Variant82(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1368::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 196) - } - pub(crate) fn __reduce523< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NumberExpr = NumberAtom => ActionFn(112); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action112::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 197) - } - pub(crate) fn __reduce524< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // NumberExpr = "-", NumberAtom => ActionFn(1369); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1369::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 197) - } - pub(crate) fn __reduce525< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = DictElement => ActionFn(264); - let __sym0 = __pop_Variant59(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action264::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant61(__nt), __end)); - (1, 198) - } - pub(crate) fn __reduce526< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = OneOrMore, ",", DictElement => ActionFn(265); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant59(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant61(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action265::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant61(__nt), __end)); - (3, 198) - } - pub(crate) fn __reduce527< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = ExpressionOrStarExpression => ActionFn(261); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action261::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (1, 199) - } - pub(crate) fn __reduce528< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = OneOrMore, ",", ExpressionOrStarExpression => ActionFn(262); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action262::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (3, 199) - } - pub(crate) fn __reduce529< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = Identifier => ActionFn(376); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action376::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant83(__nt), __end)); - (1, 200) - } - pub(crate) fn __reduce530< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = OneOrMore, ",", Identifier => ActionFn(377); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant83(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action377::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant83(__nt), __end)); - (3, 200) - } - pub(crate) fn __reduce531< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = DottedName, "as", Identifier => ActionFn(1582); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1582::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant74(__nt), __end)); - (3, 201) - } - pub(crate) fn __reduce532< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = DottedName => ActionFn(1583); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1583::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant74(__nt), __end)); - (1, 201) - } - pub(crate) fn __reduce533< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = OneOrMore>, ",", DottedName, "as", Identifier => ActionFn(1584); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant23(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant74(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1584::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant74(__nt), __end)); - (5, 201) - } - pub(crate) fn __reduce534< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = OneOrMore>, ",", DottedName => ActionFn(1585); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant74(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1585::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant74(__nt), __end)); - (3, 201) - } - pub(crate) fn __reduce535< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = Identifier, "as", Identifier => ActionFn(1586); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1586::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant74(__nt), __end)); - (3, 202) - } - pub(crate) fn __reduce536< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = Identifier => ActionFn(1587); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1587::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant74(__nt), __end)); - (1, 202) - } - pub(crate) fn __reduce537< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = OneOrMore>, ",", Identifier, "as", Identifier => ActionFn(1588); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant23(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant74(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1588::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant74(__nt), __end)); - (5, 202) - } - pub(crate) fn __reduce538< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = OneOrMore>, ",", Identifier => ActionFn(1589); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant23(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant74(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1589::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant74(__nt), __end)); - (3, 202) - } - pub(crate) fn __reduce539< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = MatchKeywordEntry => ActionFn(345); - let __sym0 = __pop_Variant80(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action345::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant84(__nt), __end)); - (1, 203) - } - pub(crate) fn __reduce540< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = OneOrMore, ",", MatchKeywordEntry => ActionFn(346); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant80(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant84(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action346::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant84(__nt), __end)); - (3, 203) - } - pub(crate) fn __reduce541< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = MatchMappingEntry => ActionFn(349); - let __sym0 = __pop_Variant81(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action349::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant85(__nt), __end)); - (1, 204) - } - pub(crate) fn __reduce542< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = OneOrMore, ",", MatchMappingEntry => ActionFn(350); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant81(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant85(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action350::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant85(__nt), __end)); - (3, 204) - } - pub(crate) fn __reduce543< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = ParameterDef => ActionFn(487); - let __sym0 = __pop_Variant11(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action487::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant86(__nt), __end)); - (1, 205) - } - pub(crate) fn __reduce544< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = OneOrMore>, ",", ParameterDef => ActionFn(488); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant11(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action488::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant86(__nt), __end)); - (3, 205) - } - pub(crate) fn __reduce545< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = ParameterDef => ActionFn(476); - let __sym0 = __pop_Variant11(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action476::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant86(__nt), __end)); - (1, 206) - } - pub(crate) fn __reduce546< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = OneOrMore>, ",", ParameterDef => ActionFn(477); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant11(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action477::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant86(__nt), __end)); - (3, 206) - } - pub(crate) fn __reduce547< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = Pattern => ActionFn(347); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action347::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant53(__nt), __end)); - (1, 207) - } - pub(crate) fn __reduce548< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = OneOrMore, ",", Pattern => ActionFn(348); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant35(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant53(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action348::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant53(__nt), __end)); - (3, 207) - } - pub(crate) fn __reduce549< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = Test<"all"> => ActionFn(310); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action310::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (1, 208) - } - pub(crate) fn __reduce550< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore> = OneOrMore>, ",", Test<"all"> => ActionFn(311); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action311::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (3, 208) - } - pub(crate) fn __reduce551< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = TestOrStarExpr => ActionFn(455); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action455::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (1, 209) - } - pub(crate) fn __reduce552< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = OneOrMore, ",", TestOrStarExpr => ActionFn(456); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action456::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (3, 209) - } - pub(crate) fn __reduce553< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = TestOrStarNamedExpr => ActionFn(266); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action266::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (1, 210) - } - pub(crate) fn __reduce554< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = OneOrMore, ",", TestOrStarNamedExpr => ActionFn(267); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action267::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (3, 210) - } - pub(crate) fn __reduce555< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = TypeParam => ActionFn(288); - let __sym0 = __pop_Variant98(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action288::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant87(__nt), __end)); - (1, 211) - } - pub(crate) fn __reduce556< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OneOrMore = OneOrMore, ",", TypeParam => ActionFn(289); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant98(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant87(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action289::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant87(__nt), __end)); - (3, 211) - } - pub(crate) fn __reduce557< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OrPattern = ClosedPattern => ActionFn(96); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action96::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 212) - } - pub(crate) fn __reduce558< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OrPattern = TwoOrMoreSep => ActionFn(1370); - let __sym0 = __pop_Variant53(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1370::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 212) - } - pub(crate) fn __reduce559< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OrTest<"all"> = (> "or")+, AndTest<"all"> => ActionFn(1371); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant17(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1371::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 213) - } - pub(crate) fn __reduce560< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OrTest<"all"> = AndTest<"all"> => ActionFn(257); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action257::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 213) - } - pub(crate) fn __reduce561< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OrTest<"no-withitems"> = (> "or")+, AndTest<"all"> => ActionFn(1372); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant17(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1372::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 214) - } - pub(crate) fn __reduce562< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // OrTest<"no-withitems"> = AndTest<"no-withitems"> => ActionFn(499); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action499::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 214) - } - pub(crate) fn __reduce563< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ParameterDef = TypedParameter => ActionFn(496); - let __sym0 = __pop_Variant11(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action496::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (1, 215) - } - pub(crate) fn __reduce564< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ParameterDef = TypedParameter, "=", Test<"all"> => ActionFn(1373); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant11(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1373::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (3, 215) - } - pub(crate) fn __reduce565< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ParameterDef = UntypedParameter => ActionFn(485); - let __sym0 = __pop_Variant11(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action485::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (1, 216) - } - pub(crate) fn __reduce566< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ParameterDef = UntypedParameter, "=", Test<"all"> => ActionFn(1374); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant11(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1374::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (3, 216) - } - pub(crate) fn __reduce567< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ParameterDefs = OneOrMore> => ActionFn(443); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action443::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant88(__nt), __end)); - (1, 217) - } - pub(crate) fn __reduce568< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ParameterDefs = OneOrMore>, ",", "/" => ActionFn(688); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action688::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant88(__nt), __end)); - (3, 217) - } - pub(crate) fn __reduce569< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ParameterDefs = OneOrMore>, ",", "/", ("," >)+ => ActionFn(689); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action689::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant88(__nt), __end)); - (4, 217) - } - pub(crate) fn __reduce570< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ParameterDefs = OneOrMore> => ActionFn(451); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action451::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant88(__nt), __end)); - (1, 218) - } - pub(crate) fn __reduce571< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ParameterDefs = OneOrMore>, ",", "/" => ActionFn(700); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action700::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant88(__nt), __end)); - (3, 218) - } - pub(crate) fn __reduce572< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ParameterDefs = OneOrMore>, ",", "/", ("," >)+ => ActionFn(701); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant12(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant86(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action701::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant88(__nt), __end)); - (4, 218) - } - pub(crate) fn __reduce729< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ParameterList? = ParameterList => ActionFn(284); - let __sym0 = __pop_Variant46(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action284::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant47(__nt), __end)); - (1, 221) - } - pub(crate) fn __reduce730< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ParameterList? = => ActionFn(285); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action285::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant47(__nt), __end)); - (0, 221) - } - pub(crate) fn __reduce751< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // PassStatement = "pass" => ActionFn(1453); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1453::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 225) - } - pub(crate) fn __reduce752< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Pattern = AsPattern => ActionFn(93); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action93::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 226) - } - pub(crate) fn __reduce753< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Pattern = OrPattern => ActionFn(94); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action94::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 226) - } - pub(crate) fn __reduce754< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Pattern? = Pattern => ActionFn(426); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action426::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant89(__nt), __end)); - (1, 227) - } - pub(crate) fn __reduce755< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Pattern? = => ActionFn(427); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action427::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant89(__nt), __end)); - (0, 227) - } - pub(crate) fn __reduce756< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // PatternArguments = "(", OneOrMore, ",", OneOrMore, ",", ")" => ActionFn(1454); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant84(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant53(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1454::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant90(__nt), __end)); - (6, 228) - } - pub(crate) fn __reduce757< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // PatternArguments = "(", OneOrMore, ",", OneOrMore, ")" => ActionFn(1455); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant84(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant53(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1455::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant90(__nt), __end)); - (5, 228) - } - pub(crate) fn __reduce758< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // PatternArguments = "(", OneOrMore, ",", ")" => ActionFn(1456); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant53(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1456::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant90(__nt), __end)); - (4, 228) - } - pub(crate) fn __reduce759< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // PatternArguments = "(", OneOrMore, ")" => ActionFn(1457); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant53(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1457::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant90(__nt), __end)); - (3, 228) - } - pub(crate) fn __reduce760< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // PatternArguments = "(", OneOrMore, ",", ")" => ActionFn(1458); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant84(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1458::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant90(__nt), __end)); - (4, 228) - } - pub(crate) fn __reduce761< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // PatternArguments = "(", OneOrMore, ")" => ActionFn(1459); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant84(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1459::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant90(__nt), __end)); - (3, 228) - } - pub(crate) fn __reduce762< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // PatternArguments = "(", ")" => ActionFn(1460); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1460::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant90(__nt), __end)); - (2, 228) - } - pub(crate) fn __reduce763< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Patterns = Pattern, "," => ActionFn(1461); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1461::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (2, 229) - } - pub(crate) fn __reduce764< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Patterns = TwoOrMoreSep, "," => ActionFn(1462); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant53(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1462::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (2, 229) - } - pub(crate) fn __reduce765< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Patterns = TwoOrMoreSep => ActionFn(1463); - let __sym0 = __pop_Variant53(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1463::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 229) - } - pub(crate) fn __reduce766< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Patterns = Pattern => ActionFn(92); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action92::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 229) - } - pub(crate) fn __reduce767< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Power<"all"> = AtomExpr<"all">, "**", Factor<"all"> => ActionFn(1464); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1464::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 230) - } - pub(crate) fn __reduce768< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Power<"all"> = AtomExpr<"all"> => ActionFn(528); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action528::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 230) - } - pub(crate) fn __reduce769< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Power<"no-withitems"> = AtomExpr<"all">, "**", Factor<"all"> => ActionFn(1465); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1465::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 231) - } - pub(crate) fn __reduce770< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Power<"no-withitems"> = AtomExpr<"no-withitems"> => ActionFn(579); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action579::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 231) - } - pub(crate) fn __reduce771< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Program = => ActionFn(3); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action3::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (0, 232) - } - pub(crate) fn __reduce772< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Program = Program, CompoundStatement => ActionFn(4); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant37(__symbols); - let __sym0 = __pop_Variant25(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action4::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (2, 232) - } - pub(crate) fn __reduce773< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Program = Program, SmallStatement, ";", "\n" => ActionFn(1180); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant37(__symbols); - let __sym0 = __pop_Variant25(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1180::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (4, 232) - } - pub(crate) fn __reduce774< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Program = Program, ( ";")+, SmallStatement, ";", "\n" => ActionFn(1181); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant37(__symbols); - let __sym1 = __pop_Variant38(__symbols); - let __sym0 = __pop_Variant25(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1181::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (5, 232) - } - pub(crate) fn __reduce775< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Program = Program, SmallStatement, "\n" => ActionFn(1182); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant37(__symbols); - let __sym0 = __pop_Variant25(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1182::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (3, 232) - } - pub(crate) fn __reduce776< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Program = Program, ( ";")+, SmallStatement, "\n" => ActionFn(1183); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant37(__symbols); - let __sym1 = __pop_Variant38(__symbols); - let __sym0 = __pop_Variant25(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1183::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (4, 232) - } - pub(crate) fn __reduce777< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Program = Program, "\n" => ActionFn(6); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant25(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action6::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (2, 232) - } - pub(crate) fn __reduce778< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // RaiseStatement = "raise" => ActionFn(1466); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1466::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 233) - } - pub(crate) fn __reduce779< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // RaiseStatement = "raise", Test<"all">, "from", Test<"all"> => ActionFn(1467); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1467::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (4, 233) - } - pub(crate) fn __reduce780< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // RaiseStatement = "raise", Test<"all"> => ActionFn(1468); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1468::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (2, 233) - } - pub(crate) fn __reduce781< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SequencePattern = "(", Pattern, ")" => ActionFn(1469); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant35(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1469::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (3, 234) - } - pub(crate) fn __reduce782< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SequencePattern = "(", ")" => ActionFn(1470); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1470::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (2, 234) - } - pub(crate) fn __reduce783< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SequencePattern = "(", Pattern, ",", ")" => ActionFn(1471); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant35(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1471::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (4, 234) - } - pub(crate) fn __reduce784< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SequencePattern = "(", ( ",")+, Pattern, ",", ")" => ActionFn(1472); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant35(__symbols); - let __sym1 = __pop_Variant36(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1472::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (5, 234) - } - pub(crate) fn __reduce785< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SequencePattern = "(", ( ",")+, Pattern, ")" => ActionFn(1473); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant35(__symbols); - let __sym1 = __pop_Variant36(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1473::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (4, 234) - } - pub(crate) fn __reduce786< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SequencePattern = "[", Pattern, "]" => ActionFn(1540); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant35(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1540::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (3, 234) - } - pub(crate) fn __reduce787< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SequencePattern = "[", "]" => ActionFn(1541); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1541::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (2, 234) - } - pub(crate) fn __reduce788< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SequencePattern = "[", ( ",")+, Pattern, "]" => ActionFn(1542); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant35(__symbols); - let __sym1 = __pop_Variant36(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1542::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (4, 234) - } - pub(crate) fn __reduce789< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SequencePattern = "[", ( ",")+, "]" => ActionFn(1543); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant36(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1543::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (3, 234) - } - pub(crate) fn __reduce790< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SetLiteralValues = OneOrMore, "," => ActionFn(648); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action648::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (2, 235) - } - pub(crate) fn __reduce791< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SetLiteralValues = OneOrMore => ActionFn(649); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action649::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (1, 235) - } - pub(crate) fn __reduce792< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ShiftExpression<"all"> = ShiftExpression<"all">, ShiftOp, ArithmeticExpression<"all"> => ActionFn(1475); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant49(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1475::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 236) - } - pub(crate) fn __reduce793< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ShiftExpression<"all"> = ArithmeticExpression<"all"> => ActionFn(503); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action503::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 236) - } - pub(crate) fn __reduce794< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ShiftExpression<"no-withitems"> = ShiftExpression<"all">, ShiftOp, ArithmeticExpression<"all"> => ActionFn(1476); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant49(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1476::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 237) - } - pub(crate) fn __reduce795< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ShiftExpression<"no-withitems"> = ArithmeticExpression<"no-withitems"> => ActionFn(540); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action540::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 237) - } - pub(crate) fn __reduce796< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ShiftOp = "<<" => ActionFn(196); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action196::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 238) - } - pub(crate) fn __reduce797< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ShiftOp = ">>" => ActionFn(197); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action197::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant49(__nt), __end)); - (1, 238) - } - pub(crate) fn __reduce798< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SingleForComprehension = "async", "for", ExpressionList, "in", OrTest<"all"> => ActionFn(1546); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant15(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1546::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant91(__nt), __end)); - (5, 239) - } - pub(crate) fn __reduce799< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SingleForComprehension = "async", "for", ExpressionList, "in", OrTest<"all">, ComprehensionIf+ => ActionFn(1547); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant17(__symbols); - let __sym4 = __pop_Variant15(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1547::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant91(__nt), __end)); - (6, 239) - } - pub(crate) fn __reduce800< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SingleForComprehension = "for", ExpressionList, "in", OrTest<"all"> => ActionFn(1548); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1548::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant91(__nt), __end)); - (4, 239) - } - pub(crate) fn __reduce801< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SingleForComprehension = "for", ExpressionList, "in", OrTest<"all">, ComprehensionIf+ => ActionFn(1549); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant17(__symbols); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1549::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant91(__nt), __end)); - (5, 239) - } - pub(crate) fn __reduce802< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SingleForComprehension+ = SingleForComprehension => ActionFn(258); - let __sym0 = __pop_Variant91(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action258::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant92(__nt), __end)); - (1, 240) - } - pub(crate) fn __reduce803< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SingleForComprehension+ = SingleForComprehension+, SingleForComprehension => ActionFn(259); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant91(__symbols); - let __sym0 = __pop_Variant92(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action259::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant92(__nt), __end)); - (2, 240) - } - pub(crate) fn __reduce804< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SliceOp = ":", Test<"all"> => ActionFn(1722); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1722::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant93(__nt), __end)); - (2, 241) - } - pub(crate) fn __reduce805< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SliceOp = ":" => ActionFn(1723); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1723::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant93(__nt), __end)); - (1, 241) - } - pub(crate) fn __reduce806< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SliceOp? = SliceOp => ActionFn(278); - let __sym0 = __pop_Variant93(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action278::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant94(__nt), __end)); - (1, 242) - } - pub(crate) fn __reduce807< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SliceOp? = => ActionFn(279); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action279::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant94(__nt), __end)); - (0, 242) - } - pub(crate) fn __reduce808< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SmallStatement = ExpressionStatement => ActionFn(13); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action13::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 243) - } - pub(crate) fn __reduce809< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SmallStatement = PassStatement => ActionFn(14); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action14::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 243) - } - pub(crate) fn __reduce810< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SmallStatement = DelStatement => ActionFn(15); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action15::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 243) - } - pub(crate) fn __reduce811< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SmallStatement = FlowStatement => ActionFn(16); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action16::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 243) - } - pub(crate) fn __reduce812< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SmallStatement = ImportStatement => ActionFn(17); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action17::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 243) - } - pub(crate) fn __reduce813< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SmallStatement = GlobalStatement => ActionFn(18); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action18::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 243) - } - pub(crate) fn __reduce814< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SmallStatement = NonlocalStatement => ActionFn(19); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action19::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 243) - } - pub(crate) fn __reduce815< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SmallStatement = AssertStatement => ActionFn(20); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action20::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 243) - } - pub(crate) fn __reduce816< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SmallStatement = TypeAliasStatement => ActionFn(21); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action21::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 243) - } - pub(crate) fn __reduce817< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SmallStatement = IpyEscapeCommandStatement => ActionFn(22); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action22::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 243) - } - pub(crate) fn __reduce818< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SmallStatement = IpyHelpEndEscapeCommandStatement => ActionFn(23); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action23::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (1, 243) - } - pub(crate) fn __reduce819< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // StarExpr = "*", Expression<"all"> => ActionFn(1479); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1479::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 244) - } - pub(crate) fn __reduce820< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // StarPattern = "*", Identifier => ActionFn(1480); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1480::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (2, 245) - } - pub(crate) fn __reduce821< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // StarTypedParameter = "*", Identifier, ":", TestOrStarExpr => ActionFn(1481); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1481::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (4, 246) - } - pub(crate) fn __reduce822< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // StarTypedParameter = "*", Identifier => ActionFn(1482); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1482::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (2, 246) - } - pub(crate) fn __reduce823< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // StarUntypedParameter = "*", Identifier => ActionFn(1483); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1483::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (2, 247) - } - pub(crate) fn __reduce824< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Statements = SmallStatement, ";", "\n" => ActionFn(1184); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1184::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant95(__nt), __end)); - (3, 248) - } - pub(crate) fn __reduce825< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Statements = ( ";")+, SmallStatement, ";", "\n" => ActionFn(1185); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant37(__symbols); - let __sym0 = __pop_Variant38(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1185::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant95(__nt), __end)); - (4, 248) - } - pub(crate) fn __reduce826< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Statements = SmallStatement, "\n" => ActionFn(1186); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1186::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant95(__nt), __end)); - (2, 248) - } - pub(crate) fn __reduce827< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Statements = ( ";")+, SmallStatement, "\n" => ActionFn(1187); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant37(__symbols); - let __sym0 = __pop_Variant38(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1187::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant95(__nt), __end)); - (3, 248) - } - pub(crate) fn __reduce828< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Statements = CompoundStatement => ActionFn(10); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action10::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant95(__nt), __end)); - (1, 248) - } - pub(crate) fn __reduce829< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Statements = Statements, CompoundStatement => ActionFn(11); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant37(__symbols); - let __sym0 = __pop_Variant95(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action11::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant95(__nt), __end)); - (2, 248) - } - pub(crate) fn __reduce830< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Statements = Statements, SmallStatement, ";", "\n" => ActionFn(1188); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant37(__symbols); - let __sym0 = __pop_Variant95(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1188::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant95(__nt), __end)); - (4, 248) - } - pub(crate) fn __reduce831< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Statements = Statements, ( ";")+, SmallStatement, ";", "\n" => ActionFn(1189); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant37(__symbols); - let __sym1 = __pop_Variant38(__symbols); - let __sym0 = __pop_Variant95(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1189::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant95(__nt), __end)); - (5, 248) - } - pub(crate) fn __reduce832< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Statements = Statements, SmallStatement, "\n" => ActionFn(1190); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant37(__symbols); - let __sym0 = __pop_Variant95(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1190::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant95(__nt), __end)); - (3, 248) - } - pub(crate) fn __reduce833< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Statements = Statements, ( ";")+, SmallStatement, "\n" => ActionFn(1191); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant37(__symbols); - let __sym1 = __pop_Variant38(__symbols); - let __sym0 = __pop_Variant95(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1191::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant95(__nt), __end)); - (4, 248) - } - pub(crate) fn __reduce834< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // String = StringLiteralOrFString => ActionFn(922); - let __sym0 = __pop_Variant67(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action922::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (1, 249) - } - pub(crate) fn __reduce837< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // StringLiteralOrFString = StringLiteral => ActionFn(216); - let __sym0 = __pop_Variant67(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action216::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant67(__nt), __end)); - (1, 251) - } - pub(crate) fn __reduce838< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // StringLiteralOrFString = FStringExpr => ActionFn(217); - let __sym0 = __pop_Variant67(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action217::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant67(__nt), __end)); - (1, 251) - } - pub(crate) fn __reduce839< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Subscript = TestOrStarNamedExpr => ActionFn(211); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action211::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 252) - } - pub(crate) fn __reduce840< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Subscript = Test<"all">, ":", Test<"all">, SliceOp => ActionFn(1724); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant93(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1724::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (4, 252) - } - pub(crate) fn __reduce841< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Subscript = Test<"all">, ":", SliceOp => ActionFn(1725); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant93(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1725::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 252) - } - pub(crate) fn __reduce842< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Subscript = ":", Test<"all">, SliceOp => ActionFn(1726); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant93(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1726::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 252) - } - pub(crate) fn __reduce843< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Subscript = ":", SliceOp => ActionFn(1727); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant93(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1727::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 252) - } - pub(crate) fn __reduce844< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Subscript = Test<"all">, ":", Test<"all"> => ActionFn(1728); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1728::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 252) - } - pub(crate) fn __reduce845< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Subscript = Test<"all">, ":" => ActionFn(1729); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1729::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 252) - } - pub(crate) fn __reduce846< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Subscript = ":", Test<"all"> => ActionFn(1730); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1730::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 252) - } - pub(crate) fn __reduce847< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Subscript = ":" => ActionFn(1731); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1731::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 252) - } - pub(crate) fn __reduce848< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SubscriptList = Subscript => ActionFn(208); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action208::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 253) - } - pub(crate) fn __reduce849< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SubscriptList = Subscript, "," => ActionFn(1487); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1487::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 253) - } - pub(crate) fn __reduce850< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SubscriptList = TwoOrMoreSep, "," => ActionFn(1488); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1488::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 253) - } - pub(crate) fn __reduce851< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // SubscriptList = TwoOrMoreSep => ActionFn(1489); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1489::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 253) - } - pub(crate) fn __reduce852< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Suite = SmallStatement, ";", "\n" => ActionFn(1192); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1192::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (3, 254) - } - pub(crate) fn __reduce853< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Suite = ( ";")+, SmallStatement, ";", "\n" => ActionFn(1193); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant37(__symbols); - let __sym0 = __pop_Variant38(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1193::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (4, 254) - } - pub(crate) fn __reduce854< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Suite = SmallStatement, "\n" => ActionFn(1194); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant37(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1194::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (2, 254) - } - pub(crate) fn __reduce855< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Suite = ( ";")+, SmallStatement, "\n" => ActionFn(1195); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant37(__symbols); - let __sym0 = __pop_Variant38(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1195::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (3, 254) - } - pub(crate) fn __reduce856< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Suite = "\n", Indent, Statements, Dedent => ActionFn(8); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant95(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action8::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant25(__nt), __end)); - (4, 254) - } - pub(crate) fn __reduce857< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Term<"all"> = Term<"all">, MulOp, Factor<"all"> => ActionFn(1490); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant49(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1490::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 255) - } - pub(crate) fn __reduce858< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Term<"all"> = Factor<"all"> => ActionFn(520); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action520::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 255) - } - pub(crate) fn __reduce859< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Term<"no-withitems"> = Term<"all">, MulOp, Factor<"all"> => ActionFn(1491); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant49(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1491::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 256) - } - pub(crate) fn __reduce860< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Term<"no-withitems"> = Factor<"no-withitems"> => ActionFn(573); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action573::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 256) - } - pub(crate) fn __reduce861< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Test<"all"> = OrTest<"all">, "if", OrTest<"all">, "else", Test<"all"> => ActionFn(1492); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant15(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1492::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (5, 257) - } - pub(crate) fn __reduce862< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Test<"all"> = OrTest<"all"> => ActionFn(401); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action401::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 257) - } - pub(crate) fn __reduce863< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Test<"all"> = LambdaDef => ActionFn(402); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action402::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 257) - } - pub(crate) fn __reduce864< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Test<"all">? = Test<"all"> => ActionFn(324); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action324::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (1, 258) - } - pub(crate) fn __reduce865< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Test<"all">? = => ActionFn(325); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action325::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (0, 258) - } - pub(crate) fn __reduce866< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Test<"no-withitems"> = OrTest<"all">, "if", OrTest<"all">, "else", Test<"all"> => ActionFn(1493); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant15(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1493::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (5, 259) - } - pub(crate) fn __reduce867< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Test<"no-withitems"> = OrTest<"no-withitems"> => ActionFn(433); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action433::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 259) - } - pub(crate) fn __reduce868< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Test<"no-withitems"> = LambdaDef => ActionFn(434); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action434::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 259) - } - pub(crate) fn __reduce869< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TestList = GenericList => ActionFn(236); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action236::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 260) - } - pub(crate) fn __reduce870< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TestList? = GenericList => ActionFn(1736); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1736::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (1, 261) - } - pub(crate) fn __reduce871< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TestList? = => ActionFn(397); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action397::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (0, 261) - } - pub(crate) fn __reduce872< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TestListOrYieldExpr = GenericList => ActionFn(1737); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1737::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 262) - } - pub(crate) fn __reduce873< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TestListOrYieldExpr = YieldExpr => ActionFn(32); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action32::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 262) - } - pub(crate) fn __reduce874< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TestOrStarExpr = Test<"all"> => ActionFn(34); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action34::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 263) - } - pub(crate) fn __reduce875< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TestOrStarExpr = StarExpr => ActionFn(35); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action35::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 263) - } - pub(crate) fn __reduce876< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TestOrStarExprList = GenericList => ActionFn(1738); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1738::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 264) - } - pub(crate) fn __reduce877< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TestOrStarNamedExpr = NamedExpressionTest => ActionFn(38); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action38::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 265) - } - pub(crate) fn __reduce878< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TestOrStarNamedExpr = StarExpr => ActionFn(39); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action39::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 265) - } - pub(crate) fn __reduce879< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Top = StartModule, Program => ActionFn(1494); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant25(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1494::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant96(__nt), __end)); - (2, 266) - } - pub(crate) fn __reduce880< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Top = StartExpression, GenericList => ActionFn(1739); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1739::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant96(__nt), __end)); - (2, 266) - } - pub(crate) fn __reduce881< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // Top = StartExpression, GenericList, ("\n")+ => ActionFn(1740); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant22(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1740::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant96(__nt), __end)); - (3, 266) - } - pub(crate) fn __reduce882< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TryStatement = "try", ":", Suite, ExceptClause+, "else", ":", Suite, "finally", ":", Suite => ActionFn(1497); - assert!(__symbols.len() >= 10); - let __sym9 = __pop_Variant25(__symbols); - let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant64(__symbols); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym9.2; - let __nt = super::__action1497::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (10, 267) - } - pub(crate) fn __reduce883< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TryStatement = "try", ":", Suite, ExceptClause+, "else", ":", Suite => ActionFn(1498); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant64(__symbols); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1498::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 267) - } - pub(crate) fn __reduce884< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TryStatement = "try", ":", Suite, ExceptClause+, "finally", ":", Suite => ActionFn(1499); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant64(__symbols); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1499::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 267) - } - pub(crate) fn __reduce885< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TryStatement = "try", ":", Suite, ExceptClause+ => ActionFn(1500); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant64(__symbols); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1500::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (4, 267) - } - pub(crate) fn __reduce886< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TryStatement = "try", ":", Suite, ExceptStarClause+, "else", ":", Suite, "finally", ":", Suite => ActionFn(1501); - assert!(__symbols.len() >= 10); - let __sym9 = __pop_Variant25(__symbols); - let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant64(__symbols); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym9.2; - let __nt = super::__action1501::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (10, 267) - } - pub(crate) fn __reduce887< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TryStatement = "try", ":", Suite, ExceptStarClause+, "else", ":", Suite => ActionFn(1502); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant64(__symbols); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1502::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 267) - } - pub(crate) fn __reduce888< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TryStatement = "try", ":", Suite, ExceptStarClause+, "finally", ":", Suite => ActionFn(1503); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant64(__symbols); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1503::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 267) - } - pub(crate) fn __reduce889< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TryStatement = "try", ":", Suite, ExceptStarClause+ => ActionFn(1504); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant64(__symbols); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1504::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (4, 267) - } - pub(crate) fn __reduce890< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TryStatement = "try", ":", Suite, "finally", ":", Suite => ActionFn(1128); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant25(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant25(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1128::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (6, 267) - } - pub(crate) fn __reduce891< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TwoOrMore = StringLiteral, StringLiteral => ActionFn(351); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant67(__symbols); - let __sym0 = __pop_Variant67(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action351::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant97(__nt), __end)); - (2, 268) - } - pub(crate) fn __reduce892< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TwoOrMore = TwoOrMore, StringLiteral => ActionFn(352); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant67(__symbols); - let __sym0 = __pop_Variant97(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action352::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant97(__nt), __end)); - (2, 268) - } - pub(crate) fn __reduce893< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TwoOrMore = StringLiteralOrFString, StringLiteralOrFString => ActionFn(276); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant67(__symbols); - let __sym0 = __pop_Variant67(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action276::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant97(__nt), __end)); - (2, 269) - } - pub(crate) fn __reduce894< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TwoOrMore = TwoOrMore, StringLiteralOrFString => ActionFn(277); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant67(__symbols); - let __sym0 = __pop_Variant97(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action277::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant97(__nt), __end)); - (2, 269) - } - pub(crate) fn __reduce895< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TwoOrMoreSep = ClosedPattern, "|", ClosedPattern => ActionFn(357); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant35(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action357::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant53(__nt), __end)); - (3, 270) - } - pub(crate) fn __reduce896< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TwoOrMoreSep = TwoOrMoreSep, "|", ClosedPattern => ActionFn(358); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant35(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant53(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action358::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant53(__nt), __end)); - (3, 270) - } - pub(crate) fn __reduce897< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TwoOrMoreSep = Pattern, ",", Pattern => ActionFn(359); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant35(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant35(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action359::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant53(__nt), __end)); - (3, 271) - } - pub(crate) fn __reduce898< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TwoOrMoreSep = TwoOrMoreSep, ",", Pattern => ActionFn(360); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant35(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant53(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action360::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant53(__nt), __end)); - (3, 271) - } - pub(crate) fn __reduce899< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TwoOrMoreSep = Subscript, ",", Subscript => ActionFn(280); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action280::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (3, 272) - } - pub(crate) fn __reduce900< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TwoOrMoreSep = TwoOrMoreSep, ",", Subscript => ActionFn(281); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action281::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (3, 272) - } - pub(crate) fn __reduce901< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TwoOrMoreSep = TestOrStarNamedExpr, ",", TestOrStarNamedExpr => ActionFn(364); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action364::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (3, 273) - } - pub(crate) fn __reduce902< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TwoOrMoreSep = TwoOrMoreSep, ",", TestOrStarNamedExpr => ActionFn(365); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action365::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant33(__nt), __end)); - (3, 273) - } - pub(crate) fn __reduce903< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TypeAliasName = Identifier => ActionFn(1505); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1505::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant44(__nt), __end)); - (1, 274) - } - pub(crate) fn __reduce904< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TypeAliasStatement = "type", TypeAliasName, TypeParams, "=", Test<"all"> => ActionFn(1772); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant15(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant99(__symbols); - let __sym1 = __pop_Variant44(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1772::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (5, 275) - } - pub(crate) fn __reduce905< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TypeAliasStatement = "type", TypeAliasName, "=", Test<"all"> => ActionFn(1773); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant15(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant44(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1773::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (4, 275) - } - pub(crate) fn __reduce906< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TypeParam = Identifier, ":", Test<"all"> => ActionFn(1507); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1507::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant98(__nt), __end)); - (3, 276) - } - pub(crate) fn __reduce907< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TypeParam = Identifier => ActionFn(1508); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1508::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant98(__nt), __end)); - (1, 276) - } - pub(crate) fn __reduce908< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TypeParam = "*", Identifier => ActionFn(1509); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1509::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant98(__nt), __end)); - (2, 276) - } - pub(crate) fn __reduce909< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TypeParam = "**", Identifier => ActionFn(1510); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant23(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1510::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant98(__nt), __end)); - (2, 276) - } - pub(crate) fn __reduce910< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TypeParams = "[", OneOrMore, ",", "]" => ActionFn(1511); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant87(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1511::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant99(__nt), __end)); - (4, 277) - } - pub(crate) fn __reduce911< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TypeParams = "[", OneOrMore, "]" => ActionFn(1512); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant87(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1512::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant99(__nt), __end)); - (3, 277) - } - pub(crate) fn __reduce912< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TypeParams? = TypeParams => ActionFn(306); - let __sym0 = __pop_Variant99(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action306::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant100(__nt), __end)); - (1, 278) - } - pub(crate) fn __reduce913< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TypeParams? = => ActionFn(307); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action307::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant100(__nt), __end)); - (0, 278) - } - pub(crate) fn __reduce914< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TypedParameter = Identifier, ":", Test<"all"> => ActionFn(1513); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1513::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (3, 279) - } - pub(crate) fn __reduce915< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // TypedParameter = Identifier => ActionFn(1514); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1514::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (1, 279) - } - pub(crate) fn __reduce916< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // UnaryOp = "+" => ActionFn(205); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action205::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant101(__nt), __end)); - (1, 280) - } - pub(crate) fn __reduce917< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // UnaryOp = "-" => ActionFn(206); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action206::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant101(__nt), __end)); - (1, 280) - } - pub(crate) fn __reduce918< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // UnaryOp = "~" => ActionFn(207); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action207::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant101(__nt), __end)); - (1, 280) - } - pub(crate) fn __reduce919< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // UntypedParameter = Identifier => ActionFn(1515); - let __sym0 = __pop_Variant23(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1515::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (1, 281) - } - pub(crate) fn __reduce920< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // ValuePattern = MatchNameOrAttr => ActionFn(1516); - let __sym0 = __pop_Variant44(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1516::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant35(__nt), __end)); - (1, 282) - } - pub(crate) fn __reduce921< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WhileStatement = "while", NamedExpressionTest, ":", Suite, "else", ":", Suite => ActionFn(1125); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant25(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant25(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1125::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (7, 283) - } - pub(crate) fn __reduce922< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WhileStatement = "while", NamedExpressionTest, ":", Suite => ActionFn(1126); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant25(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1126::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (4, 283) - } - pub(crate) fn __reduce923< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItem<"all"> = Test<"all"> => ActionFn(319); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action319::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant18(__nt), __end)); - (1, 284) - } - pub(crate) fn __reduce924< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItem<"all"> = WithItemAs => ActionFn(320); - let __sym0 = __pop_Variant18(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action320::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant18(__nt), __end)); - (1, 284) - } - pub(crate) fn __reduce925< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItem<"no-withitems"> = Test<"no-withitems"> => ActionFn(314); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action314::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant18(__nt), __end)); - (1, 285) - } - pub(crate) fn __reduce926< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItem<"no-withitems"> = WithItemAs => ActionFn(315); - let __sym0 = __pop_Variant18(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action315::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant18(__nt), __end)); - (1, 285) - } - pub(crate) fn __reduce927< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItemAs = Test<"all">, "as", Expression<"all"> => ActionFn(1517); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1517::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant18(__nt), __end)); - (3, 286) - } - pub(crate) fn __reduce928< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItems = "(", OneOrMore>, ",", ")" => ActionFn(1199); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1199::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (4, 287) - } - pub(crate) fn __reduce929< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItems = "(", OneOrMore>, ")" => ActionFn(1200); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1200::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (3, 287) - } - pub(crate) fn __reduce930< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItems = "(", OneOrMore>, ",", WithItemAs, ",", ")" => ActionFn(1202); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant18(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1202::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (6, 287) - } - pub(crate) fn __reduce931< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItems = "(", WithItemAs, ",", ")" => ActionFn(1203); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant18(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1203::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (4, 287) - } - pub(crate) fn __reduce932< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItems = "(", OneOrMore>, ",", WithItemAs, ("," >)+, ",", ")" => ActionFn(1204); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant19(__symbols); - let __sym3 = __pop_Variant18(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym6.2; - let __nt = super::__action1204::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (7, 287) - } - pub(crate) fn __reduce933< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItems = "(", WithItemAs, ("," >)+, ",", ")" => ActionFn(1205); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant19(__symbols); - let __sym1 = __pop_Variant18(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1205::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (5, 287) - } - pub(crate) fn __reduce934< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItems = "(", OneOrMore>, ",", WithItemAs, ")" => ActionFn(1206); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant18(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action1206::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (5, 287) - } - pub(crate) fn __reduce935< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItems = "(", WithItemAs, ")" => ActionFn(1207); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant18(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1207::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (3, 287) - } - pub(crate) fn __reduce936< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItems = "(", OneOrMore>, ",", WithItemAs, ("," >)+, ")" => ActionFn(1208); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant19(__symbols); - let __sym3 = __pop_Variant18(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant33(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action1208::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (6, 287) - } - pub(crate) fn __reduce937< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItems = "(", WithItemAs, ("," >)+, ")" => ActionFn(1209); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant19(__symbols); - let __sym1 = __pop_Variant18(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action1209::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (4, 287) - } - pub(crate) fn __reduce938< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItems = WithItem<"no-withitems"> => ActionFn(159); - let __sym0 = __pop_Variant18(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action159::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (1, 287) - } - pub(crate) fn __reduce939< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItems = WithItem<"all">, ("," >)+ => ActionFn(160); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant19(__symbols); - let __sym0 = __pop_Variant18(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action160::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (2, 287) - } - pub(crate) fn __reduce940< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithItemsNoAs = OneOrMore> => ActionFn(161); - let __sym0 = __pop_Variant33(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action161::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant40(__nt), __end)); - (1, 288) - } - pub(crate) fn __reduce941< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithStatement = "async", "with", WithItems, ":", Suite => ActionFn(950); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant25(__symbols); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant40(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym4.2; - let __nt = super::__action950::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (5, 289) - } - pub(crate) fn __reduce942< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // WithStatement = "with", WithItems, ":", Suite => ActionFn(951); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant25(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant40(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action951::<>(source_code, mode, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant37(__nt), __end)); - (4, 289) - } - pub(crate) fn __reduce943< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // XorExpression<"all"> = XorExpression<"all">, "^", AndExpression<"all"> => ActionFn(1518); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1518::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 290) - } - pub(crate) fn __reduce944< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // XorExpression<"all"> = AndExpression<"all"> => ActionFn(425); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action425::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 290) - } - pub(crate) fn __reduce945< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // XorExpression<"no-withitems"> = XorExpression<"all">, "^", AndExpression<"all"> => ActionFn(1519); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1519::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 291) - } - pub(crate) fn __reduce946< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // XorExpression<"no-withitems"> = AndExpression<"no-withitems"> => ActionFn(530); - let __sym0 = __pop_Variant15(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action530::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 291) - } - pub(crate) fn __reduce947< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // YieldExpr = "yield", GenericList => ActionFn(1743); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action1743::<>(source_code, mode, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (2, 292) - } - pub(crate) fn __reduce948< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // YieldExpr = "yield" => ActionFn(1744); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1744::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 292) - } - pub(crate) fn __reduce949< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // YieldExpr = "yield", "from", Test<"all"> => ActionFn(1521); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action1521::<>(source_code, mode, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (3, 292) - } - pub(crate) fn __reduce951< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // fstring_middle? = fstring_middle => ActionFn(282); - let __sym0 = __pop_Variant3(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action282::<>(source_code, mode, __sym0); - __symbols.push((__start, __Symbol::Variant102(__nt), __end)); - (1, 294) - } - pub(crate) fn __reduce952< - >( - source_code: &str, - mode: Mode, - __lookahead_start: Option<&TextSize>, - __symbols: &mut alloc::vec::Vec<(TextSize,__Symbol<>,TextSize)>, - _: core::marker::PhantomData<()>, - ) -> (usize, usize) - { - // fstring_middle? = => ActionFn(283); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); - let __end = __start.clone(); - let __nt = super::__action283::<>(source_code, mode, &__start, &__end); - __symbols.push((__start, __Symbol::Variant102(__nt), __end)); - (0, 294) - } -} -pub(crate) use self::__parse__Top::TopParser; - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action0< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Mod, TextSize), -) -> ast::Mod -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1< ->( - source_code: &str, - mode: Mode, - (_, start, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), - (_, end, _): (TextSize, TextSize, TextSize), -) -> ast::Mod -{ - ast::ModModule { body, range: (start..end).into() }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action2< ->( - source_code: &str, - mode: Mode, - (_, start, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, alloc::vec::Vec, TextSize), - (_, end, _): (TextSize, TextSize, TextSize), -) -> ast::Mod -{ - ast::ModExpression { body: Box::new(body.into()), range: (start..end).into() }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action3< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> ast::Suite -{ - vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action4< ->( - source_code: &str, - mode: Mode, - (_, mut statements, _): (TextSize, ast::Suite, TextSize), - (_, next, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Suite -{ - { - statements.push(next); - statements - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action5< ->( - source_code: &str, - mode: Mode, - (_, mut statements, _): (TextSize, ast::Suite, TextSize), - (_, small, _): (TextSize, alloc::vec::Vec, TextSize), - (_, last, _): (TextSize, ast::Stmt, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - { - statements.extend(small); - statements.push(last); - statements - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action6< ->( - source_code: &str, - mode: Mode, - (_, s, _): (TextSize, ast::Suite, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - s -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action7< ->( - source_code: &str, - mode: Mode, - (_, mut statements, _): (TextSize, alloc::vec::Vec, TextSize), - (_, last, _): (TextSize, ast::Stmt, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - { - statements.push(last); - statements - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action8< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, s, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - s -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action9< ->( - source_code: &str, - mode: Mode, - (_, mut head, _): (TextSize, alloc::vec::Vec, TextSize), - (_, last, _): (TextSize, ast::Stmt, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> Vec -{ - { - head.push(last); - head - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action10< ->( - source_code: &str, - mode: Mode, - (_, s, _): (TextSize, ast::Stmt, TextSize), -) -> Vec -{ - vec![s] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action11< ->( - source_code: &str, - mode: Mode, - (_, mut statements, _): (TextSize, Vec, TextSize), - (_, next, _): (TextSize, ast::Stmt, TextSize), -) -> Vec -{ - { - statements.push(next); - statements - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action12< ->( - source_code: &str, - mode: Mode, - (_, mut statements, _): (TextSize, Vec, TextSize), - (_, small, _): (TextSize, alloc::vec::Vec, TextSize), - (_, last, _): (TextSize, ast::Stmt, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> Vec -{ - { - statements.extend(small); - statements.push(last); - statements - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action13< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action14< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action15< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action16< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action17< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action18< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action19< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action20< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action21< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action22< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action23< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action24< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - ast::Stmt::Pass(ast::StmtPass { range: (location..end_location).into() }) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action25< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, targets, _): (TextSize, Vec, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - ast::Stmt::Delete( - ast::StmtDelete { targets: targets.into_iter().map(|expr| set_context(expr.into(), ast::ExprContext::Del)).collect(), range: (location..end_location).into() } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action26< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, expression, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, suffix, _): (TextSize, alloc::vec::Vec, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - // Just an expression, no assignment: - if suffix.is_empty() { - Ok(ast::Stmt::Expr( - ast::StmtExpr { value: Box::new(expression.into()), range: (location..end_location).into() } - )) - } else { - let mut targets = vec![set_context(expression.into(), ast::ExprContext::Store)]; - let mut values = suffix; - - let value = Box::new(values.pop().unwrap().into()); - - for target in values { - targets.push(set_context(target.into(), ast::ExprContext::Store)); - } - invalid::assignment_targets(&targets)?; - Ok(ast::Stmt::Assign( - ast::StmtAssign { targets, value, range: (location..end_location).into() } - )) - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action27< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, target, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, op, _): (TextSize, ast::Operator, TextSize), - (_, rhs, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - invalid::assignment_target(&target.expr)?; - Ok(ast::Stmt::AugAssign( - ast::StmtAugAssign { - target: Box::new(set_context(target.into(), ast::ExprContext::Store)), - op, - value: Box::new(rhs.into()), - range: (location..end_location).into() - }, - )) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action28< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, target, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, annotation, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, rhs, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - let simple = target.expr.is_name_expr(); - invalid::assignment_target(&target.expr)?; - Ok(ast::Stmt::AnnAssign( - ast::StmtAnnAssign { - target: Box::new(set_context(target.into(), ast::ExprContext::Store)), - annotation: Box::new(annotation.into()), - value: rhs.map(ast::Expr::from).map(Box::new), - simple, - range: (location..end_location).into() - }, - )) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action29< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - e -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action30< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - e -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action31< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action32< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action33< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action34< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action35< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action36< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action37< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action38< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action39< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action40< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::Add -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action41< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::Sub -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action42< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::Mult -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action43< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::MatMult -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action44< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::Div -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action45< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::Mod -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action46< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::BitAnd -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action47< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::BitOr -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action48< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::BitXor -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action49< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::LShift -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action50< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::RShift -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action51< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::Pow -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action52< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::FloorDiv -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action53< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - - ast::Stmt::Break(ast::StmtBreak { range: (location..end_location).into() }) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action54< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - ast::Stmt::Continue(ast::StmtContinue { range: (location..end_location).into() }) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action55< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, value, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - ast::Stmt::Return( - ast::StmtReturn { value: value.map(ast::Expr::from).map(Box::new), range: (location..end_location).into() } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action56< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, expression, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - ast::Stmt::Expr( - ast::StmtExpr { value: Box::new(expression.into()), range: (location..end_location).into() } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action57< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action58< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - ast::Stmt::Raise( - ast::StmtRaise { exc: None, cause: None, range: (location..end_location).into() } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action59< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, exc, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, cause, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - ast::Stmt::Raise( - ast::StmtRaise { exc: Some(Box::new(exc.into())), cause: cause.map(ast::Expr::from).map(Box::new), range: (location..end_location).into() } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action60< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, names, _): (TextSize, Vec, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - ast::Stmt::Import( - ast::StmtImport { names, range: (location..end_location).into() } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action61< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, source, _): (TextSize, (Option, Option), TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, names, _): (TextSize, Vec, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - let (level, module) = source; - ast::Stmt::ImportFrom( - ast::StmtImportFrom { - level, - module, - names, - range: (location..end_location).into() - }, - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action62< ->( - source_code: &str, - mode: Mode, - (_, dots, _): (TextSize, alloc::vec::Vec, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), -) -> (Option, Option) -{ - { - (Some(dots.iter().sum()), Some(name)) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action63< ->( - source_code: &str, - mode: Mode, - (_, dots, _): (TextSize, alloc::vec::Vec, TextSize), -) -> (Option, Option) -{ - { - (Some(dots.iter().sum()), None) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action64< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> u32 -{ - 3 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action65< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> u32 -{ - 1 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action66< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, i, _): (TextSize, Vec, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Vec -{ - i -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action67< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, i, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Vec -{ - i -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action68< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Vec -{ - { - // Star import all - vec![ast::Alias { name: ast::Identifier::new("*", (location..end_location).into()), asname: None, range: (location..end_location).into() }] - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action69< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, n, _): (TextSize, Box, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Identifier -{ - ast::Identifier::new(n, (location..end_location).into()) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action70< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, n, _): (TextSize, Box, TextSize), - (_, n2, _): (TextSize, alloc::vec::Vec<(token::Tok, ast::Identifier)>, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Identifier -{ - { - let mut r = String::from(n); - for x in n2 { - r.push('.'); - r.push_str(x.1.as_str()); - } - ast::Identifier::new(r, (location..end_location).into()) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action71< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, names, _): (TextSize, Vec, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - ast::Stmt::Global( - ast::StmtGlobal { names, range: (location..end_location).into() } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action72< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, names, _): (TextSize, Vec, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - ast::Stmt::Nonlocal( - ast::StmtNonlocal { names, range: (location..end_location).into() } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action73< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, test, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, msg, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - ast::Stmt::Assert( - ast::StmtAssert { - test: Box::new(test.into()), - msg: msg.map(ast::Expr::from).map(Box::new), - range: (location..end_location).into() - } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action74< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, c, _): (TextSize, (IpyEscapeKind, Box), TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - if mode == Mode::Ipython { - Ok(ast::Stmt::IpyEscapeCommand( - ast::StmtIpyEscapeCommand { - kind: c.0, - value: c.1, - range: (location..end_location).into() - } - )) - } else { - Err(LexicalError::new( - LexicalErrorType::OtherError("IPython escape commands are only allowed in `Mode::Ipython`".to_string().into_boxed_str()), - location, - ))? - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action75< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, c, _): (TextSize, (IpyEscapeKind, Box), TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - if mode == Mode::Ipython { - // This should never occur as the lexer won't allow it. - if !matches!(c.0, IpyEscapeKind::Magic | IpyEscapeKind::Shell) { - return Err(LexicalError::new( - LexicalErrorType::OtherError("IPython escape command expr is only allowed for % and !".to_string().into_boxed_str()), - location, - ))?; - } - Ok(ast::ExprIpyEscapeCommand { - kind: c.0, - value: c.1, - range: (location..end_location).into() - }.into()) - } else { - Err(LexicalError::new( - LexicalErrorType::OtherError("IPython escape commands are only allowed in `Mode::Ipython`".to_string().into_boxed_str()), - location, - ))? - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action76< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, suffix, _): (TextSize, alloc::vec::Vec, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - fn unparse_expr(expr: &ast::Expr, buffer: &mut String) -> Result<(), LexicalError> { - match expr { - ast::Expr::Name(ast::ExprName { id, .. }) => { - buffer.push_str(id.as_str()); - }, - ast::Expr::Subscript(ast::ExprSubscript { value, slice, range, .. }) => { - let ast::Expr::NumberLiteral(ast::ExprNumberLiteral { value: ast::Number::Int(integer), .. }) = slice.as_ref() else { - return Err(LexicalError::new( - LexicalErrorType::OtherError("only integer literals are allowed in Subscript expressions in help end escape command".to_string().into_boxed_str()), - range.start(), - )); - }; - unparse_expr(value, buffer)?; - buffer.push('['); - buffer.push_str(&format!("{}", integer)); - buffer.push(']'); - }, - ast::Expr::Attribute(ast::ExprAttribute { value, attr, .. }) => { - unparse_expr(value, buffer)?; - buffer.push('.'); - buffer.push_str(attr.as_str()); - }, - _ => { - return Err(LexicalError::new( - LexicalErrorType::OtherError("only Name, Subscript and Attribute expressions are allowed in help end escape command".to_string().into_boxed_str()), - expr.start(), - )); - } - } - Ok(()) - } - - if mode != Mode::Ipython { - return Err(ParseError::User { - error: LexicalError::new( - LexicalErrorType::OtherError("IPython escape commands are only allowed in `Mode::Ipython`".to_string().into_boxed_str()), - location, - ), - }); - } - - let kind = match suffix.len() { - 1 => IpyEscapeKind::Help, - 2 => IpyEscapeKind::Help2, - _ => { - return Err(ParseError::User { - error: LexicalError::new( - LexicalErrorType::OtherError("maximum of 2 `?` tokens are allowed in help end escape command".to_string().into_boxed_str()), - location, - ), - }); - } - }; - - let mut value = String::new(); - unparse_expr(&e.into(), &mut value)?; - - Ok(ast::Stmt::IpyEscapeCommand( - ast::StmtIpyEscapeCommand { - kind, - value: value.into_boxed_str(), - range: (location..end_location).into() - } - )) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action77< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action78< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action79< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action80< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action81< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action82< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action83< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action84< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action85< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, subject, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, cases, _): (TextSize, alloc::vec::Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - { - let end_location = cases - .last() - .unwrap() - .body - .last() - .unwrap() - .end(); - ast::Stmt::Match( - ast::StmtMatch { - subject: Box::new(subject.into()), - cases, - range: (location..end_location).into() - } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action86< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, tuple_location, _): (TextSize, TextSize, TextSize), - (_, subject, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, tuple_end_location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, cases, _): (TextSize, alloc::vec::Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - { - let end_location = cases - .last() - .unwrap() - .body - .last() - .unwrap() - .end(); - ast::Stmt::Match( - ast::StmtMatch { - subject: Box::new(ast::Expr::Tuple( - ast::ExprTuple { - elts: vec![subject.into()], - ctx: ast::ExprContext::Load, - range: (tuple_location..tuple_end_location).into(), - parenthesized: false - }, - )), - cases, - range: (location..end_location).into() - } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action87< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, tuple_location, _): (TextSize, TextSize, TextSize), - (_, elts, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, tuple_end_location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, cases, _): (TextSize, alloc::vec::Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - { - let end_location = cases - .last() - .unwrap() - .body - .last() - .unwrap() - .end(); - let elts = elts.into_iter().map(ast::Expr::from).collect(); - ast::Stmt::Match( - ast::StmtMatch { - subject: Box::new(ast::Expr::Tuple( - ast::ExprTuple { - elts, - ctx: ast::ExprContext::Load, - range: (tuple_location..tuple_end_location).into(), - parenthesized: false - }, - )), - cases, - range: (location..end_location).into() - } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action88< ->( - source_code: &str, - mode: Mode, - (_, start, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, pattern, _): (TextSize, ast::Pattern, TextSize), - (_, guard, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), -) -> ast::MatchCase -{ - { - // SAFETY: `body` is never empty because it is non-optional and `Suite` matches one or more statements. - let end = body.last().unwrap().end(); - ast::MatchCase { - pattern, - guard: guard.map(Box::new), - body, - range: (start..end).into() - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action89< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, guard, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Expr -{ - { - guard.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action90< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, pattern, _): (TextSize, ast::Pattern, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - ast::Pattern::MatchSequence( - ast::PatternMatchSequence { - patterns: vec![pattern], - range: (location..end_location).into() - }, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action91< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, patterns, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - { - ast::Pattern::MatchSequence( - ast::PatternMatchSequence { - patterns, - range: (location..end_location).into() - }, - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action92< ->( - source_code: &str, - mode: Mode, - (_, pattern, _): (TextSize, ast::Pattern, TextSize), -) -> ast::Pattern -{ - pattern -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action93< ->( - source_code: &str, - mode: Mode, - (_, pattern, _): (TextSize, ast::Pattern, TextSize), -) -> ast::Pattern -{ - pattern -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action94< ->( - source_code: &str, - mode: Mode, - (_, pattern, _): (TextSize, ast::Pattern, TextSize), -) -> ast::Pattern -{ - pattern -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action95< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, pattern, _): (TextSize, ast::Pattern, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - if name.as_str() == "_" { - Err(LexicalError::new( - LexicalErrorType::OtherError("cannot use '_' as a target".to_string().into_boxed_str()), - location, - ))? - } else { - Ok(ast::Pattern::MatchAs( - ast::PatternMatchAs { - pattern: Some(Box::new(pattern)), - name: Some(name), - range: (location..end_location).into() - }, - )) - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action96< ->( - source_code: &str, - mode: Mode, - (_, pattern, _): (TextSize, ast::Pattern, TextSize), -) -> ast::Pattern -{ - pattern -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action97< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, patterns, _): (TextSize, Vec, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - { - ast::Pattern::MatchOr( - ast::PatternMatchOr { patterns, range: (location..end_location).into() } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action98< ->( - source_code: &str, - mode: Mode, - (_, node, _): (TextSize, ast::Pattern, TextSize), -) -> ast::Pattern -{ - node -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action99< ->( - source_code: &str, - mode: Mode, - (_, node, _): (TextSize, ast::Pattern, TextSize), -) -> ast::Pattern -{ - node -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action100< ->( - source_code: &str, - mode: Mode, - (_, node, _): (TextSize, ast::Pattern, TextSize), -) -> ast::Pattern -{ - node -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action101< ->( - source_code: &str, - mode: Mode, - (_, node, _): (TextSize, ast::Pattern, TextSize), -) -> ast::Pattern -{ - node -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action102< ->( - source_code: &str, - mode: Mode, - (_, node, _): (TextSize, ast::Pattern, TextSize), -) -> ast::Pattern -{ - node -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action103< ->( - source_code: &str, - mode: Mode, - (_, node, _): (TextSize, ast::Pattern, TextSize), -) -> ast::Pattern -{ - node -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action104< ->( - source_code: &str, - mode: Mode, - (_, node, _): (TextSize, ast::Pattern, TextSize), -) -> ast::Pattern -{ - node -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action105< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, pattern, _): (TextSize, ast::Pattern, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - pattern -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action106< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - ast::PatternMatchSequence { - patterns: vec![], - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action107< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, pattern, _): (TextSize, ast::Pattern, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - { - ast::PatternMatchSequence { - patterns: vec![pattern], - range: (location..end_location).into() - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action108< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, patterns, _): (TextSize, alloc::vec::Vec, TextSize), - (_, last, _): (TextSize, ast::Pattern, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - { - let mut patterns = patterns; - patterns.push(last); - ast::PatternMatchSequence { - patterns, - range: (location..end_location).into() - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action109< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, patterns, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - ast::PatternMatchSequence { - patterns, - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action110< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - ast::PatternMatchStar { - name: if name.as_str() == "_" { None } else { Some(name) }, - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action111< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, value, _): (TextSize, ast::Number, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::Expr::NumberLiteral( - ast::ExprNumberLiteral { value, range: (location..end_location).into() } - ).into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action112< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action113< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, operand, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::Expr::UnaryOp( - ast::ExprUnaryOp { - op: ast::UnaryOp::USub, - operand: Box::new(operand.into()), - range: (location..end_location).into() - } - ).into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action114< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, op, _): (TextSize, ast::Operator, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action115< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - ast::PatternMatchSingleton { - value: ast::Singleton::None, - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action116< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - ast::PatternMatchSingleton { - value: true.into(), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action117< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - ast::PatternMatchSingleton { - value: false.into(), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action118< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - ast::PatternMatchValue { - value: Box::new(value.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action119< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - ast::PatternMatchValue { - value: Box::new(value.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action120< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, string, _): (TextSize, StringType, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - ast::PatternMatchValue { - value: Box::new(string.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action121< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, strings, _): (TextSize, Vec, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - Ok(ast::PatternMatchValue { - value: Box::new(concatenated_strings(strings, (location..end_location).into())?), - range: (location..end_location).into() - }.into()) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action122< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - ast::PatternMatchAs { - pattern: None, - name: if name.as_str() == "_" { None } else { Some(name) }, - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action123< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, id, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - ast::Expr::Name( - ast::ExprName { id: id.into(), ctx: ast::ExprContext::Load, range: (location..end_location).into() }, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action124< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, name, _): (TextSize, ast::Expr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, attr, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - ast::ExprAttribute { - value: Box::new(name), - attr, - ctx: ast::ExprContext::Load, - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action125< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, e, _): (TextSize, ast::Expr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, attr, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - ast::ExprAttribute { - value: Box::new(e), - attr, - ctx: ast::ExprContext::Load, - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action126< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, e, _): (TextSize, ast::Expr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - ast::PatternMatchValue { - value: Box::new(e), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action127< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Expr, TextSize), -) -> ast::Expr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action128< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Expr, TextSize), -) -> ast::Expr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action129< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Expr -{ - e.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action130< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Expr -{ - e.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action131< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - ast::ExprNoneLiteral { - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action132< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - ast::ExprBooleanLiteral { - value: true, - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action133< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - ast::ExprBooleanLiteral { - value: false, - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action134< ->( - source_code: &str, - mode: Mode, - (_, k, _): (TextSize, ast::Expr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, v, _): (TextSize, ast::Pattern, TextSize), -) -> (ast::Expr, ast::Pattern) -{ - (k, v) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action135< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - { - ast::PatternMatchMapping { - keys: vec![], - patterns: vec![], - rest: None, - range: (location..end_location).into() - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action136< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - { - let (keys, patterns) = e - .into_iter() - .unzip(); - ast::PatternMatchMapping { - keys, - patterns, - rest: None, - range: (location..end_location).into() - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action137< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, rest, _): (TextSize, ast::Identifier, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - { - ast::PatternMatchMapping { - keys: vec![], - patterns: vec![], - rest: Some(rest), - range: (location..end_location).into() - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action138< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, rest, _): (TextSize, ast::Identifier, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - { - let (keys, patterns) = e - .into_iter() - .unzip(); - ast::PatternMatchMapping { - keys, - patterns, - rest: Some(rest), - range: (location..end_location).into() - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action139< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, attr, _): (TextSize, ast::Identifier, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, pattern, _): (TextSize, ast::Pattern, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::PatternKeyword -{ - ast::PatternKeyword { - attr, - pattern, - range: (location..end_location).into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action140< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, cls, _): (TextSize, ast::Expr, TextSize), - (_, arguments, _): (TextSize, ast::PatternArguments, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - { - ast::PatternMatchClass { - cls: Box::new(cls), - arguments, - range: (location..end_location).into() - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action141< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, cls, _): (TextSize, ast::Expr, TextSize), - (_, arguments, _): (TextSize, ast::PatternArguments, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - { - ast::PatternMatchClass { - cls: Box::new(cls), - arguments, - range: (location..end_location).into() - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action142< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, patterns, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, keywords, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - { - ast::PatternArguments { - patterns, - keywords, - range: (location..end_location).into() - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action143< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, patterns, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - { - ast::PatternArguments { - patterns, - keywords: vec![], - range: (location..end_location).into() - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action144< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, keywords, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - { - ast::PatternArguments { - patterns: vec![], - keywords, - range: (location..end_location).into() - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action145< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - { - ast::PatternArguments { - patterns: vec![], - keywords: vec![], - range: (location..end_location).into() - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action146< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, test, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), - (_, s2, _): (TextSize, alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)>, TextSize), - (_, s3, _): (TextSize, core::option::Option<(TextSize, ast::Suite)>, TextSize), -) -> ast::Stmt -{ - { - let elif_else_clauses: Vec<_> = s2.into_iter().map(|(start, test, body)| ast::ElifElseClause { - range: (start..body.last().unwrap().end()).into(), - test: Some(test.into()), - body, - }).chain(s3.into_iter().map(|(start, body)| ast::ElifElseClause { - range: (start..body.last().unwrap().end()).into(), - test: None, - body, - })).collect(); - - let end_location = elif_else_clauses - .last() - .map_or_else(|| body.last().unwrap().end(), Ranged::end); - - ast::Stmt::If( - ast::StmtIf { test: Box::new(test.into()), body, elif_else_clauses, range: (location..end_location).into() } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action147< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, test, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), - (_, s2, _): (TextSize, core::option::Option, TextSize), -) -> ast::Stmt -{ - { - let orelse = s2.unwrap_or_default(); - let end_location = orelse - .last() - .or_else(|| body.last()) - .unwrap() - .end(); - ast::Stmt::While( - ast::StmtWhile { - test: Box::new(test.into()), - body, - orelse, - range: (location..end_location).into() - }, - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action148< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, is_async, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, target, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, iter, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), - (_, orelse, _): (TextSize, core::option::Option, TextSize), -) -> ast::Stmt -{ - { - let orelse = orelse.unwrap_or_default(); - let end_location = orelse - .last() - .or_else(|| body.last()) - .unwrap() - .end(); - let target = Box::new(set_context(target.into(), ast::ExprContext::Store)); - let iter = Box::new(iter.into()); - ast::Stmt::For(ast::StmtFor { target, iter, body, orelse, is_async: is_async.is_some(), range: (location..end_location).into() }) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action149< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), - (_, handlers, _): (TextSize, alloc::vec::Vec, TextSize), - (_, orelse, _): (TextSize, core::option::Option, TextSize), - (_, finalbody, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - let orelse = orelse.unwrap_or_default(); - let finalbody = finalbody.unwrap_or_default(); - let end_location = finalbody - .last() - .map(Ranged::end) - .or_else(|| orelse.last().map(Ranged::end)) - .or_else(|| handlers.last().map(Ranged::end)) - .unwrap(); - ast::Stmt::Try( - ast::StmtTry { - body, - handlers, - orelse, - finalbody, - is_star: false, - range: (location..end_location).into() - }, - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action150< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), - (_, handlers, _): (TextSize, alloc::vec::Vec, TextSize), - (_, orelse, _): (TextSize, core::option::Option, TextSize), - (_, finalbody, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - let orelse = orelse.unwrap_or_default(); - let finalbody = finalbody.unwrap_or_default(); - let end_location = finalbody - .last() - .or_else(|| orelse.last()) - .map(Ranged::end) - .or_else(|| handlers.last().map(Ranged::end)) - .unwrap(); - ast::Stmt::Try( - ast::StmtTry { - body, - handlers, - orelse, - finalbody, - is_star: true, - range: (location..end_location).into() - }, - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action151< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), - (_, finalbody, _): (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - { - let handlers = vec![]; - let orelse = vec![]; - let end_location = finalbody.last().unwrap().end(); - ast::Stmt::Try( - ast::StmtTry { - body, - handlers, - orelse, - finalbody, - is_star: false, - range: (location..end_location).into() - }, - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action152< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, typ, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), -) -> ast::ExceptHandler -{ - { - let end_location = body.last().unwrap().end(); - ast::ExceptHandler::ExceptHandler( - ast::ExceptHandlerExceptHandler { - type_: Some(Box::new(typ.into())), - name: None, - body, - range: (location..end_location).into() - }, - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action153< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, x, _): (TextSize, (crate::parser::ParenthesizedExpr, ast::Identifier), TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), -) -> ast::ExceptHandler -{ - { - let end_location = body.last().unwrap().end(); - ast::ExceptHandler::ExceptHandler( - ast::ExceptHandlerExceptHandler { - type_: Some(Box::new(x.0.into())), - name: Some(x.1), - body, - range: (location..end_location).into() - }, - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action154< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, typ, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), -) -> ast::ExceptHandler -{ - { - let end_location = body.last().unwrap().end(); - ast::ExceptHandler::ExceptHandler( - ast::ExceptHandlerExceptHandler { - type_: typ.map(ast::Expr::from).map(Box::new), - name: None, - body, - range: (location..end_location).into() - }, - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action155< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, x, _): (TextSize, (crate::parser::ParenthesizedExpr, ast::Identifier), TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), -) -> ast::ExceptHandler -{ - { - let end_location = body.last().unwrap().end(); - ast::ExceptHandler::ExceptHandler( - ast::ExceptHandlerExceptHandler { - type_: Some(Box::new(x.0.into())), - name: Some(x.1), - body, - range: (location..end_location).into() - }, - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action156< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, is_async, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, items, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - { - let end_location = body.last().unwrap().end(); - ast::StmtWith { items, body, is_async: is_async.is_some(), range: (location..end_location).into() }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action157< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> Vec -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action158< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, left, _): (TextSize, core::option::Option>, TextSize), - (_, mid, _): (TextSize, ast::WithItem, TextSize), - (_, right, _): (TextSize, alloc::vec::Vec, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> Vec -{ - { - left.into_iter().flatten().chain([mid]).chain(right).collect() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action159< ->( - source_code: &str, - mode: Mode, - (_, item, _): (TextSize, ast::WithItem, TextSize), -) -> Vec -{ - { - // Special-case: if the `WithItem` is a parenthesized named expression, then the item - // should _exclude_ the outer parentheses in its range. For example: - // ```python - // with (a := 0): pass - // ``` - // In this case, the `(` and `)` are part of the `with` statement. - // The same applies to `yield` and `yield from`. - let item = if item.optional_vars.is_none() && matches!(item.context_expr, ast::Expr::Named(_) | ast::Expr::Yield(_) | ast::Expr::YieldFrom(_)) { - ast::WithItem { - range: item.range().add_start(TextSize::new(1)).sub_end(TextSize::new(1)), - context_expr: item.context_expr, - optional_vars: item.optional_vars, - } - } else { - item - }; - vec![item] - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action160< ->( - source_code: &str, - mode: Mode, - (_, item, _): (TextSize, ast::WithItem, TextSize), - (_, items, _): (TextSize, alloc::vec::Vec, TextSize), -) -> Vec -{ - { - [item].into_iter().chain(items).collect() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action161< ->( - source_code: &str, - mode: Mode, - (_, all, _): (TextSize, Vec, TextSize), -) -> Vec -{ - { - all.into_iter().map(|context_expr| ast::WithItem { - range: context_expr.range(), - context_expr: context_expr.into(), - optional_vars: None, - }).collect() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action162< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, context_expr, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, optional_vars, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::WithItem -{ - { - let optional_vars = Some(Box::new(set_context(optional_vars.into(), ast::ExprContext::Store))); - ast::WithItem { - context_expr: context_expr.into(), - optional_vars, - range: (location..end_location).into(), - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action163< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, decorator_list, _): (TextSize, alloc::vec::Vec, TextSize), - (_, is_async, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, type_params, _): (TextSize, core::option::Option, TextSize), - (_, parameters, _): (TextSize, ast::Parameters, TextSize), - (_, returns, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - { - let parameters = Box::new(parameters); - let returns = returns.map(ast::Expr::from).map(Box::new); - let end_location = body.last().unwrap().end(); - ast::StmtFunctionDef { - name, - parameters, - body, - decorator_list, - returns, - type_params, - is_async: is_async.is_some(), - range: (location..end_location).into(), - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action164< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - ast::ExprName { - id: name.into(), - ctx: ast::ExprContext::Store, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action165< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, name, _): (TextSize, ast::Expr, TextSize), - (_, type_params, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - { - ast::Stmt::TypeAlias( - ast::StmtTypeAlias { - name: Box::new(name), - value: Box::new(value.into()), - type_params, - range: (location..end_location).into() - }, - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action166< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, a, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - a.as_ref().map(validate_arguments).transpose()?; - - let range = (location..end_location).into(); - let args = a - .map_or_else(|| ast::Parameters::empty(range), |mut arguments| { - arguments.range = range; - arguments - }); - - Ok(args) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action167< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::ParameterWithDefault -{ - { - let parameter = ast::Parameter { name, annotation: None, range: (location..end_location).into() }; - ast::ParameterWithDefault { parameter, default: None, range: (location..end_location).into() } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action168< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, arg, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Parameter -{ - ast::Parameter { name:arg, annotation: None, range: (location..end_location).into() } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action169< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, arg, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Parameter -{ - ast::Parameter { name:arg, annotation: None, range: (location..end_location).into() } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action170< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, annotation, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::ParameterWithDefault -{ - { - let annotation = annotation.map(ast::Expr::from).map(Box::new); - let parameter = ast::Parameter { name, annotation, range: (location..end_location).into() }; - ast::ParameterWithDefault { parameter, default: None, range: (location..end_location).into() } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action171< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, annotation, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Parameter -{ - { - let annotation = annotation.map(ast::Expr::from).map(Box::new); - ast::Parameter { name, annotation, range: (location..end_location).into() } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action172< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, annotation, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Parameter -{ - { - let annotation = annotation.map(ast::Expr::from).map(Box::new); - ast::Parameter { name, annotation, range: (location..end_location).into() } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action173< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, decorator_list, _): (TextSize, alloc::vec::Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, type_params, _): (TextSize, core::option::Option, TextSize), - (_, arguments, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, body, _): (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - { - let end_location = body.last().unwrap().end(); - ast::Stmt::ClassDef( - ast::StmtClassDef { - name, - arguments: arguments.map(Box::new), - body, - decorator_list, - type_params: type_params.map(Box::new), - range: (location..end_location).into() - }, - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action174< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, vars, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::TypeParams -{ - { - ast::TypeParams { - type_params: vars, - range: (location..end_location).into() - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action175< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, bound, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::TypeParam -{ - { - ast::TypeParam::TypeVar( - ast::TypeParamTypeVar { name, bound: bound.map(ast::Expr::from).map(Box::new), range: (location..end_location).into() } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action176< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::TypeParam -{ - { - ast::TypeParam::TypeVarTuple( - ast::TypeParamTypeVarTuple { name, range: (location..end_location).into() } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action177< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::TypeParam -{ - { - ast::TypeParam::ParamSpec( - ast::TypeParamParamSpec { name, range: (location..end_location).into() } - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action178< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, expression, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> ast::Decorator -{ - { - ast::Decorator { range: (location..end_location).into(), expression: expression.into() } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action179< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, value, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprYield { - value: value.map(ast::Expr::from).map(Box::new), - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action180< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprYieldFrom { - value: Box::new(value.into()), - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action181< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action182< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action183< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, id, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprName { - id: id.into(), - ctx: ast::ExprContext::Store, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action184< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, target, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - ast::ExprNamed { - target: Box::new(target.into()), - value: Box::new(value.into()), - range: (location..end_location).into(), - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action185< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, location_args, _): (TextSize, TextSize, TextSize), - (_, parameters, _): (TextSize, core::option::Option, TextSize), - (_, end_location_args, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, fstring_middle, _): (TextSize, core::option::Option<(Box, AnyStringKind)>, TextSize), - (_, body, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - if fstring_middle.is_some() { - return Err(LexicalError::new( - LexicalErrorType::FStringError(FStringErrorType::LambdaWithoutParentheses), - location, - ))?; - } - parameters.as_ref().map(validate_arguments).transpose()?; - - Ok(ast::ExprLambda { - parameters: parameters.map(Box::new), - body: Box::new(body.into()), - range: (location..end_location).into() - }.into()) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action186< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::CmpOp -{ - ast::CmpOp::Eq -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action187< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::CmpOp -{ - ast::CmpOp::NotEq -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action188< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::CmpOp -{ - ast::CmpOp::Lt -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action189< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::CmpOp -{ - ast::CmpOp::LtE -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action190< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::CmpOp -{ - ast::CmpOp::Gt -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action191< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::CmpOp -{ - ast::CmpOp::GtE -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action192< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::CmpOp -{ - ast::CmpOp::In -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action193< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), - (_, __1, _): (TextSize, token::Tok, TextSize), -) -> ast::CmpOp -{ - ast::CmpOp::NotIn -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action194< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::CmpOp -{ - ast::CmpOp::Is -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action195< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), - (_, __1, _): (TextSize, token::Tok, TextSize), -) -> ast::CmpOp -{ - ast::CmpOp::IsNot -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action196< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::LShift -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action197< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::RShift -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action198< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::Add -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action199< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::Sub -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action200< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::Mult -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action201< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::Div -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action202< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::FloorDiv -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action203< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::Mod -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action204< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::Operator -{ - ast::Operator::MatMult -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action205< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::UnaryOp -{ - ast::UnaryOp::UAdd -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action206< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::UnaryOp -{ - ast::UnaryOp::USub -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action207< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> ast::UnaryOp -{ - ast::UnaryOp::Invert -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action208< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action209< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, s1, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - ast::ExprTuple { - elts: vec![s1.into()], - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: false - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action210< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, elts, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let elts = elts.into_iter().map(ast::Expr::from).collect(); - ast::ExprTuple { - elts, - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: false - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action211< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action212< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, lower, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, upper, _): (TextSize, core::option::Option, TextSize), - (_, step, _): (TextSize, core::option::Option>, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let lower = lower.map(ast::Expr::from).map(Box::new); - let upper = upper.map(ast::Expr::from).map(Box::new); - let step = step.flatten().map(ast::Expr::from).map(Box::new); - ast::Expr::Slice( - ast::ExprSlice { lower, upper, step, range: (location..end_location).into() } - ).into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action213< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, core::option::Option, TextSize), -) -> Option -{ - e -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action214< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, string, _): (TextSize, StringType, TextSize), -) -> ast::Expr -{ - string.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action215< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, strings, _): (TextSize, Vec, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - Ok(concatenated_strings(strings, (location..end_location).into())?) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action216< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, StringType, TextSize), -) -> StringType -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action217< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, StringType, TextSize), -) -> StringType -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action218< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, string, _): (TextSize, (Box, AnyStringKind), TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - let (source, kind) = string; - Ok(parse_string_literal(source, kind, (location..end_location).into())?) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action219< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, start, _): (TextSize, AnyStringKind, TextSize), - (_, elements, _): (TextSize, alloc::vec::Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> StringType -{ - { - StringType::FString(ast::FString { - elements, - range: (location..end_location).into(), - flags: start.into() - }) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action220< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::FStringElement, TextSize), -) -> ast::FStringElement -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action221< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, fstring_middle, _): (TextSize, (Box, AnyStringKind), TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - let (source, kind) = fstring_middle; - Ok(parse_fstring_literal_element(source, kind, (location..end_location).into())?) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action222< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, debug, _): (TextSize, core::option::Option, TextSize), - (_, conversion, _): (TextSize, core::option::Option<(TextSize, ast::ConversionFlag)>, TextSize), - (_, format_spec, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - if value.expr.is_lambda_expr() && !value.is_parenthesized() { - return Err(LexicalError::new( - LexicalErrorType::FStringError(FStringErrorType::LambdaWithoutParentheses), - value.start(), - ))?; - } - let debug_text = debug.map(|_| { - let start_offset = location + "{".text_len(); - let end_offset = if let Some((conversion_start, _)) = conversion { - conversion_start - } else { - format_spec.as_ref().map_or_else( - || end_location - "}".text_len(), - |spec| spec.start() - ":".text_len(), - ) - }; - ast::DebugText { - leading: source_code[TextRange::new(start_offset, value.expr.start())].to_string(), - trailing: source_code[TextRange::new(value.expr.end(), end_offset)].to_string(), - } - }); - Ok( - ast::FStringElement::Expression(ast::FStringExpressionElement { - expression: Box::new(value.into()), - debug_text, - conversion: conversion.map_or(ast::ConversionFlag::None, |(_, conversion_flag)| { - conversion_flag - }), - format_spec: format_spec.map(Box::new), - range: (location..end_location).into(), - }) - ) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action223< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, format_spec, _): (TextSize, ast::FStringFormatSpec, TextSize), -) -> ast::FStringFormatSpec -{ - format_spec -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action224< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, elements, _): (TextSize, alloc::vec::Vec, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::FStringFormatSpec -{ - ast::FStringFormatSpec { - elements, - range: (location..end_location).into(), - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action225< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, name_location, _): (TextSize, TextSize, TextSize), - (_, s, _): (TextSize, Box, TextSize), -) -> Result<(TextSize, ast::ConversionFlag),__lalrpop_util::ParseError> -{ - { - let conversion = match s.as_ref() { - "s" => ast::ConversionFlag::Str, - "r" => ast::ConversionFlag::Repr, - "a" => ast::ConversionFlag::Ascii, - _ => Err(LexicalError::new( - LexicalErrorType::FStringError(FStringErrorType::InvalidConversionFlag), - name_location, - ))? - }; - Ok((location, conversion)) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action226< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), -) -> Vec -{ - e -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action227< ->( - source_code: &str, - mode: Mode, - (_, elements, _): (TextSize, Vec<(Option>, crate::parser::ParenthesizedExpr)>, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), -) -> Vec<(Option>, crate::parser::ParenthesizedExpr)> -{ - elements -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action228< ->( - source_code: &str, - mode: Mode, - (_, e1, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e2, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> (crate::parser::ParenthesizedExpr, crate::parser::ParenthesizedExpr) -{ - (e1, e2) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action229< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, (crate::parser::ParenthesizedExpr, crate::parser::ParenthesizedExpr), TextSize), -) -> (Option>, crate::parser::ParenthesizedExpr) -{ - (Some(Box::new(e.0)), e.1) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action230< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> (Option>, crate::parser::ParenthesizedExpr) -{ - (None, e) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action231< ->( - source_code: &str, - mode: Mode, - (_, e1, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), -) -> Vec -{ - e1 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action232< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action233< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action234< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action235< ->( - source_code: &str, - mode: Mode, - (_, elements, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), -) -> Vec -{ - elements -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action236< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action237< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprStarred { - value: Box::new(value.into()), - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action238< ->( - source_code: &str, - mode: Mode, - (_, c, _): (TextSize, alloc::vec::Vec, TextSize), -) -> Vec -{ - c -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action239< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, is_async, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, target, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, iter, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, ifs, _): (TextSize, alloc::vec::Vec, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Comprehension -{ - { - let is_async = is_async.is_some(); - let ifs = ifs.into_iter().map(ast::Expr::from).collect(); - ast::Comprehension { - target: set_context(target.into(), ast::ExprContext::Store), - iter: iter.into(), - ifs, - is_async, - range: (location..end_location).into() - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action240< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action241< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, c, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - c -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action242< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - let ArgumentList { args, keywords } = parse_arguments(e)?; - Ok(ast::Arguments { - args: args.into_boxed_slice(), - keywords: keywords.into_boxed_slice(), - range: (location..end_location).into() - }) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action243< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, elt, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, generators, _): (TextSize, core::option::Option>, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - { - let expr = match generators { - Some(generators) => ast::Expr::Generator( - ast::ExprGenerator { - elt: Box::new(elt.into()), - generators, - range: (location..end_location).into(), - parenthesized: false - } - ), - None => elt.into(), - }; - (None, expr) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action244< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, i, _): (TextSize, ast::Identifier, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - (Some((location, end_location, Some(i))), e.into()) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action245< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - { - let expr = ast::Expr::Starred(ast::ExprStarred { - value: Box::new(value.into()), ctx: ast::ExprContext::Load, range: (location..end_location).into(), - }); - (None, expr) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action246< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - (Some((location, end_location, None)), e.into()) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action247< ->( - source_code: &str, - mode: Mode, - (_, value, _): (TextSize, Int, TextSize), -) -> ast::Number -{ - ast::Number::Int(value) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action248< ->( - source_code: &str, - mode: Mode, - (_, value, _): (TextSize, f64, TextSize), -) -> ast::Number -{ - ast::Number::Float(value) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action249< ->( - source_code: &str, - mode: Mode, - (_, s, _): (TextSize, (f64, f64), TextSize), -) -> ast::Number -{ - ast::Number::Complex { real: s.0, imag: s.1 } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action250< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, s, _): (TextSize, Box, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Identifier -{ - ast::Identifier::new(s, (location..end_location).into()) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action251< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, Vec, TextSize), -) -> core::option::Option> -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action252< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option> -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action253< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), - (_, last, _): (TextSize, core::option::Option<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), -) -> Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - { - if let Some(element) = last { - v.push(element); - } - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action254< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action255< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), -) -> alloc::vec::Vec -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action256< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, values, _): (TextSize, alloc::vec::Vec, TextSize), - (_, last, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let values = values.into_iter().chain(std::iter::once(last)).map(ast::Expr::from).collect(); - ast::ExprBoolOp { op: ast::BoolOp::Or, values, range: (location..end_location).into() }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action257< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action258< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Comprehension, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action259< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, ast::Comprehension, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action260< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, elts, _): (TextSize, Vec, TextSize), - (_, trailing_comma, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - if elts.len() == 1 && trailing_comma.is_none() { - crate::parser::ParenthesizedExpr { - expr: elts.into_iter().next().unwrap().into(), - range: (location..end_location).into(), - } - } else { - let elts = elts.into_iter().map(ast::Expr::from).collect(); - ast::ExprTuple { - elts, - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: false - }.into() - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action261< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Vec -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action262< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action263< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, elts, _): (TextSize, Vec, TextSize), - (_, trailing_comma, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - if elts.len() == 1 && trailing_comma.is_none() { - crate::parser::ParenthesizedExpr { - expr: elts.into_iter().next().unwrap().into(), - range: (location..end_location).into(), - } - } else { - let elts = elts.into_iter().map(ast::Expr::from).collect(); - ast::ExprTuple { - elts, - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: false - }.into() - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action264< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, (Option>, crate::parser::ParenthesizedExpr), TextSize), -) -> Vec<(Option>, crate::parser::ParenthesizedExpr)> -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action265< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec<(Option>, crate::parser::ParenthesizedExpr)>, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, (Option>, crate::parser::ParenthesizedExpr), TextSize), -) -> Vec<(Option>, crate::parser::ParenthesizedExpr)> -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action266< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Vec -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action267< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action268< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::FStringFormatSpec, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action269< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action270< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, (TextSize, ast::ConversionFlag), TextSize), -) -> core::option::Option<(TextSize, ast::ConversionFlag)> -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action271< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option<(TextSize, ast::ConversionFlag)> -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action272< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action273< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action274< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action275< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), -) -> alloc::vec::Vec -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action276< ->( - source_code: &str, - mode: Mode, - (_, e1, _): (TextSize, StringType, TextSize), - (_, e2, _): (TextSize, StringType, TextSize), -) -> Vec -{ - vec![e1, e2] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action277< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, e, _): (TextSize, StringType, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action278< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, Option, TextSize), -) -> core::option::Option> -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action279< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option> -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action280< ->( - source_code: &str, - mode: Mode, - (_, e1, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e2, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Vec -{ - vec![e1, e2] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action281< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action282< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, (Box, AnyStringKind), TextSize), -) -> core::option::Option<(Box, AnyStringKind)> -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action283< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option<(Box, AnyStringKind)> -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action284< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Parameters, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action285< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action286< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, param1, _): (TextSize, (Vec, Vec), TextSize), - (_, args2, _): (TextSize, core::option::Option<(Option>, Vec, Option>)>, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - validate_pos_params(¶m1)?; - let (posonlyargs, args) = param1; - - // Now gather rest of parameters: - let (vararg, kwonlyargs, kwarg) = args2.unwrap_or((None, vec![], None)); - - Ok(ast::Parameters { - posonlyargs, - args, - kwonlyargs, - vararg, - kwarg, - range: (location..end_location).into() - }) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action287< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, params, _): (TextSize, (Option>, Vec, Option>), TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Parameters -{ - { - let (vararg, kwonlyargs, kwarg) = params; - ast::Parameters { - posonlyargs: vec![], - args: vec![], - kwonlyargs, - vararg, - kwarg, - range: (location..end_location).into() - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action288< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, ast::TypeParam, TextSize), -) -> Vec -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action289< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, ast::TypeParam, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action290< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Arguments, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action291< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action292< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action293< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action294< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action295< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action296< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action297< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action298< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Parameters, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action299< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action300< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Parameters, TextSize), -) -> ast::Parameters -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action301< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, param1, _): (TextSize, (Vec, Vec), TextSize), - (_, args2, _): (TextSize, core::option::Option<(Option>, Vec, Option>)>, TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - validate_pos_params(¶m1)?; - let (posonlyargs, args) = param1; - - // Now gather rest of parameters: - let (vararg, kwonlyargs, kwarg) = args2.unwrap_or((None, vec![], None)); - - Ok(ast::Parameters { - posonlyargs, - args, - kwonlyargs, - vararg, - kwarg, - range: (location..end_location).into() - }) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action302< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, params, _): (TextSize, (Option>, Vec, Option>), TextSize), - (_, _, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Parameters -{ - { - let (vararg, kwonlyargs, kwarg) = params; - ast::Parameters { - posonlyargs: vec![], - args: vec![], - kwonlyargs, - vararg, - kwarg, - range: (location..end_location).into() - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action303< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action304< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action305< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action306< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::TypeParams, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action307< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action308< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action309< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), -) -> alloc::vec::Vec -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action310< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Vec -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action311< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action312< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::WithItem, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action313< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, ast::WithItem, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action314< ->( - source_code: &str, - mode: Mode, - (_, context_expr, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::WithItem -{ - { - ast::WithItem { - range: context_expr.range(), - context_expr: context_expr.into(), - optional_vars: None, - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action315< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::WithItem, TextSize), -) -> ast::WithItem -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action316< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action317< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), -) -> alloc::vec::Vec -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action318< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, ast::WithItem, TextSize), -) -> ast::WithItem -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action319< ->( - source_code: &str, - mode: Mode, - (_, context_expr, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::WithItem -{ - { - ast::WithItem { - range: context_expr.range(), - context_expr: context_expr.into(), - optional_vars: None, - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action320< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::WithItem, TextSize), -) -> ast::WithItem -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action321< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, Vec, TextSize), -) -> core::option::Option> -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action322< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option> -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action323< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> Vec -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action324< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action325< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action326< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __1, _): (TextSize, ast::Identifier, TextSize), -) -> (crate::parser::ParenthesizedExpr, ast::Identifier) -{ - (__0, __1) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action327< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::ExceptHandler, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action328< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, ast::ExceptHandler, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action329< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Suite, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action330< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action331< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, ast::Suite, TextSize), -) -> ast::Suite -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action332< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::ExceptHandler, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action333< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, ast::ExceptHandler, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action334< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action335< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action336< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Suite, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action337< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action338< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, ast::Suite, TextSize), -) -> ast::Suite -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action339< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, (TextSize, ast::Suite), TextSize), -) -> core::option::Option<(TextSize, ast::Suite)> -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action340< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option<(TextSize, ast::Suite)> -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action341< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __1, _): (TextSize, ast::Suite, TextSize), -) -> (TextSize, ast::Suite) -{ - (__0, __1) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action342< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)> -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action343< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)>, TextSize), -) -> alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)> -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action344< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __1, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __2, _): (TextSize, ast::Suite, TextSize), -) -> (TextSize, crate::parser::ParenthesizedExpr, ast::Suite) -{ - (__0, __1, __2) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action345< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, ast::PatternKeyword, TextSize), -) -> Vec -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action346< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, ast::PatternKeyword, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action347< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, ast::Pattern, TextSize), -) -> Vec -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action348< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, ast::Pattern, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action349< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, (ast::Expr, ast::Pattern), TextSize), -) -> Vec<(ast::Expr, ast::Pattern)> -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action350< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, (ast::Expr, ast::Pattern), TextSize), -) -> Vec<(ast::Expr, ast::Pattern)> -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action351< ->( - source_code: &str, - mode: Mode, - (_, e1, _): (TextSize, StringType, TextSize), - (_, e2, _): (TextSize, StringType, TextSize), -) -> Vec -{ - vec![e1, e2] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action352< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, e, _): (TextSize, StringType, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action353< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, last, _): (TextSize, core::option::Option, TextSize), -) -> Vec -{ - { - if let Some(element) = last { - v.push(element); - } - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action354< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Pattern, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action355< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, ast::Pattern, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action356< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Pattern, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action357< ->( - source_code: &str, - mode: Mode, - (_, e1, _): (TextSize, ast::Pattern, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e2, _): (TextSize, ast::Pattern, TextSize), -) -> Vec -{ - vec![e1, e2] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action358< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, ast::Pattern, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action359< ->( - source_code: &str, - mode: Mode, - (_, e1, _): (TextSize, ast::Pattern, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e2, _): (TextSize, ast::Pattern, TextSize), -) -> Vec -{ - vec![e1, e2] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action360< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, ast::Pattern, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action361< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Expr, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action362< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action363< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Expr, TextSize), -) -> ast::Expr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action364< ->( - source_code: &str, - mode: Mode, - (_, e1, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e2, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Vec -{ - vec![e1, e2] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action365< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action366< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::MatchCase, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action367< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, ast::MatchCase, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action368< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action369< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action370< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> token::Tok -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action371< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op: ast::Operator::BitOr, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action372< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action373< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action374< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action375< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action376< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, ast::Identifier, TextSize), -) -> Vec -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action377< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, ast::Identifier, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action378< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, (token::Tok, ast::Identifier), TextSize), -) -> alloc::vec::Vec<(token::Tok, ast::Identifier)> -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action379< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec<(token::Tok, ast::Identifier)>, TextSize), - (_, e, _): (TextSize, (token::Tok, ast::Identifier), TextSize), -) -> alloc::vec::Vec<(token::Tok, ast::Identifier)> -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action380< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), - (_, __1, _): (TextSize, ast::Identifier, TextSize), -) -> (token::Tok, ast::Identifier) -{ - (__0, __1) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action381< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action382< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action383< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, ast::Alias, TextSize), -) -> Vec -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action384< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, ast::Alias, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action385< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, a, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Alias -{ - ast::Alias { name, asname: a, range: (location..end_location).into() } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action386< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, u32, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action387< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, u32, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action388< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action389< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), -) -> alloc::vec::Vec -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action390< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, ast::Alias, TextSize), -) -> Vec -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action391< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, ast::Alias, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action392< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, name, _): (TextSize, ast::Identifier, TextSize), - (_, a, _): (TextSize, core::option::Option, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::Alias -{ - ast::Alias { name, asname: a, range: (location..end_location).into() } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action393< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action394< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action395< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action396< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action397< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action398< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action399< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action400< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, body, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, test, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, orelse, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprIf { - test: Box::new(test.into()), - body: Box::new(body.into()), - orelse: Box::new(orelse.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action401< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action402< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action403< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action404< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), -) -> alloc::vec::Vec -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action405< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action406< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action407< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action408< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), -) -> alloc::vec::Vec -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action409< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action410< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action411< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), -) -> alloc::vec::Vec -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action412< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> token::Tok -{ - __0 -} - -#[allow(unused_variables)] -fn __action413< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> TextSize -{ - *__lookbehind -} - -#[allow(unused_variables)] -fn __action414< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> TextSize -{ - *__lookahead -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action415< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action416< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action417< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Stmt, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action418< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, ast::Stmt, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action419< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action420< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action421< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Identifier, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action422< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action423< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, ast::Identifier, TextSize), -) -> ast::Identifier -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action424< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op: ast::Operator::BitXor, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action425< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action426< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Pattern, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action427< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action428< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action429< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), -) -> alloc::vec::Vec -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action430< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, (TextSize, crate::parser::ParenthesizedExpr, ast::Suite), TextSize), -) -> alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)> -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action431< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)>, TextSize), - (_, e, _): (TextSize, (TextSize, crate::parser::ParenthesizedExpr, ast::Suite), TextSize), -) -> alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)> -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action432< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, body, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, test, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, orelse, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprIf { - test: Box::new(test.into()), - body: Box::new(body.into()), - orelse: Box::new(orelse.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action433< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action434< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action435< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Decorator, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action436< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, ast::Decorator, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action437< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, (Option>, Vec, Option>), TextSize), -) -> core::option::Option<(Option>, Vec, Option>)> -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action438< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option<(Option>, Vec, Option>)> -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action439< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, (Option>, Vec, Option>), TextSize), -) -> (Option>, Vec, Option>) -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action440< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, va, _): (TextSize, ast::Parameter, TextSize), - (_, kwonlyargs, _): (TextSize, alloc::vec::Vec, TextSize), - (_, kwarg, _): (TextSize, core::option::Option, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - { - let kwarg = kwarg.map(Box::new); - let va = Some(Box::new(va)); - - Ok((va, kwonlyargs, kwarg)) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action441< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, kwonlyargs, _): (TextSize, alloc::vec::Vec, TextSize), - (_, kwarg, _): (TextSize, core::option::Option, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - { - if kwonlyargs.is_empty() { - return Err(LexicalError::new( - LexicalErrorType::OtherError("named arguments must follow bare *".to_string().into_boxed_str()), - location, - ))?; - } - - let kwarg = kwarg.map(Box::new); - - Ok((None, kwonlyargs, kwarg)) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action442< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, kwarg, _): (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - { - let kwarg = Some(Box::new(kwarg)); - - Ok((None, vec![], kwarg)) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action443< ->( - source_code: &str, - mode: Mode, - (_, args, _): (TextSize, Vec, TextSize), -) -> (Vec, Vec) -{ - { - (vec![], args) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action444< ->( - source_code: &str, - mode: Mode, - (_, posonlyargs, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, args, _): (TextSize, alloc::vec::Vec, TextSize), -) -> (Vec, Vec) -{ - { - (posonlyargs, args) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action445< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, (Option>, Vec, Option>), TextSize), -) -> core::option::Option<(Option>, Vec, Option>)> -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action446< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option<(Option>, Vec, Option>)> -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action447< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, (Option>, Vec, Option>), TextSize), -) -> (Option>, Vec, Option>) -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action448< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, va, _): (TextSize, ast::Parameter, TextSize), - (_, kwonlyargs, _): (TextSize, alloc::vec::Vec, TextSize), - (_, kwarg, _): (TextSize, core::option::Option, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - { - let kwarg = kwarg.map(Box::new); - let va = Some(Box::new(va)); - - Ok((va, kwonlyargs, kwarg)) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action449< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, kwonlyargs, _): (TextSize, alloc::vec::Vec, TextSize), - (_, kwarg, _): (TextSize, core::option::Option, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - { - if kwonlyargs.is_empty() { - return Err(LexicalError::new( - LexicalErrorType::OtherError("named arguments must follow bare *".to_string().into_boxed_str()), - location, - ))?; - } - - let kwarg = kwarg.map(Box::new); - - Ok((None, kwonlyargs, kwarg)) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action450< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, kwarg, _): (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - { - let kwarg = Some(Box::new(kwarg)); - - Ok((None, vec![], kwarg)) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action451< ->( - source_code: &str, - mode: Mode, - (_, args, _): (TextSize, Vec, TextSize), -) -> (Vec, Vec) -{ - { - (vec![], args) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action452< ->( - source_code: &str, - mode: Mode, - (_, posonlyargs, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, args, _): (TextSize, alloc::vec::Vec, TextSize), -) -> (Vec, Vec) -{ - { - (posonlyargs, args) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action453< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::FStringElement, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action454< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, ast::FStringElement, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action455< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Vec -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action456< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action457< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action458< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action459< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action460< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, values, _): (TextSize, alloc::vec::Vec, TextSize), - (_, last, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let values = values.into_iter().chain(std::iter::once(last)).map(ast::Expr::from).collect(); - ast::ExprBoolOp { op: ast::BoolOp::And, values, range: (location..end_location).into() }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action461< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action462< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action463< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action464< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, (Option<(TextSize, TextSize, Option)>, ast::Expr), TextSize), -) -> core::option::Option<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action465< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action466< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action467< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), -) -> alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action468< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, (Option<(TextSize, TextSize, Option)>, ast::Expr), TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action469< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, (Option<(TextSize, TextSize, Option)>, ast::Expr), TextSize), -) -> alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action470< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), - (_, e, _): (TextSize, (Option<(TextSize, TextSize, Option)>, ast::Expr), TextSize), -) -> alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action471< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action472< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action473< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action474< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, operand, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprUnaryOp { - operand: Box::new(operand.into()), - op: ast::UnaryOp::Not, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action475< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action476< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, ast::ParameterWithDefault, TextSize), -) -> Vec -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action477< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, ast::ParameterWithDefault, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action478< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Parameter, TextSize), -) -> ast::Parameter -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action479< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Parameter, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action480< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action481< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, ast::Parameter, TextSize), -) -> ast::Parameter -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action482< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action483< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), -) -> alloc::vec::Vec -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action484< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, ast::ParameterWithDefault, TextSize), -) -> ast::ParameterWithDefault -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action485< ->( - source_code: &str, - mode: Mode, - (_, i, _): (TextSize, ast::ParameterWithDefault, TextSize), -) -> ast::ParameterWithDefault -{ - i -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action486< ->( - source_code: &str, - mode: Mode, - (_, mut i, _): (TextSize, ast::ParameterWithDefault, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, default, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::ParameterWithDefault -{ - { - i.default = Some(Box::new(default.into())); - i.range = (i.range.start()..end_location).into(); - i - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action487< ->( - source_code: &str, - mode: Mode, - (_, e, _): (TextSize, ast::ParameterWithDefault, TextSize), -) -> Vec -{ - vec![e] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action488< ->( - source_code: &str, - mode: Mode, - (_, mut v, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, ast::ParameterWithDefault, TextSize), -) -> Vec -{ - { - v.push(e); - v - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action489< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Parameter, TextSize), -) -> ast::Parameter -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action490< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::Parameter, TextSize), -) -> core::option::Option -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action491< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action492< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, ast::Parameter, TextSize), -) -> ast::Parameter -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action493< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action494< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), -) -> alloc::vec::Vec -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action495< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, ast::ParameterWithDefault, TextSize), -) -> ast::ParameterWithDefault -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action496< ->( - source_code: &str, - mode: Mode, - (_, i, _): (TextSize, ast::ParameterWithDefault, TextSize), -) -> ast::ParameterWithDefault -{ - i -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action497< ->( - source_code: &str, - mode: Mode, - (_, mut i, _): (TextSize, ast::ParameterWithDefault, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, default, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> ast::ParameterWithDefault -{ - { - i.default = Some(Box::new(default.into())); - i.range = (i.range.start()..end_location).into(); - i - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action498< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, values, _): (TextSize, alloc::vec::Vec, TextSize), - (_, last, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let values = values.into_iter().chain(std::iter::once(last)).map(ast::Expr::from).collect(); - ast::ExprBoolOp { op: ast::BoolOp::Or, values, range: (location..end_location).into() }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action499< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action500< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op: ast::Operator::BitAnd, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action501< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action502< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, op, _): (TextSize, ast::Operator, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action503< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action504< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, values, _): (TextSize, alloc::vec::Vec, TextSize), - (_, last, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let values = values.into_iter().chain(std::iter::once(last)).map(ast::Expr::from).collect(); - ast::ExprBoolOp { op: ast::BoolOp::And, values, range: (location..end_location).into() }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action505< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action506< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::ParameterWithDefault, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action507< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, ast::ParameterWithDefault, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action508< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::ParameterWithDefault, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action509< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, ast::ParameterWithDefault, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action510< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, comparisons, _): (TextSize, alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)>, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let mut ops = Vec::with_capacity(comparisons.len()); - let mut comparators = Vec::with_capacity(comparisons.len()); - for (op, comparator) in comparisons { - ops.push(op); - comparators.push(comparator.into()); - } - ast::ExprCompare { - left: Box::new(left.into()), - ops: ops.into_boxed_slice(), - comparators: comparators.into_boxed_slice(), - range: (location..end_location).into(), - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action511< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action512< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, (ast::CmpOp, crate::parser::ParenthesizedExpr), TextSize), -) -> alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)> -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action513< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)>, TextSize), - (_, e, _): (TextSize, (ast::CmpOp, crate::parser::ParenthesizedExpr), TextSize), -) -> alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)> -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action514< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, ast::CmpOp, TextSize), - (_, __1, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> (ast::CmpOp, crate::parser::ParenthesizedExpr) -{ - (__0, __1) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action515< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, operand, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprUnaryOp { - operand: Box::new(operand.into()), - op: ast::UnaryOp::Not, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action516< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action517< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, op, _): (TextSize, ast::Operator, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op, - right: Box::new(right.into()), - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action518< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action519< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, op, _): (TextSize, ast::Operator, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op, - right: Box::new(right.into()), - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action520< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action521< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, comparisons, _): (TextSize, alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)>, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let mut ops = Vec::with_capacity(comparisons.len()); - let mut comparators = Vec::with_capacity(comparisons.len()); - for (op, comparator) in comparisons { - ops.push(op); - comparators.push(comparator.into()); - } - ast::ExprCompare { - left: Box::new(left.into()), - ops: ops.into_boxed_slice(), - comparators: comparators.into_boxed_slice(), - range: (location..end_location).into(), - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action522< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action523< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op: ast::Operator::BitOr, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action524< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action525< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, op, _): (TextSize, ast::UnaryOp, TextSize), - (_, operand, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprUnaryOp { - operand: Box::new(operand.into()), - op, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action526< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action527< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op: ast::Operator::Pow, - right: Box::new(right.into()), - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action528< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action529< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op: ast::Operator::BitXor, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action530< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action531< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op: ast::Operator::BitAnd, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action532< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action533< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - ast::ExprAwait { value: Box::new(value.into()), range: (location..end_location).into() }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action534< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action535< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action536< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, func, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, arguments, _): (TextSize, ast::Arguments, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprCall { - func: Box::new(func.into()), - arguments, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action537< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, slice, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprSubscript { - value: Box::new(value.into()), - slice: Box::new(slice.into()), - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action538< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, attr, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprAttribute { - value: Box::new(value.into()), - attr, - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action539< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, op, _): (TextSize, ast::Operator, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op, - right: Box::new(right.into()), - range: (location..end_location).into() - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action540< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action541< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, op, _): (TextSize, ast::Operator, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op, - right: Box::new(right.into()), - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action542< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action543< ->( - source_code: &str, - mode: Mode, - (_, expr, _): (TextSize, ast::Expr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - expr.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action544< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, value, _): (TextSize, ast::Number, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprNumberLiteral { - value, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action545< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, id, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprName { - id: id.into(), - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action546< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, elts, _): (TextSize, core::option::Option>, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let elts = elts.into_iter().flatten().map(ast::Expr::from).collect(); - ast::ExprList { elts, ctx: ast::ExprContext::Load, range: (location..end_location).into() }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action547< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, elt, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, generators, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - ast::ExprListComp { elt: Box::new(elt.into()), generators, range: (location..end_location).into() }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action548< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, elts, _): (TextSize, Vec, TextSize), - (_, trailing_comma, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - if elts.len() == 1 && trailing_comma.is_none() { - crate::parser::ParenthesizedExpr { - expr: elts.into_iter().next().unwrap().into(), - range: (location..end_location).into(), - } - } else { - let elts = elts.into_iter().map(ast::Expr::from).collect(); - ast::ExprTuple { - elts, - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: true - }.into() - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action549< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, left, _): (TextSize, core::option::Option>, TextSize), - (_, mid, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, right, _): (TextSize, alloc::vec::Vec, TextSize), - (_, trailing_comma, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - if left.is_none() && right.is_empty() && trailing_comma.is_none() { - if mid.expr.is_starred_expr() { - return Err(LexicalError::new( - LexicalErrorType::OtherError("cannot use starred expression here".to_string().into_boxed_str()), - mid.start(), - ))?; - } - Ok(crate::parser::ParenthesizedExpr { - expr: mid.into(), - range: (location..end_location).into(), - }) - } else { - let elts = left.into_iter().flatten().chain([mid]).chain(right).map(ast::Expr::from).collect(); - Ok(ast::ExprTuple { - elts, - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: true - }.into()) - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action550< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprTuple { - elts: Vec::new(), - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: true - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action551< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - crate::parser::ParenthesizedExpr { - expr: e.into(), - range: (location..end_location).into(), - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action552< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, elt, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, generators, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprGenerator { - elt: Box::new(elt.into()), - generators, - range: (location..end_location).into(), - parenthesized: true - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action553< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - Err(LexicalError::new( - LexicalErrorType::OtherError("cannot use double starred expression here".to_string().into_boxed_str()), - location, - ).into()) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action554< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, core::option::Option>, crate::parser::ParenthesizedExpr)>>, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let (keys, values) = e - .unwrap_or_default() - .into_iter() - .map(|(k, v)| (k.map(|x| ast::Expr::from(*x)), ast::Expr::from(v))) - .unzip(); - ast::ExprDict { keys, values, range: (location..end_location).into() }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action555< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e1, _): (TextSize, (crate::parser::ParenthesizedExpr, crate::parser::ParenthesizedExpr), TextSize), - (_, generators, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - ast::ExprDictComp { - key: Box::new(e1.0.into()), - value: Box::new(e1.1.into()), - generators, - range: (location..end_location).into() - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action556< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, elts, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let elts = elts.into_iter().map(ast::Expr::from).collect(); - ast::ExprSet { - elts, - range: (location..end_location).into(), - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action557< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, elt, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, generators, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprSetComp { - elt: Box::new(elt.into()), - generators, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action558< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBooleanLiteral { value: true, range: (location..end_location).into() }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action559< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBooleanLiteral { value: false, range: (location..end_location).into() }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action560< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprNoneLiteral { range: (location..end_location).into() }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action561< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprEllipsisLiteral { range: (location..end_location).into() }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action562< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, Vec<(Option>, crate::parser::ParenthesizedExpr)>, TextSize), -) -> core::option::Option>, crate::parser::ParenthesizedExpr)>> -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action563< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option>, crate::parser::ParenthesizedExpr)>> -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action564< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> alloc::vec::Vec -{ - alloc::vec![] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action565< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), -) -> alloc::vec::Vec -{ - v -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action566< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action567< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, Vec, TextSize), -) -> core::option::Option> -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action568< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option> -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action569< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), -) -> Vec -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action570< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, Vec, TextSize), -) -> core::option::Option> -{ - Some(__0) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action571< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> core::option::Option> -{ - None -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action572< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, op, _): (TextSize, ast::Operator, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op, - right: Box::new(right.into()), - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action573< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action574< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, op, _): (TextSize, ast::UnaryOp, TextSize), - (_, operand, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprUnaryOp { - operand: Box::new(operand.into()), - op, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action575< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action576< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec -{ - alloc::vec![__0] -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action577< ->( - source_code: &str, - mode: Mode, - (_, v, _): (TextSize, alloc::vec::Vec, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action578< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, left, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, right, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBinOp { - left: Box::new(left.into()), - op: ast::Operator::Pow, - right: Box::new(right.into()), - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action579< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action580< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - ast::ExprAwait { value: Box::new(value.into()), range: (location..end_location).into() }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action581< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action582< ->( - source_code: &str, - mode: Mode, - (_, __0, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action583< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, func, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, arguments, _): (TextSize, ast::Arguments, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprCall { - func: Box::new(func.into()), - arguments, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action584< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, slice, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprSubscript { - value: Box::new(value.into()), - slice: Box::new(slice.into()), - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action585< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, value, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, attr, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprAttribute { - value: Box::new(value.into()), - attr, - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action586< ->( - source_code: &str, - mode: Mode, - (_, expr, _): (TextSize, ast::Expr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - expr.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action587< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, value, _): (TextSize, ast::Number, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprNumberLiteral { - value, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action588< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, id, _): (TextSize, ast::Identifier, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprName { - id: id.into(), - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action589< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, elts, _): (TextSize, core::option::Option>, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let elts = elts.into_iter().flatten().map(ast::Expr::from).collect(); - ast::ExprList { elts, ctx: ast::ExprContext::Load, range: (location..end_location).into() }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action590< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, elt, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, generators, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - ast::ExprListComp { elt: Box::new(elt.into()), generators, range: (location..end_location).into() }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action591< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, left, _): (TextSize, core::option::Option>, TextSize), - (_, mid, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, right, _): (TextSize, alloc::vec::Vec, TextSize), - (_, trailing_comma, _): (TextSize, core::option::Option, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - if left.is_none() && right.is_empty() && trailing_comma.is_none() { - if mid.expr.is_starred_expr() { - return Err(LexicalError::new( - LexicalErrorType::OtherError("cannot use starred expression here".to_string().into_boxed_str()), - mid.start(), - ))?; - } - Ok(crate::parser::ParenthesizedExpr { - expr: mid.into(), - range: (location..end_location).into(), - }) - } else { - let elts = left.into_iter().flatten().chain([mid]).chain(right).map(ast::Expr::from).collect(); - Ok(ast::ExprTuple { - elts, - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: true - }.into()) - } - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action592< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprTuple { - elts: Vec::new(), - ctx: ast::ExprContext::Load, - range: (location..end_location).into(), - parenthesized: true - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action593< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - crate::parser::ParenthesizedExpr { - expr: e.into(), - range: (location..end_location).into(), - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action594< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, elt, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, generators, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprGenerator { - elt: Box::new(elt.into()), - generators, - range: (location..end_location).into(), - parenthesized: true - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action595< ->( - source_code: &str, - mode: Mode, - (_, _, _): (TextSize, token::Tok, TextSize), - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> Result> -{ - { - Err(LexicalError::new( - LexicalErrorType::OtherError("cannot use double starred expression here".to_string().into_boxed_str()), - location, - ).into()) - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action596< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e, _): (TextSize, core::option::Option>, crate::parser::ParenthesizedExpr)>>, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let (keys, values) = e - .unwrap_or_default() - .into_iter() - .map(|(k, v)| (k.map(|x| ast::Expr::from(*x)), ast::Expr::from(v))) - .unzip(); - ast::ExprDict { keys, values, range: (location..end_location).into() }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action597< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, e1, _): (TextSize, (crate::parser::ParenthesizedExpr, crate::parser::ParenthesizedExpr), TextSize), - (_, generators, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - ast::ExprDictComp { - key: Box::new(e1.0.into()), - value: Box::new(e1.1.into()), - generators, - range: (location..end_location).into() - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action598< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, elts, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - { - let elts = elts.into_iter().map(ast::Expr::from).collect(); - ast::ExprSet { - elts, - range: (location..end_location).into(), - }.into() - } -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action599< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, elt, _): (TextSize, crate::parser::ParenthesizedExpr, TextSize), - (_, generators, _): (TextSize, Vec, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprSetComp { - elt: Box::new(elt.into()), - generators, - range: (location..end_location).into(), - }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action600< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBooleanLiteral { value: true, range: (location..end_location).into() }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action601< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprBooleanLiteral { value: false, range: (location..end_location).into() }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action602< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprNoneLiteral { range: (location..end_location).into() }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action603< ->( - source_code: &str, - mode: Mode, - (_, location, _): (TextSize, TextSize, TextSize), - (_, _, _): (TextSize, token::Tok, TextSize), - (_, end_location, _): (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - ast::ExprEllipsisLiteral { range: (location..end_location).into() }.into() -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action604< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action381( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action548( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action605< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action548( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action606< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, core::option::Option>, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __5.0; - let __end0 = __5.2; - let __temp0 = __action381( - source_code, - mode, - __5, - ); - let __temp0 = (__start0, __temp0, __end0); - __action549( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action607< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, core::option::Option>, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __5.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action549( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action608< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, core::option::Option>, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __5.0; - let __end0 = __5.2; - let __temp0 = __action381( - source_code, - mode, - __5, - ); - let __temp0 = (__start0, __temp0, __end0); - __action591( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action609< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, core::option::Option>, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __5.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action591( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action610< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec<(Option>, crate::parser::ParenthesizedExpr)>, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Vec<(Option>, crate::parser::ParenthesizedExpr)> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action381( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action227( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action611< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec<(Option>, crate::parser::ParenthesizedExpr)>, TextSize), -) -> Vec<(Option>, crate::parser::ParenthesizedExpr)> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action227( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action612< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action381( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action235( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action613< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), -) -> Vec -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action235( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action614< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action381( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action263( - source_code, - mode, - __0, - __1, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action615< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action263( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action616< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action381( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action260( - source_code, - mode, - __0, - __1, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action617< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action260( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action618< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Vec -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action381( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action67( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action619< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Vec -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action67( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action620< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action381( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action226( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action621< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), -) -> Vec -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action226( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action622< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action381( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action136( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action623< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action136( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action624< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Identifier, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __4.0; - let __end0 = __4.2; - let __temp0 = __action381( - source_code, - mode, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action137( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action625< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Identifier, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __3.2; - let __end0 = __4.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action137( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action626< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Identifier, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __6.0; - let __end0 = __6.2; - let __temp0 = __action381( - source_code, - mode, - __6, - ); - let __temp0 = (__start0, __temp0, __end0); - __action138( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action627< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Identifier, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __5.2; - let __end0 = __6.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action138( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action628< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), - __3: (TextSize, Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, token::Tok, TextSize), - __9: (TextSize, alloc::vec::Vec, TextSize), - __10: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.0; - let __end0 = __4.2; - let __temp0 = __action381( - source_code, - mode, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action87( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __5, - __6, - __7, - __8, - __9, - __10, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action629< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), - __3: (TextSize, Vec, TextSize), - __4: (TextSize, TextSize, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, alloc::vec::Vec, TextSize), - __9: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __4.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action87( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __4, - __5, - __6, - __7, - __8, - __9, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action630< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, (Vec, Vec), TextSize), - __2: (TextSize, core::option::Option<(Option>, Vec, Option>)>, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action381( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action301( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action631< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, (Vec, Vec), TextSize), - __2: (TextSize, core::option::Option<(Option>, Vec, Option>)>, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action301( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action632< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, (Option>, Vec, Option>), TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Parameters -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action381( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action302( - source_code, - mode, - __0, - __1, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action633< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, (Option>, Vec, Option>), TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Parameters -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action302( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action634< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, (Vec, Vec), TextSize), - __2: (TextSize, core::option::Option<(Option>, Vec, Option>)>, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action381( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action286( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action635< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, (Vec, Vec), TextSize), - __2: (TextSize, core::option::Option<(Option>, Vec, Option>)>, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action286( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action636< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, (Option>, Vec, Option>), TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Parameters -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action381( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action287( - source_code, - mode, - __0, - __1, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action637< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, (Option>, Vec, Option>), TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Parameters -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action287( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action638< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __5.0; - let __end0 = __5.2; - let __temp0 = __action381( - source_code, - mode, - __5, - ); - let __temp0 = (__start0, __temp0, __end0); - __action142( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action639< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __4.2; - let __end0 = __5.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action142( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action640< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action381( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action143( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action641< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action143( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action642< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action381( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action144( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action643< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action144( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action644< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action381( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action91( - source_code, - mode, - __0, - __1, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action645< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action91( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action646< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, ast::Pattern, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __4.0; - let __end0 = __4.2; - let __temp0 = __action381( - source_code, - mode, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action108( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action647< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, ast::Pattern, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __3.2; - let __end0 = __4.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action108( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action648< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action381( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action231( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action649< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), -) -> Vec -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action231( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action650< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action381( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action210( - source_code, - mode, - __0, - __1, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action651< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action210( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action652< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> ast::TypeParams -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action381( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action174( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action653< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::TypeParams -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action174( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action654< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action381( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action157( - source_code, - mode, - __0, - __1, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action655< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action157( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action656< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, ast::WithItem, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __4.0; - let __end0 = __4.2; - let __temp0 = __action381( - source_code, - mode, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action158( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action657< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, ast::WithItem, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __3.2; - let __end0 = __4.0; - let __temp0 = __action382( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action158( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action658< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Suite, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, ast::Stmt, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action405( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action5( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action659< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Suite, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, ast::Stmt, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action406( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action5( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action660< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, ast::Stmt, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action405( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action9( - source_code, - mode, - __0, - __1, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action661< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, ast::Stmt, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action406( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action9( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action662< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, ast::Stmt, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action405( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action12( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action663< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, ast::Stmt, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action406( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action12( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action664< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, ast::Stmt, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action405( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action7( - source_code, - mode, - __0, - __1, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action665< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, ast::Stmt, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action406( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action7( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action666< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, core::option::Option<(TextSize, ast::ConversionFlag)>, TextSize), - __5: (TextSize, core::option::Option, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action272( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action222( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action667< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, core::option::Option<(TextSize, ast::ConversionFlag)>, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action273( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action222( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action668< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Suite, TextSize), - __8: (TextSize, core::option::Option, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action334( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action148( - source_code, - mode, - __0, - __temp0, - __2, - __3, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action669< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, core::option::Option, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action335( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action148( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action670< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Identifier, TextSize), - __5: (TextSize, core::option::Option, TextSize), - __6: (TextSize, ast::Parameters, TextSize), - __7: (TextSize, core::option::Option, TextSize), - __8: (TextSize, token::Tok, TextSize), - __9: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action334( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action163( - source_code, - mode, - __0, - __1, - __temp0, - __3, - __4, - __5, - __6, - __7, - __8, - __9, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action671< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Identifier, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, ast::Parameters, TextSize), - __6: (TextSize, core::option::Option, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action335( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action163( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action672< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> ast::Comprehension -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action334( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action239( - source_code, - mode, - __0, - __temp0, - __2, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action673< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> ast::Comprehension -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action335( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action239( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action674< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action334( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action156( - source_code, - mode, - __0, - __temp0, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action675< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action335( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action156( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action676< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), -) -> core::option::Option -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action492( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action490( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action677< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __3.0; - let __end0 = __4.2; - let __temp0 = __action676( - source_code, - mode, - __3, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action440( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action678< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action491( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action440( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action679< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __3.0; - let __end0 = __4.2; - let __temp0 = __action676( - source_code, - mode, - __3, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action441( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action680< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action491( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action441( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action681< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), -) -> core::option::Option -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action481( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action479( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action682< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __3.0; - let __end0 = __4.2; - let __temp0 = __action681( - source_code, - mode, - __3, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action448( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action683< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action480( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action448( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action684< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __3.0; - let __end0 = __4.2; - let __temp0 = __action681( - source_code, - mode, - __3, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action449( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action685< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action480( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action449( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action686< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::ParameterWithDefault, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action495( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action506( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action687< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::ParameterWithDefault, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action495( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action507( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action688< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> (Vec, Vec) -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action493( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action444( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action689< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> (Vec, Vec) -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action494( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action444( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action690< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action493( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action677( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action691< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action494( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action677( - source_code, - mode, - __0, - __1, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action692< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action493( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action678( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action693< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action494( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action678( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action694< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action493( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action679( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action695< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action494( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action679( - source_code, - mode, - __0, - __1, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action696< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action493( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action680( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action697< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action494( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action680( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action698< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::ParameterWithDefault, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action484( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action508( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action699< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::ParameterWithDefault, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action484( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action509( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action700< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> (Vec, Vec) -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action482( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action452( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action701< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> (Vec, Vec) -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action483( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action452( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action702< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action482( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action682( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action703< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action483( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action682( - source_code, - mode, - __0, - __1, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action704< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action482( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action683( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action705< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action483( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action683( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action706< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action482( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action684( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action707< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action483( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action684( - source_code, - mode, - __0, - __1, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action708< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action482( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action685( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action709< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action483( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action685( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action710< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, TextSize, TextSize), - __1: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action489( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action442( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action711< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), -) -> (TextSize, crate::parser::ParenthesizedExpr, ast::Suite) -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action344( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action712< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), -) -> (TextSize, ast::Suite) -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action341( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action713< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action114( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action714< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action500( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action715< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action531( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action716< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action460( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action717< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action504( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action718< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action242( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action719< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action517( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action720< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action541( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action721< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Pattern, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action95( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action722< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action73( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action723< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Number, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action544( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action724< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action545( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action725< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action546( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action726< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action547( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action727< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action604( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action728< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action605( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action729< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action606( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action730< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action607( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action731< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action550( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action732< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action551( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action733< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action552( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action734< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action553( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action735< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, crate::parser::ParenthesizedExpr)>>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action554( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action736< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, (crate::parser::ParenthesizedExpr, crate::parser::ParenthesizedExpr), TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action555( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action737< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action556( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action738< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action557( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action739< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action558( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action740< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action559( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action741< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action560( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action742< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action561( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action743< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Number, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action587( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action744< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action588( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action745< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action589( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action746< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action590( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action747< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action608( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action748< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action609( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action749< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action592( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action750< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action593( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action751< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action594( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action752< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action595( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action753< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, crate::parser::ParenthesizedExpr)>>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action596( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action754< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, (crate::parser::ParenthesizedExpr, crate::parser::ParenthesizedExpr), TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action597( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action755< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action598( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action756< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action599( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action757< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action600( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action758< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action601( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action759< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action602( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action760< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action603( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action761< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Arguments, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action536( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action762< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action537( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action763< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action538( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action764< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Arguments, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action583( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action765< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action584( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action766< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action585( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action767< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action533( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action768< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action580( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action769< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action122( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action770< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action173( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action771< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Expr, TextSize), - __1: (TextSize, ast::PatternArguments, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action140( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action772< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Expr, TextSize), - __1: (TextSize, ast::PatternArguments, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action141( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action773< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)>, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action510( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action774< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)>, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action521( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action775< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::Decorator -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action178( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action776< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action25( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action777< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Box, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Identifier -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action69( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action778< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Box, TextSize), - __1: (TextSize, alloc::vec::Vec<(token::Tok, ast::Identifier)>, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Identifier -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action70( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action779< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Parameter -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action172( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action780< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Parameter -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action169( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action781< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), -) -> ast::ExceptHandler -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action154( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action782< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, (crate::parser::ParenthesizedExpr, ast::Identifier), TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), -) -> ast::ExceptHandler -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action155( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action783< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Suite, TextSize), -) -> ast::ExceptHandler -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action152( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action784< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, (crate::parser::ParenthesizedExpr, ast::Identifier), TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Suite, TextSize), -) -> ast::ExceptHandler -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action153( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action785< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action371( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action786< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action523( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action787< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action26( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action788< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action27( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action789< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action28( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action790< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Box, TextSize), -) -> Result<(TextSize, ast::ConversionFlag),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __start1 = __0.2; - let __end1 = __1.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action414( - source_code, - mode, - &__start1, - &__end1, - ); - let __temp1 = (__start1, __temp1, __end1); - __action225( - source_code, - mode, - __temp0, - __0, - __temp1, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action791< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, AnyStringKind, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> StringType -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action219( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action792< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::FStringFormatSpec -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action224( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action793< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Box, AnyStringKind), TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action221( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action794< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, core::option::Option<(TextSize, ast::ConversionFlag)>, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action666( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action795< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, core::option::Option<(TextSize, ast::ConversionFlag)>, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action667( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action796< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::UnaryOp, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action525( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action797< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::UnaryOp, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action574( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action798< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action53( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action799< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action54( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action800< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action55( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action801< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action56( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action802< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, core::option::Option, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action668( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action803< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), - __6: (TextSize, core::option::Option, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action669( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action804< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Identifier, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, ast::Parameters, TextSize), - __6: (TextSize, core::option::Option, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action670( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action805< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, ast::Parameters, TextSize), - __5: (TextSize, core::option::Option, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action671( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action806< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action243( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action807< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action244( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action808< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action245( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action809< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action246( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action810< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action614( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action811< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action615( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action812< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action616( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action813< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action617( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action814< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action71( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action815< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Box, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Identifier -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action250( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action816< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), - __4: (TextSize, alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)>, TextSize), - __5: (TextSize, core::option::Option<(TextSize, ast::Suite)>, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action146( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action817< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, core::option::Option, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Alias -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action392( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action818< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, core::option::Option, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Alias -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action385( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action819< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action66( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action820< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action618( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action821< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action619( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action822< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action68( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action823< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action60( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action824< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, (Option, Option), TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, Vec, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action61( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action825< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (IpyEscapeKind, Box), TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action75( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action826< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (IpyEscapeKind, Box), TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action74( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action827< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action76( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action828< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option, TextSize), - __2: (TextSize, TextSize, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, core::option::Option<(Box, AnyStringKind)>, TextSize), - __5: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __start1 = __0.2; - let __end1 = __1.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action414( - source_code, - mode, - &__start1, - &__end1, - ); - let __temp1 = (__start1, __temp1, __end1); - __action185( - source_code, - mode, - __temp0, - __0, - __temp1, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action829< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action115( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action830< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action116( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action831< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action117( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action832< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action118( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action833< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action119( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action834< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, StringType, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action120( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action835< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action121( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action836< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action131( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action837< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action132( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action838< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action133( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action839< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action135( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action840< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action622( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action841< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action623( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action842< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action624( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action843< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action625( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action844< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Identifier, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action626( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action845< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Identifier, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action627( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action846< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Pattern, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Suite, TextSize), -) -> ast::MatchCase -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action88( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action847< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Pattern, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::PatternKeyword -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action139( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action848< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action123( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action849< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Expr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action124( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action850< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Expr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action125( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action851< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action85( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action852< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, alloc::vec::Vec, TextSize), - __8: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __start1 = __0.2; - let __end1 = __1.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action414( - source_code, - mode, - &__start1, - &__end1, - ); - let __temp1 = (__start1, __temp1, __end1); - __action86( - source_code, - mode, - __temp0, - __0, - __temp1, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action853< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, alloc::vec::Vec, TextSize), - __8: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __start1 = __0.2; - let __end1 = __1.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action414( - source_code, - mode, - &__start1, - &__end1, - ); - let __temp1 = (__start1, __temp1, __end1); - __action628( - source_code, - mode, - __temp0, - __0, - __temp1, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action854< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, TextSize, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __start1 = __0.2; - let __end1 = __1.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action414( - source_code, - mode, - &__start1, - &__end1, - ); - let __temp1 = (__start1, __temp1, __end1); - __action629( - source_code, - mode, - __temp0, - __0, - __temp1, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action855< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action184( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action856< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action183( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action857< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action72( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action858< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action474( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action859< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action515( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action860< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Number, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action111( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action861< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action113( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action862< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action97( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action863< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action256( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action864< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action498( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action865< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, core::option::Option<(Option>, Vec, Option>)>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action630( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action866< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, core::option::Option<(Option>, Vec, Option>)>, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action631( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action867< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Option>, Vec, Option>), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Parameters -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action632( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action868< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Option>, Vec, Option>), TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Parameters -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action633( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action869< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, core::option::Option<(Option>, Vec, Option>)>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action634( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action870< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, core::option::Option<(Option>, Vec, Option>)>, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action635( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action871< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Option>, Vec, Option>), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Parameters -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action636( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action872< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Option>, Vec, Option>), TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Parameters -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action637( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action873< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action690( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action874< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action691( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action875< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action692( - source_code, - mode, - __temp0, - __0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action876< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action693( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action877< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action694( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action878< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action695( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action879< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action696( - source_code, - mode, - __temp0, - __0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action880< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action697( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action881< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action710( - source_code, - mode, - __temp0, - __0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action882< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action702( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action883< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action703( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action884< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action704( - source_code, - mode, - __temp0, - __0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action885< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action705( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action886< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action706( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action887< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action707( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action888< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action708( - source_code, - mode, - __temp0, - __0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action889< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action709( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action890< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action450( - source_code, - mode, - __temp0, - __0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action891< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action166( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action892< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action24( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action893< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action638( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action894< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action639( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action895< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action640( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action896< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action641( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action897< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action642( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action898< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action643( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action899< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action145( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action900< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Pattern, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action90( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action901< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action644( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action902< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action645( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action903< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action527( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action904< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action578( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action905< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action58( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action906< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action59( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action907< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Pattern, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action105( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action908< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action106( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action909< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Pattern, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action107( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action910< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, ast::Pattern, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action646( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action911< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, ast::Pattern, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action647( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action912< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action109( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action913< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action502( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action914< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action539( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action915< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> ast::Comprehension -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action672( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action916< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> ast::Comprehension -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action673( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action917< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option, TextSize), -) -> Option -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action213( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action918< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action237( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action919< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action110( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action920< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Parameter -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action171( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action921< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Parameter -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action168( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action922< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, StringType, TextSize), -) -> ast::Expr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action214( - source_code, - mode, - __temp0, - __0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action923< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action215( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action924< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Box, AnyStringKind), TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action218( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action925< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, core::option::Option, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, core::option::Option>, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action212( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action926< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action209( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action927< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action650( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action928< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action651( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action929< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action519( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action930< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action572( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action931< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action400( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action932< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action432( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action933< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Suite, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Mod -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action934< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Mod -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action2( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action935< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, core::option::Option, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action149( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action936< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, core::option::Option, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action150( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action937< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action151( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action938< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Expr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action164( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action939< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Expr, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action165( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action940< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, core::option::Option, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::TypeParam -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action175( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action941< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::TypeParam -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action176( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action942< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::TypeParam -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action177( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action943< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::TypeParams -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action652( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action944< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::TypeParams -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action653( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action945< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, core::option::Option, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::ParameterWithDefault -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action170( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action946< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::ParameterWithDefault -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action167( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action947< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Expr, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action126( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action948< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), - __4: (TextSize, core::option::Option, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action147( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action949< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::WithItem -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action162( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action950< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action674( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action951< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action675( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action952< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action424( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action953< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action529( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action954< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action179( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action955< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action414( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action180( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action956< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __3.2; - let __temp0 = __action873( - source_code, - mode, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action439( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action957< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __4.2; - let __temp0 = __action874( - source_code, - mode, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action439( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action958< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action875( - source_code, - mode, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action439( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action959< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action876( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action439( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action960< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __3.2; - let __temp0 = __action877( - source_code, - mode, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action439( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action961< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __4.2; - let __temp0 = __action878( - source_code, - mode, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action439( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action962< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action879( - source_code, - mode, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action439( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action963< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action880( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action439( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action964< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action881( - source_code, - mode, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action439( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action965< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action873( - source_code, - mode, - __0, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action867( - source_code, - mode, - __temp0, - __3, - __4, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action966< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action874( - source_code, - mode, - __0, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action867( - source_code, - mode, - __temp0, - __4, - __5, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action967< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action875( - source_code, - mode, - __0, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action867( - source_code, - mode, - __temp0, - __1, - __2, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action968< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action876( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action867( - source_code, - mode, - __temp0, - __2, - __3, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action969< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action877( - source_code, - mode, - __0, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action867( - source_code, - mode, - __temp0, - __3, - __4, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action970< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action878( - source_code, - mode, - __0, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action867( - source_code, - mode, - __temp0, - __4, - __5, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action971< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action879( - source_code, - mode, - __0, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action867( - source_code, - mode, - __temp0, - __1, - __2, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action972< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action880( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action867( - source_code, - mode, - __temp0, - __2, - __3, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action973< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action881( - source_code, - mode, - __0, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action867( - source_code, - mode, - __temp0, - __1, - __2, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action974< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action873( - source_code, - mode, - __0, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action868( - source_code, - mode, - __temp0, - __3, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action975< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action874( - source_code, - mode, - __0, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action868( - source_code, - mode, - __temp0, - __4, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action976< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action875( - source_code, - mode, - __0, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action868( - source_code, - mode, - __temp0, - __1, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action977< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action876( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action868( - source_code, - mode, - __temp0, - __2, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action978< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action877( - source_code, - mode, - __0, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action868( - source_code, - mode, - __temp0, - __3, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action979< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action878( - source_code, - mode, - __0, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action868( - source_code, - mode, - __temp0, - __4, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action980< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action879( - source_code, - mode, - __0, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action868( - source_code, - mode, - __temp0, - __1, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action981< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action880( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action868( - source_code, - mode, - __temp0, - __2, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action982< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action881( - source_code, - mode, - __0, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action868( - source_code, - mode, - __temp0, - __1, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action983< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action956( - source_code, - mode, - __0, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action437( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action984< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __4.2; - let __temp0 = __action957( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action437( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action985< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action958( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action437( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action986< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action959( - source_code, - mode, - __0, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action437( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action987< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action960( - source_code, - mode, - __0, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action437( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action988< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __4.2; - let __temp0 = __action961( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action437( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action989< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action962( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action437( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action990< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action963( - source_code, - mode, - __0, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action437( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action991< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action964( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action437( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action992< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __4.2; - let __temp0 = __action983( - source_code, - mode, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action865( - source_code, - mode, - __0, - __temp0, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action993< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __5.2; - let __temp0 = __action984( - source_code, - mode, - __1, - __2, - __3, - __4, - __5, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action865( - source_code, - mode, - __0, - __temp0, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action994< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action985( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action865( - source_code, - mode, - __0, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action995< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __3.2; - let __temp0 = __action986( - source_code, - mode, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action865( - source_code, - mode, - __0, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action996< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __4.2; - let __temp0 = __action987( - source_code, - mode, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action865( - source_code, - mode, - __0, - __temp0, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action997< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __5.2; - let __temp0 = __action988( - source_code, - mode, - __1, - __2, - __3, - __4, - __5, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action865( - source_code, - mode, - __0, - __temp0, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action998< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action989( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action865( - source_code, - mode, - __0, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action999< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __3.2; - let __temp0 = __action990( - source_code, - mode, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action865( - source_code, - mode, - __0, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1000< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action991( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action865( - source_code, - mode, - __0, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1001< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action438( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action865( - source_code, - mode, - __0, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1002< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __4.2; - let __temp0 = __action983( - source_code, - mode, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action866( - source_code, - mode, - __0, - __temp0, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1003< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __5.2; - let __temp0 = __action984( - source_code, - mode, - __1, - __2, - __3, - __4, - __5, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action866( - source_code, - mode, - __0, - __temp0, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1004< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action985( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action866( - source_code, - mode, - __0, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1005< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __3.2; - let __temp0 = __action986( - source_code, - mode, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action866( - source_code, - mode, - __0, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1006< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __4.2; - let __temp0 = __action987( - source_code, - mode, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action866( - source_code, - mode, - __0, - __temp0, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1007< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __5.2; - let __temp0 = __action988( - source_code, - mode, - __1, - __2, - __3, - __4, - __5, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action866( - source_code, - mode, - __0, - __temp0, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1008< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action989( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action866( - source_code, - mode, - __0, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1009< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __3.2; - let __temp0 = __action990( - source_code, - mode, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action866( - source_code, - mode, - __0, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1010< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action991( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action866( - source_code, - mode, - __0, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1011< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action438( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action866( - source_code, - mode, - __0, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1012< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action478( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action890( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1013< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __3.2; - let __temp0 = __action882( - source_code, - mode, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action447( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1014< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __4.2; - let __temp0 = __action883( - source_code, - mode, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action447( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1015< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action884( - source_code, - mode, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action447( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1016< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action885( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action447( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1017< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __3.2; - let __temp0 = __action886( - source_code, - mode, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action447( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1018< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __4.2; - let __temp0 = __action887( - source_code, - mode, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action447( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1019< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action888( - source_code, - mode, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action447( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1020< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action889( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action447( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1021< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), -) -> Result<(Option>, Vec, Option>),__lalrpop_util::ParseError> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action1012( - source_code, - mode, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action447( - source_code, - mode, - __0, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1022< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action882( - source_code, - mode, - __0, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action871( - source_code, - mode, - __temp0, - __3, - __4, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1023< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action883( - source_code, - mode, - __0, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action871( - source_code, - mode, - __temp0, - __4, - __5, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1024< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action884( - source_code, - mode, - __0, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action871( - source_code, - mode, - __temp0, - __1, - __2, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1025< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action885( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action871( - source_code, - mode, - __temp0, - __2, - __3, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1026< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action886( - source_code, - mode, - __0, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action871( - source_code, - mode, - __temp0, - __3, - __4, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1027< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action887( - source_code, - mode, - __0, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action871( - source_code, - mode, - __temp0, - __4, - __5, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1028< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action888( - source_code, - mode, - __0, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action871( - source_code, - mode, - __temp0, - __1, - __2, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1029< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action889( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action871( - source_code, - mode, - __temp0, - __2, - __3, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1030< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action1012( - source_code, - mode, - __0, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action871( - source_code, - mode, - __temp0, - __1, - __2, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1031< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action882( - source_code, - mode, - __0, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action872( - source_code, - mode, - __temp0, - __3, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1032< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action883( - source_code, - mode, - __0, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action872( - source_code, - mode, - __temp0, - __4, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1033< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action884( - source_code, - mode, - __0, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action872( - source_code, - mode, - __temp0, - __1, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1034< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action885( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action872( - source_code, - mode, - __temp0, - __2, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1035< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action886( - source_code, - mode, - __0, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action872( - source_code, - mode, - __temp0, - __3, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1036< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action887( - source_code, - mode, - __0, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action872( - source_code, - mode, - __temp0, - __4, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1037< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action888( - source_code, - mode, - __0, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action872( - source_code, - mode, - __temp0, - __1, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1038< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action889( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action872( - source_code, - mode, - __temp0, - __2, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1039< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action1012( - source_code, - mode, - __0, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action872( - source_code, - mode, - __temp0, - __1, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1040< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action1013( - source_code, - mode, - __0, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action445( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1041< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __4.2; - let __temp0 = __action1014( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action445( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1042< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action1015( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action445( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1043< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action1016( - source_code, - mode, - __0, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action445( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1044< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action1017( - source_code, - mode, - __0, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action445( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1045< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __4.2; - let __temp0 = __action1018( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action445( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1046< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action1019( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action445( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1047< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action1020( - source_code, - mode, - __0, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action445( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1048< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameter, TextSize), -) -> Result>, Vec, Option>)>,__lalrpop_util::ParseError> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action1021( - source_code, - mode, - __0, - __1, - )?; - let __temp0 = (__start0, __temp0, __end0); - Ok(__action445( - source_code, - mode, - __temp0, - )) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1049< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __4.2; - let __temp0 = __action1040( - source_code, - mode, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action869( - source_code, - mode, - __0, - __temp0, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1050< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __5.2; - let __temp0 = __action1041( - source_code, - mode, - __1, - __2, - __3, - __4, - __5, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action869( - source_code, - mode, - __0, - __temp0, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1051< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1042( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action869( - source_code, - mode, - __0, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1052< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __3.2; - let __temp0 = __action1043( - source_code, - mode, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action869( - source_code, - mode, - __0, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1053< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __4.2; - let __temp0 = __action1044( - source_code, - mode, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action869( - source_code, - mode, - __0, - __temp0, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1054< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __5.2; - let __temp0 = __action1045( - source_code, - mode, - __1, - __2, - __3, - __4, - __5, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action869( - source_code, - mode, - __0, - __temp0, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1055< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1046( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action869( - source_code, - mode, - __0, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1056< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __3.2; - let __temp0 = __action1047( - source_code, - mode, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action869( - source_code, - mode, - __0, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1057< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1048( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action869( - source_code, - mode, - __0, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1058< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action446( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action869( - source_code, - mode, - __0, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1059< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __4.2; - let __temp0 = __action1040( - source_code, - mode, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action870( - source_code, - mode, - __0, - __temp0, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1060< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __5.2; - let __temp0 = __action1041( - source_code, - mode, - __1, - __2, - __3, - __4, - __5, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action870( - source_code, - mode, - __0, - __temp0, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1061< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1042( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action870( - source_code, - mode, - __0, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1062< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __3.2; - let __temp0 = __action1043( - source_code, - mode, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action870( - source_code, - mode, - __0, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1063< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __4.2; - let __temp0 = __action1044( - source_code, - mode, - __1, - __2, - __3, - __4, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action870( - source_code, - mode, - __0, - __temp0, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1064< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __5.2; - let __temp0 = __action1045( - source_code, - mode, - __1, - __2, - __3, - __4, - __5, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action870( - source_code, - mode, - __0, - __temp0, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1065< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1046( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action870( - source_code, - mode, - __0, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1066< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __3.2; - let __temp0 = __action1047( - source_code, - mode, - __1, - __2, - __3, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action870( - source_code, - mode, - __0, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1067< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1048( - source_code, - mode, - __1, - __2, - )?; - let __temp0 = (__start0, __temp0, __end0); - __action870( - source_code, - mode, - __0, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1068< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action446( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action870( - source_code, - mode, - __0, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1069< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action375( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action373( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1070< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.0; - let __end0 = __3.2; - let __temp0 = __action1069( - source_code, - mode, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action722( - source_code, - mode, - __0, - __1, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1071< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action374( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action722( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1072< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action566( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action576( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1073< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action566( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action577( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1074< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action564( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action729( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1075< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action565( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action729( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1076< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action564( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action730( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1077< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action565( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action730( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1078< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action564( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action747( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1079< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action565( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action747( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1080< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action564( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action748( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1081< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action565( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action748( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1082< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::WithItem, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action318( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action312( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1083< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::WithItem, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action318( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action313( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1084< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, ast::WithItem, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action316( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action656( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1085< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, ast::WithItem, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action317( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action656( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1086< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, ast::WithItem, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action316( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action657( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1087< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, ast::WithItem, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action317( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action657( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1088< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action305( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action303( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1089< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Identifier, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, ast::Parameters, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __8: (TextSize, token::Tok, TextSize), - __9: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __6.0; - let __end0 = __7.2; - let __temp0 = __action1088( - source_code, - mode, - __6, - __7, - ); - let __temp0 = (__start0, __temp0, __end0); - __action804( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - __8, - __9, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1090< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Identifier, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, ast::Parameters, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __5.2; - let __end0 = __6.0; - let __temp0 = __action304( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action804( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1091< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, ast::Parameters, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __5.0; - let __end0 = __6.2; - let __temp0 = __action1088( - source_code, - mode, - __5, - __6, - ); - let __temp0 = (__start0, __temp0, __end0); - __action805( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1092< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, ast::Parameters, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.2; - let __end0 = __5.0; - let __temp0 = __action304( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action805( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1093< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), -) -> alloc::vec::Vec<(token::Tok, ast::Identifier)> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action380( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action378( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1094< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec<(token::Tok, ast::Identifier)>, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), -) -> alloc::vec::Vec<(token::Tok, ast::Identifier)> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action380( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action379( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1095< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action297( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action295( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1096< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::Parameter -{ - let __start0 = __2.0; - let __end0 = __3.2; - let __temp0 = __action1095( - source_code, - mode, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action779( - source_code, - mode, - __0, - __1, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1097< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Parameter -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action296( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action779( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1098< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::TypeParam -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1095( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action940( - source_code, - mode, - __0, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1099< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::TypeParam -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action296( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action940( - source_code, - mode, - __0, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1100< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::ParameterWithDefault -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1095( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action945( - source_code, - mode, - __0, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1101< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::ParameterWithDefault -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action296( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action945( - source_code, - mode, - __0, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1102< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action294( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action292( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1103< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::Parameter -{ - let __start0 = __2.0; - let __end0 = __3.2; - let __temp0 = __action1102( - source_code, - mode, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action920( - source_code, - mode, - __0, - __1, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1104< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Parameter -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action293( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action920( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1105< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action370( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action368( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1106< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action370( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action369( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1107< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action412( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action415( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1108< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action412( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action416( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1109< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Mod -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action410( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action934( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1110< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Mod -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action411( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action934( - source_code, - mode, - __0, - __1, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1111< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), -) -> core::option::Option -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action423( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action421( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1112< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Alias -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1111( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action817( - source_code, - mode, - __0, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1113< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Alias -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action422( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action817( - source_code, - mode, - __0, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1114< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> ast::Alias -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1111( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action818( - source_code, - mode, - __0, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1115< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, TextSize, TextSize), -) -> ast::Alias -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action422( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action818( - source_code, - mode, - __0, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1116< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), -) -> core::option::Option -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action338( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action336( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1117< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, token::Tok, TextSize), - __9: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __7.0; - let __end0 = __9.2; - let __temp0 = __action1116( - source_code, - mode, - __7, - __8, - __9, - ); - let __temp0 = (__start0, __temp0, __end0); - __action802( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1118< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __6.2; - let __end0 = __6.2; - let __temp0 = __action337( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action802( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1119< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __6.0; - let __end0 = __8.2; - let __temp0 = __action1116( - source_code, - mode, - __6, - __7, - __8, - ); - let __temp0 = (__start0, __temp0, __end0); - __action803( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1120< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action337( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action803( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1121< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, core::option::Option, TextSize), - __8: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.0; - let __end0 = __6.2; - let __temp0 = __action1116( - source_code, - mode, - __4, - __5, - __6, - ); - let __temp0 = (__start0, __temp0, __end0); - __action935( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1122< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __4.0; - let __temp0 = __action337( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action935( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1123< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, core::option::Option, TextSize), - __8: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.0; - let __end0 = __6.2; - let __temp0 = __action1116( - source_code, - mode, - __4, - __5, - __6, - ); - let __temp0 = (__start0, __temp0, __end0); - __action936( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1124< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __4.0; - let __temp0 = __action337( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action936( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1125< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.0; - let __end0 = __6.2; - let __temp0 = __action1116( - source_code, - mode, - __4, - __5, - __6, - ); - let __temp0 = (__start0, __temp0, __end0); - __action948( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1126< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action337( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action948( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1127< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), -) -> core::option::Option -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action331( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action329( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1128< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.0; - let __end0 = __5.2; - let __temp0 = __action331( - source_code, - mode, - __3, - __4, - __5, - ); - let __temp0 = (__start0, __temp0, __end0); - __action937( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1129< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, token::Tok, TextSize), - __9: (TextSize, ast::Suite, TextSize), - __10: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __7.0; - let __end0 = __9.2; - let __temp0 = __action1127( - source_code, - mode, - __7, - __8, - __9, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1121( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - __10, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1130< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __6.2; - let __end0 = __7.0; - let __temp0 = __action330( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1121( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1131< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.0; - let __end0 = __6.2; - let __temp0 = __action1127( - source_code, - mode, - __4, - __5, - __6, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1122( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1132< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __4.0; - let __temp0 = __action330( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1122( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1133< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, token::Tok, TextSize), - __9: (TextSize, ast::Suite, TextSize), - __10: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __7.0; - let __end0 = __9.2; - let __temp0 = __action1127( - source_code, - mode, - __7, - __8, - __9, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1123( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - __10, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1134< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __6.2; - let __end0 = __7.0; - let __temp0 = __action330( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1123( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1135< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.0; - let __end0 = __6.2; - let __temp0 = __action1127( - source_code, - mode, - __4, - __5, - __6, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1124( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1136< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __4.0; - let __temp0 = __action330( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1124( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1137< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action395( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action393( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1138< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.0; - let __end0 = __3.2; - let __temp0 = __action1137( - source_code, - mode, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action906( - source_code, - mode, - __0, - __1, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1139< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action394( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action906( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1140< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), -) -> alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action711( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action430( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1141< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)>, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Suite, TextSize), -) -> alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)> -{ - let __start0 = __1.0; - let __end0 = __4.2; - let __temp0 = __action711( - source_code, - mode, - __1, - __2, - __3, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action431( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1142< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), - __4: (TextSize, core::option::Option<(TextSize, ast::Suite)>, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __4.0; - let __temp0 = __action342( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action816( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1143< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), - __4: (TextSize, alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)>, TextSize), - __5: (TextSize, core::option::Option<(TextSize, ast::Suite)>, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.0; - let __end0 = __4.2; - let __temp0 = __action343( - source_code, - mode, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action816( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1144< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), -) -> core::option::Option<(TextSize, ast::Suite)> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action712( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action339( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1145< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.0; - let __end0 = __6.2; - let __temp0 = __action1144( - source_code, - mode, - __4, - __5, - __6, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1142( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1146< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action340( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1142( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1147< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), - __4: (TextSize, alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)>, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __5.0; - let __end0 = __7.2; - let __temp0 = __action1144( - source_code, - mode, - __5, - __6, - __7, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1143( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1148< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), - __4: (TextSize, alloc::vec::Vec<(TextSize, crate::parser::ParenthesizedExpr, ast::Suite)>, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action340( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1143( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1149< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action459( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action457( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1150< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action459( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action458( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1151< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Option<(TextSize, TextSize, Option)>, ast::Expr), TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action468( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action469( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1152< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), - __1: (TextSize, (Option<(TextSize, TextSize, Option)>, ast::Expr), TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action468( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action470( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1153< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, core::option::Option<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), -) -> Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action466( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action253( - source_code, - mode, - __temp0, - __0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1154< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), - __1: (TextSize, core::option::Option<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), -) -> Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action467( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action253( - source_code, - mode, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1155< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action473( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action471( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1156< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action473( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action472( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1157< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> core::option::Option> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action569( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action567( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1158< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1157( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1074( - source_code, - mode, - __0, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1159< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action568( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1074( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1160< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1157( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1075( - source_code, - mode, - __0, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1161< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action568( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1075( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1162< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1157( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1076( - source_code, - mode, - __0, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1163< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action568( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1076( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1164< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1157( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1077( - source_code, - mode, - __0, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1165< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action568( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1077( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1166< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1157( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1078( - source_code, - mode, - __0, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1167< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action568( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1078( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1168< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1157( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1079( - source_code, - mode, - __0, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1169< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action568( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1079( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1170< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1157( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1080( - source_code, - mode, - __0, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1171< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action568( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1080( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1172< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1157( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1081( - source_code, - mode, - __0, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1173< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action568( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1081( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1174< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Pattern, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action356( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action354( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1175< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, ast::Pattern, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action356( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action355( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1176< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, core::option::Option, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action428( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action353( - source_code, - mode, - __temp0, - __0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1177< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, core::option::Option, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action429( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action353( - source_code, - mode, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1178< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Stmt, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action409( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action417( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1179< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, ast::Stmt, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> alloc::vec::Vec -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action409( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action418( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1180< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Suite, TextSize), - __1: (TextSize, ast::Stmt, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action407( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action658( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1181< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Suite, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, ast::Stmt, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action408( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action658( - source_code, - mode, - __0, - __temp0, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1182< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Suite, TextSize), - __1: (TextSize, ast::Stmt, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action407( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action659( - source_code, - mode, - __0, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1183< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Suite, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, ast::Stmt, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action408( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action659( - source_code, - mode, - __0, - __temp0, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1184< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Stmt, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action407( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action660( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1185< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, ast::Stmt, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action408( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action660( - source_code, - mode, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1186< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Stmt, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action407( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action661( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1187< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, ast::Stmt, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action408( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action661( - source_code, - mode, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1188< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, ast::Stmt, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action407( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action662( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1189< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, ast::Stmt, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action408( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action662( - source_code, - mode, - __0, - __temp0, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1190< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, ast::Stmt, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action407( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action663( - source_code, - mode, - __0, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1191< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, ast::Stmt, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action408( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action663( - source_code, - mode, - __0, - __temp0, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1192< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Stmt, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action407( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action664( - source_code, - mode, - __temp0, - __0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1193< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, ast::Stmt, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action408( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action664( - source_code, - mode, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1194< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Stmt, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action407( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action665( - source_code, - mode, - __temp0, - __0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1195< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, ast::Stmt, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> ast::Suite -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action408( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action665( - source_code, - mode, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1196< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Identifier, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::ExceptHandler -{ - let __start0 = __1.0; - let __end0 = __3.2; - let __temp0 = __action326( - source_code, - mode, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action782( - source_code, - mode, - __0, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1197< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Identifier, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::ExceptHandler -{ - let __start0 = __2.0; - let __end0 = __4.2; - let __temp0 = __action326( - source_code, - mode, - __2, - __3, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action784( - source_code, - mode, - __0, - __1, - __temp0, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1198< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action161( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action323( - source_code, - mode, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1199< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action161( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action654( - source_code, - mode, - __0, - __temp0, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1200< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action161( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action655( - source_code, - mode, - __0, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1201< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> core::option::Option> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action1198( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action321( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1202< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::WithItem, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1201( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1084( - source_code, - mode, - __0, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1203< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::WithItem, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action322( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1084( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1204< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::WithItem, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1201( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1085( - source_code, - mode, - __0, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1205< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::WithItem, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action322( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1085( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1206< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::WithItem, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1201( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1086( - source_code, - mode, - __0, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1207< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::WithItem, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action322( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1086( - source_code, - mode, - __0, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1208< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::WithItem, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1201( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1087( - source_code, - mode, - __0, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1209< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::WithItem, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action322( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1087( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1210< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::CmpOp, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)> -{ - let __start0 = __0.0; - let __end0 = __1.2; - let __temp0 = __action514( - source_code, - mode, - __0, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action512( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1211< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)>, TextSize), - __1: (TextSize, ast::CmpOp, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action514( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action513( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1212< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Expr, TextSize), -) -> core::option::Option -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action363( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action361( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1213< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Pattern, TextSize), - __2: (TextSize, ast::Expr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Suite, TextSize), -) -> ast::MatchCase -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action1212( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action846( - source_code, - mode, - __0, - __1, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1214< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Pattern, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), -) -> ast::MatchCase -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action362( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action846( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1215< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameters, TextSize), -) -> core::option::Option -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action300( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action298( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1216< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameters, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action1215( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action891( - source_code, - mode, - __0, - __temp0, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1217< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, TextSize, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action299( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action891( - source_code, - mode, - __0, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1218< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action713( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1219< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action714( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1220< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action715( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1221< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action716( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1222< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action717( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1223< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action718( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1224< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action719( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1225< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action720( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1226< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Pattern, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action721( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1227< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1070( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1228< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1071( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1229< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Number, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action723( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1230< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action724( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1231< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action725( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1232< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action726( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1233< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action727( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1234< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action728( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1235< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1158( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1236< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1159( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1237< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __6.2; - let __end0 = __6.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1160( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1238< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1161( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1239< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1162( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1240< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1163( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1241< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1164( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1242< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1165( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1243< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action731( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1244< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action732( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1245< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action733( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1246< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action734( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1247< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, crate::parser::ParenthesizedExpr)>>, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action735( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1248< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, (crate::parser::ParenthesizedExpr, crate::parser::ParenthesizedExpr), TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action736( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1249< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action737( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1250< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action738( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1251< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action739( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1252< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action740( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1253< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action741( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1254< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action742( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1255< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Number, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action743( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1256< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action744( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1257< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action745( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1258< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action746( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1259< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1166( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1260< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1167( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1261< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __6.2; - let __end0 = __6.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1168( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1262< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1169( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1263< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1170( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1264< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1171( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1265< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1172( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1266< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1173( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1267< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action749( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1268< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action750( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1269< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action751( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1270< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action752( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1271< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option>, crate::parser::ParenthesizedExpr)>>, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action753( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1272< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, (crate::parser::ParenthesizedExpr, crate::parser::ParenthesizedExpr), TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action754( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1273< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action755( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1274< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, Vec, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action756( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1275< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action757( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1276< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action758( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1277< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action759( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1278< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action760( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1279< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Arguments, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action761( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1280< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action762( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1281< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action763( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1282< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Arguments, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action764( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1283< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action765( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1284< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action766( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1285< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action767( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1286< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action768( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1287< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action769( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1288< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Expr, TextSize), - __1: (TextSize, ast::PatternArguments, TextSize), -) -> ast::Pattern -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action771( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1289< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Expr, TextSize), - __1: (TextSize, ast::PatternArguments, TextSize), -) -> ast::Pattern -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action772( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1290< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)>, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action773( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1291< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, alloc::vec::Vec<(ast::CmpOp, crate::parser::ParenthesizedExpr)>, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action774( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1292< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> ast::Decorator -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action775( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1293< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action776( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1294< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Box, TextSize), -) -> ast::Identifier -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action777( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1295< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Box, TextSize), - __1: (TextSize, alloc::vec::Vec<(token::Tok, ast::Identifier)>, TextSize), -) -> ast::Identifier -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action778( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1296< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Parameter -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1096( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1297< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), -) -> ast::Parameter -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1097( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1298< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), -) -> ast::Parameter -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action780( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1299< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action785( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1300< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action786( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1301< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action787( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1302< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action788( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1303< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, core::option::Option, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action789( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1304< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, AnyStringKind, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> StringType -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action791( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1305< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), -) -> ast::FStringFormatSpec -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action792( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1306< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Box, AnyStringKind), TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action793( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1307< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, core::option::Option<(TextSize, ast::ConversionFlag)>, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action794( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1308< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, core::option::Option<(TextSize, ast::ConversionFlag)>, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action795( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1309< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::UnaryOp, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action796( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1310< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::UnaryOp, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action797( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1311< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action798( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1312< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action799( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1313< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action800( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1314< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action801( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1315< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, core::option::Option>, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action806( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1316< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action807( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1317< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action808( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1318< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action809( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1319< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action810( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1320< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action811( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1321< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action812( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1322< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action813( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1323< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action814( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1324< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Box, TextSize), -) -> ast::Identifier -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action815( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1325< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), -) -> ast::Alias -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1112( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1326< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> ast::Alias -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1113( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1327< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), -) -> ast::Alias -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1114( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1328< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> ast::Alias -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1115( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1329< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), -) -> Vec -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action819( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1330< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action820( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1331< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action821( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1332< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> Vec -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action822( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1333< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action823( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1334< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, (Option, Option), TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, Vec, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action824( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1335< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (IpyEscapeKind, Box), TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action825( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1336< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (IpyEscapeKind, Box), TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action826( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1337< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action827( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1338< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, core::option::Option<(Box, AnyStringKind)>, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __start1 = __4.2; - let __end1 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action413( - source_code, - mode, - &__start1, - &__end1, - ); - let __temp1 = (__start1, __temp1, __end1); - __action828( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - __4, - __temp1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1339< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action829( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1340< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action830( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1341< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action831( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1342< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action832( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1343< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action833( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1344< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, StringType, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action834( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1345< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action835( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1346< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> ast::Expr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action836( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1347< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> ast::Expr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action837( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1348< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> ast::Expr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action838( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1349< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action839( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1350< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action840( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1351< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action841( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1352< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action842( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1353< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action843( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1354< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Identifier, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __6.2; - let __end0 = __6.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action844( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1355< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec<(ast::Expr, ast::Pattern)>, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Identifier, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action845( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1356< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Pattern, TextSize), -) -> ast::PatternKeyword -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action847( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1357< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> ast::Expr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action848( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1358< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Expr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), -) -> ast::Expr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action849( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1359< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Expr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), -) -> ast::Expr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action850( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1360< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action852( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1361< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action853( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1362< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action854( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1363< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action855( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1364< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action856( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1365< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action857( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1366< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action858( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1367< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action859( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1368< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Number, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action860( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1369< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action861( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1370< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action862( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1371< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action863( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1372< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action864( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1373< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::ParameterWithDefault, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::ParameterWithDefault -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action497( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1374< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::ParameterWithDefault, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::ParameterWithDefault -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action486( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1375< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action992( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1376< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __6.2; - let __end0 = __6.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action993( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1377< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action994( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1378< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action995( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1379< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action996( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1380< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __6.2; - let __end0 = __6.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action997( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1381< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action998( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1382< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action999( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1383< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1000( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1384< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1001( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1385< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1002( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1386< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1003( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1387< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1004( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1388< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1005( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1389< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1006( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1390< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1007( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1391< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1008( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1392< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1009( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1393< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1010( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1394< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1011( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1395< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action965( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1396< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action966( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1397< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action967( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1398< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action968( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1399< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action969( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1400< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action970( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1401< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action971( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1402< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action972( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1403< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action973( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1404< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action974( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1405< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action975( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1406< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action976( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1407< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action977( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1408< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action978( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1409< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action979( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1410< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action980( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1411< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action981( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1412< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action982( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1413< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1049( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1414< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __6.2; - let __end0 = __6.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1050( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1415< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1051( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1416< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1052( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1417< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1053( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1418< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __6.2; - let __end0 = __6.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1054( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1419< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1055( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1420< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1056( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1421< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1057( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1422< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1058( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1423< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1059( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1424< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1060( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1425< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1061( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1426< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1062( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1427< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1063( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1428< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1064( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1429< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1065( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1430< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1066( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1431< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1067( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1432< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Vec, Vec), TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1068( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1433< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1022( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1434< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1023( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1435< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1024( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1436< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1025( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1437< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1026( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1438< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1027( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1439< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1028( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1440< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1029( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1441< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1030( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1442< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1031( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1443< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1032( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1444< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1033( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1445< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1034( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1446< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1035( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1447< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1036( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1448< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1037( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1449< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1038( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1450< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1039( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1451< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameters, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1216( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1452< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1217( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1453< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action892( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1454< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action893( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1455< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action894( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1456< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action895( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1457< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action896( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1458< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action897( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1459< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action898( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1460< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> ast::PatternArguments -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action899( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1461< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Pattern, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action900( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1462< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action901( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1463< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action902( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1464< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action903( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1465< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action904( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1466< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action905( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1467< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1138( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1468< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1139( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1469< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Pattern, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action907( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1470< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action908( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1471< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Pattern, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action909( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1472< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, ast::Pattern, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action910( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1473< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, ast::Pattern, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action911( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1474< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action912( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1475< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action913( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1476< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action914( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1477< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), -) -> ast::Comprehension -{ - let __start0 = __5.2; - let __end0 = __5.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action915( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1478< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), -) -> ast::Comprehension -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action916( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1479< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action918( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1480< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), -) -> ast::Pattern -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action919( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1481< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Parameter -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1103( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1482< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), -) -> ast::Parameter -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1104( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1483< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), -) -> ast::Parameter -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action921( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1484< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action923( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1485< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Box, AnyStringKind), TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action924( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1486< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, core::option::Option, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, core::option::Option>, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action925( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1487< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action926( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1488< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action927( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1489< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action928( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1490< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action929( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1491< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action930( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1492< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action931( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1493< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action932( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1494< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Suite, TextSize), -) -> ast::Mod -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action933( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1495< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Mod -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1109( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1496< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> ast::Mod -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1110( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1497< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, token::Tok, TextSize), - __9: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __9.2; - let __end0 = __9.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1129( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - __8, - __9, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1498< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __6.2; - let __end0 = __6.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1130( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1499< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __6.2; - let __end0 = __6.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1131( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1500< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1132( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1501< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, token::Tok, TextSize), - __9: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __9.2; - let __end0 = __9.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1133( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - __8, - __9, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1502< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __6.2; - let __end0 = __6.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1134( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1503< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __6.2; - let __end0 = __6.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1135( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1504< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1136( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1505< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> ast::Expr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action938( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1506< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Expr, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action939( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1507< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::TypeParam -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1098( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1508< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> ast::TypeParam -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1099( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1509< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), -) -> ast::TypeParam -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action941( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1510< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), -) -> ast::TypeParam -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action942( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1511< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::TypeParams -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action943( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1512< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> ast::TypeParams -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action944( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1513< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::ParameterWithDefault -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1100( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1514< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> ast::ParameterWithDefault -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1101( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1515< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> ast::ParameterWithDefault -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action946( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1516< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Expr, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action947( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1517< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::WithItem -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action949( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1518< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action952( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1519< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action953( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1520< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, core::option::Option, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.2; - let __end0 = __1.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action954( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1521< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action413( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action955( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1522< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, ast::Arguments, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.0; - let __end0 = __4.2; - let __temp0 = __action290( - source_code, - mode, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action770( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1523< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __4.0; - let __temp0 = __action291( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action770( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1524< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action403( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1301( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1525< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action404( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1301( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1526< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Result> -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action398( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1303( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1527< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action399( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1303( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1528< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, (Option<(TextSize, TextSize, Option)>, ast::Expr), TextSize), -) -> Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action464( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1153( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1529< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - let __start0 = *__lookbehind; - let __end0 = *__lookahead; - let __temp0 = __action465( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1153( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1530< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), - __1: (TextSize, (Option<(TextSize, TextSize, Option)>, ast::Expr), TextSize), -) -> Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action464( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1154( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1531< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), -) -> Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)> -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action465( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1154( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1532< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, (Option<(TextSize, TextSize, Option)>, ast::Expr), TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action1528( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1223( - source_code, - mode, - __0, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1533< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action1529( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1223( - source_code, - mode, - __0, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1534< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), - __2: (TextSize, (Option<(TextSize, TextSize, Option)>, ast::Expr), TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1530( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1223( - source_code, - mode, - __0, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1535< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec<(Option<(TextSize, TextSize, Option)>, ast::Expr)>, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action1531( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1223( - source_code, - mode, - __0, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1536< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Pattern, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action426( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1176( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1537< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> Vec -{ - let __start0 = *__lookbehind; - let __end0 = *__lookahead; - let __temp0 = __action427( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1176( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1538< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, ast::Pattern, TextSize), -) -> Vec -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action426( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1177( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1539< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), -) -> Vec -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action427( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1177( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1540< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Pattern, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action1536( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1474( - source_code, - mode, - __0, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1541< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action1537( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1474( - source_code, - mode, - __0, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1542< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, ast::Pattern, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __1.0; - let __end0 = __2.2; - let __temp0 = __action1538( - source_code, - mode, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1474( - source_code, - mode, - __0, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1543< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> ast::Pattern -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action1539( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1474( - source_code, - mode, - __0, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1544< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, Vec, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action251( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1315( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1545< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> (Option<(TextSize, TextSize, Option)>, ast::Expr) -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action252( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1315( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1546< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Comprehension -{ - let __start0 = __4.2; - let __end0 = __4.2; - let __temp0 = __action254( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1477( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1547< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), -) -> ast::Comprehension -{ - let __start0 = __5.0; - let __end0 = __5.2; - let __temp0 = __action255( - source_code, - mode, - __5, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1477( - source_code, - mode, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1548< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Comprehension -{ - let __start0 = __3.2; - let __end0 = __3.2; - let __temp0 = __action254( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1478( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1549< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, alloc::vec::Vec, TextSize), -) -> ast::Comprehension -{ - let __start0 = __4.0; - let __end0 = __4.2; - let __temp0 = __action255( - source_code, - mode, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1478( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1550< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, ast::Arguments, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action308( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1522( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1551< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, ast::Arguments, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action309( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1522( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1552< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action308( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1523( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1553< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action309( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1523( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1554< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, ast::Parameters, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action308( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1089( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1555< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Identifier, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, ast::Parameters, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __8: (TextSize, token::Tok, TextSize), - __9: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action309( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1089( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - __8, - __9, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1556< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, ast::Parameters, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action308( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1090( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1557< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Identifier, TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, ast::Parameters, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action309( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1090( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1558< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, ast::Parameters, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action308( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1091( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1559< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, ast::Parameters, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action309( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1091( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1560< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, ast::Parameters, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action308( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1092( - source_code, - mode, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1561< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, ast::Parameters, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action309( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1092( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1562< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec<(Option>, crate::parser::ParenthesizedExpr)>, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action562( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1247( - source_code, - mode, - __0, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1563< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action563( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1247( - source_code, - mode, - __0, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1564< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec<(Option>, crate::parser::ParenthesizedExpr)>, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action562( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1271( - source_code, - mode, - __0, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1565< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action563( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1271( - source_code, - mode, - __0, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1566< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, (TextSize, ast::ConversionFlag), TextSize), - __4: (TextSize, core::option::Option, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action270( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1307( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1567< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action271( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1307( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1568< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, (TextSize, ast::ConversionFlag), TextSize), - __3: (TextSize, core::option::Option, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action270( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1308( - source_code, - mode, - __0, - __1, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1569< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action271( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1308( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1570< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, (TextSize, ast::ConversionFlag), TextSize), - __4: (TextSize, ast::FStringFormatSpec, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __4.0; - let __end0 = __4.2; - let __temp0 = __action268( - source_code, - mode, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1566( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1571< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, (TextSize, ast::ConversionFlag), TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.2; - let __end0 = __4.0; - let __temp0 = __action269( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1566( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1572< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::FStringFormatSpec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action268( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1567( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1573< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action269( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1567( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1574< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, (TextSize, ast::ConversionFlag), TextSize), - __3: (TextSize, ast::FStringFormatSpec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action268( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1568( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1575< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, (TextSize, ast::ConversionFlag), TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action269( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1568( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1576< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, ast::FStringFormatSpec, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action268( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1569( - source_code, - mode, - __0, - __1, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1577< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action269( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1569( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1578< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, AnyStringKind, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> StringType -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action274( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1304( - source_code, - mode, - __0, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1579< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, AnyStringKind, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> StringType -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action275( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1304( - source_code, - mode, - __0, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1580< ->( - source_code: &str, - mode: Mode, - __lookbehind: &TextSize, - __lookahead: &TextSize, -) -> ast::FStringFormatSpec -{ - let __start0 = *__lookbehind; - let __end0 = *__lookahead; - let __temp0 = __action274( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1305( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1581< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), -) -> ast::FStringFormatSpec -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action275( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1305( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1582< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action1325( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action390( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1583< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action1326( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action390( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1584< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Identifier, TextSize), -) -> Vec -{ - let __start0 = __2.0; - let __end0 = __4.2; - let __temp0 = __action1325( - source_code, - mode, - __2, - __3, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action391( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1585< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), -) -> Vec -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action1326( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action391( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1586< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action1327( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action383( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1587< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> Vec -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action1328( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action383( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1588< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Identifier, TextSize), -) -> Vec -{ - let __start0 = __2.0; - let __end0 = __4.2; - let __temp0 = __action1327( - source_code, - mode, - __2, - __3, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action384( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1589< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), -) -> Vec -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action1328( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action384( - source_code, - mode, - __0, - __1, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1590< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, ast::Identifier, TextSize), -) -> (Option, Option) -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __temp0 = __action388( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action62( - source_code, - mode, - __temp0, - __0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1591< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, ast::Identifier, TextSize), -) -> (Option, Option) -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action389( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action62( - source_code, - mode, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1592< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action570( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1231( - source_code, - mode, - __0, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1593< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action571( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1231( - source_code, - mode, - __0, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1594< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Vec, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action570( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1257( - source_code, - mode, - __0, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1595< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action571( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1257( - source_code, - mode, - __0, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1596< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1375( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1597< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Parameter, TextSize), - __7: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1375( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1598< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), - __8: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1375( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1599< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1376( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1600< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), - __8: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1376( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1601< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Parameter, TextSize), - __9: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1376( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - __8, - __9, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1602< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1377( - source_code, - mode, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1603< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1377( - source_code, - mode, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1604< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1377( - source_code, - mode, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1605< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1378( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1606< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1378( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1607< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1378( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1608< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1379( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1609< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Parameter, TextSize), - __7: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1379( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1610< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), - __8: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1379( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1611< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1380( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1612< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), - __8: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1380( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1613< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Parameter, TextSize), - __9: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1380( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - __8, - __9, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1614< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1381( - source_code, - mode, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1615< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1381( - source_code, - mode, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1616< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1381( - source_code, - mode, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1617< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1382( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1618< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1382( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1619< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1382( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1620< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1383( - source_code, - mode, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1621< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1383( - source_code, - mode, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1622< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1383( - source_code, - mode, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1623< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1384( - source_code, - mode, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1624< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1384( - source_code, - mode, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1625< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1384( - source_code, - mode, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1626< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1385( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1627< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1385( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1628< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1385( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1629< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1386( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1630< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1386( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1631< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1386( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1632< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1387( - source_code, - mode, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1633< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1387( - source_code, - mode, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1634< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1387( - source_code, - mode, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1635< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1388( - source_code, - mode, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1636< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1388( - source_code, - mode, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1637< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1388( - source_code, - mode, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1638< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1389( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1639< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1389( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1640< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1389( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1641< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1390( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1642< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1390( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1643< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1390( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1644< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1391( - source_code, - mode, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1645< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1391( - source_code, - mode, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1646< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1391( - source_code, - mode, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1647< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1392( - source_code, - mode, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1648< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1392( - source_code, - mode, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1649< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1392( - source_code, - mode, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1650< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1393( - source_code, - mode, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1651< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1393( - source_code, - mode, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1652< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1393( - source_code, - mode, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1653< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action443( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1394( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1654< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action688( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1394( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1655< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action689( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1394( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1656< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1413( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1657< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Parameter, TextSize), - __7: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1413( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1658< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), - __8: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1413( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1659< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1414( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1660< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), - __8: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1414( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1661< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Parameter, TextSize), - __9: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1414( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - __8, - __9, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1662< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1415( - source_code, - mode, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1663< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1415( - source_code, - mode, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1664< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1415( - source_code, - mode, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1665< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1416( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1666< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1416( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1667< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1416( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1668< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1417( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1669< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Parameter, TextSize), - __7: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1417( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1670< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), - __8: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1417( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1671< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1418( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1672< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), - __8: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1418( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1673< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Parameter, TextSize), - __9: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1418( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - __8, - __9, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1674< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1419( - source_code, - mode, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1675< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1419( - source_code, - mode, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1676< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1419( - source_code, - mode, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1677< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1420( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1678< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1420( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1679< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1420( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1680< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1421( - source_code, - mode, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1681< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1421( - source_code, - mode, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1682< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1421( - source_code, - mode, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1683< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1422( - source_code, - mode, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1684< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1422( - source_code, - mode, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1685< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1422( - source_code, - mode, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1686< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1423( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1687< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1423( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1688< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1423( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1689< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1424( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1690< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1424( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1691< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1424( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1692< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1425( - source_code, - mode, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1693< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1425( - source_code, - mode, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1694< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1425( - source_code, - mode, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1695< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1426( - source_code, - mode, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1696< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1426( - source_code, - mode, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1697< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1426( - source_code, - mode, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1698< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1427( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1699< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1427( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1700< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1427( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1701< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1428( - source_code, - mode, - __temp0, - __1, - __2, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1702< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1428( - source_code, - mode, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1703< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1428( - source_code, - mode, - __temp0, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1704< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1429( - source_code, - mode, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1705< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1429( - source_code, - mode, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1706< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1429( - source_code, - mode, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1707< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1430( - source_code, - mode, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1708< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1430( - source_code, - mode, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1709< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1430( - source_code, - mode, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1710< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1431( - source_code, - mode, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1711< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1431( - source_code, - mode, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1712< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Parameter, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1431( - source_code, - mode, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1713< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action451( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1432( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1714< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __2.2; - let __temp0 = __action700( - source_code, - mode, - __0, - __1, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1432( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1715< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __3.2; - let __temp0 = __action701( - source_code, - mode, - __0, - __1, - __2, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1432( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1716< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameters, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, core::option::Option<(Box, AnyStringKind)>, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Result> -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action284( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1338( - source_code, - mode, - __0, - __temp0, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1717< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, core::option::Option<(Box, AnyStringKind)>, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Result> -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action285( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1338( - source_code, - mode, - __0, - __temp0, - __1, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1718< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, core::option::Option, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, core::option::Option, TextSize), - __3: (TextSize, Option, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action278( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1486( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1719< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, core::option::Option, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, core::option::Option, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __2.2; - let __end0 = __2.2; - let __temp0 = __action279( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1486( - source_code, - mode, - __0, - __1, - __2, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1720< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), -) -> ast::ExceptHandler -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action324( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action781( - source_code, - mode, - __0, - __temp0, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1721< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Suite, TextSize), -) -> ast::ExceptHandler -{ - let __start0 = __0.2; - let __end0 = __1.0; - let __temp0 = __action325( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action781( - source_code, - mode, - __0, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1722< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Option -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action324( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action917( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1723< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> Option -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action325( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action917( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1724< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, Option, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __start1 = __2.0; - let __end1 = __2.2; - let __temp0 = __action324( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action324( - source_code, - mode, - __2, - ); - let __temp1 = (__start1, __temp1, __end1); - __action1718( - source_code, - mode, - __temp0, - __1, - __temp1, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1725< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, Option, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __start1 = __1.2; - let __end1 = __2.0; - let __temp0 = __action324( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action325( - source_code, - mode, - &__start1, - &__end1, - ); - let __temp1 = (__start1, __temp1, __end1); - __action1718( - source_code, - mode, - __temp0, - __1, - __temp1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1726< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, Option, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __start1 = __1.0; - let __end1 = __1.2; - let __temp0 = __action325( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action324( - source_code, - mode, - __1, - ); - let __temp1 = (__start1, __temp1, __end1); - __action1718( - source_code, - mode, - __temp0, - __0, - __temp1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1727< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, Option, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __start1 = __0.2; - let __end1 = __1.0; - let __temp0 = __action325( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action325( - source_code, - mode, - &__start1, - &__end1, - ); - let __temp1 = (__start1, __temp1, __end1); - __action1718( - source_code, - mode, - __temp0, - __0, - __temp1, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1728< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __start1 = __2.0; - let __end1 = __2.2; - let __temp0 = __action324( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action324( - source_code, - mode, - __2, - ); - let __temp1 = (__start1, __temp1, __end1); - __action1719( - source_code, - mode, - __temp0, - __1, - __temp1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1729< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __start1 = __1.2; - let __end1 = __1.2; - let __temp0 = __action324( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action325( - source_code, - mode, - &__start1, - &__end1, - ); - let __temp1 = (__start1, __temp1, __end1); - __action1719( - source_code, - mode, - __temp0, - __1, - __temp1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1730< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __start1 = __1.0; - let __end1 = __1.2; - let __temp0 = __action325( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action324( - source_code, - mode, - __1, - ); - let __temp1 = (__start1, __temp1, __end1); - __action1719( - source_code, - mode, - __temp0, - __0, - __temp1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1731< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.0; - let __start1 = __0.2; - let __end1 = __0.2; - let __temp0 = __action325( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - let __temp1 = __action325( - source_code, - mode, - &__start1, - &__end1, - ); - let __temp1 = (__start1, __temp1, __end1); - __action1719( - source_code, - mode, - __temp0, - __0, - __temp1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1732< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, token::Tok, TextSize), - __9: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.0; - let __end0 = __4.2; - let __temp0 = __action236( - source_code, - mode, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1117( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __5, - __6, - __7, - __8, - __9, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1733< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.0; - let __end0 = __4.2; - let __temp0 = __action236( - source_code, - mode, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1118( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1734< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action236( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1119( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1735< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action236( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1120( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1736< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> core::option::Option -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action236( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action396( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1737< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action236( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action31( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1738< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action236( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action33( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1739< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Mod -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action236( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1495( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1740< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __2: (TextSize, alloc::vec::Vec, TextSize), -) -> ast::Mod -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action236( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1496( - source_code, - mode, - __0, - __temp0, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1741< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action1736( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1313( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1742< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> ast::Stmt -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action397( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1313( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1743< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __1.0; - let __end0 = __1.2; - let __temp0 = __action1736( - source_code, - mode, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1520( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1744< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), -) -> crate::parser::ParenthesizedExpr -{ - let __start0 = __0.2; - let __end0 = __0.2; - let __temp0 = __action397( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1520( - source_code, - mode, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1745< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action1738( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1524( - source_code, - mode, - __temp0, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1746< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, alloc::vec::Vec, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action1738( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1525( - source_code, - mode, - __temp0, - __1, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1747< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __1: (TextSize, ast::Operator, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Result> -{ - let __start0 = __0.0; - let __end0 = __0.2; - let __temp0 = __action1738( - source_code, - mode, - __0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1302( - source_code, - mode, - __temp0, - __1, - __2, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1748< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, ast::TypeParams, TextSize), - __3: (TextSize, ast::Arguments, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action306( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1550( - source_code, - mode, - __0, - __1, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1749< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, ast::Arguments, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action307( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1550( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1750< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, ast::TypeParams, TextSize), - __4: (TextSize, ast::Arguments, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action306( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1551( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1751< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, ast::Arguments, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action307( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1551( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1752< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, ast::TypeParams, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action306( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1552( - source_code, - mode, - __0, - __1, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1753< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action307( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1552( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1754< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, ast::TypeParams, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action306( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1553( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1755< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action307( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1553( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1756< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, ast::TypeParams, TextSize), - __4: (TextSize, ast::Parameters, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action306( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1554( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1757< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, ast::Parameters, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action307( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1554( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1758< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Identifier, TextSize), - __4: (TextSize, ast::TypeParams, TextSize), - __5: (TextSize, ast::Parameters, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __8: (TextSize, token::Tok, TextSize), - __9: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.0; - let __end0 = __4.2; - let __temp0 = __action306( - source_code, - mode, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1555( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __5, - __6, - __7, - __8, - __9, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1759< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Identifier, TextSize), - __4: (TextSize, ast::Parameters, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __4.0; - let __temp0 = __action307( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1555( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1760< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, ast::TypeParams, TextSize), - __4: (TextSize, ast::Parameters, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action306( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1556( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1761< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, ast::Parameters, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action307( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1556( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1762< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Identifier, TextSize), - __4: (TextSize, ast::TypeParams, TextSize), - __5: (TextSize, ast::Parameters, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __4.0; - let __end0 = __4.2; - let __temp0 = __action306( - source_code, - mode, - __4, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1557( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1763< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, ast::Identifier, TextSize), - __4: (TextSize, ast::Parameters, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.2; - let __end0 = __4.0; - let __temp0 = __action307( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1557( - source_code, - mode, - __0, - __1, - __2, - __3, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1764< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, ast::TypeParams, TextSize), - __3: (TextSize, ast::Parameters, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action306( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1558( - source_code, - mode, - __0, - __1, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1765< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, ast::Parameters, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action307( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1558( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1766< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, ast::TypeParams, TextSize), - __4: (TextSize, ast::Parameters, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __7: (TextSize, token::Tok, TextSize), - __8: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action306( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1559( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - __6, - __7, - __8, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1767< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, ast::Parameters, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, crate::parser::ParenthesizedExpr, TextSize), - __6: (TextSize, token::Tok, TextSize), - __7: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action307( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1559( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - __5, - __6, - __7, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1768< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, ast::TypeParams, TextSize), - __3: (TextSize, ast::Parameters, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action306( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1560( - source_code, - mode, - __0, - __1, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1769< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Identifier, TextSize), - __2: (TextSize, ast::Parameters, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action307( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1560( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1770< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, ast::TypeParams, TextSize), - __4: (TextSize, ast::Parameters, TextSize), - __5: (TextSize, token::Tok, TextSize), - __6: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action306( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1561( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1771< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, alloc::vec::Vec, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, ast::Identifier, TextSize), - __3: (TextSize, ast::Parameters, TextSize), - __4: (TextSize, token::Tok, TextSize), - __5: (TextSize, ast::Suite, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action307( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1561( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - __4, - __5, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1772< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Expr, TextSize), - __2: (TextSize, ast::TypeParams, TextSize), - __3: (TextSize, token::Tok, TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Stmt -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action306( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1506( - source_code, - mode, - __0, - __1, - __temp0, - __3, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1773< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Expr, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> ast::Stmt -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action307( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1506( - source_code, - mode, - __0, - __1, - __temp0, - __2, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1774< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameters, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, (Box, AnyStringKind), TextSize), - __4: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Result> -{ - let __start0 = __3.0; - let __end0 = __3.2; - let __temp0 = __action282( - source_code, - mode, - __3, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1716( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __4, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1775< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, ast::Parameters, TextSize), - __2: (TextSize, token::Tok, TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Result> -{ - let __start0 = __2.2; - let __end0 = __3.0; - let __temp0 = __action283( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1716( - source_code, - mode, - __0, - __1, - __2, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1776< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, (Box, AnyStringKind), TextSize), - __3: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Result> -{ - let __start0 = __2.0; - let __end0 = __2.2; - let __temp0 = __action282( - source_code, - mode, - __2, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1717( - source_code, - mode, - __0, - __1, - __temp0, - __3, - ) -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments)] -fn __action1777< ->( - source_code: &str, - mode: Mode, - __0: (TextSize, token::Tok, TextSize), - __1: (TextSize, token::Tok, TextSize), - __2: (TextSize, crate::parser::ParenthesizedExpr, TextSize), -) -> Result> -{ - let __start0 = __1.2; - let __end0 = __2.0; - let __temp0 = __action283( - source_code, - mode, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action1717( - source_code, - mode, - __0, - __1, - __temp0, - __2, - ) -} -#[allow(clippy::type_complexity)] - -pub trait __ToTriple<> -{ - fn to_triple(value: Self) -> Result<(TextSize,token::Tok,TextSize), __lalrpop_util::ParseError>; -} - -impl<> __ToTriple<> for (TextSize, token::Tok, TextSize) -{ - fn to_triple(value: Self) -> Result<(TextSize,token::Tok,TextSize), __lalrpop_util::ParseError> { - Ok(value) - } -} -impl<> __ToTriple<> for Result<(TextSize, token::Tok, TextSize), LexicalError> -{ - fn to_triple(value: Self) -> Result<(TextSize,token::Tok,TextSize), __lalrpop_util::ParseError> { - match value { - Ok(v) => Ok(v), - Err(error) => Err(__lalrpop_util::ParseError::User { error }), - } - } -} diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__ann_assign_name.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__ann_assign_name.snap deleted file mode 100644 index 656770c094..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__ann_assign_name.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - AnnAssign( - StmtAnnAssign { - range: 0..10, - target: Name( - ExprName { - range: 0..1, - id: "x", - ctx: Store, - }, - ), - annotation: Name( - ExprName { - range: 3..6, - id: "int", - ctx: Load, - }, - ), - value: Some( - NumberLiteral( - ExprNumberLiteral { - range: 9..10, - value: Int( - 1, - ), - }, - ), - ), - simple: true, - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_attribute.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_attribute.snap deleted file mode 100644 index 76cec0d3a4..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_attribute.snap +++ /dev/null @@ -1,63 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - Assign( - StmtAssign { - range: 0..15, - targets: [ - Attribute( - ExprAttribute { - range: 0..3, - value: Name( - ExprName { - range: 0..1, - id: "x", - ctx: Load, - }, - ), - attr: Identifier { - id: "y", - range: 2..3, - }, - ctx: Store, - }, - ), - ], - value: Tuple( - ExprTuple { - range: 6..15, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 7..8, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 10..11, - value: Int( - 2, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 13..14, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_for.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_for.snap deleted file mode 100644 index 8dcbeb2c5d..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_for.snap +++ /dev/null @@ -1,60 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - For( - StmtFor { - range: 0..24, - is_async: false, - target: Name( - ExprName { - range: 4..5, - id: "x", - ctx: Store, - }, - ), - iter: Tuple( - ExprTuple { - range: 9..18, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 10..11, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 13..14, - value: Int( - 2, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 16..17, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - body: [ - Pass( - StmtPass { - range: 20..24, - }, - ), - ], - orelse: [], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list.snap deleted file mode 100644 index db36fdb708..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list.snap +++ /dev/null @@ -1,68 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - Assign( - StmtAssign { - range: 0..18, - targets: [ - List( - ExprList { - range: 0..6, - elts: [ - Name( - ExprName { - range: 1..2, - id: "x", - ctx: Store, - }, - ), - Name( - ExprName { - range: 4..5, - id: "y", - ctx: Store, - }, - ), - ], - ctx: Store, - }, - ), - ], - value: Tuple( - ExprTuple { - range: 9..18, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 10..11, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 13..14, - value: Int( - 2, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 16..17, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list_comp.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list_comp.snap deleted file mode 100644 index 1e53db4378..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list_comp.snap +++ /dev/null @@ -1,79 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - Assign( - StmtAssign { - range: 0..26, - targets: [ - Name( - ExprName { - range: 0..1, - id: "x", - ctx: Store, - }, - ), - ], - value: ListComp( - ExprListComp { - range: 4..26, - elt: Name( - ExprName { - range: 5..6, - id: "y", - ctx: Load, - }, - ), - generators: [ - Comprehension { - range: 7..25, - target: Name( - ExprName { - range: 11..12, - id: "y", - ctx: Store, - }, - ), - iter: Tuple( - ExprTuple { - range: 16..25, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 17..18, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 20..21, - value: Int( - 2, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 23..24, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - ifs: [], - is_async: false, - }, - ], - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_name.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_name.snap deleted file mode 100644 index 5370e550a8..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_name.snap +++ /dev/null @@ -1,53 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - Assign( - StmtAssign { - range: 0..13, - targets: [ - Name( - ExprName { - range: 0..1, - id: "x", - ctx: Store, - }, - ), - ], - value: Tuple( - ExprTuple { - range: 4..13, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 5..6, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 8..9, - value: Int( - 2, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 11..12, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_named_expr.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_named_expr.snap deleted file mode 100644 index 63b8236e4e..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_named_expr.snap +++ /dev/null @@ -1,39 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - If( - StmtIf { - range: 0..14, - test: Named( - ExprNamed { - range: 3..8, - target: Name( - ExprName { - range: 3..4, - id: "x", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 7..8, - value: Int( - 1, - ), - }, - ), - }, - ), - body: [ - Pass( - StmtPass { - range: 10..14, - }, - ), - ], - elif_else_clauses: [], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_set_comp.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_set_comp.snap deleted file mode 100644 index 0ddedadeb0..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_set_comp.snap +++ /dev/null @@ -1,79 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - Assign( - StmtAssign { - range: 0..26, - targets: [ - Name( - ExprName { - range: 0..1, - id: "x", - ctx: Store, - }, - ), - ], - value: SetComp( - ExprSetComp { - range: 4..26, - elt: Name( - ExprName { - range: 5..6, - id: "y", - ctx: Load, - }, - ), - generators: [ - Comprehension { - range: 7..25, - target: Name( - ExprName { - range: 11..12, - id: "y", - ctx: Store, - }, - ), - iter: Tuple( - ExprTuple { - range: 16..25, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 17..18, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 20..21, - value: Int( - 2, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 23..24, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - ifs: [], - is_async: false, - }, - ], - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_starred.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_starred.snap deleted file mode 100644 index 7e1d7b5eb5..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_starred.snap +++ /dev/null @@ -1,75 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - Assign( - StmtAssign { - range: 0..19, - targets: [ - Tuple( - ExprTuple { - range: 0..7, - elts: [ - Name( - ExprName { - range: 1..2, - id: "x", - ctx: Store, - }, - ), - Starred( - ExprStarred { - range: 4..6, - value: Name( - ExprName { - range: 5..6, - id: "y", - ctx: Store, - }, - ), - ctx: Store, - }, - ), - ], - ctx: Store, - parenthesized: true, - }, - ), - ], - value: Tuple( - ExprTuple { - range: 10..19, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 11..12, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 14..15, - value: Int( - 2, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 17..18, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_subscript.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_subscript.snap deleted file mode 100644 index d0ba09c0fc..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_subscript.snap +++ /dev/null @@ -1,66 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - Assign( - StmtAssign { - range: 0..16, - targets: [ - Subscript( - ExprSubscript { - range: 0..4, - value: Name( - ExprName { - range: 0..1, - id: "x", - ctx: Load, - }, - ), - slice: Name( - ExprName { - range: 2..3, - id: "y", - ctx: Load, - }, - ), - ctx: Store, - }, - ), - ], - value: Tuple( - ExprTuple { - range: 7..16, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 8..9, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 11..12, - value: Int( - 2, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 14..15, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_tuple.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_tuple.snap deleted file mode 100644 index 125ab24786..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_tuple.snap +++ /dev/null @@ -1,69 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - Assign( - StmtAssign { - range: 0..18, - targets: [ - Tuple( - ExprTuple { - range: 0..6, - elts: [ - Name( - ExprName { - range: 1..2, - id: "x", - ctx: Store, - }, - ), - Name( - ExprName { - range: 4..5, - id: "y", - ctx: Store, - }, - ), - ], - ctx: Store, - parenthesized: true, - }, - ), - ], - value: Tuple( - ExprTuple { - range: 9..18, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 10..11, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 13..14, - value: Int( - 2, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 16..17, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_with.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_with.snap deleted file mode 100644 index 9700d860a8..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_with.snap +++ /dev/null @@ -1,41 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - With( - StmtWith { - range: 0..17, - is_async: false, - items: [ - WithItem { - range: 5..11, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 5..6, - value: Int( - 1, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 10..11, - id: "x", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 13..17, - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_attribute.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_attribute.snap deleted file mode 100644 index 9a2abb4150..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_attribute.snap +++ /dev/null @@ -1,62 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - AugAssign( - StmtAugAssign { - range: 0..16, - target: Attribute( - ExprAttribute { - range: 0..3, - value: Name( - ExprName { - range: 0..1, - id: "x", - ctx: Load, - }, - ), - attr: Identifier { - id: "y", - range: 2..3, - }, - ctx: Store, - }, - ), - op: Add, - value: Tuple( - ExprTuple { - range: 7..16, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 8..9, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 11..12, - value: Int( - 2, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 14..15, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_name.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_name.snap deleted file mode 100644 index 760e6d3638..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_name.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - AugAssign( - StmtAugAssign { - range: 0..6, - target: Name( - ExprName { - range: 0..1, - id: "x", - ctx: Store, - }, - ), - op: Add, - value: NumberLiteral( - ExprNumberLiteral { - range: 5..6, - value: Int( - 1, - ), - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_subscript.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_subscript.snap deleted file mode 100644 index c6cf4f5504..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_subscript.snap +++ /dev/null @@ -1,65 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - AugAssign( - StmtAugAssign { - range: 0..17, - target: Subscript( - ExprSubscript { - range: 0..4, - value: Name( - ExprName { - range: 0..1, - id: "x", - ctx: Load, - }, - ), - slice: Name( - ExprName { - range: 2..3, - id: "y", - ctx: Load, - }, - ), - ctx: Store, - }, - ), - op: Add, - value: Tuple( - ExprTuple { - range: 8..17, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 9..10, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 12..13, - value: Int( - 2, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 15..16, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__del_attribute.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__del_attribute.snap deleted file mode 100644 index 0ee68d973c..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__del_attribute.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - Delete( - StmtDelete { - range: 0..7, - targets: [ - Attribute( - ExprAttribute { - range: 4..7, - value: Name( - ExprName { - range: 4..5, - id: "x", - ctx: Load, - }, - ), - attr: Identifier { - id: "y", - range: 6..7, - }, - ctx: Del, - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__del_name.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__del_name.snap deleted file mode 100644 index c885abecbb..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__del_name.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - Delete( - StmtDelete { - range: 0..5, - targets: [ - Name( - ExprName { - range: 4..5, - id: "x", - ctx: Del, - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__del_subscript.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__del_subscript.snap deleted file mode 100644 index f6333d4625..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__del_subscript.snap +++ /dev/null @@ -1,33 +0,0 @@ ---- -source: crates/ruff_python_parser/src/context.rs -expression: parse_ast ---- -[ - Delete( - StmtDelete { - range: 0..8, - targets: [ - Subscript( - ExprSubscript { - range: 4..8, - value: Name( - ExprName { - range: 4..5, - id: "x", - ctx: Load, - }, - ), - slice: Name( - ExprName { - range: 6..7, - id: "y", - ctx: Load, - }, - ), - ctx: Del, - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args.snap deleted file mode 100644 index ad7dbadf9a..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args.snap +++ /dev/null @@ -1,73 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..23, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..17, - posonlyargs: [], - args: [], - vararg: None, - kwonlyargs: [ - ParameterWithDefault { - range: 9..10, - parameter: Parameter { - range: 9..10, - name: Identifier { - id: "a", - range: 9..10, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 12..13, - parameter: Parameter { - range: 12..13, - name: Identifier { - id: "b", - range: 12..13, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 15..16, - parameter: Parameter { - range: 15..16, - name: Identifier { - id: "c", - range: 15..16, - }, - annotation: None, - }, - default: None, - }, - ], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 19..23, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults.snap deleted file mode 100644 index 4fc4042179..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults.snap +++ /dev/null @@ -1,91 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..29, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..23, - posonlyargs: [], - args: [], - vararg: None, - kwonlyargs: [ - ParameterWithDefault { - range: 9..10, - parameter: Parameter { - range: 9..10, - name: Identifier { - id: "a", - range: 9..10, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 12..16, - parameter: Parameter { - range: 12..13, - name: Identifier { - id: "b", - range: 12..13, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 14..16, - value: Int( - 20, - ), - }, - ), - ), - }, - ParameterWithDefault { - range: 18..22, - parameter: Parameter { - range: 18..19, - name: Identifier { - id: "c", - range: 18..19, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 20..22, - value: Int( - 30, - ), - }, - ), - ), - }, - ], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 25..29, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults_and_kwargs.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults_and_kwargs.snap deleted file mode 100644 index 85cef58628..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults_and_kwargs.snap +++ /dev/null @@ -1,100 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..39, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..33, - posonlyargs: [], - args: [], - vararg: None, - kwonlyargs: [ - ParameterWithDefault { - range: 9..10, - parameter: Parameter { - range: 9..10, - name: Identifier { - id: "a", - range: 9..10, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 12..16, - parameter: Parameter { - range: 12..13, - name: Identifier { - id: "b", - range: 12..13, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 14..16, - value: Int( - 20, - ), - }, - ), - ), - }, - ParameterWithDefault { - range: 18..22, - parameter: Parameter { - range: 18..19, - name: Identifier { - id: "c", - range: 18..19, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 20..22, - value: Int( - 30, - ), - }, - ), - ), - }, - ], - kwarg: Some( - Parameter { - range: 24..32, - name: Identifier { - id: "kwargs", - range: 26..32, - }, - annotation: None, - }, - ), - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 35..39, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults_and_varargs.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults_and_varargs.snap deleted file mode 100644 index 2120c99122..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults_and_varargs.snap +++ /dev/null @@ -1,100 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..33, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..27, - posonlyargs: [], - args: [], - vararg: Some( - Parameter { - range: 6..11, - name: Identifier { - id: "args", - range: 7..11, - }, - annotation: None, - }, - ), - kwonlyargs: [ - ParameterWithDefault { - range: 13..14, - parameter: Parameter { - range: 13..14, - name: Identifier { - id: "a", - range: 13..14, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 16..20, - parameter: Parameter { - range: 16..17, - name: Identifier { - id: "b", - range: 16..17, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 18..20, - value: Int( - 20, - ), - }, - ), - ), - }, - ParameterWithDefault { - range: 22..26, - parameter: Parameter { - range: 22..23, - name: Identifier { - id: "c", - range: 22..23, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 24..26, - value: Int( - 30, - ), - }, - ), - ), - }, - ], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 29..33, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults_and_varargs_and_kwargs.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults_and_varargs_and_kwargs.snap deleted file mode 100644 index 3d4f0637e4..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults_and_varargs_and_kwargs.snap +++ /dev/null @@ -1,109 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..43, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..37, - posonlyargs: [], - args: [], - vararg: Some( - Parameter { - range: 6..11, - name: Identifier { - id: "args", - range: 7..11, - }, - annotation: None, - }, - ), - kwonlyargs: [ - ParameterWithDefault { - range: 13..14, - parameter: Parameter { - range: 13..14, - name: Identifier { - id: "a", - range: 13..14, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 16..20, - parameter: Parameter { - range: 16..17, - name: Identifier { - id: "b", - range: 16..17, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 18..20, - value: Int( - 20, - ), - }, - ), - ), - }, - ParameterWithDefault { - range: 22..26, - parameter: Parameter { - range: 22..23, - name: Identifier { - id: "c", - range: 22..23, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 24..26, - value: Int( - 30, - ), - }, - ), - ), - }, - ], - kwarg: Some( - Parameter { - range: 28..36, - name: Identifier { - id: "kwargs", - range: 30..36, - }, - annotation: None, - }, - ), - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 39..43, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_no_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_no_args.snap deleted file mode 100644 index 4e2121628d..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_no_args.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..13, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..7, - posonlyargs: [], - args: [], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 9..13, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_no_args_with_ranges.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_no_args_with_ranges.snap deleted file mode 100644 index 4e2121628d..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_no_args_with_ranges.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..13, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..7, - posonlyargs: [], - args: [], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 9..13, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args.snap deleted file mode 100644 index 9d6cff1a2d..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args.snap +++ /dev/null @@ -1,111 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..35, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..29, - posonlyargs: [ - ParameterWithDefault { - range: 6..7, - parameter: Parameter { - range: 6..7, - name: Identifier { - id: "a", - range: 6..7, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 9..10, - parameter: Parameter { - range: 9..10, - name: Identifier { - id: "b", - range: 9..10, - }, - annotation: None, - }, - default: None, - }, - ], - args: [ - ParameterWithDefault { - range: 15..16, - parameter: Parameter { - range: 15..16, - name: Identifier { - id: "c", - range: 15..16, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [ - ParameterWithDefault { - range: 21..22, - parameter: Parameter { - range: 21..22, - name: Identifier { - id: "d", - range: 21..22, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 24..25, - parameter: Parameter { - range: 24..25, - name: Identifier { - id: "e", - range: 24..25, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 27..28, - parameter: Parameter { - range: 27..28, - name: Identifier { - id: "f", - range: 27..28, - }, - annotation: None, - }, - default: None, - }, - ], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 31..35, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults.snap deleted file mode 100644 index dd47b9a62f..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults.snap +++ /dev/null @@ -1,129 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..41, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..35, - posonlyargs: [ - ParameterWithDefault { - range: 6..7, - parameter: Parameter { - range: 6..7, - name: Identifier { - id: "a", - range: 6..7, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 9..10, - parameter: Parameter { - range: 9..10, - name: Identifier { - id: "b", - range: 9..10, - }, - annotation: None, - }, - default: None, - }, - ], - args: [ - ParameterWithDefault { - range: 15..16, - parameter: Parameter { - range: 15..16, - name: Identifier { - id: "c", - range: 15..16, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [ - ParameterWithDefault { - range: 21..22, - parameter: Parameter { - range: 21..22, - name: Identifier { - id: "d", - range: 21..22, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 24..28, - parameter: Parameter { - range: 24..25, - name: Identifier { - id: "e", - range: 24..25, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 26..28, - value: Int( - 20, - ), - }, - ), - ), - }, - ParameterWithDefault { - range: 30..34, - parameter: Parameter { - range: 30..31, - name: Identifier { - id: "f", - range: 30..31, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 32..34, - value: Int( - 30, - ), - }, - ), - ), - }, - ], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 37..41, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_kwargs.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_kwargs.snap deleted file mode 100644 index 2ccce4990c..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_kwargs.snap +++ /dev/null @@ -1,138 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..51, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..45, - posonlyargs: [ - ParameterWithDefault { - range: 6..7, - parameter: Parameter { - range: 6..7, - name: Identifier { - id: "a", - range: 6..7, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 9..10, - parameter: Parameter { - range: 9..10, - name: Identifier { - id: "b", - range: 9..10, - }, - annotation: None, - }, - default: None, - }, - ], - args: [ - ParameterWithDefault { - range: 15..16, - parameter: Parameter { - range: 15..16, - name: Identifier { - id: "c", - range: 15..16, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [ - ParameterWithDefault { - range: 21..22, - parameter: Parameter { - range: 21..22, - name: Identifier { - id: "d", - range: 21..22, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 24..28, - parameter: Parameter { - range: 24..25, - name: Identifier { - id: "e", - range: 24..25, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 26..28, - value: Int( - 20, - ), - }, - ), - ), - }, - ParameterWithDefault { - range: 30..34, - parameter: Parameter { - range: 30..31, - name: Identifier { - id: "f", - range: 30..31, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 32..34, - value: Int( - 30, - ), - }, - ), - ), - }, - ], - kwarg: Some( - Parameter { - range: 36..44, - name: Identifier { - id: "kwargs", - range: 38..44, - }, - annotation: None, - }, - ), - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 47..51, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs.snap deleted file mode 100644 index d3b39aa3d0..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs.snap +++ /dev/null @@ -1,138 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..45, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..39, - posonlyargs: [ - ParameterWithDefault { - range: 6..7, - parameter: Parameter { - range: 6..7, - name: Identifier { - id: "a", - range: 6..7, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 9..10, - parameter: Parameter { - range: 9..10, - name: Identifier { - id: "b", - range: 9..10, - }, - annotation: None, - }, - default: None, - }, - ], - args: [ - ParameterWithDefault { - range: 15..16, - parameter: Parameter { - range: 15..16, - name: Identifier { - id: "c", - range: 15..16, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: Some( - Parameter { - range: 18..23, - name: Identifier { - id: "args", - range: 19..23, - }, - annotation: None, - }, - ), - kwonlyargs: [ - ParameterWithDefault { - range: 25..26, - parameter: Parameter { - range: 25..26, - name: Identifier { - id: "d", - range: 25..26, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 28..32, - parameter: Parameter { - range: 28..29, - name: Identifier { - id: "e", - range: 28..29, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 30..32, - value: Int( - 20, - ), - }, - ), - ), - }, - ParameterWithDefault { - range: 34..38, - parameter: Parameter { - range: 34..35, - name: Identifier { - id: "f", - range: 34..35, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 36..38, - value: Int( - 30, - ), - }, - ), - ), - }, - ], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 41..45, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs.snap deleted file mode 100644 index ff402928cc..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs.snap +++ /dev/null @@ -1,147 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..55, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..49, - posonlyargs: [ - ParameterWithDefault { - range: 6..7, - parameter: Parameter { - range: 6..7, - name: Identifier { - id: "a", - range: 6..7, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 9..10, - parameter: Parameter { - range: 9..10, - name: Identifier { - id: "b", - range: 9..10, - }, - annotation: None, - }, - default: None, - }, - ], - args: [ - ParameterWithDefault { - range: 15..16, - parameter: Parameter { - range: 15..16, - name: Identifier { - id: "c", - range: 15..16, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: Some( - Parameter { - range: 18..23, - name: Identifier { - id: "args", - range: 19..23, - }, - annotation: None, - }, - ), - kwonlyargs: [ - ParameterWithDefault { - range: 25..26, - parameter: Parameter { - range: 25..26, - name: Identifier { - id: "d", - range: 25..26, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 28..32, - parameter: Parameter { - range: 28..29, - name: Identifier { - id: "e", - range: 28..29, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 30..32, - value: Int( - 20, - ), - }, - ), - ), - }, - ParameterWithDefault { - range: 34..38, - parameter: Parameter { - range: 34..35, - name: Identifier { - id: "f", - range: 34..35, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 36..38, - value: Int( - 30, - ), - }, - ), - ), - }, - ], - kwarg: Some( - Parameter { - range: 40..48, - name: Identifier { - id: "kwargs", - range: 42..48, - }, - annotation: None, - }, - ), - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 51..55, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args.snap deleted file mode 100644 index 788b1b7a49..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args.snap +++ /dev/null @@ -1,73 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..20, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..14, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 6..7, - parameter: Parameter { - range: 6..7, - name: Identifier { - id: "a", - range: 6..7, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 9..10, - parameter: Parameter { - range: 9..10, - name: Identifier { - id: "b", - range: 9..10, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 12..13, - parameter: Parameter { - range: 12..13, - name: Identifier { - id: "c", - range: 12..13, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 16..20, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args_with_defaults.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args_with_defaults.snap deleted file mode 100644 index 267a2d118d..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args_with_defaults.snap +++ /dev/null @@ -1,92 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..29, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..23, - posonlyargs: [ - ParameterWithDefault { - range: 6..7, - parameter: Parameter { - range: 6..7, - name: Identifier { - id: "a", - range: 6..7, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 9..13, - parameter: Parameter { - range: 9..10, - name: Identifier { - id: "b", - range: 9..10, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 11..13, - value: Int( - 20, - ), - }, - ), - ), - }, - ], - args: [ - ParameterWithDefault { - range: 18..22, - parameter: Parameter { - range: 18..19, - name: Identifier { - id: "c", - range: 18..19, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 20..22, - value: Int( - 30, - ), - }, - ), - ), - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 25..29, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args_with_defaults_and_varargs_and_kwargs.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args_with_defaults_and_varargs_and_kwargs.snap deleted file mode 100644 index 5a04f0568e..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args_with_defaults_and_varargs_and_kwargs.snap +++ /dev/null @@ -1,110 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..46, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..40, - posonlyargs: [ - ParameterWithDefault { - range: 6..7, - parameter: Parameter { - range: 6..7, - name: Identifier { - id: "a", - range: 6..7, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 9..13, - parameter: Parameter { - range: 9..10, - name: Identifier { - id: "b", - range: 9..10, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 11..13, - value: Int( - 20, - ), - }, - ), - ), - }, - ], - args: [ - ParameterWithDefault { - range: 18..22, - parameter: Parameter { - range: 18..19, - name: Identifier { - id: "c", - range: 18..19, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 20..22, - value: Int( - 30, - ), - }, - ), - ), - }, - ], - vararg: Some( - Parameter { - range: 24..29, - name: Identifier { - id: "args", - range: 25..29, - }, - annotation: None, - }, - ), - kwonlyargs: [], - kwarg: Some( - Parameter { - range: 31..39, - name: Identifier { - id: "kwargs", - range: 33..39, - }, - annotation: None, - }, - ), - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 42..46, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args_with_ranges.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args_with_ranges.snap deleted file mode 100644 index 788b1b7a49..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args_with_ranges.snap +++ /dev/null @@ -1,73 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..20, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..14, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 6..7, - parameter: Parameter { - range: 6..7, - name: Identifier { - id: "a", - range: 6..7, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 9..10, - parameter: Parameter { - range: 9..10, - name: Identifier { - id: "b", - range: 9..10, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 12..13, - parameter: Parameter { - range: 12..13, - name: Identifier { - id: "c", - range: 12..13, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 16..20, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_posonly_and_pos_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_posonly_and_pos_args.snap deleted file mode 100644 index 70057ff683..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_posonly_and_pos_args.snap +++ /dev/null @@ -1,74 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - FunctionDef( - StmtFunctionDef { - range: 0..23, - is_async: false, - decorator_list: [], - name: Identifier { - id: "f", - range: 4..5, - }, - type_params: None, - parameters: Parameters { - range: 5..17, - posonlyargs: [ - ParameterWithDefault { - range: 6..7, - parameter: Parameter { - range: 6..7, - name: Identifier { - id: "a", - range: 6..7, - }, - annotation: None, - }, - default: None, - }, - ], - args: [ - ParameterWithDefault { - range: 12..13, - parameter: Parameter { - range: 12..13, - name: Identifier { - id: "b", - range: 12..13, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 15..16, - parameter: Parameter { - range: 15..16, - name: Identifier { - id: "c", - range: 15..16, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 19..23, - }, - ), - ], - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args.snap deleted file mode 100644 index 38d20e2b29..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args.snap +++ /dev/null @@ -1,73 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - Expr( - StmtExpr { - range: 0..20, - value: Lambda( - ExprLambda { - range: 0..20, - parameters: Some( - Parameters { - range: 7..17, - posonlyargs: [], - args: [], - vararg: None, - kwonlyargs: [ - ParameterWithDefault { - range: 10..11, - parameter: Parameter { - range: 10..11, - name: Identifier { - id: "a", - range: 10..11, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 13..14, - parameter: Parameter { - range: 13..14, - name: Identifier { - id: "b", - range: 13..14, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 16..17, - parameter: Parameter { - range: 16..17, - name: Identifier { - id: "c", - range: 16..17, - }, - annotation: None, - }, - default: None, - }, - ], - kwarg: None, - }, - ), - body: NumberLiteral( - ExprNumberLiteral { - range: 19..20, - value: Int( - 1, - ), - }, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args_with_defaults.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args_with_defaults.snap deleted file mode 100644 index 3defc8ae80..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args_with_defaults.snap +++ /dev/null @@ -1,91 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - Expr( - StmtExpr { - range: 0..26, - value: Lambda( - ExprLambda { - range: 0..26, - parameters: Some( - Parameters { - range: 7..23, - posonlyargs: [], - args: [], - vararg: None, - kwonlyargs: [ - ParameterWithDefault { - range: 10..11, - parameter: Parameter { - range: 10..11, - name: Identifier { - id: "a", - range: 10..11, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 13..17, - parameter: Parameter { - range: 13..14, - name: Identifier { - id: "b", - range: 13..14, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 15..17, - value: Int( - 20, - ), - }, - ), - ), - }, - ParameterWithDefault { - range: 19..23, - parameter: Parameter { - range: 19..20, - name: Identifier { - id: "c", - range: 19..20, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 21..23, - value: Int( - 30, - ), - }, - ), - ), - }, - ], - kwarg: None, - }, - ), - body: NumberLiteral( - ExprNumberLiteral { - range: 25..26, - value: Int( - 1, - ), - }, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_no_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_no_args.snap deleted file mode 100644 index 3008200f44..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_no_args.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - Expr( - StmtExpr { - range: 0..9, - value: Lambda( - ExprLambda { - range: 0..9, - parameters: None, - body: NumberLiteral( - ExprNumberLiteral { - range: 8..9, - value: Int( - 1, - ), - }, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_and_kw_only_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_and_kw_only_args.snap deleted file mode 100644 index 5758b172ce..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_and_kw_only_args.snap +++ /dev/null @@ -1,99 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - Expr( - StmtExpr { - range: 0..29, - value: Lambda( - ExprLambda { - range: 0..29, - parameters: Some( - Parameters { - range: 7..26, - posonlyargs: [ - ParameterWithDefault { - range: 7..8, - parameter: Parameter { - range: 7..8, - name: Identifier { - id: "a", - range: 7..8, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 10..11, - parameter: Parameter { - range: 10..11, - name: Identifier { - id: "b", - range: 10..11, - }, - annotation: None, - }, - default: None, - }, - ], - args: [ - ParameterWithDefault { - range: 16..17, - parameter: Parameter { - range: 16..17, - name: Identifier { - id: "c", - range: 16..17, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [ - ParameterWithDefault { - range: 22..23, - parameter: Parameter { - range: 22..23, - name: Identifier { - id: "d", - range: 22..23, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 25..26, - parameter: Parameter { - range: 25..26, - name: Identifier { - id: "e", - range: 25..26, - }, - annotation: None, - }, - default: None, - }, - ], - kwarg: None, - }, - ), - body: NumberLiteral( - ExprNumberLiteral { - range: 28..29, - value: Int( - 0, - ), - }, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_and_kw_only_args_and_vararg_and_kwarg.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_and_kw_only_args_and_vararg_and_kwarg.snap deleted file mode 100644 index bea5386896..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_and_kw_only_args_and_vararg_and_kwarg.snap +++ /dev/null @@ -1,105 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - Expr( - StmtExpr { - range: 0..32, - value: Lambda( - ExprLambda { - range: 0..32, - parameters: Some( - Parameters { - range: 7..29, - posonlyargs: [ - ParameterWithDefault { - range: 7..8, - parameter: Parameter { - range: 7..8, - name: Identifier { - id: "a", - range: 7..8, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 10..11, - parameter: Parameter { - range: 10..11, - name: Identifier { - id: "b", - range: 10..11, - }, - annotation: None, - }, - default: None, - }, - ], - args: [ - ParameterWithDefault { - range: 16..17, - parameter: Parameter { - range: 16..17, - name: Identifier { - id: "c", - range: 16..17, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: Some( - Parameter { - range: 19..21, - name: Identifier { - id: "d", - range: 20..21, - }, - annotation: None, - }, - ), - kwonlyargs: [ - ParameterWithDefault { - range: 23..24, - parameter: Parameter { - range: 23..24, - name: Identifier { - id: "e", - range: 23..24, - }, - annotation: None, - }, - default: None, - }, - ], - kwarg: Some( - Parameter { - range: 26..29, - name: Identifier { - id: "f", - range: 28..29, - }, - annotation: None, - }, - ), - }, - ), - body: NumberLiteral( - ExprNumberLiteral { - range: 31..32, - value: Int( - 0, - ), - }, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args.snap deleted file mode 100644 index 4af124410e..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args.snap +++ /dev/null @@ -1,73 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - Expr( - StmtExpr { - range: 0..17, - value: Lambda( - ExprLambda { - range: 0..17, - parameters: Some( - Parameters { - range: 7..14, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 7..8, - parameter: Parameter { - range: 7..8, - name: Identifier { - id: "a", - range: 7..8, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 10..11, - parameter: Parameter { - range: 10..11, - name: Identifier { - id: "b", - range: 10..11, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 13..14, - parameter: Parameter { - range: 13..14, - name: Identifier { - id: "c", - range: 13..14, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - ), - body: NumberLiteral( - ExprNumberLiteral { - range: 16..17, - value: Int( - 1, - ), - }, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args_with_defaults.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args_with_defaults.snap deleted file mode 100644 index 8867a6076c..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args_with_defaults.snap +++ /dev/null @@ -1,92 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - Expr( - StmtExpr { - range: 0..26, - value: Lambda( - ExprLambda { - range: 0..26, - parameters: Some( - Parameters { - range: 7..23, - posonlyargs: [ - ParameterWithDefault { - range: 7..8, - parameter: Parameter { - range: 7..8, - name: Identifier { - id: "a", - range: 7..8, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 10..14, - parameter: Parameter { - range: 10..11, - name: Identifier { - id: "b", - range: 10..11, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 12..14, - value: Int( - 20, - ), - }, - ), - ), - }, - ], - args: [ - ParameterWithDefault { - range: 19..23, - parameter: Parameter { - range: 19..20, - name: Identifier { - id: "c", - range: 19..20, - }, - annotation: None, - }, - default: Some( - NumberLiteral( - ExprNumberLiteral { - range: 21..23, - value: Int( - 30, - ), - }, - ), - ), - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - ), - body: NumberLiteral( - ExprNumberLiteral { - range: 25..26, - value: Int( - 1, - ), - }, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_posonly_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_posonly_args.snap deleted file mode 100644 index d64c4cb84d..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_posonly_args.snap +++ /dev/null @@ -1,74 +0,0 @@ ---- -source: crates/ruff_python_parser/src/function.rs -expression: parse_ast ---- -Ok( - [ - Expr( - StmtExpr { - range: 0..20, - value: Lambda( - ExprLambda { - range: 0..20, - parameters: Some( - Parameters { - range: 7..17, - posonlyargs: [ - ParameterWithDefault { - range: 7..8, - parameter: Parameter { - range: 7..8, - name: Identifier { - id: "a", - range: 7..8, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 10..11, - parameter: Parameter { - range: 10..11, - name: Identifier { - id: "b", - range: 10..11, - }, - annotation: None, - }, - default: None, - }, - ], - args: [ - ParameterWithDefault { - range: 16..17, - parameter: Parameter { - range: 16..17, - name: Identifier { - id: "c", - range: 16..17, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - ), - body: NumberLiteral( - ExprNumberLiteral { - range: 19..20, - value: Int( - 1, - ), - }, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_assignment_expr.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_assignment_expr.snap deleted file mode 100644 index cf2c840aa0..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_assignment_expr.snap +++ /dev/null @@ -1,33 +0,0 @@ ---- -source: crates/ruff_python_parser/src/invalid.rs -expression: ast ---- -Ok( - [ - Expr( - StmtExpr { - range: 0..8, - value: Named( - ExprNamed { - range: 1..7, - target: Name( - ExprName { - range: 1..2, - id: "x", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 6..7, - value: Int( - 5, - ), - }, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_attribute_normal.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_attribute_normal.snap deleted file mode 100644 index feb0fedf4b..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_attribute_normal.snap +++ /dev/null @@ -1,40 +0,0 @@ ---- -source: crates/ruff_python_parser/src/invalid.rs -expression: ast ---- -Ok( - [ - Assign( - StmtAssign { - range: 0..12, - targets: [ - Attribute( - ExprAttribute { - range: 0..7, - value: Name( - ExprName { - range: 0..3, - id: "foo", - ctx: Load, - }, - ), - attr: Identifier { - id: "bar", - range: 4..7, - }, - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 10..12, - value: Int( - 42, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_attribute_weird.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_attribute_weird.snap deleted file mode 100644 index 9e23886b10..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_attribute_weird.snap +++ /dev/null @@ -1,51 +0,0 @@ ---- -source: crates/ruff_python_parser/src/invalid.rs -expression: ast ---- -Ok( - [ - Assign( - StmtAssign { - range: 0..12, - targets: [ - Attribute( - ExprAttribute { - range: 0..7, - value: StringLiteral( - ExprStringLiteral { - range: 0..5, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 0..5, - value: "foo", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - attr: Identifier { - id: "y", - range: 6..7, - }, - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 10..12, - value: Int( - 42, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_ipy_escape_command.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_ipy_escape_command.snap deleted file mode 100644 index 8aec96f050..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_ipy_escape_command.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: crates/ruff_python_parser/src/invalid.rs -expression: ast ---- -Ok( - Module( - ModModule { - range: 0..9, - body: [ - IpyEscapeCommand( - StmtIpyEscapeCommand { - range: 0..9, - kind: Shell, - value: "foo = 42", - }, - ), - ], - }, - ), -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_list.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_list.snap deleted file mode 100644 index f2673d1c28..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_list.snap +++ /dev/null @@ -1,76 +0,0 @@ ---- -source: crates/ruff_python_parser/src/invalid.rs -expression: ast ---- -Ok( - [ - Assign( - StmtAssign { - range: 0..21, - targets: [ - List( - ExprList { - range: 0..9, - elts: [ - Name( - ExprName { - range: 1..2, - id: "x", - ctx: Store, - }, - ), - Name( - ExprName { - range: 4..5, - id: "y", - ctx: Store, - }, - ), - Name( - ExprName { - range: 7..8, - id: "z", - ctx: Store, - }, - ), - ], - ctx: Store, - }, - ), - ], - value: List( - ExprList { - range: 12..21, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 13..14, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 16..17, - value: Int( - 2, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 19..20, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_name.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_name.snap deleted file mode 100644 index 9bde5767f1..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_name.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: crates/ruff_python_parser/src/invalid.rs -expression: ast ---- -Ok( - [ - Assign( - StmtAssign { - range: 0..8, - targets: [ - Name( - ExprName { - range: 0..3, - id: "foo", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 6..8, - value: Int( - 42, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_slice_normal.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_slice_normal.snap deleted file mode 100644 index c6a55fb48e..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_slice_normal.snap +++ /dev/null @@ -1,70 +0,0 @@ ---- -source: crates/ruff_python_parser/src/invalid.rs -expression: ast ---- -Ok( - [ - Assign( - StmtAssign { - range: 0..13, - targets: [ - Subscript( - ExprSubscript { - range: 0..6, - value: Name( - ExprName { - range: 0..1, - id: "x", - ctx: Load, - }, - ), - slice: Slice( - ExprSlice { - range: 2..5, - lower: Some( - NumberLiteral( - ExprNumberLiteral { - range: 2..3, - value: Int( - 1, - ), - }, - ), - ), - upper: Some( - NumberLiteral( - ExprNumberLiteral { - range: 4..5, - value: Int( - 2, - ), - }, - ), - ), - step: None, - }, - ), - ctx: Store, - }, - ), - ], - value: List( - ExprList { - range: 9..13, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 10..12, - value: Int( - 42, - ), - }, - ), - ], - ctx: Load, - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_slice_weird.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_slice_weird.snap deleted file mode 100644 index a48ebfcc5d..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_slice_weird.snap +++ /dev/null @@ -1,71 +0,0 @@ ---- -source: crates/ruff_python_parser/src/invalid.rs -expression: ast ---- -Ok( - [ - Assign( - StmtAssign { - range: 0..13, - targets: [ - Subscript( - ExprSubscript { - range: 0..6, - value: NumberLiteral( - ExprNumberLiteral { - range: 0..1, - value: Int( - 5, - ), - }, - ), - slice: Slice( - ExprSlice { - range: 2..5, - lower: Some( - NumberLiteral( - ExprNumberLiteral { - range: 2..3, - value: Int( - 1, - ), - }, - ), - ), - upper: Some( - NumberLiteral( - ExprNumberLiteral { - range: 4..5, - value: Int( - 2, - ), - }, - ), - ), - step: None, - }, - ), - ctx: Store, - }, - ), - ], - value: List( - ExprList { - range: 9..13, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 10..12, - value: Int( - 42, - ), - }, - ), - ], - ctx: Load, - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_starred.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_starred.snap deleted file mode 100644 index 963ecc513b..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_starred.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: crates/ruff_python_parser/src/invalid.rs -expression: ast ---- -Ok( - [ - Assign( - StmtAssign { - range: 0..9, - targets: [ - Starred( - ExprStarred { - range: 0..4, - value: Name( - ExprName { - range: 1..4, - id: "foo", - ctx: Store, - }, - ), - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 7..9, - value: Int( - 42, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_subscript_normal.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_subscript_normal.snap deleted file mode 100644 index 225358f190..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_subscript_normal.snap +++ /dev/null @@ -1,44 +0,0 @@ ---- -source: crates/ruff_python_parser/src/invalid.rs -expression: ast ---- -Ok( - [ - Assign( - StmtAssign { - range: 0..9, - targets: [ - Subscript( - ExprSubscript { - range: 0..4, - value: Name( - ExprName { - range: 0..1, - id: "x", - ctx: Load, - }, - ), - slice: NumberLiteral( - ExprNumberLiteral { - range: 2..3, - value: Int( - 0, - ), - }, - ), - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 7..9, - value: Int( - 42, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_subscript_weird.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_subscript_weird.snap deleted file mode 100644 index 5073da87b7..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_subscript_weird.snap +++ /dev/null @@ -1,45 +0,0 @@ ---- -source: crates/ruff_python_parser/src/invalid.rs -expression: ast ---- -Ok( - [ - Assign( - StmtAssign { - range: 0..9, - targets: [ - Subscript( - ExprSubscript { - range: 0..4, - value: NumberLiteral( - ExprNumberLiteral { - range: 0..1, - value: Int( - 5, - ), - }, - ), - slice: NumberLiteral( - ExprNumberLiteral { - range: 2..3, - value: Int( - 0, - ), - }, - ), - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 7..9, - value: Int( - 42, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_tuple.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_tuple.snap deleted file mode 100644 index 9f05e6bea1..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_tuple.snap +++ /dev/null @@ -1,78 +0,0 @@ ---- -source: crates/ruff_python_parser/src/invalid.rs -expression: ast ---- -Ok( - [ - Assign( - StmtAssign { - range: 0..21, - targets: [ - Tuple( - ExprTuple { - range: 0..9, - elts: [ - Name( - ExprName { - range: 1..2, - id: "x", - ctx: Store, - }, - ), - Name( - ExprName { - range: 4..5, - id: "y", - ctx: Store, - }, - ), - Name( - ExprName { - range: 7..8, - id: "z", - ctx: Store, - }, - ), - ], - ctx: Store, - parenthesized: true, - }, - ), - ], - value: Tuple( - ExprTuple { - range: 12..21, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 13..14, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 16..17, - value: Int( - 2, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 19..20, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__lexer__tests__invalid_leading_zero_big.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__lexer__tests__invalid_leading_zero_big.snap index c2906398a5..a0eb10bff4 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__lexer__tests__invalid_leading_zero_big.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__lexer__tests__invalid_leading_zero_big.snap @@ -5,8 +5,8 @@ expression: tokens Err( LexicalError { error: OtherError( - "Invalid Token", + "Invalid decimal integer literal", ), - location: 0, + location: 0..85, }, ) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__lexer__tests__invalid_leading_zero_small.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__lexer__tests__invalid_leading_zero_small.snap index c2906398a5..cf606bd31d 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__lexer__tests__invalid_leading_zero_small.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__lexer__tests__invalid_leading_zero_small.snap @@ -5,8 +5,8 @@ expression: tokens Err( LexicalError { error: OtherError( - "Invalid Token", + "Invalid decimal integer literal", ), - location: 0, + location: 0..3, }, ) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__lexer__tests__tet_too_low_dedent.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__lexer__tests__tet_too_low_dedent.snap index 8a9ba410ae..648ba0ccda 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__lexer__tests__tet_too_low_dedent.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__lexer__tests__tet_too_low_dedent.snap @@ -48,7 +48,7 @@ expression: tokens Err( LexicalError { error: IndentationError, - location: 20, + location: 18..20, }, ), Ok( diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__decorator_ranges.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__decorator_ranges.snap deleted file mode 100644 index 160699606e..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__decorator_ranges.snap +++ /dev/null @@ -1,75 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - FunctionDef( - StmtFunctionDef { - range: 0..34, - is_async: false, - decorator_list: [ - Decorator { - range: 0..13, - expression: Name( - ExprName { - range: 1..13, - id: "my_decorator", - ctx: Load, - }, - ), - }, - ], - name: Identifier { - id: "test", - range: 18..22, - }, - type_params: None, - parameters: Parameters { - range: 22..24, - posonlyargs: [], - args: [], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 30..34, - }, - ), - ], - }, - ), - ClassDef( - StmtClassDef { - range: 36..73, - decorator_list: [ - Decorator { - range: 36..52, - expression: Name( - ExprName { - range: 37..52, - id: "class_decorator", - ctx: Load, - }, - ), - }, - ], - name: Identifier { - id: "Abcd", - range: 59..63, - }, - type_params: None, - arguments: None, - body: [ - Pass( - StmtPass { - range: 69..73, - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__dict_unpacking.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__dict_unpacking.snap deleted file mode 100644 index c78b2f8fe9..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__dict_unpacking.snap +++ /dev/null @@ -1,97 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -Dict( - ExprDict { - range: 0..25, - keys: [ - Some( - StringLiteral( - ExprStringLiteral { - range: 1..4, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 1..4, - value: "a", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - None, - Some( - StringLiteral( - ExprStringLiteral { - range: 16..19, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 16..19, - value: "d", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - ], - values: [ - StringLiteral( - ExprStringLiteral { - range: 6..9, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 6..9, - value: "b", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - Name( - ExprName { - range: 13..14, - id: "c", - ctx: Load, - }, - ), - StringLiteral( - ExprStringLiteral { - range: 21..24, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 21..24, - value: "e", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ], - }, -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings.snap deleted file mode 100644 index 92f4961fad..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings.snap +++ /dev/null @@ -1,1105 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..9, - value: FString( - ExprFString { - range: 0..9, - value: FStringValue { - inner: Single( - FString( - FString { - range: 0..9, - elements: [ - Expression( - FStringExpressionElement { - range: 2..8, - expression: StringLiteral( - ExprStringLiteral { - range: 3..7, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 3..7, - value: " f", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 10..20, - value: FString( - ExprFString { - range: 10..20, - value: FStringValue { - inner: Single( - FString( - FString { - range: 10..20, - elements: [ - Expression( - FStringExpressionElement { - range: 12..19, - expression: Name( - ExprName { - range: 13..16, - id: "foo", - ctx: Load, - }, - ), - debug_text: None, - conversion: Str, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 21..28, - value: FString( - ExprFString { - range: 21..28, - value: FStringValue { - inner: Single( - FString( - FString { - range: 21..28, - elements: [ - Expression( - FStringExpressionElement { - range: 23..27, - expression: Tuple( - ExprTuple { - range: 24..26, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 24..25, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 29..39, - value: FString( - ExprFString { - range: 29..39, - value: FStringValue { - inner: Single( - FString( - FString { - range: 29..39, - elements: [ - Expression( - FStringExpressionElement { - range: 31..38, - expression: Compare( - ExprCompare { - range: 32..36, - left: NumberLiteral( - ExprNumberLiteral { - range: 32..33, - value: Int( - 3, - ), - }, - ), - ops: [ - NotEq, - ], - comparators: [ - NumberLiteral( - ExprNumberLiteral { - range: 35..36, - value: Int( - 4, - ), - }, - ), - ], - }, - ), - debug_text: None, - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 37..37, - elements: [], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 40..55, - value: FString( - ExprFString { - range: 40..55, - value: FStringValue { - inner: Single( - FString( - FString { - range: 40..55, - elements: [ - Expression( - FStringExpressionElement { - range: 42..54, - expression: NumberLiteral( - ExprNumberLiteral { - range: 43..44, - value: Int( - 3, - ), - }, - ), - debug_text: None, - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 45..53, - elements: [ - Expression( - FStringExpressionElement { - range: 45..50, - expression: StringLiteral( - ExprStringLiteral { - range: 46..49, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 46..49, - value: "}", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 50..53, - value: ">10", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 56..71, - value: FString( - ExprFString { - range: 56..71, - value: FStringValue { - inner: Single( - FString( - FString { - range: 56..71, - elements: [ - Expression( - FStringExpressionElement { - range: 58..70, - expression: NumberLiteral( - ExprNumberLiteral { - range: 59..60, - value: Int( - 3, - ), - }, - ), - debug_text: None, - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 61..69, - elements: [ - Expression( - FStringExpressionElement { - range: 61..66, - expression: StringLiteral( - ExprStringLiteral { - range: 62..65, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 62..65, - value: "{", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 66..69, - value: ">10", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 72..86, - value: FString( - ExprFString { - range: 72..86, - value: FStringValue { - inner: Single( - FString( - FString { - range: 72..86, - elements: [ - Expression( - FStringExpressionElement { - range: 74..85, - expression: Name( - ExprName { - range: 77..80, - id: "foo", - ctx: Load, - }, - ), - debug_text: Some( - DebugText { - leading: " ", - trailing: " = ", - }, - ), - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 87..107, - value: FString( - ExprFString { - range: 87..107, - value: FStringValue { - inner: Single( - FString( - FString { - range: 87..107, - elements: [ - Expression( - FStringExpressionElement { - range: 89..106, - expression: Name( - ExprName { - range: 92..95, - id: "foo", - ctx: Load, - }, - ), - debug_text: Some( - DebugText { - leading: " ", - trailing: " = ", - }, - ), - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 100..105, - elements: [ - Literal( - FStringLiteralElement { - range: 100..105, - value: ".3f ", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 108..126, - value: FString( - ExprFString { - range: 108..126, - value: FStringValue { - inner: Single( - FString( - FString { - range: 108..126, - elements: [ - Expression( - FStringExpressionElement { - range: 110..125, - expression: Name( - ExprName { - range: 113..116, - id: "foo", - ctx: Load, - }, - ), - debug_text: Some( - DebugText { - leading: " ", - trailing: " = ", - }, - ), - conversion: Str, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 127..143, - value: FString( - ExprFString { - range: 127..143, - value: FStringValue { - inner: Single( - FString( - FString { - range: 127..143, - elements: [ - Expression( - FStringExpressionElement { - range: 129..142, - expression: Tuple( - ExprTuple { - range: 132..136, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 132..133, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 135..136, - value: Int( - 2, - ), - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - debug_text: Some( - DebugText { - leading: " ", - trailing: " = ", - }, - ), - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 144..170, - value: FString( - ExprFString { - range: 144..170, - value: FStringValue { - inner: Single( - FString( - FString { - range: 144..170, - elements: [ - Expression( - FStringExpressionElement { - range: 146..169, - expression: FString( - ExprFString { - range: 147..163, - value: FStringValue { - inner: Single( - FString( - FString { - range: 147..163, - elements: [ - Expression( - FStringExpressionElement { - range: 149..162, - expression: NumberLiteral( - ExprNumberLiteral { - range: 150..156, - value: Float( - 3.1415, - ), - }, - ), - debug_text: Some( - DebugText { - leading: "", - trailing: "=", - }, - ), - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 158..161, - elements: [ - Literal( - FStringLiteralElement { - range: 158..161, - value: ".1f", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 164..168, - elements: [ - Literal( - FStringLiteralElement { - range: 164..168, - value: "*^20", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 172..206, - value: Dict( - ExprDict { - range: 172..206, - keys: [ - Some( - FString( - ExprFString { - range: 173..201, - value: FStringValue { - inner: Concatenated( - [ - Literal( - StringLiteral { - range: 173..179, - value: "foo ", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - FString( - FString { - range: 180..195, - elements: [ - Literal( - FStringLiteralElement { - range: 182..186, - value: "bar ", - }, - ), - Expression( - FStringExpressionElement { - range: 186..193, - expression: BinOp( - ExprBinOp { - range: 187..192, - left: Name( - ExprName { - range: 187..188, - id: "x", - ctx: Load, - }, - ), - op: Add, - right: Name( - ExprName { - range: 191..192, - id: "y", - ctx: Load, - }, - ), - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 193..194, - value: " ", - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 196..201, - value: "baz", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - ], - ), - }, - }, - ), - ), - ], - values: [ - NumberLiteral( - ExprNumberLiteral { - range: 203..205, - value: Int( - 10, - ), - }, - ), - ], - }, - ), - }, - ), - Match( - StmtMatch { - range: 207..298, - subject: Name( - ExprName { - range: 213..216, - id: "foo", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 222..246, - pattern: MatchValue( - PatternMatchValue { - range: 227..232, - value: StringLiteral( - ExprStringLiteral { - range: 227..232, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 227..232, - value: "one", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), - guard: None, - body: [ - Pass( - StmtPass { - range: 242..246, - }, - ), - ], - }, - MatchCase { - range: 251..298, - pattern: MatchValue( - PatternMatchValue { - range: 256..284, - value: StringLiteral( - ExprStringLiteral { - range: 256..284, - value: StringLiteralValue { - inner: Concatenated( - ConcatenatedStringLiteral { - strings: [ - StringLiteral { - range: 256..269, - value: "implicitly ", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - StringLiteral { - range: 270..284, - value: "concatenated", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ], - value: "implicitly concatenated", - }, - ), - }, - }, - ), - }, - ), - guard: None, - body: [ - Pass( - StmtPass { - range: 294..298, - }, - ), - ], - }, - ], - }, - ), - Expr( - StmtExpr { - range: 300..317, - value: FString( - ExprFString { - range: 300..317, - value: FStringValue { - inner: Single( - FString( - FString { - range: 300..317, - elements: [ - Literal( - FStringLiteralElement { - range: 302..303, - value: "\\", - }, - ), - Expression( - FStringExpressionElement { - range: 303..308, - expression: Name( - ExprName { - range: 304..307, - id: "foo", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 308..309, - value: "\\", - }, - ), - Expression( - FStringExpressionElement { - range: 309..316, - expression: Name( - ExprName { - range: 310..313, - id: "bar", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 314..315, - elements: [ - Literal( - FStringLiteralElement { - range: 314..315, - value: "\\", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 318..332, - value: FString( - ExprFString { - range: 318..332, - value: FStringValue { - inner: Single( - FString( - FString { - range: 318..332, - elements: [ - Literal( - FStringLiteralElement { - range: 320..331, - value: "\\{foo\\}", - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 333..373, - value: FString( - ExprFString { - range: 333..373, - value: FStringValue { - inner: Single( - FString( - FString { - range: 333..373, - elements: [ - Expression( - FStringExpressionElement { - range: 337..370, - expression: Name( - ExprName { - range: 343..346, - id: "foo", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 347..369, - elements: [ - Literal( - FStringLiteralElement { - range: 347..369, - value: "x\n y\n z\n", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: true, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 374..392, - value: FString( - ExprFString { - range: 374..392, - value: FStringValue { - inner: Single( - FString( - FString { - range: 374..392, - elements: [ - Expression( - FStringExpressionElement { - range: 376..391, - expression: Name( - ExprName { - range: 381..384, - id: "foo", - ctx: Load, - }, - ), - debug_text: Some( - DebugText { - leading: " ( ", - trailing: " ) = ", - }, - ), - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings_with_unicode.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings_with_unicode.snap deleted file mode 100644 index 4e90969031..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings_with_unicode.snap +++ /dev/null @@ -1,322 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..29, - value: FString( - ExprFString { - range: 0..29, - value: FStringValue { - inner: Concatenated( - [ - Literal( - StringLiteral { - range: 0..6, - value: "foo", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Unicode, - triple_quoted: false, - }, - }, - ), - FString( - FString { - range: 7..15, - elements: [ - Expression( - FStringExpressionElement { - range: 9..14, - expression: Name( - ExprName { - range: 10..13, - id: "bar", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 16..21, - value: "baz", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 22..29, - value: " some", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - ], - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 30..59, - value: FString( - ExprFString { - range: 30..59, - value: FStringValue { - inner: Concatenated( - [ - Literal( - StringLiteral { - range: 30..35, - value: "foo", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - FString( - FString { - range: 36..44, - elements: [ - Expression( - FStringExpressionElement { - range: 38..43, - expression: Name( - ExprName { - range: 39..42, - id: "bar", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 45..51, - value: "baz", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Unicode, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 52..59, - value: " some", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - ], - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 60..89, - value: FString( - ExprFString { - range: 60..89, - value: FStringValue { - inner: Concatenated( - [ - Literal( - StringLiteral { - range: 60..65, - value: "foo", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - FString( - FString { - range: 66..74, - elements: [ - Expression( - FStringExpressionElement { - range: 68..73, - expression: Name( - ExprName { - range: 69..72, - id: "bar", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 75..80, - value: "baz", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 81..89, - value: " some", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Unicode, - triple_quoted: false, - }, - }, - ), - ], - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 90..128, - value: FString( - ExprFString { - range: 90..128, - value: FStringValue { - inner: Concatenated( - [ - Literal( - StringLiteral { - range: 90..96, - value: "foo", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Unicode, - triple_quoted: false, - }, - }, - ), - FString( - FString { - range: 97..116, - elements: [ - Literal( - FStringLiteralElement { - range: 99..103, - value: "bar ", - }, - ), - Expression( - FStringExpressionElement { - range: 103..108, - expression: Name( - ExprName { - range: 104..107, - id: "baz", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 108..115, - value: " really", - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 117..123, - value: "bar", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Unicode, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 124..128, - value: "no", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - ], - ), - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__generator_expression_argument.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__generator_expression_argument.snap deleted file mode 100644 index 10031be8bd..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__generator_expression_argument.snap +++ /dev/null @@ -1,175 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -Call( - ExprCall { - range: 0..141, - func: Attribute( - ExprAttribute { - range: 0..8, - value: StringLiteral( - ExprStringLiteral { - range: 0..3, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 0..3, - value: " ", - flags: StringLiteralFlags { - quote_style: Single, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - attr: Identifier { - id: "join", - range: 4..8, - }, - ctx: Load, - }, - ), - arguments: Arguments { - range: 8..141, - args: [ - Generator( - ExprGenerator { - range: 14..139, - elt: Name( - ExprName { - range: 14..17, - id: "sql", - ctx: Load, - }, - ), - generators: [ - Comprehension { - range: 22..139, - target: Name( - ExprName { - range: 26..29, - id: "sql", - ctx: Store, - }, - ), - iter: Tuple( - ExprTuple { - range: 33..139, - elts: [ - If( - ExprIf { - range: 43..80, - test: Name( - ExprName { - range: 65..70, - id: "limit", - ctx: Load, - }, - ), - body: BinOp( - ExprBinOp { - range: 43..61, - left: StringLiteral( - ExprStringLiteral { - range: 43..53, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 43..53, - value: "LIMIT %d", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - op: Mod, - right: Name( - ExprName { - range: 56..61, - id: "limit", - ctx: Load, - }, - ), - }, - ), - orelse: NoneLiteral( - ExprNoneLiteral { - range: 76..80, - }, - ), - }, - ), - If( - ExprIf { - range: 90..132, - test: Name( - ExprName { - range: 116..122, - id: "offset", - ctx: Load, - }, - ), - body: BinOp( - ExprBinOp { - range: 91..111, - left: StringLiteral( - ExprStringLiteral { - range: 91..102, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 91..102, - value: "OFFSET %d", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - op: Mod, - right: Name( - ExprName { - range: 105..111, - id: "offset", - ctx: Load, - }, - ), - }, - ), - orelse: NoneLiteral( - ExprNoneLiteral { - range: 128..132, - }, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - ifs: [], - is_async: false, - }, - ], - parenthesized: false, - }, - ), - ], - keywords: [], - }, - }, -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match.snap deleted file mode 100644 index f3a23fad39..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match.snap +++ /dev/null @@ -1,624 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Match( - StmtMatch { - range: 1..73, - subject: Dict( - ExprDict { - range: 7..18, - keys: [ - Some( - StringLiteral( - ExprStringLiteral { - range: 8..14, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 8..14, - value: "test", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - ], - values: [ - NumberLiteral( - ExprNumberLiteral { - range: 16..17, - value: Int( - 1, - ), - }, - ), - ], - }, - ), - cases: [ - MatchCase { - range: 24..73, - pattern: MatchMapping( - PatternMatchMapping { - range: 29..52, - keys: [], - patterns: [], - rest: Some( - Identifier { - id: "rest", - range: 41..45, - }, - ), - }, - ), - guard: None, - body: [ - Expr( - StmtExpr { - range: 62..73, - value: Call( - ExprCall { - range: 62..73, - func: Name( - ExprName { - range: 62..67, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 67..73, - args: [ - Name( - ExprName { - range: 68..72, - id: "rest", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 74..177, - subject: Dict( - ExprDict { - range: 80..97, - keys: [ - Some( - StringLiteral( - ExprStringLiteral { - range: 81..88, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 81..88, - value: "label", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - ], - values: [ - StringLiteral( - ExprStringLiteral { - range: 90..96, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 90..96, - value: "test", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ], - }, - ), - cases: [ - MatchCase { - range: 103..177, - pattern: MatchMapping( - PatternMatchMapping { - range: 108..155, - keys: [ - StringLiteral( - ExprStringLiteral { - range: 118..125, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 118..125, - value: "label", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ], - patterns: [ - MatchAs( - PatternMatchAs { - range: 127..148, - pattern: Some( - MatchOr( - PatternMatchOr { - range: 127..139, - patterns: [ - MatchClass( - PatternMatchClass { - range: 127..132, - cls: Name( - ExprName { - range: 127..130, - id: "str", - ctx: Load, - }, - ), - arguments: PatternArguments { - range: 130..132, - patterns: [], - keywords: [], - }, - }, - ), - MatchSingleton( - PatternMatchSingleton { - range: 135..139, - value: None, - }, - ), - ], - }, - ), - ), - name: Some( - Identifier { - id: "label", - range: 143..148, - }, - ), - }, - ), - ], - rest: None, - }, - ), - guard: None, - body: [ - Expr( - StmtExpr { - range: 165..177, - value: Call( - ExprCall { - range: 165..177, - func: Name( - ExprName { - range: 165..170, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 170..177, - args: [ - Name( - ExprName { - range: 171..176, - id: "label", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 178..218, - subject: Name( - ExprName { - range: 184..185, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 191..218, - pattern: MatchSequence( - PatternMatchSequence { - range: 196..203, - patterns: [ - MatchValue( - PatternMatchValue { - range: 197..198, - value: NumberLiteral( - ExprNumberLiteral { - range: 197..198, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 200..201, - value: NumberLiteral( - ExprNumberLiteral { - range: 200..201, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 213..218, - targets: [ - Name( - ExprName { - range: 213..214, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 217..218, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 219..259, - subject: Name( - ExprName { - range: 225..226, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 232..259, - pattern: MatchSequence( - PatternMatchSequence { - range: 237..244, - patterns: [ - MatchValue( - PatternMatchValue { - range: 238..239, - value: NumberLiteral( - ExprNumberLiteral { - range: 238..239, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 241..242, - value: NumberLiteral( - ExprNumberLiteral { - range: 241..242, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 254..259, - targets: [ - Name( - ExprName { - range: 254..255, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 258..259, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 260..297, - subject: Name( - ExprName { - range: 266..267, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 273..297, - pattern: MatchSequence( - PatternMatchSequence { - range: 278..282, - patterns: [ - MatchValue( - PatternMatchValue { - range: 279..280, - value: NumberLiteral( - ExprNumberLiteral { - range: 279..280, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 292..297, - targets: [ - Name( - ExprName { - range: 292..293, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 296..297, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 298..332, - subject: Tuple( - ExprTuple { - range: 304..306, - elts: [ - Name( - ExprName { - range: 304..305, - id: "x", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - cases: [ - MatchCase { - range: 312..332, - pattern: MatchAs( - PatternMatchAs { - range: 317..318, - pattern: None, - name: Some( - Identifier { - id: "z", - range: 317..318, - }, - ), - }, - ), - guard: None, - body: [ - Pass( - StmtPass { - range: 328..332, - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 333..369, - subject: Tuple( - ExprTuple { - range: 339..343, - elts: [ - Name( - ExprName { - range: 339..340, - id: "x", - ctx: Load, - }, - ), - Name( - ExprName { - range: 342..343, - id: "y", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - cases: [ - MatchCase { - range: 349..369, - pattern: MatchAs( - PatternMatchAs { - range: 354..355, - pattern: None, - name: Some( - Identifier { - id: "z", - range: 354..355, - }, - ), - }, - ), - guard: None, - body: [ - Pass( - StmtPass { - range: 365..369, - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 370..407, - subject: Tuple( - ExprTuple { - range: 376..381, - elts: [ - Name( - ExprName { - range: 376..377, - id: "x", - ctx: Load, - }, - ), - Name( - ExprName { - range: 379..380, - id: "y", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - cases: [ - MatchCase { - range: 387..407, - pattern: MatchAs( - PatternMatchAs { - range: 392..393, - pattern: None, - name: Some( - Identifier { - id: "z", - range: 392..393, - }, - ), - }, - ), - guard: None, - body: [ - Pass( - StmtPass { - range: 403..407, - }, - ), - ], - }, - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match_as_identifier.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match_as_identifier.snap deleted file mode 100644 index a0f26918e4..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match_as_identifier.snap +++ /dev/null @@ -1,833 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_suite(source).unwrap() ---- -[ - Expr( - StmtExpr { - range: 2..17, - value: Tuple( - ExprTuple { - range: 2..17, - elts: [ - BinOp( - ExprBinOp { - range: 2..14, - left: BinOp( - ExprBinOp { - range: 2..10, - left: Name( - ExprName { - range: 2..7, - id: "match", - ctx: Load, - }, - ), - op: Mult, - right: Name( - ExprName { - range: 9..10, - id: "a", - ctx: Load, - }, - ), - }, - ), - op: Add, - right: Name( - ExprName { - range: 13..14, - id: "b", - ctx: Load, - }, - ), - }, - ), - Name( - ExprName { - range: 16..17, - id: "c", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 43..60, - value: Tuple( - ExprTuple { - range: 43..60, - elts: [ - BinOp( - ExprBinOp { - range: 43..57, - left: Name( - ExprName { - range: 43..48, - id: "match", - ctx: Load, - }, - ), - op: Mult, - right: BinOp( - ExprBinOp { - range: 51..56, - left: Name( - ExprName { - range: 51..52, - id: "a", - ctx: Load, - }, - ), - op: Add, - right: Name( - ExprName { - range: 55..56, - id: "b", - ctx: Load, - }, - ), - }, - ), - }, - ), - Name( - ExprName { - range: 59..60, - id: "c", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 86..103, - value: Call( - ExprCall { - range: 86..103, - func: Name( - ExprName { - range: 86..91, - id: "match", - ctx: Load, - }, - ), - arguments: Arguments { - range: 92..103, - args: [ - Starred( - ExprStarred { - range: 93..99, - value: BinOp( - ExprBinOp { - range: 94..99, - left: Name( - ExprName { - range: 94..95, - id: "a", - ctx: Load, - }, - ), - op: Add, - right: Name( - ExprName { - range: 98..99, - id: "b", - ctx: Load, - }, - ), - }, - ), - ctx: Load, - }, - ), - Name( - ExprName { - range: 101..102, - id: "c", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 130..146, - value: BinOp( - ExprBinOp { - range: 130..146, - left: BinOp( - ExprBinOp { - range: 130..142, - left: Name( - ExprName { - range: 130..135, - id: "match", - ctx: Load, - }, - ), - op: Sub, - right: BinOp( - ExprBinOp { - range: 137..142, - left: Name( - ExprName { - range: 137..138, - id: "a", - ctx: Load, - }, - ), - op: Mult, - right: Name( - ExprName { - range: 141..142, - id: "b", - ctx: Load, - }, - ), - }, - ), - }, - ), - op: Add, - right: Name( - ExprName { - range: 145..146, - id: "c", - ctx: Load, - }, - ), - }, - ), - }, - ), - Expr( - StmtExpr { - range: 173..191, - value: BinOp( - ExprBinOp { - range: 173..191, - left: BinOp( - ExprBinOp { - range: 173..187, - left: Name( - ExprName { - range: 173..178, - id: "match", - ctx: Load, - }, - ), - op: Sub, - right: BinOp( - ExprBinOp { - range: 181..186, - left: Name( - ExprName { - range: 181..182, - id: "a", - ctx: Load, - }, - ), - op: Mult, - right: Name( - ExprName { - range: 185..186, - id: "b", - ctx: Load, - }, - ), - }, - ), - }, - ), - op: Add, - right: Name( - ExprName { - range: 190..191, - id: "c", - ctx: Load, - }, - ), - }, - ), - }, - ), - Expr( - StmtExpr { - range: 218..236, - value: BinOp( - ExprBinOp { - range: 218..236, - left: BinOp( - ExprBinOp { - range: 218..232, - left: Call( - ExprCall { - range: 218..228, - func: Name( - ExprName { - range: 218..223, - id: "match", - ctx: Load, - }, - ), - arguments: Arguments { - range: 224..228, - args: [ - UnaryOp( - ExprUnaryOp { - range: 225..227, - op: USub, - operand: Name( - ExprName { - range: 226..227, - id: "a", - ctx: Load, - }, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - op: Mult, - right: Name( - ExprName { - range: 231..232, - id: "b", - ctx: Load, - }, - ), - }, - ), - op: Add, - right: Name( - ExprName { - range: 235..236, - id: "c", - ctx: Load, - }, - ), - }, - ), - }, - ), - Expr( - StmtExpr { - range: 264..274, - value: Attribute( - ExprAttribute { - range: 264..274, - value: Call( - ExprCall { - range: 264..272, - func: Name( - ExprName { - range: 264..269, - id: "match", - ctx: Load, - }, - ), - arguments: Arguments { - range: 270..272, - args: [], - keywords: [], - }, - }, - ), - attr: Identifier { - id: "a", - range: 273..274, - }, - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 291..303, - value: Attribute( - ExprAttribute { - range: 291..303, - value: Call( - ExprCall { - range: 291..301, - func: Name( - ExprName { - range: 291..296, - id: "match", - ctx: Load, - }, - ), - arguments: Arguments { - range: 297..301, - args: [ - Tuple( - ExprTuple { - range: 298..300, - elts: [], - ctx: Load, - parenthesized: true, - }, - ), - ], - keywords: [], - }, - }, - ), - attr: Identifier { - id: "a", - range: 302..303, - }, - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 322..335, - value: Attribute( - ExprAttribute { - range: 322..335, - value: Call( - ExprCall { - range: 322..333, - func: Name( - ExprName { - range: 322..327, - id: "match", - ctx: Load, - }, - ), - arguments: Arguments { - range: 328..333, - args: [ - Tuple( - ExprTuple { - range: 329..331, - elts: [], - ctx: Load, - parenthesized: true, - }, - ), - ], - keywords: [], - }, - }, - ), - attr: Identifier { - id: "a", - range: 334..335, - }, - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 354..365, - value: Attribute( - ExprAttribute { - range: 354..365, - value: Subscript( - ExprSubscript { - range: 354..363, - value: Name( - ExprName { - range: 354..359, - id: "match", - ctx: Load, - }, - ), - slice: Name( - ExprName { - range: 361..362, - id: "a", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - attr: Identifier { - id: "b", - range: 364..365, - }, - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 383..395, - value: Attribute( - ExprAttribute { - range: 383..395, - value: Subscript( - ExprSubscript { - range: 383..393, - value: Name( - ExprName { - range: 383..388, - id: "match", - ctx: Load, - }, - ), - slice: Tuple( - ExprTuple { - range: 390..392, - elts: [ - Name( - ExprName { - range: 390..391, - id: "a", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - ctx: Load, - }, - ), - attr: Identifier { - id: "b", - range: 394..395, - }, - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 436..450, - value: Attribute( - ExprAttribute { - range: 436..450, - value: Subscript( - ExprSubscript { - range: 436..448, - value: Name( - ExprName { - range: 436..441, - id: "match", - ctx: Load, - }, - ), - slice: Tuple( - ExprTuple { - range: 443..447, - elts: [ - Name( - ExprName { - range: 444..445, - id: "a", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - ctx: Load, - }, - ), - attr: Identifier { - id: "b", - range: 449..450, - }, - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 471..488, - value: Subscript( - ExprSubscript { - range: 471..488, - value: Call( - ExprCall { - range: 471..478, - func: Name( - ExprName { - range: 471..476, - id: "match", - ctx: Load, - }, - ), - arguments: Arguments { - range: 476..478, - args: [], - keywords: [], - }, - }, - ), - slice: Slice( - ExprSlice { - range: 479..487, - lower: Some( - Name( - ExprName { - range: 479..480, - id: "a", - ctx: Load, - }, - ), - ), - upper: Some( - Name( - ExprName { - range: 486..487, - id: "b", - ctx: Load, - }, - ), - ), - step: None, - }, - ), - ctx: Load, - }, - ), - }, - ), - If( - StmtIf { - range: 508..527, - test: Named( - ExprNamed { - range: 511..521, - target: Name( - ExprName { - range: 511..516, - id: "match", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 520..521, - value: Int( - 1, - ), - }, - ), - }, - ), - body: [ - Pass( - StmtPass { - range: 523..527, - }, - ), - ], - elif_else_clauses: [], - }, - ), - Match( - StmtMatch { - range: 528..582, - subject: Name( - ExprName { - range: 534..539, - id: "match", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 545..557, - pattern: MatchValue( - PatternMatchValue { - range: 550..551, - value: NumberLiteral( - ExprNumberLiteral { - range: 550..551, - value: Int( - 1, - ), - }, - ), - }, - ), - guard: None, - body: [ - Pass( - StmtPass { - range: 553..557, - }, - ), - ], - }, - MatchCase { - range: 562..582, - pattern: MatchValue( - PatternMatchValue { - range: 567..568, - value: NumberLiteral( - ExprNumberLiteral { - range: 567..568, - value: Int( - 2, - ), - }, - ), - }, - ), - guard: None, - body: [ - Pass( - StmtPass { - range: 578..582, - }, - ), - ], - }, - ], - }, - ), - Assign( - StmtAssign { - range: 583..619, - targets: [ - Name( - ExprName { - range: 583..588, - id: "match", - ctx: Store, - }, - ), - ], - value: Lambda( - ExprLambda { - range: 591..619, - parameters: Some( - Parameters { - range: 598..603, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 598..603, - parameter: Parameter { - range: 598..603, - name: Identifier { - id: "query", - range: 598..603, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - ), - body: Compare( - ExprCompare { - range: 605..619, - left: Name( - ExprName { - range: 605..610, - id: "query", - ctx: Load, - }, - ), - ops: [ - Eq, - ], - comparators: [ - Name( - ExprName { - range: 614..619, - id: "event", - ctx: Load, - }, - ), - ], - }, - ), - }, - ), - }, - ), - Expr( - StmtExpr { - range: 620..636, - value: Call( - ExprCall { - range: 620..636, - func: Name( - ExprName { - range: 620..625, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 625..636, - args: [ - Call( - ExprCall { - range: 626..635, - func: Name( - ExprName { - range: 626..631, - id: "match", - ctx: Load, - }, - ), - arguments: Arguments { - range: 631..635, - args: [ - NumberLiteral( - ExprNumberLiteral { - range: 632..634, - value: Int( - 12, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__named_expression.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__named_expression.snap deleted file mode 100644 index 39154f69fd..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__named_expression.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -Named( - ExprNamed { - range: 1..15, - target: Name( - ExprName { - range: 1..2, - id: "x", - ctx: Store, - }, - ), - value: BinOp( - ExprBinOp { - range: 8..13, - left: Name( - ExprName { - range: 8..9, - id: "y", - ctx: Load, - }, - ), - op: Mult, - right: Name( - ExprName { - range: 12..13, - id: "z", - ctx: Load, - }, - ), - }, - ), - }, -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals.snap deleted file mode 100644 index c43a803b89..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals.snap +++ /dev/null @@ -1,404 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: "parse_suite(source, \"\").unwrap()" ---- -[ - Assign( - StmtAssign { - range: 0..13, - targets: [ - Name( - ExprName { - range: 0..1, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 4..13, - value: Int( - 123456789, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 14..24, - targets: [ - Name( - ExprName { - range: 14..15, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 18..24, - value: Int( - 123456, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 25..31, - targets: [ - Name( - ExprName { - range: 25..26, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 29..31, - value: Float( - 0.1, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 32..38, - targets: [ - Name( - ExprName { - range: 32..33, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 36..38, - value: Float( - 1.0, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 39..47, - targets: [ - Name( - ExprName { - range: 39..40, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 43..47, - value: Float( - 10.0, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 48..56, - targets: [ - Name( - ExprName { - range: 48..49, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 52..56, - value: Float( - 0.1, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 57..73, - targets: [ - Name( - ExprName { - range: 57..58, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 61..73, - value: Float( - 1.00000001, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 74..97, - targets: [ - Name( - ExprName { - range: 74..75, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 78..97, - value: Float( - 123456789.12345679, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 98..131, - targets: [ - Name( - ExprName { - range: 98..99, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 102..131, - value: Float( - inf, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 132..155, - targets: [ - Name( - ExprName { - range: 132..133, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 136..155, - value: Float( - inf, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 156..170, - targets: [ - Name( - ExprName { - range: 156..157, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 160..170, - value: Complex { - real: 0.0, - imag: 123456789.0, - }, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 171..195, - targets: [ - Name( - ExprName { - range: 171..172, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 175..195, - value: Complex { - real: 0.0, - imag: 123456789.12345679, - }, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 196..207, - targets: [ - Name( - ExprName { - range: 196..197, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 200..207, - value: Int( - 727756, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 208..218, - targets: [ - Name( - ExprName { - range: 208..209, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 212..218, - value: Int( - 11, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 219..228, - targets: [ - Name( - ExprName { - range: 219..220, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 223..228, - value: Int( - 511, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 229..244, - targets: [ - Name( - ExprName { - range: 229..230, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 233..244, - value: Float( - 6e-9, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 245..254, - targets: [ - Name( - ExprName { - range: 245..246, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 249..254, - value: Int( - 10000, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 255..265, - targets: [ - Name( - ExprName { - range: 255..256, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 259..265, - value: Int( - 133333, - ), - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals_attribute_access.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals_attribute_access.snap deleted file mode 100644 index 79d63ba491..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals_attribute_access.snap +++ /dev/null @@ -1,663 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: "parse_suite(source, \"\").unwrap()" ---- -[ - Assign( - StmtAssign { - range: 0..19, - targets: [ - Name( - ExprName { - range: 0..1, - id: "x", - ctx: Store, - }, - ), - ], - value: Call( - ExprCall { - range: 4..19, - func: Attribute( - ExprAttribute { - range: 4..17, - value: NumberLiteral( - ExprNumberLiteral { - range: 4..6, - value: Float( - 0.1, - ), - }, - ), - attr: Identifier { - id: "is_integer", - range: 7..17, - }, - ctx: Load, - }, - ), - arguments: Arguments { - range: 17..19, - args: [], - keywords: [], - }, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 20..32, - targets: [ - Name( - ExprName { - range: 20..21, - id: "x", - ctx: Store, - }, - ), - ], - value: Attribute( - ExprAttribute { - range: 24..32, - value: NumberLiteral( - ExprNumberLiteral { - range: 24..26, - value: Float( - 1.0, - ), - }, - ), - attr: Identifier { - id: "imag", - range: 28..32, - }, - ctx: Load, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 33..46, - targets: [ - Name( - ExprName { - range: 33..34, - id: "x", - ctx: Store, - }, - ), - ], - value: Attribute( - ExprAttribute { - range: 37..46, - value: NumberLiteral( - ExprNumberLiteral { - range: 37..41, - value: Float( - 10.0, - ), - }, - ), - attr: Identifier { - id: "imag", - range: 42..46, - }, - ctx: Load, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 47..60, - targets: [ - Name( - ExprName { - range: 47..48, - id: "x", - ctx: Store, - }, - ), - ], - value: Attribute( - ExprAttribute { - range: 51..60, - value: NumberLiteral( - ExprNumberLiteral { - range: 51..55, - value: Float( - 0.1, - ), - }, - ), - attr: Identifier { - id: "real", - range: 56..60, - }, - ctx: Load, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 61..90, - targets: [ - Name( - ExprName { - range: 61..62, - id: "x", - ctx: Store, - }, - ), - ], - value: Call( - ExprCall { - range: 65..90, - func: Attribute( - ExprAttribute { - range: 65..88, - value: NumberLiteral( - ExprNumberLiteral { - range: 65..84, - value: Float( - 123456789.12345679, - ), - }, - ), - attr: Identifier { - id: "hex", - range: 85..88, - }, - ctx: Load, - }, - ), - arguments: Arguments { - range: 88..90, - args: [], - keywords: [], - }, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 91..130, - targets: [ - Name( - ExprName { - range: 91..92, - id: "x", - ctx: Store, - }, - ), - ], - value: Attribute( - ExprAttribute { - range: 95..130, - value: NumberLiteral( - ExprNumberLiteral { - range: 95..124, - value: Float( - inf, - ), - }, - ), - attr: Identifier { - id: "real", - range: 126..130, - }, - ctx: Load, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 131..167, - targets: [ - Name( - ExprName { - range: 131..132, - id: "x", - ctx: Store, - }, - ), - ], - value: Call( - ExprCall { - range: 135..167, - func: Attribute( - ExprAttribute { - range: 135..165, - value: NumberLiteral( - ExprNumberLiteral { - range: 135..154, - value: Float( - inf, - ), - }, - ), - attr: Identifier { - id: "conjugate", - range: 156..165, - }, - ctx: Load, - }, - ), - arguments: Arguments { - range: 165..167, - args: [], - keywords: [], - }, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 168..187, - targets: [ - Name( - ExprName { - range: 168..169, - id: "x", - ctx: Store, - }, - ), - ], - value: Attribute( - ExprAttribute { - range: 172..187, - value: NumberLiteral( - ExprNumberLiteral { - range: 172..182, - value: Complex { - real: 0.0, - imag: 123456789.0, - }, - }, - ), - attr: Identifier { - id: "real", - range: 183..187, - }, - ctx: Load, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 188..241, - targets: [ - Name( - ExprName { - range: 188..189, - id: "x", - ctx: Store, - }, - ), - ], - value: Call( - ExprCall { - range: 192..241, - func: Attribute( - ExprAttribute { - range: 192..220, - value: NumberLiteral( - ExprNumberLiteral { - range: 192..212, - value: Complex { - real: 0.0, - imag: 123456789.12345679, - }, - }, - ), - attr: Identifier { - id: "__add__", - range: 213..220, - }, - ctx: Load, - }, - ), - arguments: Arguments { - range: 220..241, - args: [ - Call( - ExprCall { - range: 221..240, - func: Attribute( - ExprAttribute { - range: 221..238, - value: NumberLiteral( - ExprNumberLiteral { - range: 221..227, - value: Int( - 11, - ), - }, - ), - attr: Identifier { - id: "bit_length", - range: 228..238, - }, - ctx: Load, - }, - ), - arguments: Arguments { - range: 238..240, - args: [], - keywords: [], - }, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 242..265, - targets: [ - Name( - ExprName { - range: 242..243, - id: "x", - ctx: Store, - }, - ), - ], - value: Call( - ExprCall { - range: 246..265, - func: Attribute( - ExprAttribute { - range: 246..263, - value: NumberLiteral( - ExprNumberLiteral { - range: 246..253, - value: Int( - 727756, - ), - }, - ), - attr: Identifier { - id: "conjugate", - range: 254..263, - }, - ctx: Load, - }, - ), - arguments: Arguments { - range: 263..265, - args: [], - keywords: [], - }, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 266..289, - targets: [ - Name( - ExprName { - range: 266..267, - id: "x", - ctx: Store, - }, - ), - ], - value: Call( - ExprCall { - range: 270..289, - func: Attribute( - ExprAttribute { - range: 270..287, - value: NumberLiteral( - ExprNumberLiteral { - range: 270..276, - value: Int( - 11, - ), - }, - ), - attr: Identifier { - id: "conjugate", - range: 278..287, - }, - ctx: Load, - }, - ), - arguments: Arguments { - range: 287..289, - args: [], - keywords: [], - }, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 290..305, - targets: [ - Name( - ExprName { - range: 290..291, - id: "x", - ctx: Store, - }, - ), - ], - value: Attribute( - ExprAttribute { - range: 294..305, - value: NumberLiteral( - ExprNumberLiteral { - range: 294..299, - value: Int( - 511, - ), - }, - ), - attr: Identifier { - id: "real", - range: 301..305, - }, - ctx: Load, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 306..329, - targets: [ - Name( - ExprName { - range: 306..307, - id: "x", - ctx: Store, - }, - ), - ], - value: Call( - ExprCall { - range: 310..329, - func: Attribute( - ExprAttribute { - range: 310..327, - value: NumberLiteral( - ExprNumberLiteral { - range: 310..321, - value: Float( - 6e-9, - ), - }, - ), - attr: Identifier { - id: "hex", - range: 324..327, - }, - ctx: Load, - }, - ), - arguments: Arguments { - range: 327..329, - args: [], - keywords: [], - }, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 330..344, - targets: [ - Name( - ExprName { - range: 330..331, - id: "x", - ctx: Store, - }, - ), - ], - value: UnaryOp( - ExprUnaryOp { - range: 334..344, - op: USub, - operand: NumberLiteral( - ExprNumberLiteral { - range: 335..344, - value: Complex { - real: 0.0, - imag: 100.0, - }, - }, - ), - }, - ), - }, - ), - If( - StmtIf { - range: 346..366, - test: Attribute( - ExprAttribute { - range: 349..357, - value: NumberLiteral( - ExprNumberLiteral { - range: 349..351, - value: Int( - 10, - ), - }, - ), - attr: Identifier { - id: "real", - range: 353..357, - }, - ctx: Load, - }, - ), - body: [ - Expr( - StmtExpr { - range: 363..366, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 363..366, - }, - ), - }, - ), - ], - elif_else_clauses: [], - }, - ), - Assign( - StmtAssign { - range: 368..379, - targets: [ - Name( - ExprName { - range: 368..369, - id: "y", - ctx: Store, - }, - ), - ], - value: Subscript( - ExprSubscript { - range: 372..379, - value: NumberLiteral( - ExprNumberLiteral { - range: 372..375, - value: Int( - 100, - ), - }, - ), - slice: Name( - ExprName { - range: 376..378, - id: "no", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 380..391, - targets: [ - Name( - ExprName { - range: 380..381, - id: "y", - ctx: Store, - }, - ), - ], - value: Call( - ExprCall { - range: 384..391, - func: NumberLiteral( - ExprNumberLiteral { - range: 384..387, - value: Int( - 100, - ), - }, - ), - arguments: Arguments { - range: 387..391, - args: [ - Name( - ExprName { - range: 388..390, - id: "no", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parenthesized_with_statement.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parenthesized_with_statement.snap deleted file mode 100644 index bace4a7dbb..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parenthesized_with_statement.snap +++ /dev/null @@ -1,678 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_suite(source).unwrap() ---- -[ - With( - StmtWith { - range: 0..21, - is_async: false, - items: [ - WithItem { - range: 6..9, - context_expr: Name( - ExprName { - range: 7..8, - id: "a", - ctx: Load, - }, - ), - optional_vars: None, - }, - WithItem { - range: 11..14, - context_expr: Name( - ExprName { - range: 12..13, - id: "b", - ctx: Load, - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 17..21, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 22..56, - is_async: false, - items: [ - WithItem { - range: 28..31, - context_expr: Name( - ExprName { - range: 29..30, - id: "a", - ctx: Load, - }, - ), - optional_vars: None, - }, - WithItem { - range: 33..36, - context_expr: Name( - ExprName { - range: 34..35, - id: "b", - ctx: Load, - }, - ), - optional_vars: None, - }, - WithItem { - range: 38..44, - context_expr: Name( - ExprName { - range: 38..39, - id: "c", - ctx: Load, - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 43..44, - id: "d", - ctx: Store, - }, - ), - ), - }, - WithItem { - range: 46..49, - context_expr: Name( - ExprName { - range: 47..48, - id: "e", - ctx: Load, - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 52..56, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 57..74, - is_async: false, - items: [ - WithItem { - range: 63..64, - context_expr: Name( - ExprName { - range: 63..64, - id: "a", - ctx: Load, - }, - ), - optional_vars: None, - }, - WithItem { - range: 66..67, - context_expr: Name( - ExprName { - range: 66..67, - id: "b", - ctx: Load, - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 70..74, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 75..97, - is_async: false, - items: [ - WithItem { - range: 80..91, - context_expr: Tuple( - ExprTuple { - range: 80..86, - elts: [ - Name( - ExprName { - range: 81..82, - id: "a", - ctx: Load, - }, - ), - Name( - ExprName { - range: 84..85, - id: "b", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 90..91, - id: "c", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 93..97, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 98..122, - is_async: false, - items: [ - WithItem { - range: 104..115, - context_expr: Tuple( - ExprTuple { - range: 104..110, - elts: [ - Name( - ExprName { - range: 105..106, - id: "a", - ctx: Load, - }, - ), - Name( - ExprName { - range: 108..109, - id: "b", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 114..115, - id: "c", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 118..122, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 123..142, - is_async: false, - items: [ - WithItem { - range: 129..135, - context_expr: Name( - ExprName { - range: 129..130, - id: "a", - ctx: Load, - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 134..135, - id: "b", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 138..142, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 143..157, - is_async: false, - items: [ - WithItem { - range: 149..150, - context_expr: Name( - ExprName { - range: 149..150, - id: "a", - ctx: Load, - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 153..157, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 158..177, - is_async: false, - items: [ - WithItem { - range: 164..170, - context_expr: Named( - ExprNamed { - range: 164..170, - target: Name( - ExprName { - range: 164..165, - id: "a", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 169..170, - value: Int( - 0, - ), - }, - ), - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 173..177, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 178..202, - is_async: false, - items: [ - WithItem { - range: 183..196, - context_expr: Named( - ExprNamed { - range: 184..190, - target: Name( - ExprName { - range: 184..185, - id: "a", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 189..190, - value: Int( - 0, - ), - }, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 195..196, - id: "x", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 198..202, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 203..219, - is_async: false, - items: [ - WithItem { - range: 209..212, - context_expr: Name( - ExprName { - range: 210..211, - id: "a", - ctx: Load, - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 215..219, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 220..241, - is_async: false, - items: [ - WithItem { - range: 226..234, - context_expr: Named( - ExprNamed { - range: 227..233, - target: Name( - ExprName { - range: 227..228, - id: "a", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 232..233, - value: Int( - 0, - ), - }, - ), - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 237..241, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 242..271, - is_async: false, - items: [ - WithItem { - range: 248..254, - context_expr: Name( - ExprName { - range: 248..249, - id: "a", - ctx: Load, - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 253..254, - id: "b", - ctx: Store, - }, - ), - ), - }, - WithItem { - range: 256..264, - context_expr: Named( - ExprNamed { - range: 257..263, - target: Name( - ExprName { - range: 257..258, - id: "a", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 262..263, - value: Int( - 0, - ), - }, - ), - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 267..271, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 272..296, - is_async: false, - items: [ - WithItem { - range: 278..279, - context_expr: Name( - ExprName { - range: 278..279, - id: "a", - ctx: Load, - }, - ), - optional_vars: None, - }, - WithItem { - range: 281..289, - context_expr: Named( - ExprNamed { - range: 282..288, - target: Name( - ExprName { - range: 282..283, - id: "a", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 287..288, - value: Int( - 0, - ), - }, - ), - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 292..296, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 297..315, - is_async: false, - items: [ - WithItem { - range: 303..308, - context_expr: Yield( - ExprYield { - range: 303..308, - value: None, - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 311..315, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 316..341, - is_async: false, - items: [ - WithItem { - range: 322..334, - context_expr: YieldFrom( - ExprYieldFrom { - range: 322..334, - value: Name( - ExprName { - range: 333..334, - id: "a", - ctx: Load, - }, - ), - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 337..341, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 342..362, - is_async: false, - items: [ - WithItem { - range: 348..355, - context_expr: Yield( - ExprYield { - range: 349..354, - value: None, - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 358..362, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 363..390, - is_async: false, - items: [ - WithItem { - range: 369..383, - context_expr: YieldFrom( - ExprYieldFrom { - range: 370..382, - value: Name( - ExprName { - range: 381..382, - id: "a", - ctx: Load, - }, - ), - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 386..390, - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_bool_op_and.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_bool_op_and.snap deleted file mode 100644 index 66a11f2ded..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_bool_op_and.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -BoolOp( - ExprBoolOp { - range: 0..7, - op: And, - values: [ - Name( - ExprName { - range: 0..1, - id: "x", - ctx: Load, - }, - ), - Name( - ExprName { - range: 6..7, - id: "y", - ctx: Load, - }, - ), - ], - }, -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_bool_op_or.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_bool_op_or.snap deleted file mode 100644 index 9a7059d242..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_bool_op_or.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -BoolOp( - ExprBoolOp { - range: 0..6, - op: Or, - values: [ - Name( - ExprName { - range: 0..1, - id: "x", - ctx: Load, - }, - ), - Name( - ExprName { - range: 5..6, - id: "y", - ctx: Load, - }, - ), - ], - }, -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class.snap deleted file mode 100644 index 2bf1f84ada..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class.snap +++ /dev/null @@ -1,154 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_suite(source).unwrap() ---- -[ - ClassDef( - StmtClassDef { - range: 0..98, - decorator_list: [], - name: Identifier { - id: "Foo", - range: 6..9, - }, - type_params: None, - arguments: Some( - Arguments { - range: 9..15, - args: [ - Name( - ExprName { - range: 10..11, - id: "A", - ctx: Load, - }, - ), - Name( - ExprName { - range: 13..14, - id: "B", - ctx: Load, - }, - ), - ], - keywords: [], - }, - ), - body: [ - FunctionDef( - StmtFunctionDef { - range: 18..44, - is_async: false, - decorator_list: [], - name: Identifier { - id: "__init__", - range: 22..30, - }, - type_params: None, - parameters: Parameters { - range: 30..36, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 31..35, - parameter: Parameter { - range: 31..35, - name: Identifier { - id: "self", - range: 31..35, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 40..44, - }, - ), - ], - }, - ), - FunctionDef( - StmtFunctionDef { - range: 46..98, - is_async: false, - decorator_list: [], - name: Identifier { - id: "method_with_default", - range: 50..69, - }, - type_params: None, - parameters: Parameters { - range: 69..90, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 70..74, - parameter: Parameter { - range: 70..74, - name: Identifier { - id: "self", - range: 70..74, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 76..89, - parameter: Parameter { - range: 76..79, - name: Identifier { - id: "arg", - range: 76..79, - }, - annotation: None, - }, - default: Some( - StringLiteral( - ExprStringLiteral { - range: 80..89, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 80..89, - value: "default", - flags: StringLiteralFlags { - quote_style: Single, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 94..98, - }, - ), - ], - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class_generic_types.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class_generic_types.snap deleted file mode 100644 index 49c4bfd338..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class_generic_types.snap +++ /dev/null @@ -1,455 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_suite(source).unwrap() ---- -[ - ClassDef( - StmtClassDef { - range: 10..29, - decorator_list: [], - name: Identifier { - id: "Foo", - range: 16..19, - }, - type_params: Some( - TypeParams { - range: 19..22, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 20..21, - name: Identifier { - id: "T", - range: 20..21, - }, - bound: None, - }, - ), - ], - }, - ), - arguments: Some( - Arguments { - range: 22..24, - args: [], - keywords: [], - }, - ), - body: [ - Expr( - StmtExpr { - range: 26..29, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 26..29, - }, - ), - }, - ), - ], - }, - ), - ClassDef( - StmtClassDef { - range: 52..76, - decorator_list: [], - name: Identifier { - id: "Foo", - range: 58..61, - }, - type_params: Some( - TypeParams { - range: 61..69, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 62..68, - name: Identifier { - id: "T", - range: 62..63, - }, - bound: Some( - Name( - ExprName { - range: 65..68, - id: "str", - ctx: Load, - }, - ), - ), - }, - ), - ], - }, - ), - arguments: Some( - Arguments { - range: 69..71, - args: [], - keywords: [], - }, - ), - body: [ - Expr( - StmtExpr { - range: 73..76, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 73..76, - }, - ), - }, - ), - ], - }, - ), - ClassDef( - StmtClassDef { - range: 105..138, - decorator_list: [], - name: Identifier { - id: "Foo", - range: 111..114, - }, - type_params: Some( - TypeParams { - range: 114..131, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 115..130, - name: Identifier { - id: "T", - range: 115..116, - }, - bound: Some( - Tuple( - ExprTuple { - range: 118..130, - elts: [ - Name( - ExprName { - range: 119..122, - id: "str", - ctx: Load, - }, - ), - Name( - ExprName { - range: 124..129, - id: "bytes", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - ), - }, - ), - ], - }, - ), - arguments: Some( - Arguments { - range: 131..133, - args: [], - keywords: [], - }, - ), - body: [ - Expr( - StmtExpr { - range: 135..138, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 135..138, - }, - ), - }, - ), - ], - }, - ), - ClassDef( - StmtClassDef { - range: 159..181, - decorator_list: [], - name: Identifier { - id: "Foo", - range: 165..168, - }, - type_params: Some( - TypeParams { - range: 168..174, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 169..170, - name: Identifier { - id: "T", - range: 169..170, - }, - bound: None, - }, - ), - TypeVar( - TypeParamTypeVar { - range: 172..173, - name: Identifier { - id: "U", - range: 172..173, - }, - bound: None, - }, - ), - ], - }, - ), - arguments: Some( - Arguments { - range: 174..176, - args: [], - keywords: [], - }, - ), - body: [ - Expr( - StmtExpr { - range: 178..181, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 178..181, - }, - ), - }, - ), - ], - }, - ), - ClassDef( - StmtClassDef { - range: 200..223, - decorator_list: [], - name: Identifier { - id: "Foo", - range: 206..209, - }, - type_params: Some( - TypeParams { - range: 209..216, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 210..211, - name: Identifier { - id: "T", - range: 210..211, - }, - bound: None, - }, - ), - TypeVar( - TypeParamTypeVar { - range: 213..214, - name: Identifier { - id: "U", - range: 213..214, - }, - bound: None, - }, - ), - ], - }, - ), - arguments: Some( - Arguments { - range: 216..218, - args: [], - keywords: [], - }, - ), - body: [ - Expr( - StmtExpr { - range: 220..223, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 220..223, - }, - ), - }, - ), - ], - }, - ), - ClassDef( - StmtClassDef { - range: 240..261, - decorator_list: [], - name: Identifier { - id: "Foo", - range: 246..249, - }, - type_params: Some( - TypeParams { - range: 249..254, - type_params: [ - TypeVarTuple( - TypeParamTypeVarTuple { - range: 250..253, - name: Identifier { - id: "Ts", - range: 251..253, - }, - }, - ), - ], - }, - ), - arguments: Some( - Arguments { - range: 254..256, - args: [], - keywords: [], - }, - ), - body: [ - Expr( - StmtExpr { - range: 258..261, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 258..261, - }, - ), - }, - ), - ], - }, - ), - ClassDef( - StmtClassDef { - range: 275..296, - decorator_list: [], - name: Identifier { - id: "Foo", - range: 281..284, - }, - type_params: Some( - TypeParams { - range: 284..289, - type_params: [ - ParamSpec( - TypeParamParamSpec { - range: 285..288, - name: Identifier { - id: "P", - range: 287..288, - }, - }, - ), - ], - }, - ), - arguments: Some( - Arguments { - range: 289..291, - args: [], - keywords: [], - }, - ), - body: [ - Expr( - StmtExpr { - range: 293..296, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 293..296, - }, - ), - }, - ), - ], - }, - ), - ClassDef( - StmtClassDef { - range: 312..351, - decorator_list: [], - name: Identifier { - id: "Foo", - range: 318..321, - }, - type_params: Some( - TypeParams { - range: 321..341, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 322..323, - name: Identifier { - id: "X", - range: 322..323, - }, - bound: None, - }, - ), - TypeVar( - TypeParamTypeVar { - range: 325..331, - name: Identifier { - id: "Y", - range: 325..326, - }, - bound: Some( - Name( - ExprName { - range: 328..331, - id: "str", - ctx: Load, - }, - ), - ), - }, - ), - TypeVarTuple( - TypeParamTypeVarTuple { - range: 333..335, - name: Identifier { - id: "U", - range: 334..335, - }, - }, - ), - ParamSpec( - TypeParamParamSpec { - range: 337..340, - name: Identifier { - id: "P", - range: 339..340, - }, - }, - ), - ], - }, - ), - arguments: Some( - Arguments { - range: 341..343, - args: [], - keywords: [], - }, - ), - body: [ - Pass( - StmtPass { - range: 347..351, - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_dict_comprehension.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_dict_comprehension.snap deleted file mode 100644 index ca8d83bdb3..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_dict_comprehension.snap +++ /dev/null @@ -1,44 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -DictComp( - ExprDictComp { - range: 0..19, - key: Name( - ExprName { - range: 1..3, - id: "x1", - ctx: Load, - }, - ), - value: Name( - ExprName { - range: 5..7, - id: "x2", - ctx: Load, - }, - ), - generators: [ - Comprehension { - range: 8..18, - target: Name( - ExprName { - range: 12..13, - id: "y", - ctx: Store, - }, - ), - iter: Name( - ExprName { - range: 17..18, - id: "z", - ctx: Load, - }, - ), - ifs: [], - is_async: false, - }, - ], - }, -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_double_list_comprehension.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_double_list_comprehension.snap deleted file mode 100644 index d939442291..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_double_list_comprehension.snap +++ /dev/null @@ -1,123 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -ListComp( - ExprListComp { - range: 0..48, - elt: Name( - ExprName { - range: 1..2, - id: "x", - ctx: Load, - }, - ), - generators: [ - Comprehension { - range: 3..17, - target: Tuple( - ExprTuple { - range: 7..12, - elts: [ - Name( - ExprName { - range: 7..8, - id: "y", - ctx: Store, - }, - ), - Name( - ExprName { - range: 10..12, - id: "y2", - ctx: Store, - }, - ), - ], - ctx: Store, - parenthesized: false, - }, - ), - iter: Name( - ExprName { - range: 16..17, - id: "z", - ctx: Load, - }, - ), - ifs: [], - is_async: false, - }, - Comprehension { - range: 18..47, - target: Name( - ExprName { - range: 22..23, - id: "a", - ctx: Store, - }, - ), - iter: Name( - ExprName { - range: 27..28, - id: "b", - ctx: Load, - }, - ), - ifs: [ - Compare( - ExprCompare { - range: 32..37, - left: Name( - ExprName { - range: 32..33, - id: "a", - ctx: Load, - }, - ), - ops: [ - Lt, - ], - comparators: [ - NumberLiteral( - ExprNumberLiteral { - range: 36..37, - value: Int( - 5, - ), - }, - ), - ], - }, - ), - Compare( - ExprCompare { - range: 41..47, - left: Name( - ExprName { - range: 41..42, - id: "a", - ctx: Load, - }, - ), - ops: [ - Gt, - ], - comparators: [ - NumberLiteral( - ExprNumberLiteral { - range: 45..47, - value: Int( - 10, - ), - }, - ), - ], - }, - ), - ], - is_async: false, - }, - ], - }, -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_empty.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_empty.snap deleted file mode 100644 index 657c2bb740..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_empty.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_f_string.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_f_string.snap deleted file mode 100644 index 4ece08bdae..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_f_string.snap +++ /dev/null @@ -1,38 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..14, - value: FString( - ExprFString { - range: 0..14, - value: FStringValue { - inner: Single( - FString( - FString { - range: 0..14, - elements: [ - Literal( - FStringLiteralElement { - range: 2..13, - value: "Hello world", - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_function_definition.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_function_definition.snap deleted file mode 100644 index 861340e6d2..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_function_definition.snap +++ /dev/null @@ -1,571 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_suite(source).unwrap() ---- -[ - FunctionDef( - StmtFunctionDef { - range: 0..20, - is_async: false, - decorator_list: [], - name: Identifier { - id: "func", - range: 4..8, - }, - type_params: None, - parameters: Parameters { - range: 8..11, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 9..10, - parameter: Parameter { - range: 9..10, - name: Identifier { - id: "a", - range: 9..10, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Expr( - StmtExpr { - range: 17..20, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 17..20, - }, - ), - }, - ), - ], - }, - ), - FunctionDef( - StmtFunctionDef { - range: 22..53, - is_async: false, - decorator_list: [], - name: Identifier { - id: "func", - range: 26..30, - }, - type_params: Some( - TypeParams { - range: 30..33, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 31..32, - name: Identifier { - id: "T", - range: 31..32, - }, - bound: None, - }, - ), - ], - }, - ), - parameters: Parameters { - range: 33..39, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 34..38, - parameter: Parameter { - range: 34..38, - name: Identifier { - id: "a", - range: 34..35, - }, - annotation: Some( - Name( - ExprName { - range: 37..38, - id: "T", - ctx: Load, - }, - ), - ), - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: Some( - Name( - ExprName { - range: 43..44, - id: "T", - ctx: Load, - }, - ), - ), - body: [ - Expr( - StmtExpr { - range: 50..53, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 50..53, - }, - ), - }, - ), - ], - }, - ), - FunctionDef( - StmtFunctionDef { - range: 55..91, - is_async: false, - decorator_list: [], - name: Identifier { - id: "func", - range: 59..63, - }, - type_params: Some( - TypeParams { - range: 63..71, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 64..70, - name: Identifier { - id: "T", - range: 64..65, - }, - bound: Some( - Name( - ExprName { - range: 67..70, - id: "str", - ctx: Load, - }, - ), - ), - }, - ), - ], - }, - ), - parameters: Parameters { - range: 71..77, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 72..76, - parameter: Parameter { - range: 72..76, - name: Identifier { - id: "a", - range: 72..73, - }, - annotation: Some( - Name( - ExprName { - range: 75..76, - id: "T", - ctx: Load, - }, - ), - ), - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: Some( - Name( - ExprName { - range: 81..82, - id: "T", - ctx: Load, - }, - ), - ), - body: [ - Expr( - StmtExpr { - range: 88..91, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 88..91, - }, - ), - }, - ), - ], - }, - ), - FunctionDef( - StmtFunctionDef { - range: 93..138, - is_async: false, - decorator_list: [], - name: Identifier { - id: "func", - range: 97..101, - }, - type_params: Some( - TypeParams { - range: 101..118, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 102..117, - name: Identifier { - id: "T", - range: 102..103, - }, - bound: Some( - Tuple( - ExprTuple { - range: 105..117, - elts: [ - Name( - ExprName { - range: 106..109, - id: "str", - ctx: Load, - }, - ), - Name( - ExprName { - range: 111..116, - id: "bytes", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - ), - }, - ), - ], - }, - ), - parameters: Parameters { - range: 118..124, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 119..123, - parameter: Parameter { - range: 119..123, - name: Identifier { - id: "a", - range: 119..120, - }, - annotation: Some( - Name( - ExprName { - range: 122..123, - id: "T", - ctx: Load, - }, - ), - ), - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: Some( - Name( - ExprName { - range: 128..129, - id: "T", - ctx: Load, - }, - ), - ), - body: [ - Expr( - StmtExpr { - range: 135..138, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 135..138, - }, - ), - }, - ), - ], - }, - ), - FunctionDef( - StmtFunctionDef { - range: 140..171, - is_async: false, - decorator_list: [], - name: Identifier { - id: "func", - range: 144..148, - }, - type_params: Some( - TypeParams { - range: 148..153, - type_params: [ - TypeVarTuple( - TypeParamTypeVarTuple { - range: 149..152, - name: Identifier { - id: "Ts", - range: 150..152, - }, - }, - ), - ], - }, - ), - parameters: Parameters { - range: 153..162, - posonlyargs: [], - args: [], - vararg: Some( - Parameter { - range: 154..161, - name: Identifier { - id: "a", - range: 155..156, - }, - annotation: Some( - Starred( - ExprStarred { - range: 158..161, - value: Name( - ExprName { - range: 159..161, - id: "Ts", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - ), - }, - ), - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Expr( - StmtExpr { - range: 168..171, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 168..171, - }, - ), - }, - ), - ], - }, - ), - FunctionDef( - StmtFunctionDef { - range: 173..230, - is_async: false, - decorator_list: [], - name: Identifier { - id: "func", - range: 177..181, - }, - type_params: Some( - TypeParams { - range: 181..186, - type_params: [ - ParamSpec( - TypeParamParamSpec { - range: 182..185, - name: Identifier { - id: "P", - range: 184..185, - }, - }, - ), - ], - }, - ), - parameters: Parameters { - range: 186..221, - posonlyargs: [], - args: [], - vararg: Some( - Parameter { - range: 187..200, - name: Identifier { - id: "args", - range: 188..192, - }, - annotation: Some( - Attribute( - ExprAttribute { - range: 194..200, - value: Name( - ExprName { - range: 194..195, - id: "P", - ctx: Load, - }, - ), - attr: Identifier { - id: "args", - range: 196..200, - }, - ctx: Load, - }, - ), - ), - }, - ), - kwonlyargs: [], - kwarg: Some( - Parameter { - range: 202..220, - name: Identifier { - id: "kwargs", - range: 204..210, - }, - annotation: Some( - Attribute( - ExprAttribute { - range: 212..220, - value: Name( - ExprName { - range: 212..213, - id: "P", - ctx: Load, - }, - ), - attr: Identifier { - id: "kwargs", - range: 214..220, - }, - ctx: Load, - }, - ), - ), - }, - ), - }, - returns: None, - body: [ - Expr( - StmtExpr { - range: 227..230, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 227..230, - }, - ), - }, - ), - ], - }, - ), - FunctionDef( - StmtFunctionDef { - range: 232..273, - is_async: false, - decorator_list: [], - name: Identifier { - id: "func", - range: 236..240, - }, - type_params: Some( - TypeParams { - range: 240..261, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 241..242, - name: Identifier { - id: "T", - range: 241..242, - }, - bound: None, - }, - ), - TypeVar( - TypeParamTypeVar { - range: 244..250, - name: Identifier { - id: "U", - range: 244..245, - }, - bound: Some( - Name( - ExprName { - range: 247..250, - id: "str", - ctx: Load, - }, - ), - ), - }, - ), - TypeVarTuple( - TypeParamTypeVarTuple { - range: 252..255, - name: Identifier { - id: "Ts", - range: 253..255, - }, - }, - ), - ParamSpec( - TypeParamParamSpec { - range: 257..260, - name: Identifier { - id: "P", - range: 259..260, - }, - }, - ), - ], - }, - ), - parameters: Parameters { - range: 261..263, - posonlyargs: [], - args: [], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 269..273, - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_generator_comprehension.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_generator_comprehension.snap deleted file mode 100644 index 73b442c471..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_generator_comprehension.snap +++ /dev/null @@ -1,38 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -Generator( - ExprGenerator { - range: 0..14, - elt: Name( - ExprName { - range: 1..2, - id: "x", - ctx: Load, - }, - ), - generators: [ - Comprehension { - range: 3..13, - target: Name( - ExprName { - range: 7..8, - id: "y", - ctx: Store, - }, - ), - iter: Name( - ExprName { - range: 12..13, - id: "z", - ctx: Load, - }, - ), - ifs: [], - is_async: false, - }, - ], - parenthesized: true, - }, -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_if_elif_else.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_if_elif_else.snap deleted file mode 100644 index 9f9e87a388..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_if_elif_else.snap +++ /dev/null @@ -1,83 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - If( - StmtIf { - range: 0..28, - test: NumberLiteral( - ExprNumberLiteral { - range: 3..4, - value: Int( - 1, - ), - }, - ), - body: [ - Expr( - StmtExpr { - range: 6..8, - value: NumberLiteral( - ExprNumberLiteral { - range: 6..8, - value: Int( - 10, - ), - }, - ), - }, - ), - ], - elif_else_clauses: [ - ElifElseClause { - range: 9..19, - test: Some( - NumberLiteral( - ExprNumberLiteral { - range: 14..15, - value: Int( - 2, - ), - }, - ), - ), - body: [ - Expr( - StmtExpr { - range: 17..19, - value: NumberLiteral( - ExprNumberLiteral { - range: 17..19, - value: Int( - 20, - ), - }, - ), - }, - ), - ], - }, - ElifElseClause { - range: 20..28, - test: None, - body: [ - Expr( - StmtExpr { - range: 26..28, - value: NumberLiteral( - ExprNumberLiteral { - range: 26..28, - value: Int( - 30, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_if_else_generator_comprehension.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_if_else_generator_comprehension.snap deleted file mode 100644 index f5a76841ee..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_if_else_generator_comprehension.snap +++ /dev/null @@ -1,57 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -Generator( - ExprGenerator { - range: 0..26, - elt: If( - ExprIf { - range: 1..14, - test: Name( - ExprName { - range: 6..7, - id: "y", - ctx: Load, - }, - ), - body: Name( - ExprName { - range: 1..2, - id: "x", - ctx: Load, - }, - ), - orelse: Name( - ExprName { - range: 13..14, - id: "y", - ctx: Load, - }, - ), - }, - ), - generators: [ - Comprehension { - range: 15..25, - target: Name( - ExprName { - range: 19..20, - id: "y", - ctx: Store, - }, - ), - iter: Name( - ExprName { - range: 24..25, - id: "z", - ctx: Load, - }, - ), - ifs: [], - is_async: false, - }, - ], - parenthesized: true, - }, -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_kwargs.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_kwargs.snap deleted file mode 100644 index 47b635c56c..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_kwargs.snap +++ /dev/null @@ -1,65 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..32, - value: Call( - ExprCall { - range: 0..32, - func: Name( - ExprName { - range: 0..7, - id: "my_func", - ctx: Load, - }, - ), - arguments: Arguments { - range: 7..32, - args: [ - StringLiteral( - ExprStringLiteral { - range: 8..20, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 8..20, - value: "positional", - flags: StringLiteralFlags { - quote_style: Single, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ], - keywords: [ - Keyword { - range: 22..31, - arg: Some( - Identifier { - id: "keyword", - range: 22..29, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 30..31, - value: Int( - 2, - ), - }, - ), - }, - ], - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_lambda.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_lambda.snap deleted file mode 100644 index 4401fd6c84..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_lambda.snap +++ /dev/null @@ -1,71 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..18, - value: Lambda( - ExprLambda { - range: 0..18, - parameters: Some( - Parameters { - range: 7..11, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 7..8, - parameter: Parameter { - range: 7..8, - name: Identifier { - id: "x", - range: 7..8, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 10..11, - parameter: Parameter { - range: 10..11, - name: Identifier { - id: "y", - range: 10..11, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - ), - body: BinOp( - ExprBinOp { - range: 13..18, - left: Name( - ExprName { - range: 13..14, - id: "x", - ctx: Load, - }, - ), - op: Mult, - right: Name( - ExprName { - range: 17..18, - id: "y", - ctx: Load, - }, - ), - }, - ), - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_lambda_no_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_lambda_no_args.snap deleted file mode 100644 index a24210739c..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_lambda_no_args.snap +++ /dev/null @@ -1,25 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..9, - value: Lambda( - ExprLambda { - range: 0..9, - parameters: None, - body: NumberLiteral( - ExprNumberLiteral { - range: 8..9, - value: Int( - 1, - ), - }, - ), - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_list_comprehension.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_list_comprehension.snap deleted file mode 100644 index 869bc11b0d..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_list_comprehension.snap +++ /dev/null @@ -1,37 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -ListComp( - ExprListComp { - range: 0..14, - elt: Name( - ExprName { - range: 1..2, - id: "x", - ctx: Load, - }, - ), - generators: [ - Comprehension { - range: 3..13, - target: Name( - ExprName { - range: 7..8, - id: "y", - ctx: Store, - }, - ), - iter: Name( - ExprName { - range: 12..13, - id: "z", - ctx: Load, - }, - ), - ifs: [], - is_async: false, - }, - ], - }, -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_named_expression_generator_comprehension.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_named_expression_generator_comprehension.snap deleted file mode 100644 index 3141b28fbb..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_named_expression_generator_comprehension.snap +++ /dev/null @@ -1,64 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -Generator( - ExprGenerator { - range: 0..23, - elt: Named( - ExprNamed { - range: 1..11, - target: Name( - ExprName { - range: 1..2, - id: "x", - ctx: Store, - }, - ), - value: BinOp( - ExprBinOp { - range: 6..11, - left: Name( - ExprName { - range: 6..7, - id: "y", - ctx: Load, - }, - ), - op: Add, - right: NumberLiteral( - ExprNumberLiteral { - range: 10..11, - value: Int( - 1, - ), - }, - ), - }, - ), - }, - ), - generators: [ - Comprehension { - range: 12..22, - target: Name( - ExprName { - range: 16..17, - id: "y", - ctx: Store, - }, - ), - iter: Name( - ExprName { - range: 21..22, - id: "z", - ctx: Load, - }, - ), - ifs: [], - is_async: false, - }, - ], - parenthesized: true, - }, -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_2.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_2.snap deleted file mode 100644 index aa2b2e62b4..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_2.snap +++ /dev/null @@ -1,55 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..23, - value: Call( - ExprCall { - range: 0..23, - func: Name( - ExprName { - range: 0..5, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 5..23, - args: [ - StringLiteral( - ExprStringLiteral { - range: 6..19, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 6..19, - value: "Hello world", - flags: StringLiteralFlags { - quote_style: Single, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 21..22, - value: Int( - 2, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_hello.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_hello.snap deleted file mode 100644 index 0c1a836f1f..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_hello.snap +++ /dev/null @@ -1,47 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..20, - value: Call( - ExprCall { - range: 0..20, - func: Name( - ExprName { - range: 0..5, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 5..20, - args: [ - StringLiteral( - ExprStringLiteral { - range: 6..19, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 6..19, - value: "Hello world", - flags: StringLiteralFlags { - quote_style: Single, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_string.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_string.snap deleted file mode 100644 index ddf2de815e..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_string.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..13, - value: StringLiteral( - ExprStringLiteral { - range: 0..13, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 0..13, - value: "Hello world", - flags: StringLiteralFlags { - quote_style: Single, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_tuples.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_tuples.snap deleted file mode 100644 index 8cb747325c..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_tuples.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_suite(source).unwrap() ---- -[ - Assign( - StmtAssign { - range: 0..11, - targets: [ - Tuple( - ExprTuple { - range: 0..4, - elts: [ - Name( - ExprName { - range: 0..1, - id: "a", - ctx: Store, - }, - ), - Name( - ExprName { - range: 3..4, - id: "b", - ctx: Store, - }, - ), - ], - ctx: Store, - parenthesized: false, - }, - ), - ], - value: Tuple( - ExprTuple { - range: 7..11, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 7..8, - value: Int( - 4, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 10..11, - value: Int( - 5, - ), - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_type_declaration.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_type_declaration.snap deleted file mode 100644 index fa99a71304..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_type_declaration.snap +++ /dev/null @@ -1,954 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_suite(source).unwrap() ---- -[ - TypeAlias( - StmtTypeAlias { - range: 1..13, - name: Name( - ExprName { - range: 6..7, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 10..13, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 14..32, - name: Name( - ExprName { - range: 19..20, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: BinOp( - ExprBinOp { - range: 23..32, - left: Name( - ExprName { - range: 23..26, - id: "int", - ctx: Load, - }, - ), - op: BitOr, - right: Name( - ExprName { - range: 29..32, - id: "str", - ctx: Load, - }, - ), - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 33..61, - name: Name( - ExprName { - range: 38..39, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: BinOp( - ExprBinOp { - range: 42..61, - left: Name( - ExprName { - range: 42..45, - id: "int", - ctx: Load, - }, - ), - op: BitOr, - right: StringLiteral( - ExprStringLiteral { - range: 48..61, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 48..61, - value: "ForwardRefY", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 62..88, - name: Name( - ExprName { - range: 67..68, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 68..71, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 69..70, - name: Identifier { - id: "T", - range: 69..70, - }, - bound: None, - }, - ), - ], - }, - ), - value: BinOp( - ExprBinOp { - range: 74..88, - left: Name( - ExprName { - range: 74..75, - id: "T", - ctx: Load, - }, - ), - op: BitOr, - right: Subscript( - ExprSubscript { - range: 78..88, - value: Name( - ExprName { - range: 78..82, - id: "list", - ctx: Load, - }, - ), - slice: Subscript( - ExprSubscript { - range: 83..87, - value: Name( - ExprName { - range: 83..84, - id: "X", - ctx: Load, - }, - ), - slice: Name( - ExprName { - range: 85..86, - id: "T", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - ctx: Load, - }, - ), - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 102..117, - name: Name( - ExprName { - range: 107..108, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 108..111, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 109..110, - name: Identifier { - id: "T", - range: 109..110, - }, - bound: None, - }, - ), - ], - }, - ), - value: Name( - ExprName { - range: 114..117, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 118..146, - name: Name( - ExprName { - range: 123..124, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 124..127, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 125..126, - name: Identifier { - id: "T", - range: 125..126, - }, - bound: None, - }, - ), - ], - }, - ), - value: BinOp( - ExprBinOp { - range: 130..146, - left: Subscript( - ExprSubscript { - range: 130..137, - value: Name( - ExprName { - range: 130..134, - id: "list", - ctx: Load, - }, - ), - slice: Name( - ExprName { - range: 135..136, - id: "T", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - op: BitOr, - right: Subscript( - ExprSubscript { - range: 140..146, - value: Name( - ExprName { - range: 140..143, - id: "set", - ctx: Load, - }, - ), - slice: Name( - ExprName { - range: 144..145, - id: "T", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 147..179, - name: Name( - ExprName { - range: 152..153, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 153..166, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 154..155, - name: Identifier { - id: "T", - range: 154..155, - }, - bound: None, - }, - ), - TypeVarTuple( - TypeParamTypeVarTuple { - range: 157..160, - name: Identifier { - id: "Ts", - range: 158..160, - }, - }, - ), - ParamSpec( - TypeParamParamSpec { - range: 162..165, - name: Identifier { - id: "P", - range: 164..165, - }, - }, - ), - ], - }, - ), - value: Tuple( - ExprTuple { - range: 169..179, - elts: [ - Name( - ExprName { - range: 170..171, - id: "T", - ctx: Load, - }, - ), - Name( - ExprName { - range: 173..175, - id: "Ts", - ctx: Load, - }, - ), - Name( - ExprName { - range: 177..178, - id: "P", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 180..217, - name: Name( - ExprName { - range: 185..186, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 186..204, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 187..193, - name: Identifier { - id: "T", - range: 187..188, - }, - bound: Some( - Name( - ExprName { - range: 190..193, - id: "int", - ctx: Load, - }, - ), - ), - }, - ), - TypeVarTuple( - TypeParamTypeVarTuple { - range: 195..198, - name: Identifier { - id: "Ts", - range: 196..198, - }, - }, - ), - ParamSpec( - TypeParamParamSpec { - range: 200..203, - name: Identifier { - id: "P", - range: 202..203, - }, - }, - ), - ], - }, - ), - value: Tuple( - ExprTuple { - range: 207..217, - elts: [ - Name( - ExprName { - range: 208..209, - id: "T", - ctx: Load, - }, - ), - Name( - ExprName { - range: 211..213, - id: "Ts", - ctx: Load, - }, - ), - Name( - ExprName { - range: 215..216, - id: "P", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 218..262, - name: Name( - ExprName { - range: 223..224, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 224..249, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 225..238, - name: Identifier { - id: "T", - range: 225..226, - }, - bound: Some( - Tuple( - ExprTuple { - range: 228..238, - elts: [ - Name( - ExprName { - range: 229..232, - id: "int", - ctx: Load, - }, - ), - Name( - ExprName { - range: 234..237, - id: "str", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - ), - }, - ), - TypeVarTuple( - TypeParamTypeVarTuple { - range: 240..243, - name: Identifier { - id: "Ts", - range: 241..243, - }, - }, - ), - ParamSpec( - TypeParamParamSpec { - range: 245..248, - name: Identifier { - id: "P", - range: 247..248, - }, - }, - ), - ], - }, - ), - value: Tuple( - ExprTuple { - range: 252..262, - elts: [ - Name( - ExprName { - range: 253..254, - id: "T", - ctx: Load, - }, - ), - Name( - ExprName { - range: 256..258, - id: "Ts", - ctx: Load, - }, - ), - Name( - ExprName { - range: 260..261, - id: "P", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 293..308, - name: Name( - ExprName { - range: 298..302, - id: "type", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 305..308, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 309..325, - name: Name( - ExprName { - range: 314..319, - id: "match", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 322..325, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 326..341, - name: Name( - ExprName { - range: 331..335, - id: "case", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 338..341, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 367..382, - name: Name( - ExprName { - range: 372..375, - id: "foo", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 378..382, - id: "type", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 383..399, - name: Name( - ExprName { - range: 388..391, - id: "foo", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 394..399, - id: "match", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 400..415, - name: Name( - ExprName { - range: 405..408, - id: "foo", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 411..415, - id: "case", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 439..454, - name: Name( - ExprName { - range: 447..448, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 451..454, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 455..470, - name: Name( - ExprName { - range: 460..461, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 467..470, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 471..486, - name: Name( - ExprName { - range: 476..477, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 483..486, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 487..507, - name: Name( - ExprName { - range: 492..493, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 502..505, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 508..527, - name: Name( - ExprName { - range: 519..520, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 520..523, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 521..522, - name: Identifier { - id: "T", - range: 521..522, - }, - bound: None, - }, - ), - ], - }, - ), - value: Name( - ExprName { - range: 526..527, - id: "T", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 528..548, - name: Name( - ExprName { - range: 533..534, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 541..544, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 542..543, - name: Identifier { - id: "T", - range: 542..543, - }, - bound: None, - }, - ), - ], - }, - ), - value: Name( - ExprName { - range: 547..548, - id: "T", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 549..568, - name: Name( - ExprName { - range: 554..555, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 555..558, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 556..557, - name: Identifier { - id: "T", - range: 556..557, - }, - bound: None, - }, - ), - ], - }, - ), - value: Name( - ExprName { - range: 567..568, - id: "T", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 590..602, - name: Name( - ExprName { - range: 595..596, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 599..602, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 604..616, - name: Name( - ExprName { - range: 609..610, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 613..616, - id: "str", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 618..631, - name: Name( - ExprName { - range: 623..624, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 627..631, - id: "type", - ctx: Load, - }, - ), - }, - ), - ClassDef( - StmtClassDef { - range: 632..653, - decorator_list: [], - name: Identifier { - id: "X", - range: 638..639, - }, - type_params: None, - arguments: None, - body: [ - TypeAlias( - StmtTypeAlias { - range: 641..653, - name: Name( - ExprName { - range: 646..647, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 650..653, - id: "int", - ctx: Load, - }, - ), - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__patma.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__patma.snap deleted file mode 100644 index 04c6984481..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__patma.snap +++ /dev/null @@ -1,3739 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Match( - StmtMatch { - range: 67..103, - subject: Name( - ExprName { - range: 73..74, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 80..103, - pattern: MatchValue( - PatternMatchValue { - range: 85..88, - value: UnaryOp( - ExprUnaryOp { - range: 85..88, - op: USub, - operand: NumberLiteral( - ExprNumberLiteral { - range: 86..88, - value: Complex { - real: 0.0, - imag: 0.0, - }, - }, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 98..103, - targets: [ - Name( - ExprName { - range: 98..99, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 102..103, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 126..167, - subject: Name( - ExprName { - range: 132..133, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 139..167, - pattern: MatchClass( - PatternMatchClass { - range: 144..152, - cls: Name( - ExprName { - range: 144..149, - id: "bytes", - ctx: Load, - }, - ), - arguments: PatternArguments { - range: 149..152, - patterns: [ - MatchAs( - PatternMatchAs { - range: 150..151, - pattern: None, - name: Some( - Identifier { - id: "z", - range: 150..151, - }, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 162..167, - targets: [ - Name( - ExprName { - range: 162..163, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 166..167, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 190..260, - subject: Name( - ExprName { - range: 196..197, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 203..229, - pattern: MatchValue( - PatternMatchValue { - range: 208..209, - value: NumberLiteral( - ExprNumberLiteral { - range: 208..209, - value: Int( - 0, - ), - }, - ), - }, - ), - guard: Some( - NumberLiteral( - ExprNumberLiteral { - range: 213..214, - value: Int( - 0, - ), - }, - ), - ), - body: [ - Assign( - StmtAssign { - range: 224..229, - targets: [ - Name( - ExprName { - range: 224..225, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 228..229, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 234..260, - pattern: MatchValue( - PatternMatchValue { - range: 239..240, - value: NumberLiteral( - ExprNumberLiteral { - range: 239..240, - value: Int( - 0, - ), - }, - ), - }, - ), - guard: Some( - NumberLiteral( - ExprNumberLiteral { - range: 244..245, - value: Int( - 1, - ), - }, - ), - ), - body: [ - Assign( - StmtAssign { - range: 255..260, - targets: [ - Name( - ExprName { - range: 255..256, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 259..260, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 283..332, - subject: NumberLiteral( - ExprNumberLiteral { - range: 289..290, - value: Int( - 3, - ), - }, - ), - cases: [ - MatchCase { - range: 296..332, - pattern: MatchOr( - PatternMatchOr { - range: 301..314, - patterns: [ - MatchValue( - PatternMatchValue { - range: 301..302, - value: NumberLiteral( - ExprNumberLiteral { - range: 301..302, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 305..306, - value: NumberLiteral( - ExprNumberLiteral { - range: 305..306, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 309..310, - value: NumberLiteral( - ExprNumberLiteral { - range: 309..310, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 313..314, - value: NumberLiteral( - ExprNumberLiteral { - range: 313..314, - value: Int( - 3, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 324..332, - targets: [ - Name( - ExprName { - range: 324..325, - id: "x", - ctx: Store, - }, - ), - ], - value: BooleanLiteral( - ExprBooleanLiteral { - range: 328..332, - value: true, - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 355..403, - subject: Name( - ExprName { - range: 361..362, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 368..403, - pattern: MatchOr( - PatternMatchOr { - range: 373..388, - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 373..379, - patterns: [ - MatchValue( - PatternMatchValue { - range: 374..375, - value: NumberLiteral( - ExprNumberLiteral { - range: 374..375, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 377..378, - value: NumberLiteral( - ExprNumberLiteral { - range: 377..378, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - ), - MatchSequence( - PatternMatchSequence { - range: 382..388, - patterns: [ - MatchValue( - PatternMatchValue { - range: 383..384, - value: NumberLiteral( - ExprNumberLiteral { - range: 383..384, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 386..387, - value: NumberLiteral( - ExprNumberLiteral { - range: 386..387, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 398..403, - targets: [ - Name( - ExprName { - range: 398..399, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 402..403, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 445..523, - subject: Name( - ExprName { - range: 451..452, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 458..489, - pattern: MatchSequence( - PatternMatchSequence { - range: 463..467, - patterns: [ - MatchStar( - PatternMatchStar { - range: 464..466, - name: None, - }, - ), - ], - }, - ), - guard: None, - body: [ - Return( - StmtReturn { - range: 477..489, - value: Some( - StringLiteral( - ExprStringLiteral { - range: 484..489, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 484..489, - value: "seq", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - }, - ), - ], - }, - MatchCase { - range: 494..523, - pattern: MatchMapping( - PatternMatchMapping { - range: 499..501, - keys: [], - patterns: [], - rest: None, - }, - ), - guard: None, - body: [ - Return( - StmtReturn { - range: 511..523, - value: Some( - StringLiteral( - ExprStringLiteral { - range: 518..523, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 518..523, - value: "map", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 546..714, - subject: Name( - ExprName { - range: 552..553, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 559..594, - pattern: MatchMapping( - PatternMatchMapping { - range: 564..579, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 565..566, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 568..578, - patterns: [ - MatchValue( - PatternMatchValue { - range: 569..570, - value: NumberLiteral( - ExprNumberLiteral { - range: 569..570, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 572..573, - value: NumberLiteral( - ExprNumberLiteral { - range: 572..573, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 575..577, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 589..594, - targets: [ - Name( - ExprName { - range: 589..590, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 593..594, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 599..687, - pattern: MatchOr( - PatternMatchOr { - range: 604..672, - patterns: [ - MatchMapping( - PatternMatchMapping { - range: 604..626, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 605..606, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchOr( - PatternMatchOr { - range: 608..625, - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 608..618, - patterns: [ - MatchValue( - PatternMatchValue { - range: 609..610, - value: NumberLiteral( - ExprNumberLiteral { - range: 609..610, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 612..613, - value: NumberLiteral( - ExprNumberLiteral { - range: 612..613, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 615..617, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - MatchSingleton( - PatternMatchSingleton { - range: 621..625, - value: True, - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - MatchMapping( - PatternMatchMapping { - range: 629..638, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 630..631, - value: Int( - 1, - ), - }, - ), - ], - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 633..637, - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 634..636, - patterns: [], - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - MatchMapping( - PatternMatchMapping { - range: 641..656, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 642..643, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 645..655, - patterns: [ - MatchValue( - PatternMatchValue { - range: 646..647, - value: NumberLiteral( - ExprNumberLiteral { - range: 646..647, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 649..650, - value: NumberLiteral( - ExprNumberLiteral { - range: 649..650, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 652..654, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - MatchSequence( - PatternMatchSequence { - range: 659..661, - patterns: [], - }, - ), - MatchValue( - PatternMatchValue { - range: 664..667, - value: StringLiteral( - ExprStringLiteral { - range: 664..667, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 664..667, - value: "X", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 670..672, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 682..687, - targets: [ - Name( - ExprName { - range: 682..683, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 686..687, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 692..714, - pattern: MatchSequence( - PatternMatchSequence { - range: 697..699, - patterns: [], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 709..714, - targets: [ - Name( - ExprName { - range: 709..710, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 713..714, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 737..782, - subject: Name( - ExprName { - range: 743..744, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 750..782, - pattern: MatchValue( - PatternMatchValue { - range: 755..767, - value: BinOp( - ExprBinOp { - range: 755..767, - left: NumberLiteral( - ExprNumberLiteral { - range: 755..759, - value: Float( - 0.25, - ), - }, - ), - op: Add, - right: NumberLiteral( - ExprNumberLiteral { - range: 762..767, - value: Complex { - real: 0.0, - imag: 1.75, - }, - }, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 777..782, - targets: [ - Name( - ExprName { - range: 777..778, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 781..782, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 805..841, - subject: Name( - ExprName { - range: 811..812, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 818..841, - pattern: MatchValue( - PatternMatchValue { - range: 823..826, - value: UnaryOp( - ExprUnaryOp { - range: 823..826, - op: USub, - operand: NumberLiteral( - ExprNumberLiteral { - range: 824..826, - value: Complex { - real: 0.0, - imag: 0.0, - }, - }, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 836..841, - targets: [ - Name( - ExprName { - range: 836..837, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 840..841, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 864..913, - subject: NumberLiteral( - ExprNumberLiteral { - range: 870..871, - value: Int( - 4, - ), - }, - ), - cases: [ - MatchCase { - range: 877..913, - pattern: MatchOr( - PatternMatchOr { - range: 882..895, - patterns: [ - MatchValue( - PatternMatchValue { - range: 882..883, - value: NumberLiteral( - ExprNumberLiteral { - range: 882..883, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 886..887, - value: NumberLiteral( - ExprNumberLiteral { - range: 886..887, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 890..891, - value: NumberLiteral( - ExprNumberLiteral { - range: 890..891, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 894..895, - value: NumberLiteral( - ExprNumberLiteral { - range: 894..895, - value: Int( - 3, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 905..913, - targets: [ - Name( - ExprName { - range: 905..906, - id: "x", - ctx: Store, - }, - ), - ], - value: BooleanLiteral( - ExprBooleanLiteral { - range: 909..913, - value: true, - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 936..975, - subject: Name( - ExprName { - range: 942..943, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 949..975, - pattern: MatchValue( - PatternMatchValue { - range: 954..955, - value: NumberLiteral( - ExprNumberLiteral { - range: 954..955, - value: Int( - 0, - ), - }, - ), - }, - ), - guard: Some( - Name( - ExprName { - range: 959..960, - id: "x", - ctx: Load, - }, - ), - ), - body: [ - Assign( - StmtAssign { - range: 970..975, - targets: [ - Name( - ExprName { - range: 970..971, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 974..975, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 998..1098, - subject: Name( - ExprName { - range: 1004..1005, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1011..1037, - pattern: MatchMapping( - PatternMatchMapping { - range: 1016..1022, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 1017..1018, - value: Int( - 1, - ), - }, - ), - ], - patterns: [ - MatchValue( - PatternMatchValue { - range: 1020..1021, - value: NumberLiteral( - ExprNumberLiteral { - range: 1020..1021, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - rest: None, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1032..1037, - targets: [ - Name( - ExprName { - range: 1032..1033, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1036..1037, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 1042..1068, - pattern: MatchMapping( - PatternMatchMapping { - range: 1047..1053, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 1048..1049, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchValue( - PatternMatchValue { - range: 1051..1052, - value: NumberLiteral( - ExprNumberLiteral { - range: 1051..1052, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - rest: None, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1063..1068, - targets: [ - Name( - ExprName { - range: 1063..1064, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1067..1068, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 1073..1098, - pattern: MatchMapping( - PatternMatchMapping { - range: 1078..1083, - keys: [], - patterns: [], - rest: Some( - Identifier { - id: "z", - range: 1081..1082, - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1093..1098, - targets: [ - Name( - ExprName { - range: 1093..1094, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1097..1098, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1121..1162, - subject: Call( - ExprCall { - range: 1127..1132, - func: Name( - ExprName { - range: 1127..1130, - id: "Seq", - ctx: Load, - }, - ), - arguments: Arguments { - range: 1130..1132, - args: [], - keywords: [], - }, - }, - ), - cases: [ - MatchCase { - range: 1138..1162, - pattern: MatchSequence( - PatternMatchSequence { - range: 1143..1147, - patterns: [ - MatchStar( - PatternMatchStar { - range: 1144..1146, - name: None, - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1157..1162, - targets: [ - Name( - ExprName { - range: 1157..1158, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1161..1162, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1185..1245, - subject: Name( - ExprName { - range: 1191..1192, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1198..1219, - pattern: MatchValue( - PatternMatchValue { - range: 1203..1204, - value: NumberLiteral( - ExprNumberLiteral { - range: 1203..1204, - value: Int( - 1, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1214..1219, - targets: [ - Name( - ExprName { - range: 1214..1215, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1218..1219, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 1224..1245, - pattern: MatchValue( - PatternMatchValue { - range: 1229..1230, - value: NumberLiteral( - ExprNumberLiteral { - range: 1229..1230, - value: Int( - 1, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1240..1245, - targets: [ - Name( - ExprName { - range: 1240..1241, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1244..1245, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1268..1315, - subject: Name( - ExprName { - range: 1274..1275, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1281..1315, - pattern: MatchMapping( - PatternMatchMapping { - range: 1286..1298, - keys: [ - StringLiteral( - ExprStringLiteral { - range: 1287..1292, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 1287..1292, - value: "foo", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ], - patterns: [ - MatchAs( - PatternMatchAs { - range: 1294..1297, - pattern: None, - name: Some( - Identifier { - id: "bar", - range: 1294..1297, - }, - ), - }, - ), - ], - rest: None, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1308..1315, - targets: [ - Name( - ExprName { - range: 1308..1309, - id: "y", - ctx: Store, - }, - ), - ], - value: Name( - ExprName { - range: 1312..1315, - id: "bar", - ctx: Load, - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1338..1392, - subject: Tuple( - ExprTuple { - range: 1344..1353, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 1345..1346, - value: Int( - 0, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 1348..1349, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 1351..1352, - value: Int( - 2, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - cases: [ - MatchCase { - range: 1359..1392, - pattern: MatchSequence( - PatternMatchSequence { - range: 1364..1377, - patterns: [ - MatchValue( - PatternMatchValue { - range: 1365..1366, - value: NumberLiteral( - ExprNumberLiteral { - range: 1365..1366, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 1368..1369, - value: NumberLiteral( - ExprNumberLiteral { - range: 1368..1369, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchStar( - PatternMatchStar { - range: 1371..1373, - name: Some( - Identifier { - id: "x", - range: 1372..1373, - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 1375..1376, - value: NumberLiteral( - ExprNumberLiteral { - range: 1375..1376, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1387..1392, - targets: [ - Name( - ExprName { - range: 1387..1388, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1391..1392, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1415..1529, - subject: Name( - ExprName { - range: 1421..1422, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1428..1451, - pattern: MatchSequence( - PatternMatchSequence { - range: 1433..1436, - patterns: [ - MatchValue( - PatternMatchValue { - range: 1434..1435, - value: NumberLiteral( - ExprNumberLiteral { - range: 1434..1435, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1446..1451, - targets: [ - Name( - ExprName { - range: 1446..1447, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1450..1451, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 1456..1498, - pattern: MatchSequence( - PatternMatchSequence { - range: 1461..1467, - patterns: [ - MatchValue( - PatternMatchValue { - range: 1462..1463, - value: NumberLiteral( - ExprNumberLiteral { - range: 1462..1463, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 1465..1466, - value: NumberLiteral( - ExprNumberLiteral { - range: 1465..1466, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ), - guard: Some( - Named( - ExprNamed { - range: 1472..1482, - target: Name( - ExprName { - range: 1472..1473, - id: "x", - ctx: Store, - }, - ), - value: Subscript( - ExprSubscript { - range: 1477..1482, - value: Name( - ExprName { - range: 1477..1478, - id: "x", - ctx: Load, - }, - ), - slice: Slice( - ExprSlice { - range: 1479..1481, - lower: None, - upper: Some( - NumberLiteral( - ExprNumberLiteral { - range: 1480..1481, - value: Int( - 0, - ), - }, - ), - ), - step: None, - }, - ), - ctx: Load, - }, - ), - }, - ), - ), - body: [ - Assign( - StmtAssign { - range: 1493..1498, - targets: [ - Name( - ExprName { - range: 1493..1494, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1497..1498, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 1503..1529, - pattern: MatchSequence( - PatternMatchSequence { - range: 1508..1514, - patterns: [ - MatchValue( - PatternMatchValue { - range: 1509..1510, - value: NumberLiteral( - ExprNumberLiteral { - range: 1509..1510, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 1512..1513, - value: NumberLiteral( - ExprNumberLiteral { - range: 1512..1513, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1524..1529, - targets: [ - Name( - ExprName { - range: 1524..1525, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1528..1529, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1552..1595, - subject: Name( - ExprName { - range: 1558..1559, - id: "w", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1565..1595, - pattern: MatchSequence( - PatternMatchSequence { - range: 1570..1580, - patterns: [ - MatchAs( - PatternMatchAs { - range: 1571..1572, - pattern: None, - name: Some( - Identifier { - id: "x", - range: 1571..1572, - }, - ), - }, - ), - MatchAs( - PatternMatchAs { - range: 1574..1575, - pattern: None, - name: Some( - Identifier { - id: "y", - range: 1574..1575, - }, - ), - }, - ), - MatchStar( - PatternMatchStar { - range: 1577..1579, - name: None, - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1590..1595, - targets: [ - Name( - ExprName { - range: 1590..1591, - id: "z", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1594..1595, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1618..1664, - subject: Name( - ExprName { - range: 1624..1625, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1631..1664, - pattern: MatchValue( - PatternMatchValue { - range: 1636..1649, - value: BinOp( - ExprBinOp { - range: 1636..1649, - left: UnaryOp( - ExprUnaryOp { - range: 1636..1641, - op: USub, - operand: NumberLiteral( - ExprNumberLiteral { - range: 1637..1641, - value: Float( - 0.25, - ), - }, - ), - }, - ), - op: Sub, - right: NumberLiteral( - ExprNumberLiteral { - range: 1644..1649, - value: Complex { - real: 0.0, - imag: 1.75, - }, - }, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1659..1664, - targets: [ - Name( - ExprName { - range: 1659..1660, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1663..1664, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1687..1726, - subject: Tuple( - ExprTuple { - range: 1693..1697, - elts: [ - Name( - ExprName { - range: 1694..1695, - id: "x", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - cases: [ - MatchCase { - range: 1703..1726, - pattern: MatchSequence( - PatternMatchSequence { - range: 1708..1711, - patterns: [ - MatchAs( - PatternMatchAs { - range: 1709..1710, - pattern: None, - name: Some( - Identifier { - id: "y", - range: 1709..1710, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1721..1726, - targets: [ - Name( - ExprName { - range: 1721..1722, - id: "z", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1725..1726, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1749..1789, - subject: Name( - ExprName { - range: 1755..1756, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1762..1789, - pattern: MatchValue( - PatternMatchValue { - range: 1767..1774, - value: Attribute( - ExprAttribute { - range: 1767..1774, - value: Attribute( - ExprAttribute { - range: 1767..1772, - value: Attribute( - ExprAttribute { - range: 1767..1770, - value: Name( - ExprName { - range: 1767..1768, - id: "A", - ctx: Load, - }, - ), - attr: Identifier { - id: "B", - range: 1769..1770, - }, - ctx: Load, - }, - ), - attr: Identifier { - id: "C", - range: 1771..1772, - }, - ctx: Load, - }, - ), - attr: Identifier { - id: "D", - range: 1773..1774, - }, - ctx: Load, - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1784..1789, - targets: [ - Name( - ExprName { - range: 1784..1785, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1788..1789, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1812..1849, - subject: Name( - ExprName { - range: 1818..1819, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1825..1849, - pattern: MatchSingleton( - PatternMatchSingleton { - range: 1830..1834, - value: None, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1844..1849, - targets: [ - Name( - ExprName { - range: 1844..1845, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1848..1849, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1872..1906, - subject: Name( - ExprName { - range: 1878..1879, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1885..1906, - pattern: MatchValue( - PatternMatchValue { - range: 1890..1891, - value: NumberLiteral( - ExprNumberLiteral { - range: 1890..1891, - value: Int( - 0, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1901..1906, - targets: [ - Name( - ExprName { - range: 1901..1902, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1905..1906, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1929..1967, - subject: Name( - ExprName { - range: 1935..1936, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1942..1967, - pattern: MatchSingleton( - PatternMatchSingleton { - range: 1947..1952, - value: False, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1962..1967, - targets: [ - Name( - ExprName { - range: 1962..1963, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1966..1967, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1990..2081, - subject: Name( - ExprName { - range: 1996..1997, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 2003..2025, - pattern: MatchSequence( - PatternMatchSequence { - range: 2008..2010, - patterns: [], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2020..2025, - targets: [ - Name( - ExprName { - range: 2020..2021, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2024..2025, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 2030..2054, - pattern: MatchSequence( - PatternMatchSequence { - range: 2035..2039, - patterns: [ - MatchValue( - PatternMatchValue { - range: 2036..2038, - value: StringLiteral( - ExprStringLiteral { - range: 2036..2038, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 2036..2038, - value: "", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2049..2054, - targets: [ - Name( - ExprName { - range: 2049..2050, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2053..2054, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 2059..2081, - pattern: MatchValue( - PatternMatchValue { - range: 2064..2066, - value: StringLiteral( - ExprStringLiteral { - range: 2064..2066, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 2064..2066, - value: "", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2076..2081, - targets: [ - Name( - ExprName { - range: 2076..2077, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2080..2081, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2104..2138, - subject: Name( - ExprName { - range: 2110..2111, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 2117..2138, - pattern: MatchAs( - PatternMatchAs { - range: 2122..2123, - pattern: None, - name: Some( - Identifier { - id: "z", - range: 2122..2123, - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2133..2138, - targets: [ - Name( - ExprName { - range: 2133..2134, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2137..2138, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2161..2207, - subject: Name( - ExprName { - range: 2167..2168, - id: "w", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 2174..2207, - pattern: MatchSequence( - PatternMatchSequence { - range: 2179..2192, - patterns: [ - MatchAs( - PatternMatchAs { - range: 2180..2181, - pattern: None, - name: Some( - Identifier { - id: "x", - range: 2180..2181, - }, - ), - }, - ), - MatchAs( - PatternMatchAs { - range: 2183..2184, - pattern: None, - name: Some( - Identifier { - id: "y", - range: 2183..2184, - }, - ), - }, - ), - MatchStar( - PatternMatchStar { - range: 2186..2191, - name: Some( - Identifier { - id: "rest", - range: 2187..2191, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2202..2207, - targets: [ - Name( - ExprName { - range: 2202..2203, - id: "z", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2206..2207, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2230..2307, - subject: Name( - ExprName { - range: 2236..2237, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 2243..2307, - pattern: MatchOr( - PatternMatchOr { - range: 2248..2278, - patterns: [ - MatchAs( - PatternMatchAs { - range: 2249..2255, - pattern: Some( - MatchValue( - PatternMatchValue { - range: 2249..2250, - value: NumberLiteral( - ExprNumberLiteral { - range: 2249..2250, - value: Int( - 0, - ), - }, - ), - }, - ), - ), - name: Some( - Identifier { - id: "z", - range: 2254..2255, - }, - ), - }, - ), - MatchAs( - PatternMatchAs { - range: 2260..2266, - pattern: Some( - MatchValue( - PatternMatchValue { - range: 2260..2261, - value: NumberLiteral( - ExprNumberLiteral { - range: 2260..2261, - value: Int( - 1, - ), - }, - ), - }, - ), - ), - name: Some( - Identifier { - id: "z", - range: 2265..2266, - }, - ), - }, - ), - MatchAs( - PatternMatchAs { - range: 2271..2277, - pattern: Some( - MatchValue( - PatternMatchValue { - range: 2271..2272, - value: NumberLiteral( - ExprNumberLiteral { - range: 2271..2272, - value: Int( - 2, - ), - }, - ), - }, - ), - ), - name: Some( - Identifier { - id: "z", - range: 2276..2277, - }, - ), - }, - ), - ], - }, - ), - guard: Some( - Compare( - ExprCompare { - range: 2282..2292, - left: Name( - ExprName { - range: 2282..2283, - id: "z", - ctx: Load, - }, - ), - ops: [ - Eq, - ], - comparators: [ - BinOp( - ExprBinOp { - range: 2287..2292, - left: Name( - ExprName { - range: 2287..2288, - id: "x", - ctx: Load, - }, - ), - op: Mod, - right: NumberLiteral( - ExprNumberLiteral { - range: 2291..2292, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ), - ), - body: [ - Assign( - StmtAssign { - range: 2302..2307, - targets: [ - Name( - ExprName { - range: 2302..2303, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2306..2307, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2330..2499, - subject: Name( - ExprName { - range: 2336..2337, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 2343..2378, - pattern: MatchMapping( - PatternMatchMapping { - range: 2348..2363, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 2349..2350, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 2352..2362, - patterns: [ - MatchValue( - PatternMatchValue { - range: 2353..2354, - value: NumberLiteral( - ExprNumberLiteral { - range: 2353..2354, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 2356..2357, - value: NumberLiteral( - ExprNumberLiteral { - range: 2356..2357, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 2359..2361, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2373..2378, - targets: [ - Name( - ExprName { - range: 2373..2374, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2377..2378, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 2383..2472, - pattern: MatchOr( - PatternMatchOr { - range: 2388..2457, - patterns: [ - MatchMapping( - PatternMatchMapping { - range: 2388..2411, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 2389..2390, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchOr( - PatternMatchOr { - range: 2392..2410, - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 2392..2402, - patterns: [ - MatchValue( - PatternMatchValue { - range: 2393..2394, - value: NumberLiteral( - ExprNumberLiteral { - range: 2393..2394, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 2396..2397, - value: NumberLiteral( - ExprNumberLiteral { - range: 2396..2397, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 2399..2401, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - MatchSingleton( - PatternMatchSingleton { - range: 2405..2410, - value: False, - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - MatchMapping( - PatternMatchMapping { - range: 2414..2423, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 2415..2416, - value: Int( - 1, - ), - }, - ), - ], - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 2418..2422, - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 2419..2421, - patterns: [], - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - MatchMapping( - PatternMatchMapping { - range: 2426..2441, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 2427..2428, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 2430..2440, - patterns: [ - MatchValue( - PatternMatchValue { - range: 2431..2432, - value: NumberLiteral( - ExprNumberLiteral { - range: 2431..2432, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 2434..2435, - value: NumberLiteral( - ExprNumberLiteral { - range: 2434..2435, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 2437..2439, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - MatchSequence( - PatternMatchSequence { - range: 2444..2446, - patterns: [], - }, - ), - MatchValue( - PatternMatchValue { - range: 2449..2452, - value: StringLiteral( - ExprStringLiteral { - range: 2449..2452, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 2449..2452, - value: "X", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 2455..2457, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2467..2472, - targets: [ - Name( - ExprName { - range: 2467..2468, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2471..2472, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 2477..2499, - pattern: MatchSequence( - PatternMatchSequence { - range: 2482..2484, - patterns: [], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2494..2499, - targets: [ - Name( - ExprName { - range: 2494..2495, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2498..2499, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2522..2568, - subject: Tuple( - ExprTuple { - range: 2528..2537, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 2529..2530, - value: Int( - 0, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 2532..2533, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 2535..2536, - value: Int( - 2, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - cases: [ - MatchCase { - range: 2543..2568, - pattern: MatchSequence( - PatternMatchSequence { - range: 2548..2553, - patterns: [ - MatchValue( - PatternMatchValue { - range: 2548..2549, - value: NumberLiteral( - ExprNumberLiteral { - range: 2548..2549, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchStar( - PatternMatchStar { - range: 2551..2553, - name: Some( - Identifier { - id: "x", - range: 2552..2553, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2563..2568, - targets: [ - Name( - ExprName { - range: 2563..2564, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2567..2568, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2591..2638, - subject: Tuple( - ExprTuple { - range: 2597..2606, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 2598..2599, - value: Int( - 0, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 2601..2602, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 2604..2605, - value: Int( - 2, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - cases: [ - MatchCase { - range: 2612..2638, - pattern: MatchSequence( - PatternMatchSequence { - range: 2617..2623, - patterns: [ - MatchStar( - PatternMatchStar { - range: 2617..2619, - name: Some( - Identifier { - id: "x", - range: 2618..2619, - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 2621..2622, - value: NumberLiteral( - ExprNumberLiteral { - range: 2621..2622, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2633..2638, - targets: [ - Name( - ExprName { - range: 2633..2634, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2637..2638, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2661..2697, - subject: Tuple( - ExprTuple { - range: 2667..2669, - elts: [ - Name( - ExprName { - range: 2667..2668, - id: "x", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - cases: [ - MatchCase { - range: 2675..2697, - pattern: MatchSequence( - PatternMatchSequence { - range: 2680..2682, - patterns: [ - MatchAs( - PatternMatchAs { - range: 2680..2681, - pattern: None, - name: Some( - Identifier { - id: "y", - range: 2680..2681, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2692..2697, - targets: [ - Name( - ExprName { - range: 2692..2693, - id: "z", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2696..2697, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2720..2760, - subject: Tuple( - ExprTuple { - range: 2726..2730, - elts: [ - Name( - ExprName { - range: 2726..2727, - id: "w", - ctx: Load, - }, - ), - Name( - ExprName { - range: 2729..2730, - id: "x", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - cases: [ - MatchCase { - range: 2736..2760, - pattern: MatchSequence( - PatternMatchSequence { - range: 2741..2745, - patterns: [ - MatchAs( - PatternMatchAs { - range: 2741..2742, - pattern: None, - name: Some( - Identifier { - id: "y", - range: 2741..2742, - }, - ), - }, - ), - MatchAs( - PatternMatchAs { - range: 2744..2745, - pattern: None, - name: Some( - Identifier { - id: "z", - range: 2744..2745, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2755..2760, - targets: [ - Name( - ExprName { - range: 2755..2756, - id: "v", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2759..2760, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2783..2829, - subject: Tuple( - ExprTuple { - range: 2789..2796, - elts: [ - Named( - ExprNamed { - range: 2789..2795, - target: Name( - ExprName { - range: 2789..2790, - id: "w", - ctx: Store, - }, - ), - value: Name( - ExprName { - range: 2794..2795, - id: "x", - ctx: Load, - }, - ), - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - cases: [ - MatchCase { - range: 2802..2829, - pattern: MatchSequence( - PatternMatchSequence { - range: 2807..2814, - patterns: [ - MatchAs( - PatternMatchAs { - range: 2807..2813, - pattern: Some( - MatchAs( - PatternMatchAs { - range: 2807..2808, - pattern: None, - name: Some( - Identifier { - id: "y", - range: 2807..2808, - }, - ), - }, - ), - ), - name: Some( - Identifier { - id: "v", - range: 2812..2813, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2824..2829, - targets: [ - Name( - ExprName { - range: 2824..2825, - id: "z", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2828..2829, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__slice.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__slice.snap deleted file mode 100644 index 3113d14036..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__slice.snap +++ /dev/null @@ -1,52 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -Subscript( - ExprSubscript { - range: 0..8, - value: Name( - ExprName { - range: 0..1, - id: "x", - ctx: Load, - }, - ), - slice: Slice( - ExprSlice { - range: 2..7, - lower: Some( - NumberLiteral( - ExprNumberLiteral { - range: 2..3, - value: Int( - 1, - ), - }, - ), - ), - upper: Some( - NumberLiteral( - ExprNumberLiteral { - range: 4..5, - value: Int( - 2, - ), - }, - ), - ), - step: Some( - NumberLiteral( - ExprNumberLiteral { - range: 6..7, - value: Int( - 3, - ), - }, - ), - ), - }, - ), - ctx: Load, - }, -) diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__star_index.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__star_index.snap deleted file mode 100644 index 340b3ea3d5..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__star_index.snap +++ /dev/null @@ -1,267 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Assign( - StmtAssign { - range: 0..36, - targets: [ - Name( - ExprName { - range: 0..11, - id: "array_slice", - ctx: Store, - }, - ), - ], - value: Subscript( - ExprSubscript { - range: 14..36, - value: Name( - ExprName { - range: 14..19, - id: "array", - ctx: Load, - }, - ), - slice: Tuple( - ExprTuple { - range: 20..35, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 20..21, - value: Int( - 0, - ), - }, - ), - Starred( - ExprStarred { - range: 23..31, - value: Name( - ExprName { - range: 24..31, - id: "indexes", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - UnaryOp( - ExprUnaryOp { - range: 33..35, - op: USub, - operand: NumberLiteral( - ExprNumberLiteral { - range: 34..35, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - ctx: Load, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 37..73, - targets: [ - Subscript( - ExprSubscript { - range: 37..59, - value: Name( - ExprName { - range: 37..42, - id: "array", - ctx: Load, - }, - ), - slice: Tuple( - ExprTuple { - range: 43..58, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 43..44, - value: Int( - 0, - ), - }, - ), - Starred( - ExprStarred { - range: 46..54, - value: Name( - ExprName { - range: 47..54, - id: "indexes", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - UnaryOp( - ExprUnaryOp { - range: 56..58, - op: USub, - operand: NumberLiteral( - ExprNumberLiteral { - range: 57..58, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - ctx: Store, - }, - ), - ], - value: Name( - ExprName { - range: 62..73, - id: "array_slice", - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 74..119, - value: Subscript( - ExprSubscript { - range: 74..119, - value: Name( - ExprName { - range: 74..79, - id: "array", - ctx: Load, - }, - ), - slice: Tuple( - ExprTuple { - range: 80..118, - elts: [ - Starred( - ExprStarred { - range: 80..98, - value: Name( - ExprName { - range: 81..98, - id: "indexes_to_select", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - Starred( - ExprStarred { - range: 100..118, - value: Name( - ExprName { - range: 101..118, - id: "indexes_to_select", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 120..150, - value: Subscript( - ExprSubscript { - range: 120..150, - value: Name( - ExprName { - range: 120..125, - id: "array", - ctx: Load, - }, - ), - slice: Tuple( - ExprTuple { - range: 126..149, - elts: [ - Slice( - ExprSlice { - range: 126..129, - lower: Some( - NumberLiteral( - ExprNumberLiteral { - range: 126..127, - value: Int( - 3, - ), - }, - ), - ), - upper: Some( - NumberLiteral( - ExprNumberLiteral { - range: 128..129, - value: Int( - 5, - ), - }, - ), - ), - step: None, - }, - ), - Starred( - ExprStarred { - range: 131..149, - value: Name( - ExprName { - range: 132..149, - id: "indexes_to_select", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - ctx: Load, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try.snap deleted file mode 100644 index b01b083778..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try.snap +++ /dev/null @@ -1,262 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Try( - StmtTry { - range: 0..134, - body: [ - Raise( - StmtRaise { - range: 9..28, - exc: Some( - Call( - ExprCall { - range: 15..28, - func: Name( - ExprName { - range: 15..25, - id: "ValueError", - ctx: Load, - }, - ), - arguments: Arguments { - range: 25..28, - args: [ - NumberLiteral( - ExprNumberLiteral { - range: 26..27, - value: Int( - 1, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - ), - cause: None, - }, - ), - ], - handlers: [ - ExceptHandler( - ExceptHandlerExceptHandler { - range: 29..82, - type_: Some( - Name( - ExprName { - range: 36..45, - id: "TypeError", - ctx: Load, - }, - ), - ), - name: Some( - Identifier { - id: "e", - range: 49..50, - }, - ), - body: [ - Expr( - StmtExpr { - range: 56..82, - value: Call( - ExprCall { - range: 56..82, - func: Name( - ExprName { - range: 56..61, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 61..82, - args: [ - FString( - ExprFString { - range: 62..81, - value: FStringValue { - inner: Single( - FString( - FString { - range: 62..81, - elements: [ - Literal( - FStringLiteralElement { - range: 64..71, - value: "caught ", - }, - ), - Expression( - FStringExpressionElement { - range: 71..80, - expression: Call( - ExprCall { - range: 72..79, - func: Name( - ExprName { - range: 72..76, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 76..79, - args: [ - Name( - ExprName { - range: 77..78, - id: "e", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - ], - }, - ), - ExceptHandler( - ExceptHandlerExceptHandler { - range: 83..134, - type_: Some( - Name( - ExprName { - range: 90..97, - id: "OSError", - ctx: Load, - }, - ), - ), - name: Some( - Identifier { - id: "e", - range: 101..102, - }, - ), - body: [ - Expr( - StmtExpr { - range: 108..134, - value: Call( - ExprCall { - range: 108..134, - func: Name( - ExprName { - range: 108..113, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 113..134, - args: [ - FString( - ExprFString { - range: 114..133, - value: FStringValue { - inner: Single( - FString( - FString { - range: 114..133, - elements: [ - Literal( - FStringLiteralElement { - range: 116..123, - value: "caught ", - }, - ), - Expression( - FStringExpressionElement { - range: 123..132, - expression: Call( - ExprCall { - range: 124..131, - func: Name( - ExprName { - range: 124..128, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 128..131, - args: [ - Name( - ExprName { - range: 129..130, - id: "e", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - ], - }, - ), - ], - orelse: [], - finalbody: [], - is_star: false, - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try_star.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try_star.snap deleted file mode 100644 index c40a3d53dd..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try_star.snap +++ /dev/null @@ -1,446 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Try( - StmtTry { - range: 0..260, - body: [ - Raise( - StmtRaise { - range: 9..98, - exc: Some( - Call( - ExprCall { - range: 15..98, - func: Name( - ExprName { - range: 15..29, - id: "ExceptionGroup", - ctx: Load, - }, - ), - arguments: Arguments { - range: 29..98, - args: [ - StringLiteral( - ExprStringLiteral { - range: 30..34, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 30..34, - value: "eg", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - List( - ExprList { - range: 44..97, - elts: [ - Call( - ExprCall { - range: 45..58, - func: Name( - ExprName { - range: 45..55, - id: "ValueError", - ctx: Load, - }, - ), - arguments: Arguments { - range: 55..58, - args: [ - NumberLiteral( - ExprNumberLiteral { - range: 56..57, - value: Int( - 1, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - Call( - ExprCall { - range: 60..72, - func: Name( - ExprName { - range: 60..69, - id: "TypeError", - ctx: Load, - }, - ), - arguments: Arguments { - range: 69..72, - args: [ - NumberLiteral( - ExprNumberLiteral { - range: 70..71, - value: Int( - 2, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - Call( - ExprCall { - range: 74..84, - func: Name( - ExprName { - range: 74..81, - id: "OSError", - ctx: Load, - }, - ), - arguments: Arguments { - range: 81..84, - args: [ - NumberLiteral( - ExprNumberLiteral { - range: 82..83, - value: Int( - 3, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - Call( - ExprCall { - range: 86..96, - func: Name( - ExprName { - range: 86..93, - id: "OSError", - ctx: Load, - }, - ), - arguments: Arguments { - range: 93..96, - args: [ - NumberLiteral( - ExprNumberLiteral { - range: 94..95, - value: Int( - 4, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - ], - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - ), - cause: None, - }, - ), - ], - handlers: [ - ExceptHandler( - ExceptHandlerExceptHandler { - range: 99..180, - type_: Some( - Name( - ExprName { - range: 107..116, - id: "TypeError", - ctx: Load, - }, - ), - ), - name: Some( - Identifier { - id: "e", - range: 120..121, - }, - ), - body: [ - Expr( - StmtExpr { - range: 127..180, - value: Call( - ExprCall { - range: 127..180, - func: Name( - ExprName { - range: 127..132, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 132..180, - args: [ - FString( - ExprFString { - range: 133..179, - value: FStringValue { - inner: Single( - FString( - FString { - range: 133..179, - elements: [ - Literal( - FStringLiteralElement { - range: 135..142, - value: "caught ", - }, - ), - Expression( - FStringExpressionElement { - range: 142..151, - expression: Call( - ExprCall { - range: 143..150, - func: Name( - ExprName { - range: 143..147, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 147..150, - args: [ - Name( - ExprName { - range: 148..149, - id: "e", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 151..164, - value: " with nested ", - }, - ), - Expression( - FStringExpressionElement { - range: 164..178, - expression: Attribute( - ExprAttribute { - range: 165..177, - value: Name( - ExprName { - range: 165..166, - id: "e", - ctx: Load, - }, - ), - attr: Identifier { - id: "exceptions", - range: 167..177, - }, - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - ], - }, - ), - ExceptHandler( - ExceptHandlerExceptHandler { - range: 181..260, - type_: Some( - Name( - ExprName { - range: 189..196, - id: "OSError", - ctx: Load, - }, - ), - ), - name: Some( - Identifier { - id: "e", - range: 200..201, - }, - ), - body: [ - Expr( - StmtExpr { - range: 207..260, - value: Call( - ExprCall { - range: 207..260, - func: Name( - ExprName { - range: 207..212, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 212..260, - args: [ - FString( - ExprFString { - range: 213..259, - value: FStringValue { - inner: Single( - FString( - FString { - range: 213..259, - elements: [ - Literal( - FStringLiteralElement { - range: 215..222, - value: "caught ", - }, - ), - Expression( - FStringExpressionElement { - range: 222..231, - expression: Call( - ExprCall { - range: 223..230, - func: Name( - ExprName { - range: 223..227, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 227..230, - args: [ - Name( - ExprName { - range: 228..229, - id: "e", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 231..244, - value: " with nested ", - }, - ), - Expression( - FStringExpressionElement { - range: 244..258, - expression: Attribute( - ExprAttribute { - range: 245..257, - value: Name( - ExprName { - range: 245..246, - id: "e", - ctx: Load, - }, - ), - attr: Identifier { - id: "exceptions", - range: 247..257, - }, - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - ], - }, - ), - ], - orelse: [], - finalbody: [], - is_star: true, - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__tuple.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__tuple.snap deleted file mode 100644 index 73d7183402..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__tuple.snap +++ /dev/null @@ -1,124 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..3, - value: Tuple( - ExprTuple { - range: 0..3, - elts: [ - Name( - ExprName { - range: 0..1, - id: "a", - ctx: Load, - }, - ), - Name( - ExprName { - range: 2..3, - id: "b", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 4..9, - value: Tuple( - ExprTuple { - range: 4..9, - elts: [ - Name( - ExprName { - range: 5..6, - id: "a", - ctx: Load, - }, - ), - Name( - ExprName { - range: 7..8, - id: "b", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 10..12, - value: Tuple( - ExprTuple { - range: 10..12, - elts: [], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 13..17, - value: Tuple( - ExprTuple { - range: 13..17, - elts: [ - Name( - ExprName { - range: 14..15, - id: "a", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 18..25, - value: Tuple( - ExprTuple { - range: 19..24, - elts: [ - Name( - ExprName { - range: 20..21, - id: "a", - ctx: Load, - }, - ), - Name( - ExprName { - range: 22..23, - id: "b", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__type_as_identifier.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__type_as_identifier.snap deleted file mode 100644 index 8f8dc1302e..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__type_as_identifier.snap +++ /dev/null @@ -1,1037 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_suite(source).unwrap() ---- -[ - Expr( - StmtExpr { - range: 2..16, - value: Tuple( - ExprTuple { - range: 2..16, - elts: [ - BinOp( - ExprBinOp { - range: 2..13, - left: BinOp( - ExprBinOp { - range: 2..9, - left: Name( - ExprName { - range: 2..6, - id: "type", - ctx: Load, - }, - ), - op: Mult, - right: Name( - ExprName { - range: 8..9, - id: "a", - ctx: Load, - }, - ), - }, - ), - op: Add, - right: Name( - ExprName { - range: 12..13, - id: "b", - ctx: Load, - }, - ), - }, - ), - Name( - ExprName { - range: 15..16, - id: "c", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 41..57, - value: Tuple( - ExprTuple { - range: 41..57, - elts: [ - BinOp( - ExprBinOp { - range: 41..54, - left: Name( - ExprName { - range: 41..45, - id: "type", - ctx: Load, - }, - ), - op: Mult, - right: BinOp( - ExprBinOp { - range: 48..53, - left: Name( - ExprName { - range: 48..49, - id: "a", - ctx: Load, - }, - ), - op: Add, - right: Name( - ExprName { - range: 52..53, - id: "b", - ctx: Load, - }, - ), - }, - ), - }, - ), - Name( - ExprName { - range: 56..57, - id: "c", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 82..98, - value: Call( - ExprCall { - range: 82..98, - func: Name( - ExprName { - range: 82..86, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 87..98, - args: [ - Starred( - ExprStarred { - range: 88..94, - value: BinOp( - ExprBinOp { - range: 89..94, - left: Name( - ExprName { - range: 89..90, - id: "a", - ctx: Load, - }, - ), - op: Add, - right: Name( - ExprName { - range: 93..94, - id: "b", - ctx: Load, - }, - ), - }, - ), - ctx: Load, - }, - ), - Name( - ExprName { - range: 96..97, - id: "c", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 124..139, - value: BinOp( - ExprBinOp { - range: 124..139, - left: BinOp( - ExprBinOp { - range: 124..135, - left: Name( - ExprName { - range: 124..128, - id: "type", - ctx: Load, - }, - ), - op: Sub, - right: BinOp( - ExprBinOp { - range: 130..135, - left: Name( - ExprName { - range: 130..131, - id: "a", - ctx: Load, - }, - ), - op: Mult, - right: Name( - ExprName { - range: 134..135, - id: "b", - ctx: Load, - }, - ), - }, - ), - }, - ), - op: Add, - right: Name( - ExprName { - range: 138..139, - id: "c", - ctx: Load, - }, - ), - }, - ), - }, - ), - Expr( - StmtExpr { - range: 165..182, - value: BinOp( - ExprBinOp { - range: 165..182, - left: BinOp( - ExprBinOp { - range: 165..178, - left: Name( - ExprName { - range: 165..169, - id: "type", - ctx: Load, - }, - ), - op: Sub, - right: BinOp( - ExprBinOp { - range: 172..177, - left: Name( - ExprName { - range: 172..173, - id: "a", - ctx: Load, - }, - ), - op: Mult, - right: Name( - ExprName { - range: 176..177, - id: "b", - ctx: Load, - }, - ), - }, - ), - }, - ), - op: Add, - right: Name( - ExprName { - range: 181..182, - id: "c", - ctx: Load, - }, - ), - }, - ), - }, - ), - Expr( - StmtExpr { - range: 208..225, - value: BinOp( - ExprBinOp { - range: 208..225, - left: BinOp( - ExprBinOp { - range: 208..221, - left: Call( - ExprCall { - range: 208..217, - func: Name( - ExprName { - range: 208..212, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 213..217, - args: [ - UnaryOp( - ExprUnaryOp { - range: 214..216, - op: USub, - operand: Name( - ExprName { - range: 215..216, - id: "a", - ctx: Load, - }, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - op: Mult, - right: Name( - ExprName { - range: 220..221, - id: "b", - ctx: Load, - }, - ), - }, - ), - op: Add, - right: Name( - ExprName { - range: 224..225, - id: "c", - ctx: Load, - }, - ), - }, - ), - }, - ), - Expr( - StmtExpr { - range: 252..261, - value: Attribute( - ExprAttribute { - range: 252..261, - value: Call( - ExprCall { - range: 252..259, - func: Name( - ExprName { - range: 252..256, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 257..259, - args: [], - keywords: [], - }, - }, - ), - attr: Identifier { - id: "a", - range: 260..261, - }, - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 277..288, - value: Attribute( - ExprAttribute { - range: 277..288, - value: Call( - ExprCall { - range: 277..286, - func: Name( - ExprName { - range: 277..281, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 282..286, - args: [ - Tuple( - ExprTuple { - range: 283..285, - elts: [], - ctx: Load, - parenthesized: true, - }, - ), - ], - keywords: [], - }, - }, - ), - attr: Identifier { - id: "a", - range: 287..288, - }, - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 306..318, - value: Attribute( - ExprAttribute { - range: 306..318, - value: Call( - ExprCall { - range: 306..316, - func: Name( - ExprName { - range: 306..310, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 311..316, - args: [ - Tuple( - ExprTuple { - range: 312..314, - elts: [], - ctx: Load, - parenthesized: true, - }, - ), - ], - keywords: [], - }, - }, - ), - attr: Identifier { - id: "a", - range: 317..318, - }, - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 336..346, - value: Attribute( - ExprAttribute { - range: 336..346, - value: Subscript( - ExprSubscript { - range: 336..344, - value: Name( - ExprName { - range: 336..340, - id: "type", - ctx: Load, - }, - ), - slice: Name( - ExprName { - range: 342..343, - id: "a", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - attr: Identifier { - id: "b", - range: 345..346, - }, - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 363..374, - value: Attribute( - ExprAttribute { - range: 363..374, - value: Subscript( - ExprSubscript { - range: 363..372, - value: Name( - ExprName { - range: 363..367, - id: "type", - ctx: Load, - }, - ), - slice: Tuple( - ExprTuple { - range: 369..371, - elts: [ - Name( - ExprName { - range: 369..370, - id: "a", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - ctx: Load, - }, - ), - attr: Identifier { - id: "b", - range: 373..374, - }, - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 413..426, - value: Attribute( - ExprAttribute { - range: 413..426, - value: Subscript( - ExprSubscript { - range: 413..424, - value: Name( - ExprName { - range: 413..417, - id: "type", - ctx: Load, - }, - ), - slice: Tuple( - ExprTuple { - range: 419..423, - elts: [ - Name( - ExprName { - range: 420..421, - id: "a", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - ctx: Load, - }, - ), - attr: Identifier { - id: "b", - range: 425..426, - }, - ctx: Load, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 446..462, - value: Subscript( - ExprSubscript { - range: 446..462, - value: Call( - ExprCall { - range: 446..452, - func: Name( - ExprName { - range: 446..450, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 450..452, - args: [], - keywords: [], - }, - }, - ), - slice: Slice( - ExprSlice { - range: 453..461, - lower: Some( - Name( - ExprName { - range: 453..454, - id: "a", - ctx: Load, - }, - ), - ), - upper: Some( - Name( - ExprName { - range: 460..461, - id: "b", - ctx: Load, - }, - ), - ), - step: None, - }, - ), - ctx: Load, - }, - ), - }, - ), - If( - StmtIf { - range: 481..499, - test: Named( - ExprNamed { - range: 484..493, - target: Name( - ExprName { - range: 484..488, - id: "type", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 492..493, - value: Int( - 1, - ), - }, - ), - }, - ), - body: [ - Pass( - StmtPass { - range: 495..499, - }, - ), - ], - elif_else_clauses: [], - }, - ), - Assign( - StmtAssign { - range: 500..535, - targets: [ - Name( - ExprName { - range: 500..504, - id: "type", - ctx: Store, - }, - ), - ], - value: Lambda( - ExprLambda { - range: 507..535, - parameters: Some( - Parameters { - range: 514..519, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 514..519, - parameter: Parameter { - range: 514..519, - name: Identifier { - id: "query", - range: 514..519, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - ), - body: Compare( - ExprCompare { - range: 521..535, - left: Name( - ExprName { - range: 521..526, - id: "query", - ctx: Load, - }, - ), - ops: [ - Eq, - ], - comparators: [ - Name( - ExprName { - range: 530..535, - id: "event", - ctx: Load, - }, - ), - ], - }, - ), - }, - ), - }, - ), - Expr( - StmtExpr { - range: 536..551, - value: Call( - ExprCall { - range: 536..551, - func: Name( - ExprName { - range: 536..541, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 541..551, - args: [ - Call( - ExprCall { - range: 542..550, - func: Name( - ExprName { - range: 542..546, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 546..550, - args: [ - NumberLiteral( - ExprNumberLiteral { - range: 547..549, - value: Int( - 12, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 552..562, - value: Call( - ExprCall { - range: 552..562, - func: Name( - ExprName { - range: 552..556, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 556..562, - args: [ - Name( - ExprName { - range: 557..561, - id: "type", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 563..581, - targets: [ - Name( - ExprName { - range: 563..564, - id: "a", - ctx: Store, - }, - ), - ], - value: Compare( - ExprCompare { - range: 570..579, - left: Name( - ExprName { - range: 570..574, - id: "type", - ctx: Load, - }, - ), - ops: [ - In, - ], - comparators: [ - Name( - ExprName { - range: 578..579, - id: "C", - ctx: Load, - }, - ), - ], - }, - ), - }, - ), - Assign( - StmtAssign { - range: 582..598, - targets: [ - Name( - ExprName { - range: 582..583, - id: "a", - ctx: Store, - }, - ), - ], - value: Call( - ExprCall { - range: 589..596, - func: Name( - ExprName { - range: 589..593, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 593..596, - args: [ - Name( - ExprName { - range: 594..595, - id: "b", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 599..616, - value: Call( - ExprCall { - range: 599..616, - func: Name( - ExprName { - range: 599..603, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 604..616, - args: [], - keywords: [ - Keyword { - range: 607..614, - arg: Some( - Identifier { - id: "X", - range: 607..608, - }, - ), - value: Name( - ExprName { - range: 611..614, - id: "int", - ctx: Load, - }, - ), - }, - ], - }, - }, - ), - }, - ), - Assign( - StmtAssign { - range: 617..625, - targets: [ - Name( - ExprName { - range: 617..621, - id: "type", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 624..625, - value: Int( - 1, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 626..638, - targets: [ - Name( - ExprName { - range: 626..630, - id: "type", - ctx: Store, - }, - ), - Name( - ExprName { - range: 633..634, - id: "x", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 637..638, - value: Int( - 1, - ), - }, - ), - }, - ), - Assign( - StmtAssign { - range: 639..651, - targets: [ - Name( - ExprName { - range: 639..640, - id: "x", - ctx: Store, - }, - ), - Name( - ExprName { - range: 643..647, - id: "type", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 650..651, - value: Int( - 1, - ), - }, - ), - }, - ), - Expr( - StmtExpr { - range: 652..666, - value: Lambda( - ExprLambda { - range: 652..666, - parameters: Some( - Parameters { - range: 659..660, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 659..660, - parameter: Parameter { - range: 659..660, - name: Identifier { - id: "x", - range: 659..660, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - ), - body: Name( - ExprName { - range: 662..666, - id: "type", - ctx: Load, - }, - ), - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__variadic_generics.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__variadic_generics.snap deleted file mode 100644 index c2f6b07f5e..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__variadic_generics.snap +++ /dev/null @@ -1,89 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_ast ---- -[ - FunctionDef( - StmtFunctionDef { - range: 1..49, - is_async: false, - decorator_list: [], - name: Identifier { - id: "args_to_tuple", - range: 5..18, - }, - type_params: None, - parameters: Parameters { - range: 18..30, - posonlyargs: [], - args: [], - vararg: Some( - Parameter { - range: 19..29, - name: Identifier { - id: "args", - range: 20..24, - }, - annotation: Some( - Starred( - ExprStarred { - range: 26..29, - value: Name( - ExprName { - range: 27..29, - id: "Ts", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - ), - }, - ), - kwonlyargs: [], - kwarg: None, - }, - returns: Some( - Subscript( - ExprSubscript { - range: 34..44, - value: Name( - ExprName { - range: 34..39, - id: "Tuple", - ctx: Load, - }, - ), - slice: Starred( - ExprStarred { - range: 40..43, - value: Name( - ExprName { - range: 41..43, - id: "Ts", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - ctx: Load, - }, - ), - ), - body: [ - Expr( - StmtExpr { - range: 46..49, - value: EllipsisLiteral( - ExprEllipsisLiteral { - range: 46..49, - }, - ), - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__with_statement.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__with_statement.snap deleted file mode 100644 index ac34bf5571..0000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__with_statement.snap +++ /dev/null @@ -1,1158 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_suite(source).unwrap() ---- -[ - With( - StmtWith { - range: 0..12, - is_async: false, - items: [ - WithItem { - range: 5..6, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 5..6, - value: Int( - 0, - ), - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 8..12, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 13..30, - is_async: false, - items: [ - WithItem { - range: 18..24, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 18..19, - value: Int( - 0, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 23..24, - id: "x", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 26..30, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 31..46, - is_async: false, - items: [ - WithItem { - range: 36..37, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 36..37, - value: Int( - 0, - ), - }, - ), - optional_vars: None, - }, - WithItem { - range: 39..40, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 39..40, - value: Int( - 1, - ), - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 42..46, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 47..72, - is_async: false, - items: [ - WithItem { - range: 52..58, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 52..53, - value: Int( - 0, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 57..58, - id: "x", - ctx: Store, - }, - ), - ), - }, - WithItem { - range: 60..66, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 60..61, - value: Int( - 1, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 65..66, - id: "y", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 68..72, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 73..97, - is_async: false, - items: [ - WithItem { - range: 78..91, - context_expr: If( - ExprIf { - range: 78..91, - test: NumberLiteral( - ExprNumberLiteral { - range: 83..84, - value: Int( - 1, - ), - }, - ), - body: NumberLiteral( - ExprNumberLiteral { - range: 78..79, - value: Int( - 0, - ), - }, - ), - orelse: NumberLiteral( - ExprNumberLiteral { - range: 90..91, - value: Int( - 2, - ), - }, - ), - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 93..97, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 98..127, - is_async: false, - items: [ - WithItem { - range: 103..121, - context_expr: If( - ExprIf { - range: 103..116, - test: NumberLiteral( - ExprNumberLiteral { - range: 108..109, - value: Int( - 1, - ), - }, - ), - body: NumberLiteral( - ExprNumberLiteral { - range: 103..104, - value: Int( - 0, - ), - }, - ), - orelse: NumberLiteral( - ExprNumberLiteral { - range: 115..116, - value: Int( - 2, - ), - }, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 120..121, - id: "x", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 123..127, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 128..141, - is_async: false, - items: [ - WithItem { - range: 133..135, - context_expr: Tuple( - ExprTuple { - range: 133..135, - elts: [], - ctx: Load, - parenthesized: true, - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 137..141, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 142..160, - is_async: false, - items: [ - WithItem { - range: 147..154, - context_expr: Tuple( - ExprTuple { - range: 147..149, - elts: [], - ctx: Load, - parenthesized: true, - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 153..154, - id: "x", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 156..160, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 161..175, - is_async: false, - items: [ - WithItem { - range: 167..168, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 167..168, - value: Int( - 0, - ), - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 171..175, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 176..195, - is_async: false, - items: [ - WithItem { - range: 181..189, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 182..183, - value: Int( - 0, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 188..189, - id: "x", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 191..195, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 196..211, - is_async: false, - items: [ - WithItem { - range: 202..203, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 202..203, - value: Int( - 0, - ), - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 207..211, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 212..232, - is_async: false, - items: [ - WithItem { - range: 217..226, - context_expr: Tuple( - ExprTuple { - range: 217..221, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 218..219, - value: Int( - 0, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 225..226, - id: "x", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 228..232, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 233..250, - is_async: false, - items: [ - WithItem { - range: 239..240, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 239..240, - value: Int( - 0, - ), - }, - ), - optional_vars: None, - }, - WithItem { - range: 242..243, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 242..243, - value: Int( - 1, - ), - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 246..250, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 251..273, - is_async: false, - items: [ - WithItem { - range: 256..267, - context_expr: Tuple( - ExprTuple { - range: 256..262, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 257..258, - value: Int( - 0, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 260..261, - value: Int( - 1, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 266..267, - id: "x", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 269..273, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 274..290, - is_async: false, - items: [ - WithItem { - range: 279..284, - context_expr: Tuple( - ExprTuple { - range: 279..284, - elts: [ - Starred( - ExprStarred { - range: 280..282, - value: Name( - ExprName { - range: 281..282, - id: "a", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 286..290, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 291..312, - is_async: false, - items: [ - WithItem { - range: 296..306, - context_expr: Tuple( - ExprTuple { - range: 296..301, - elts: [ - Starred( - ExprStarred { - range: 297..299, - value: Name( - ExprName { - range: 298..299, - id: "a", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 305..306, - id: "x", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 308..312, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 313..331, - is_async: false, - items: [ - WithItem { - range: 318..325, - context_expr: Tuple( - ExprTuple { - range: 318..325, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 319..320, - value: Int( - 0, - ), - }, - ), - Starred( - ExprStarred { - range: 322..324, - value: Name( - ExprName { - range: 323..324, - id: "a", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 327..331, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 332..355, - is_async: false, - items: [ - WithItem { - range: 337..349, - context_expr: Tuple( - ExprTuple { - range: 337..344, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 338..339, - value: Int( - 0, - ), - }, - ), - Starred( - ExprStarred { - range: 341..343, - value: Name( - ExprName { - range: 342..343, - id: "a", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 348..349, - id: "x", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 351..355, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 356..375, - is_async: false, - items: [ - WithItem { - range: 362..368, - context_expr: Named( - ExprNamed { - range: 362..368, - target: Name( - ExprName { - range: 362..363, - id: "a", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 367..368, - value: Int( - 0, - ), - }, - ), - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 371..375, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 376..400, - is_async: false, - items: [ - WithItem { - range: 381..394, - context_expr: Named( - ExprNamed { - range: 382..388, - target: Name( - ExprName { - range: 382..383, - id: "a", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 387..388, - value: Int( - 0, - ), - }, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 393..394, - id: "x", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 396..400, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 401..428, - is_async: false, - items: [ - WithItem { - range: 406..422, - context_expr: Tuple( - ExprTuple { - range: 406..422, - elts: [ - Named( - ExprNamed { - range: 407..413, - target: Name( - ExprName { - range: 407..408, - id: "a", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 412..413, - value: Int( - 0, - ), - }, - ), - }, - ), - Named( - ExprNamed { - range: 415..421, - target: Name( - ExprName { - range: 415..416, - id: "b", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 420..421, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - optional_vars: None, - }, - ], - body: [ - Pass( - StmtPass { - range: 424..428, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 429..461, - is_async: false, - items: [ - WithItem { - range: 434..455, - context_expr: Tuple( - ExprTuple { - range: 434..450, - elts: [ - Named( - ExprNamed { - range: 435..441, - target: Name( - ExprName { - range: 435..436, - id: "a", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 440..441, - value: Int( - 0, - ), - }, - ), - }, - ), - Named( - ExprNamed { - range: 443..449, - target: Name( - ExprName { - range: 443..444, - id: "b", - ctx: Store, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 448..449, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 454..455, - id: "x", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 457..461, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 462..481, - is_async: false, - items: [ - WithItem { - range: 468..474, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 468..469, - value: Int( - 0, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 473..474, - id: "a", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 477..481, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 482..502, - is_async: false, - items: [ - WithItem { - range: 488..494, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 488..489, - value: Int( - 0, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 493..494, - id: "a", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 498..502, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 503..530, - is_async: false, - items: [ - WithItem { - range: 509..515, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 509..510, - value: Int( - 0, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 514..515, - id: "a", - ctx: Store, - }, - ), - ), - }, - WithItem { - range: 517..523, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 517..518, - value: Int( - 1, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 522..523, - id: "b", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 526..530, - }, - ), - ], - }, - ), - With( - StmtWith { - range: 531..559, - is_async: false, - items: [ - WithItem { - range: 537..543, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 537..538, - value: Int( - 0, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 542..543, - id: "a", - ctx: Store, - }, - ), - ), - }, - WithItem { - range: 545..551, - context_expr: NumberLiteral( - ExprNumberLiteral { - range: 545..546, - value: Int( - 1, - ), - }, - ), - optional_vars: Some( - Name( - ExprName { - range: 550..551, - id: "b", - ctx: Store, - }, - ), - ), - }, - ], - body: [ - Pass( - StmtPass { - range: 555..559, - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__invalid_byte_literal_error.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__invalid_byte_literal_error.snap new file mode 100644 index 0000000000..cfd2346294 --- /dev/null +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__invalid_byte_literal_error.snap @@ -0,0 +1,10 @@ +--- +source: crates/ruff_python_parser/src/string.rs +expression: error +--- +ParseError { + error: Lexical( + InvalidByteLiteral, + ), + location: 6..10, +} diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__invalid_unicode_literal.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__invalid_unicode_literal.snap new file mode 100644 index 0000000000..05ba4616d5 --- /dev/null +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__invalid_unicode_literal.snap @@ -0,0 +1,10 @@ +--- +source: crates/ruff_python_parser/src/string.rs +expression: error +--- +ParseError { + error: Lexical( + UnicodeError, + ), + location: 4..6, +} diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__invalid_unicode_name_error.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__invalid_unicode_name_error.snap new file mode 100644 index 0000000000..d657f5063d --- /dev/null +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__invalid_unicode_name_error.snap @@ -0,0 +1,10 @@ +--- +source: crates/ruff_python_parser/src/string.rs +expression: error +--- +ParseError { + error: Lexical( + UnicodeError, + ), + location: 4..11, +} diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__missing_unicode_lbrace_error.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__missing_unicode_lbrace_error.snap new file mode 100644 index 0000000000..fec204c0df --- /dev/null +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__missing_unicode_lbrace_error.snap @@ -0,0 +1,10 @@ +--- +source: crates/ruff_python_parser/src/string.rs +expression: error +--- +ParseError { + error: Lexical( + MissingUnicodeLbrace, + ), + location: 3..3, +} diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__missing_unicode_rbrace_error.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__missing_unicode_rbrace_error.snap new file mode 100644 index 0000000000..c052b292f5 --- /dev/null +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__missing_unicode_rbrace_error.snap @@ -0,0 +1,10 @@ +--- +source: crates/ruff_python_parser/src/string.rs +expression: error +--- +ParseError { + error: Lexical( + MissingUnicodeRbrace, + ), + location: 9..9, +} diff --git a/crates/ruff_python_parser/src/soft_keywords.rs b/crates/ruff_python_parser/src/soft_keywords.rs index e4bff73edc..e29781c749 100644 --- a/crates/ruff_python_parser/src/soft_keywords.rs +++ b/crates/ruff_python_parser/src/soft_keywords.rs @@ -146,7 +146,7 @@ where Tok::NonLogicalNewline | Tok::Comment { .. } => { // Nothing to do. } - Tok::StartModule | Tok::Newline | Tok::Indent | Tok::Dedent => { + Tok::Newline | Tok::Indent | Tok::Dedent => { self.position = Position::Statement; } // If we see a semicolon, assume we're at the start of a simple statement, as in: diff --git a/crates/ruff_python_parser/src/string.rs b/crates/ruff_python_parser/src/string.rs index 6327197631..5c9a65f274 100644 --- a/crates/ruff_python_parser/src/string.rs +++ b/crates/ruff_python_parser/src/string.rs @@ -6,8 +6,8 @@ use ruff_python_ast::{self as ast, AnyStringKind, Expr}; use ruff_text_size::{Ranged, TextRange, TextSize}; use crate::lexer::{LexicalError, LexicalErrorType}; -use crate::token::Tok; +#[derive(Debug)] pub(crate) enum StringType { Str(ast::StringLiteral), Bytes(ast::BytesLiteral), @@ -40,10 +40,15 @@ enum EscapedChar { } struct StringParser { + /// The raw content of the string e.g., the `foo` part in `"foo"`. source: Box, + /// Current position of the parser in the source. cursor: usize, + /// The kind of string. kind: AnyStringKind, + /// The location of the first character in the source from the start of the file. offset: TextSize, + /// The range of the string literal. range: TextRange, } @@ -65,9 +70,16 @@ impl StringParser { skipped_str } + /// Returns the current position of the parser considering the offset. #[inline] - fn get_pos(&self) -> TextSize { - self.offset + TextSize::try_from(self.cursor).unwrap() + fn position(&self) -> TextSize { + self.compute_position(self.cursor) + } + + /// Computes the position of the cursor considering the offset. + #[inline] + fn compute_position(&self, cursor: usize) -> TextSize { + self.offset + TextSize::try_from(cursor).unwrap() } /// Returns the next byte in the string, if there is one. @@ -98,19 +110,32 @@ impl StringParser { fn parse_unicode_literal(&mut self, literal_number: usize) -> Result { let mut p: u32 = 0u32; - let unicode_error = LexicalError::new(LexicalErrorType::UnicodeError, self.get_pos()); for i in 1..=literal_number { + let start = self.position(); match self.next_char() { Some(c) => match c.to_digit(16) { Some(d) => p += d << ((literal_number - i) * 4), - None => return Err(unicode_error), + None => { + return Err(LexicalError::new( + LexicalErrorType::UnicodeError, + TextRange::at(start, TextSize::try_from(c.len_utf8()).unwrap()), + )); + } }, - None => return Err(unicode_error), + None => { + return Err(LexicalError::new( + LexicalErrorType::UnicodeError, + TextRange::empty(self.position()), + )) + } } } match p { 0xD800..=0xDFFF => Ok(std::char::REPLACEMENT_CHARACTER), - _ => std::char::from_u32(p).ok_or(unicode_error), + _ => std::char::from_u32(p).ok_or(LexicalError::new( + LexicalErrorType::UnicodeError, + TextRange::empty(self.position()), + )), } } @@ -134,33 +159,45 @@ impl StringParser { } fn parse_unicode_name(&mut self) -> Result { - let start_pos = self.get_pos(); - + let start_pos = self.position(); let Some('{') = self.next_char() else { - return Err(LexicalError::new(LexicalErrorType::StringError, start_pos)); + return Err(LexicalError::new( + LexicalErrorType::MissingUnicodeLbrace, + TextRange::empty(start_pos), + )); }; - let start_pos = self.get_pos(); + let start_pos = self.position(); let Some(close_idx) = self.source[self.cursor..].find('}') else { return Err(LexicalError::new( - LexicalErrorType::StringError, - self.get_pos(), + LexicalErrorType::MissingUnicodeRbrace, + TextRange::empty(self.compute_position(self.source.len())), )); }; let name_and_ending = self.skip_bytes(close_idx + 1); let name = &name_and_ending[..name_and_ending.len() - 1]; - unicode_names2::character(name) - .ok_or_else(|| LexicalError::new(LexicalErrorType::UnicodeError, start_pos)) + unicode_names2::character(name).ok_or_else(|| { + LexicalError::new( + LexicalErrorType::UnicodeError, + // The cursor is right after the `}` character, so we subtract 1 to get the correct + // range of the unicode name. + TextRange::new( + start_pos, + self.compute_position(self.cursor - '}'.len_utf8()), + ), + ) + }) } /// Parse an escaped character, returning the new character. fn parse_escaped_char(&mut self) -> Result, LexicalError> { let Some(first_char) = self.next_char() else { + // TODO: check when this error case happens return Err(LexicalError::new( LexicalErrorType::StringError, - self.get_pos(), + TextRange::empty(self.position()), )); }; @@ -189,32 +226,19 @@ impl StringParser { return Ok(None); } - _ => { - if self.kind.is_byte_string() && !first_char.is_ascii() { - return Err(LexicalError::new( - LexicalErrorType::OtherError( - "bytes can only contain ASCII literal characters" - .to_string() - .into_boxed_str(), - ), - self.get_pos(), - )); - } - - return Ok(Some(EscapedChar::Escape(first_char))); - } + _ => return Ok(Some(EscapedChar::Escape(first_char))), }; Ok(Some(EscapedChar::Literal(new_char))) } - fn parse_fstring_middle(mut self) -> Result { + fn parse_fstring_middle(mut self) -> Result { // Fast-path: if the f-string doesn't contain any escape sequences, return the literal. let Some(mut index) = memchr::memchr3(b'{', b'}', b'\\', self.source.as_bytes()) else { - return Ok(ast::FStringElement::Literal(ast::FStringLiteralElement { + return Ok(ast::FStringLiteralElement { value: self.source, range: self.range, - })); + }); }; let mut value = String::with_capacity(self.source.len()); @@ -257,18 +281,22 @@ impl StringParser { // This is still an invalid escape sequence, but we don't want to // raise a syntax error as is done by the CPython parser. It might // be supported in the future, refer to point 3: https://peps.python.org/pep-0701/#rejected-ideas - b'\\' if !self.kind.is_raw_string() && self.peek_byte().is_some() => { - match self.parse_escaped_char()? { - None => {} - Some(EscapedChar::Literal(c)) => value.push(c), - Some(EscapedChar::Escape(c)) => { - value.push('\\'); - value.push(c); + b'\\' => { + if !self.kind.is_raw_string() && self.peek_byte().is_some() { + match self.parse_escaped_char()? { + None => {} + Some(EscapedChar::Literal(c)) => value.push(c), + Some(EscapedChar::Escape(c)) => { + value.push('\\'); + value.push(c); + } } + } else { + value.push('\\'); } } ch => { - value.push(char::from(*ch)); + unreachable!("Expected '{{', '}}', or '\\' but got {:?}", ch); } } @@ -284,21 +312,21 @@ impl StringParser { index = next_index; } - Ok(ast::FStringElement::Literal(ast::FStringLiteralElement { + Ok(ast::FStringLiteralElement { value: value.into_boxed_str(), range: self.range, - })) + }) } fn parse_bytes(mut self) -> Result { if let Some(index) = self.source.as_bytes().find_non_ascii_byte() { + let ch = self.source.chars().nth(index).unwrap(); return Err(LexicalError::new( - LexicalErrorType::OtherError( - "bytes can only contain ASCII literal characters" - .to_string() - .into_boxed_str(), + LexicalErrorType::InvalidByteLiteral, + TextRange::at( + self.compute_position(index), + TextSize::try_from(ch.len_utf8()).unwrap(), ), - self.offset + TextSize::try_from(index).unwrap(), )); } @@ -430,156 +458,19 @@ pub(crate) fn parse_string_literal( StringParser::new(source, kind, range.start() + kind.opener_len(), range).parse() } +// TODO(dhruvmanila): Move this to the new parser pub(crate) fn parse_fstring_literal_element( source: Box, kind: AnyStringKind, range: TextRange, -) -> Result { +) -> Result { StringParser::new(source, kind, range.start(), range).parse_fstring_middle() } -pub(crate) fn concatenated_strings( - strings: Vec, - range: TextRange, -) -> Result { - #[cfg(debug_assertions)] - debug_assert!(strings.len() > 1); - - let mut has_fstring = false; - let mut byte_literal_count = 0; - for string in &strings { - match string { - StringType::FString(_) => has_fstring = true, - StringType::Bytes(_) => byte_literal_count += 1, - StringType::Str(_) => {} - } - } - let has_bytes = byte_literal_count > 0; - - if has_bytes && byte_literal_count < strings.len() { - return Err(LexicalError::new( - LexicalErrorType::OtherError( - "cannot mix bytes and non-bytes literals" - .to_string() - .into_boxed_str(), - ), - range.start(), - )); - } - - if has_bytes { - let mut values = Vec::with_capacity(strings.len()); - for string in strings { - match string { - StringType::Bytes(value) => values.push(value), - _ => unreachable!("Unexpected non-bytes literal."), - } - } - return Ok(Expr::from(ast::ExprBytesLiteral { - value: ast::BytesLiteralValue::concatenated(values), - range, - })); - } - - if !has_fstring { - let mut values = Vec::with_capacity(strings.len()); - for string in strings { - match string { - StringType::Str(value) => values.push(value), - _ => unreachable!("Unexpected non-string literal."), - } - } - return Ok(Expr::from(ast::ExprStringLiteral { - value: ast::StringLiteralValue::concatenated(values), - range, - })); - } - - let mut parts = Vec::with_capacity(strings.len()); - for string in strings { - match string { - StringType::FString(fstring) => parts.push(ast::FStringPart::FString(fstring)), - StringType::Str(string) => parts.push(ast::FStringPart::Literal(string)), - StringType::Bytes(_) => unreachable!("Unexpected bytes literal."), - } - } - - Ok(ast::ExprFString { - value: ast::FStringValue::concatenated(parts), - range, - } - .into()) -} - -// TODO: consolidate these with ParseError -/// An error that occurred during parsing of an f-string. -#[derive(Debug, Clone, PartialEq)] -struct FStringError { - /// The type of error that occurred. - pub(crate) error: FStringErrorType, - /// The location of the error. - pub(crate) location: TextSize, -} - -impl From for LexicalError { - fn from(err: FStringError) -> Self { - LexicalError::new(LexicalErrorType::FStringError(err.error), err.location) - } -} - -/// Represents the different types of errors that can occur during parsing of an f-string. -#[derive(Copy, Debug, Clone, PartialEq)] -pub enum FStringErrorType { - /// Expected a right brace after an opened left brace. - UnclosedLbrace, - /// An invalid conversion flag was encountered. - InvalidConversionFlag, - /// A single right brace was encountered. - SingleRbrace, - /// Unterminated string. - UnterminatedString, - /// Unterminated triple-quoted string. - UnterminatedTripleQuotedString, - // TODO(dhruvmanila): The parser can't catch all cases of this error, but - // wherever it can, we'll display the correct error message. - /// A lambda expression without parentheses was encountered. - LambdaWithoutParentheses, -} - -impl std::fmt::Display for FStringErrorType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - use FStringErrorType::{ - InvalidConversionFlag, LambdaWithoutParentheses, SingleRbrace, UnclosedLbrace, - UnterminatedString, UnterminatedTripleQuotedString, - }; - match self { - UnclosedLbrace => write!(f, "expecting '}}'"), - InvalidConversionFlag => write!(f, "invalid conversion character"), - SingleRbrace => write!(f, "single '}}' is not allowed"), - UnterminatedString => write!(f, "unterminated string"), - UnterminatedTripleQuotedString => write!(f, "unterminated triple-quoted string"), - LambdaWithoutParentheses => { - write!(f, "lambda expressions are not allowed without parentheses") - } - } - } -} - -impl From for crate::parser::LalrpopError { - fn from(err: FStringError) -> Self { - lalrpop_util::ParseError::User { - error: LexicalError::new(LexicalErrorType::FStringError(err.error), err.location), - } - } -} - #[cfg(test)] mod tests { use crate::lexer::LexicalErrorType; - use crate::parser::parse_suite; - use crate::{ParseErrorType, Suite}; - - use super::*; + use crate::{parse_suite, FStringErrorType, ParseErrorType, Suite}; const WINDOWS_EOL: &str = "\r\n"; const MAC_EOL: &str = "\r"; @@ -665,6 +556,7 @@ mod tests { parse_suite(source) .map_err(|e| match e.error { ParseErrorType::Lexical(LexicalErrorType::FStringError(e)) => e, + ParseErrorType::FStringError(e) => e, e => unreachable!("Expected FStringError: {:?}", e), }) .expect_err("Expected error") @@ -679,10 +571,12 @@ mod tests { parse_fstring_error("f'{lambda x:{x}}'"), LambdaWithoutParentheses ); - assert_eq!( - parse_fstring_error("f'{lambda x: {x}}'"), - LambdaWithoutParentheses - ); + // NOTE: The parser produces the `LambdaWithoutParentheses` for this case, but + // since the parser only return the first error to maintain compatibility with + // the rest of the codebase, this test case fails. The `LambdaWithoutParentheses` + // error appears after the unexpected `FStringMiddle` token, which is between the + // `:` and the `{`. + // assert_eq!(parse_fstring_error("f'{lambda x: {x}}'"), LambdaWithoutParentheses); assert!(parse_suite(r#"f"{class}""#,).is_err()); } @@ -912,6 +806,46 @@ mod tests { insta::assert_debug_snapshot!(parse_ast); } + #[test] + fn test_invalid_unicode_literal() { + let source = r"'\x1ó34'"; + let error = parse_suite(source).unwrap_err(); + + insta::assert_debug_snapshot!(error); + } + + #[test] + fn test_missing_unicode_lbrace_error() { + let source = r"'\N '"; + let error = parse_suite(source).unwrap_err(); + + insta::assert_debug_snapshot!(error); + } + + #[test] + fn test_missing_unicode_rbrace_error() { + let source = r"'\N{SPACE'"; + let error = parse_suite(source).unwrap_err(); + + insta::assert_debug_snapshot!(error); + } + + #[test] + fn test_invalid_unicode_name_error() { + let source = r"'\N{INVALID}'"; + let error = parse_suite(source).unwrap_err(); + + insta::assert_debug_snapshot!(error); + } + + #[test] + fn test_invalid_byte_literal_error() { + let source = r"b'123a𝐁c'"; + let error = parse_suite(source).unwrap_err(); + + insta::assert_debug_snapshot!(error); + } + macro_rules! test_aliases_parse { ($($name:ident: $alias:expr,)*) => { $( diff --git a/crates/ruff_python_parser/src/token.rs b/crates/ruff_python_parser/src/token.rs index d57fa4c720..9ae2cf4f20 100644 --- a/crates/ruff_python_parser/src/token.rs +++ b/crates/ruff_python_parser/src/token.rs @@ -4,11 +4,12 @@ //! loosely based on the token definitions found in the [CPython source]. //! //! [CPython source]: https://github.com/python/cpython/blob/dfc2e065a2e71011017077e549cd2f9bf4944c54/Include/internal/pycore_token.h; -use crate::Mode; -use ruff_python_ast::{AnyStringKind, Int, IpyEscapeKind}; +use ruff_python_ast::{AnyStringKind, BoolOp, Int, IpyEscapeKind, Operator, UnaryOp}; use std::fmt; +use crate::Mode; + /// The set of tokens the Python source code can be tokenized in. #[derive(Clone, Debug, PartialEq, is_macro::Is)] pub enum Tok { @@ -220,6 +221,7 @@ pub enum Tok { With, Yield, + Unknown, // RustPython specific. StartModule, StartExpression, @@ -239,9 +241,9 @@ impl fmt::Display for Tok { #[allow(clippy::enum_glob_use)] use Tok::*; match self { - Name { name } => write!(f, "'{name}'"), - Int { value } => write!(f, "'{value}'"), - Float { value } => write!(f, "'{value}'"), + Name { name } => write!(f, "{name}"), + Int { value } => write!(f, "{value}"), + Float { value } => write!(f, "{value}"), Complex { real, imag } => write!(f, "{real}j{imag}"), String { value, kind } => { write!(f, "{}", kind.format_string_contents(value)) @@ -257,94 +259,95 @@ impl fmt::Display for Tok { StartModule => f.write_str("StartProgram"), StartExpression => f.write_str("StartExpression"), EndOfFile => f.write_str("EOF"), - Question => f.write_str("'?'"), - Exclamation => f.write_str("'!'"), - Lpar => f.write_str("'('"), - Rpar => f.write_str("')'"), - Lsqb => f.write_str("'['"), - Rsqb => f.write_str("']'"), - Colon => f.write_str("':'"), - Comma => f.write_str("','"), + Question => f.write_str("?"), + Exclamation => f.write_str("!"), + Lpar => f.write_str("("), + Rpar => f.write_str(")"), + Lsqb => f.write_str("["), + Rsqb => f.write_str("]"), + Colon => f.write_str(":"), + Comma => f.write_str(","), Comment(value) => f.write_str(value), - Semi => f.write_str("';'"), - Plus => f.write_str("'+'"), - Minus => f.write_str("'-'"), - Star => f.write_str("'*'"), - Slash => f.write_str("'/'"), - Vbar => f.write_str("'|'"), - Amper => f.write_str("'&'"), - Less => f.write_str("'<'"), - Greater => f.write_str("'>'"), - Equal => f.write_str("'='"), - Dot => f.write_str("'.'"), - Percent => f.write_str("'%'"), - Lbrace => f.write_str("'{'"), - Rbrace => f.write_str("'}'"), - EqEqual => f.write_str("'=='"), - NotEqual => f.write_str("'!='"), - LessEqual => f.write_str("'<='"), - GreaterEqual => f.write_str("'>='"), - Tilde => f.write_str("'~'"), - CircumFlex => f.write_str("'^'"), - LeftShift => f.write_str("'<<'"), - RightShift => f.write_str("'>>'"), - DoubleStar => f.write_str("'**'"), - DoubleStarEqual => f.write_str("'**='"), - PlusEqual => f.write_str("'+='"), - MinusEqual => f.write_str("'-='"), - StarEqual => f.write_str("'*='"), - SlashEqual => f.write_str("'/='"), - PercentEqual => f.write_str("'%='"), - AmperEqual => f.write_str("'&='"), - VbarEqual => f.write_str("'|='"), - CircumflexEqual => f.write_str("'^='"), - LeftShiftEqual => f.write_str("'<<='"), - RightShiftEqual => f.write_str("'>>='"), - DoubleSlash => f.write_str("'//'"), - DoubleSlashEqual => f.write_str("'//='"), - At => f.write_str("'@'"), - AtEqual => f.write_str("'@='"), - Rarrow => f.write_str("'->'"), - Ellipsis => f.write_str("'...'"), - False => f.write_str("'False'"), - None => f.write_str("'None'"), - True => f.write_str("'True'"), - And => f.write_str("'and'"), - As => f.write_str("'as'"), - Assert => f.write_str("'assert'"), - Async => f.write_str("'async'"), - Await => f.write_str("'await'"), - Break => f.write_str("'break'"), - Class => f.write_str("'class'"), - Continue => f.write_str("'continue'"), - Def => f.write_str("'def'"), - Del => f.write_str("'del'"), - Elif => f.write_str("'elif'"), - Else => f.write_str("'else'"), - Except => f.write_str("'except'"), - Finally => f.write_str("'finally'"), - For => f.write_str("'for'"), - From => f.write_str("'from'"), - Global => f.write_str("'global'"), - If => f.write_str("'if'"), - Import => f.write_str("'import'"), - In => f.write_str("'in'"), - Is => f.write_str("'is'"), - Lambda => f.write_str("'lambda'"), - Nonlocal => f.write_str("'nonlocal'"), - Not => f.write_str("'not'"), - Or => f.write_str("'or'"), - Pass => f.write_str("'pass'"), - Raise => f.write_str("'raise'"), - Return => f.write_str("'return'"), - Try => f.write_str("'try'"), - While => f.write_str("'while'"), - Match => f.write_str("'match'"), - Type => f.write_str("'type'"), - Case => f.write_str("'case'"), - With => f.write_str("'with'"), - Yield => f.write_str("'yield'"), - ColonEqual => f.write_str("':='"), + Semi => f.write_str(";"), + Plus => f.write_str("+"), + Minus => f.write_str("-"), + Star => f.write_str("*"), + Slash => f.write_str("/"), + Vbar => f.write_str("|"), + Amper => f.write_str("&"), + Less => f.write_str("<"), + Greater => f.write_str(">"), + Equal => f.write_str("="), + Dot => f.write_str("."), + Percent => f.write_str("%"), + Lbrace => f.write_str("{"), + Rbrace => f.write_str("}"), + EqEqual => f.write_str("=="), + NotEqual => f.write_str("!="), + LessEqual => f.write_str("<="), + GreaterEqual => f.write_str(">="), + Tilde => f.write_str("~"), + CircumFlex => f.write_str("^"), + LeftShift => f.write_str("<<"), + RightShift => f.write_str(">>"), + DoubleStar => f.write_str("**"), + DoubleStarEqual => f.write_str("**="), + PlusEqual => f.write_str("+="), + MinusEqual => f.write_str("-="), + StarEqual => f.write_str("*="), + SlashEqual => f.write_str("/="), + PercentEqual => f.write_str("%="), + AmperEqual => f.write_str("&="), + VbarEqual => f.write_str("|="), + CircumflexEqual => f.write_str("^="), + LeftShiftEqual => f.write_str("<<="), + RightShiftEqual => f.write_str(">>="), + DoubleSlash => f.write_str("//"), + DoubleSlashEqual => f.write_str("//="), + At => f.write_str("@"), + AtEqual => f.write_str("@="), + Rarrow => f.write_str("->"), + Ellipsis => f.write_str("..."), + False => f.write_str("False"), + None => f.write_str("None"), + True => f.write_str("True"), + And => f.write_str("and"), + As => f.write_str("as"), + Assert => f.write_str("assert"), + Async => f.write_str("async"), + Await => f.write_str("await"), + Break => f.write_str("break"), + Class => f.write_str("class"), + Continue => f.write_str("continue"), + Def => f.write_str("def"), + Del => f.write_str("del"), + Elif => f.write_str("elif"), + Else => f.write_str("else"), + Except => f.write_str("except"), + Finally => f.write_str("finally"), + For => f.write_str("for"), + From => f.write_str("from"), + Global => f.write_str("global"), + If => f.write_str("if"), + Import => f.write_str("import"), + In => f.write_str("in"), + Is => f.write_str("is"), + Lambda => f.write_str("lambda"), + Nonlocal => f.write_str("nonlocal"), + Not => f.write_str("not"), + Or => f.write_str("or"), + Pass => f.write_str("pass"), + Raise => f.write_str("raise"), + Return => f.write_str("return"), + Try => f.write_str("try"), + While => f.write_str("while"), + Match => f.write_str("match"), + Type => f.write_str("type"), + Case => f.write_str("case"), + With => f.write_str("with"), + Yield => f.write_str("yield"), + ColonEqual => f.write_str(":="), + Unknown => f.write_str(">"), } } } @@ -370,7 +373,7 @@ pub enum TokenKind { /// Token value for the end of an f-string. This includes the closing quote. FStringEnd, /// Token value for a IPython escape command. - EscapeCommand, + IpyEscapeCommand, /// Token value for a comment. These are filtered out of the token stream prior to parsing. Comment, /// Token value for a newline. @@ -524,6 +527,7 @@ pub enum TokenKind { With, Yield, + Unknown, // RustPython specific. StartModule, StartInteractive, @@ -695,6 +699,49 @@ impl TokenKind { matches!(self, TokenKind::Match | TokenKind::Case) } + #[inline] + pub const fn is_compare_operator(&self) -> bool { + matches!( + self, + TokenKind::Not + | TokenKind::In + | TokenKind::Is + | TokenKind::EqEqual + | TokenKind::NotEqual + | TokenKind::Less + | TokenKind::LessEqual + | TokenKind::Greater + | TokenKind::GreaterEqual + ) + } + + #[inline] + pub const fn is_bool_operator(&self) -> bool { + matches!(self, TokenKind::And | TokenKind::Or) + } + + /// Returns the [`Operator`] that corresponds to this token kind, if it is + /// an augmented assignment operator, or [`None`] otherwise. + #[inline] + pub const fn as_augmented_assign_operator(&self) -> Option { + match self { + TokenKind::PlusEqual => Some(Operator::Add), + TokenKind::MinusEqual => Some(Operator::Sub), + TokenKind::StarEqual => Some(Operator::Mult), + TokenKind::AtEqual => Some(Operator::MatMult), + TokenKind::DoubleStarEqual => Some(Operator::Pow), + TokenKind::SlashEqual => Some(Operator::Div), + TokenKind::DoubleSlashEqual => Some(Operator::FloorDiv), + TokenKind::PercentEqual => Some(Operator::Mod), + TokenKind::AmperEqual => Some(Operator::BitAnd), + TokenKind::VbarEqual => Some(Operator::BitOr), + TokenKind::CircumflexEqual => Some(Operator::BitXor), + TokenKind::LeftShiftEqual => Some(Operator::LShift), + TokenKind::RightShiftEqual => Some(Operator::RShift), + _ => None, + } + } + pub const fn from_token(token: &Tok) -> Self { match token { Tok::Name { .. } => TokenKind::Name, @@ -705,7 +752,7 @@ impl TokenKind { Tok::FStringStart(_) => TokenKind::FStringStart, Tok::FStringMiddle { .. } => TokenKind::FStringMiddle, Tok::FStringEnd => TokenKind::FStringEnd, - Tok::IpyEscapeCommand { .. } => TokenKind::EscapeCommand, + Tok::IpyEscapeCommand { .. } => TokenKind::IpyEscapeCommand, Tok::Comment(_) => TokenKind::Comment, Tok::Newline => TokenKind::Newline, Tok::NonLogicalNewline => TokenKind::NonLogicalNewline, @@ -799,6 +846,7 @@ impl TokenKind { Tok::Type => TokenKind::Type, Tok::With => TokenKind::With, Tok::Yield => TokenKind::Yield, + Tok::Unknown => TokenKind::Unknown, Tok::StartModule => TokenKind::StartModule, Tok::StartExpression => TokenKind::StartExpression, } @@ -811,6 +859,183 @@ impl From<&Tok> for TokenKind { } } +impl From for TokenKind { + fn from(value: Tok) -> Self { + Self::from_token(&value) + } +} + +impl TryFrom for Operator { + type Error = (); + + fn try_from(value: TokenKind) -> Result { + Ok(match value { + TokenKind::At | TokenKind::AtEqual => Operator::MatMult, + TokenKind::Plus | TokenKind::PlusEqual => Operator::Add, + TokenKind::Star | TokenKind::StarEqual => Operator::Mult, + TokenKind::Vbar | TokenKind::VbarEqual => Operator::BitOr, + TokenKind::Minus | TokenKind::MinusEqual => Operator::Sub, + TokenKind::Slash | TokenKind::SlashEqual => Operator::Div, + TokenKind::Amper | TokenKind::AmperEqual => Operator::BitAnd, + TokenKind::Percent | TokenKind::PercentEqual => Operator::Mod, + TokenKind::DoubleStar | TokenKind::DoubleStarEqual => Operator::Pow, + TokenKind::LeftShift | TokenKind::LeftShiftEqual => Operator::LShift, + TokenKind::CircumFlex | TokenKind::CircumflexEqual => Operator::BitXor, + TokenKind::RightShift | TokenKind::RightShiftEqual => Operator::RShift, + TokenKind::DoubleSlash | TokenKind::DoubleSlashEqual => Operator::FloorDiv, + _ => return Err(()), + }) + } +} + +impl TryFrom for BoolOp { + type Error = (); + + fn try_from(value: TokenKind) -> Result { + Ok(match value { + TokenKind::And => BoolOp::And, + TokenKind::Or => BoolOp::Or, + _ => return Err(()), + }) + } +} + +impl TryFrom<&Tok> for UnaryOp { + type Error = String; + + fn try_from(value: &Tok) -> Result { + TokenKind::from_token(value).try_into() + } +} + +impl TryFrom for UnaryOp { + type Error = String; + + fn try_from(value: TokenKind) -> Result { + Ok(match value { + TokenKind::Plus => UnaryOp::UAdd, + TokenKind::Minus => UnaryOp::USub, + TokenKind::Tilde => UnaryOp::Invert, + TokenKind::Not => UnaryOp::Not, + _ => return Err(format!("unexpected token: {value:?}")), + }) + } +} + +impl fmt::Display for TokenKind { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let value = match self { + TokenKind::Unknown => "Unknown", + TokenKind::StartModule => "StartModule", + TokenKind::StartExpression => "StartExpression", + TokenKind::StartInteractive => "StartInteractive", + TokenKind::Newline => "newline", + TokenKind::NonLogicalNewline => "NonLogicalNewline", + TokenKind::Indent => "indent", + TokenKind::Dedent => "dedent", + TokenKind::EndOfFile => "end of file", + TokenKind::Name => "name", + TokenKind::Int => "int", + TokenKind::Float => "float", + TokenKind::Complex => "complex", + TokenKind::String => "string", + TokenKind::FStringStart => "FStringStart", + TokenKind::FStringMiddle => "FStringMiddle", + TokenKind::FStringEnd => "FStringEnd", + TokenKind::IpyEscapeCommand => "IPython escape command", + TokenKind::Comment => "comment", + TokenKind::Question => "'?'", + TokenKind::Exclamation => "'!'", + TokenKind::Lpar => "'('", + TokenKind::Rpar => "')'", + TokenKind::Lsqb => "'['", + TokenKind::Rsqb => "']'", + TokenKind::Lbrace => "'{'", + TokenKind::Rbrace => "'}'", + TokenKind::Equal => "'='", + TokenKind::ColonEqual => "':='", + TokenKind::Dot => "'.'", + TokenKind::Colon => "':'", + TokenKind::Semi => "';'", + TokenKind::Comma => "','", + TokenKind::Rarrow => "'->'", + TokenKind::Plus => "'+'", + TokenKind::Minus => "'-'", + TokenKind::Star => "'*'", + TokenKind::DoubleStar => "'**'", + TokenKind::Slash => "'/'", + TokenKind::DoubleSlash => "'//'", + TokenKind::Percent => "'%'", + TokenKind::Vbar => "'|'", + TokenKind::Amper => "'&'", + TokenKind::CircumFlex => "'^'", + TokenKind::LeftShift => "'<<'", + TokenKind::RightShift => "'>>'", + TokenKind::Tilde => "'~'", + TokenKind::At => "'@'", + TokenKind::Less => "'<'", + TokenKind::Greater => "'>'", + TokenKind::EqEqual => "'=='", + TokenKind::NotEqual => "'!='", + TokenKind::LessEqual => "'<='", + TokenKind::GreaterEqual => "'>='", + TokenKind::PlusEqual => "'+='", + TokenKind::MinusEqual => "'-='", + TokenKind::StarEqual => "'*='", + TokenKind::DoubleStarEqual => "'**='", + TokenKind::SlashEqual => "'/='", + TokenKind::DoubleSlashEqual => "'//='", + TokenKind::PercentEqual => "'%='", + TokenKind::VbarEqual => "'|='", + TokenKind::AmperEqual => "'&='", + TokenKind::CircumflexEqual => "'^='", + TokenKind::LeftShiftEqual => "'<<='", + TokenKind::RightShiftEqual => "'>>='", + TokenKind::AtEqual => "'@='", + TokenKind::Ellipsis => "'...'", + TokenKind::False => "'False'", + TokenKind::None => "'None'", + TokenKind::True => "'True'", + TokenKind::And => "'and'", + TokenKind::As => "'as'", + TokenKind::Assert => "'assert'", + TokenKind::Async => "'async'", + TokenKind::Await => "'await'", + TokenKind::Break => "'break'", + TokenKind::Class => "'class'", + TokenKind::Continue => "'continue'", + TokenKind::Def => "'def'", + TokenKind::Del => "'del'", + TokenKind::Elif => "'elif'", + TokenKind::Else => "'else'", + TokenKind::Except => "'except'", + TokenKind::Finally => "'finally'", + TokenKind::For => "'for'", + TokenKind::From => "'from'", + TokenKind::Global => "'global'", + TokenKind::If => "'if'", + TokenKind::Import => "'import'", + TokenKind::In => "'in'", + TokenKind::Is => "'is'", + TokenKind::Lambda => "'lambda'", + TokenKind::Nonlocal => "'nonlocal'", + TokenKind::Not => "'not'", + TokenKind::Or => "'or'", + TokenKind::Pass => "'pass'", + TokenKind::Raise => "'raise'", + TokenKind::Return => "'return'", + TokenKind::Try => "'try'", + TokenKind::While => "'while'", + TokenKind::Match => "'match'", + TokenKind::Type => "'type'", + TokenKind::Case => "'case'", + TokenKind::With => "'with'", + TokenKind::Yield => "'yield'", + }; + f.write_str(value) + } +} + #[cfg(target_pointer_width = "64")] mod sizes { use crate::lexer::{LexicalError, LexicalErrorType}; diff --git a/crates/ruff_python_parser/src/token_set.rs b/crates/ruff_python_parser/src/token_set.rs new file mode 100644 index 0000000000..843fe53faa --- /dev/null +++ b/crates/ruff_python_parser/src/token_set.rs @@ -0,0 +1,52 @@ +use crate::TokenKind; + +/// A bit-set of `TokenKind`s +#[derive(Clone, Copy)] +pub(crate) struct TokenSet(u128); + +impl TokenSet { + pub(crate) const fn new(kinds: [TokenKind; N]) -> TokenSet { + let mut res = 0u128; + let mut i = 0usize; + + while i < N { + let kind = kinds[i]; + res |= mask(kind); + i += 1; + } + TokenSet(res) + } + + pub(crate) const fn union(self, other: TokenSet) -> TokenSet { + TokenSet(self.0 | other.0) + } + + pub(crate) const fn remove(self, kind: TokenKind) -> TokenSet { + TokenSet(self.0 & !mask(kind)) + } + + pub(crate) const fn contains(&self, kind: TokenKind) -> bool { + self.0 & mask(kind) != 0 + } +} + +const fn mask(kind: TokenKind) -> u128 { + 1u128 << (kind as usize) +} + +impl From<[TokenKind; N]> for TokenSet { + fn from(kinds: [TokenKind; N]) -> Self { + TokenSet::new(kinds) + } +} + +#[test] +fn token_set_works_for_tokens() { + use crate::TokenKind::*; + let mut ts = TokenSet::new([EndOfFile, Name]); + assert!(ts.contains(EndOfFile)); + assert!(ts.contains(Name)); + assert!(!ts.contains(Plus)); + ts = ts.remove(Name); + assert!(!ts.contains(Name)); +} diff --git a/crates/ruff_python_parser/src/token_source.rs b/crates/ruff_python_parser/src/token_source.rs index b133ee5ff2..1b48b143cf 100644 --- a/crates/ruff_python_parser/src/token_source.rs +++ b/crates/ruff_python_parser/src/token_source.rs @@ -1,18 +1,77 @@ -use crate::lexer::LexResult; -use crate::Tok; use std::iter::FusedIterator; +use ruff_text_size::{TextRange, TextSize}; + +use crate::lexer::{LexResult, LexicalError, Spanned}; +use crate::{Tok, TokenKind}; + #[derive(Clone, Debug)] pub(crate) struct TokenSource { tokens: std::vec::IntoIter, + errors: Vec, } impl TokenSource { pub(crate) fn new(tokens: Vec) -> Self { Self { tokens: tokens.into_iter(), + errors: Vec::new(), } } + + /// Returns the position of the current token. + /// + /// This is the position before any whitespace or comments. + pub(crate) fn position(&self) -> Option { + let first = self.tokens.as_slice().first()?; + + let range = match first { + Ok((_, range)) => *range, + Err(error) => error.location(), + }; + + Some(range.start()) + } + + /// Returns the end of the last token + pub(crate) fn end(&self) -> Option { + let last = self.tokens.as_slice().last()?; + + let range = match last { + Ok((_, range)) => *range, + Err(error) => error.location(), + }; + + Some(range.end()) + } + + /// Returns the next token kind and its range without consuming it. + pub(crate) fn peek(&self) -> Option<(TokenKind, TextRange)> { + let mut iter = self.tokens.as_slice().iter(); + + loop { + let next = iter.next()?; + + if next.as_ref().is_ok_and(is_trivia) { + continue; + } + + break Some(match next { + Ok((token, range)) => (TokenKind::from_token(token), *range), + Err(error) => (TokenKind::Unknown, error.location()), + }); + } + } + + pub(crate) fn finish(self) -> Vec { + assert_eq!( + self.tokens.as_slice(), + &[], + "TokenSource was not fully consumed." + ); + + self.errors + } } impl FromIterator for TokenSource { @@ -23,24 +82,34 @@ impl FromIterator for TokenSource { } impl Iterator for TokenSource { - type Item = LexResult; + type Item = Spanned; #[inline] fn next(&mut self) -> Option { loop { let next = self.tokens.next()?; - if is_trivia(&next) { - continue; - } + match next { + Ok(token) => { + if is_trivia(&token) { + continue; + } - break Some(next); + break Some(token); + } + + Err(error) => { + let location = error.location(); + self.errors.push(error); + break Some((Tok::Unknown, location)); + } + } } } } impl FusedIterator for TokenSource {} -const fn is_trivia(result: &LexResult) -> bool { - matches!(result, Ok((Tok::Comment(_) | Tok::NonLogicalNewline, _))) +const fn is_trivia(result: &Spanned) -> bool { + matches!(result, (Tok::Comment(_) | Tok::NonLogicalNewline, _)) } diff --git a/crates/ruff_python_parser/src/typing.rs b/crates/ruff_python_parser/src/typing.rs index 18efe4041f..477f4b466b 100644 --- a/crates/ruff_python_parser/src/typing.rs +++ b/crates/ruff_python_parser/src/typing.rs @@ -5,7 +5,7 @@ use ruff_python_ast::str; use ruff_python_ast::Expr; use ruff_text_size::{TextLen, TextRange}; -#[derive(is_macro::Is, Copy, Clone)] +#[derive(is_macro::Is, Copy, Clone, Debug)] pub enum AnnotationKind { /// The annotation is defined as part a simple string literal, /// e.g. `x: "List[int]" = []`. Annotations within simple literals diff --git a/crates/ruff_python_parser/tests/fixtures.rs b/crates/ruff_python_parser/tests/fixtures.rs new file mode 100644 index 0000000000..58896d6912 --- /dev/null +++ b/crates/ruff_python_parser/tests/fixtures.rs @@ -0,0 +1,293 @@ +use std::cmp::Ordering; +use std::fmt::{Formatter, Write}; +use std::fs; +use std::path::Path; + +use annotate_snippets::display_list::{DisplayList, FormatOptions}; +use annotate_snippets::snippet::{AnnotationType, Slice, Snippet, SourceAnnotation}; + +use ruff_python_ast::visitor::preorder::{walk_module, PreorderVisitor, TraversalSignal}; +use ruff_python_ast::{AnyNodeRef, Mod}; +use ruff_python_parser::{Mode, ParseErrorType, Program}; +use ruff_source_file::{LineIndex, OneIndexed, SourceCode}; +use ruff_text_size::{Ranged, TextLen, TextRange, TextSize}; + +#[test] +fn valid_syntax() { + insta::glob!("../resources", "valid/**/*.py", test_valid_syntax); +} + +#[test] +fn invalid_syntax() { + insta::glob!("../resources", "invalid/**/*.py", test_invalid_syntax); +} + +#[test] +fn inline_ok() { + insta::glob!("../resources/inline", "ok/**/*.py", test_valid_syntax); +} + +#[test] +fn inline_err() { + insta::glob!("../resources/inline", "err/**/*.py", test_invalid_syntax); +} + +/// Asserts that the parser generates no syntax errors for a valid program. +/// Snapshots the AST. +fn test_valid_syntax(input_path: &Path) { + let source = fs::read_to_string(input_path).expect("Expected test file to exist"); + let program = Program::parse_str(&source, Mode::Module); + + if !program.is_valid() { + let line_index = LineIndex::from_source_text(&source); + let source_code = SourceCode::new(&source, &line_index); + + let mut message = "Expected no syntax errors for a valid program but the parser generated the following errors:\n".to_string(); + + for error in program.errors() { + writeln!( + &mut message, + "{}\n", + CodeFrame { + range: error.location, + error, + source_code: &source_code, + } + ) + .unwrap(); + } + + panic!("{input_path:?}: {message}"); + } + + validate_ast(program.ast(), source.text_len(), input_path); + + let mut output = String::new(); + writeln!(&mut output, "## AST").unwrap(); + writeln!(&mut output, "\n```\n{:#?}\n```", program.ast()).unwrap(); + + insta::with_settings!({ + omit_expression => true, + input_file => input_path, + prepend_module_to_snapshot => false, + }, { + insta::assert_snapshot!(output); + }); +} + +/// Assert that the parser generates at least one syntax error for the given input file. +/// Snapshots the AST and the error messages. +fn test_invalid_syntax(input_path: &Path) { + let source = fs::read_to_string(input_path).expect("Expected test file to exist"); + let program = Program::parse_str(&source, Mode::Module); + + assert!( + !program.is_valid(), + "{input_path:?}: Expected parser to generate at least one syntax error for a program containing syntax errors." + ); + + validate_ast(program.ast(), source.text_len(), input_path); + + let mut output = String::new(); + writeln!(&mut output, "## AST").unwrap(); + writeln!(&mut output, "\n```\n{:#?}\n```", program.ast()).unwrap(); + + writeln!(&mut output, "## Errors\n").unwrap(); + + let line_index = LineIndex::from_source_text(&source); + let source_code = SourceCode::new(&source, &line_index); + + for error in program.errors() { + writeln!( + &mut output, + "{}\n", + CodeFrame { + range: error.location, + error, + source_code: &source_code, + } + ) + .unwrap(); + } + + insta::with_settings!({ + omit_expression => true, + input_file => input_path, + prepend_module_to_snapshot => false, + }, { + insta::assert_snapshot!(output); + }); +} + +// Test that is intentionally ignored by default. +// Use it for quickly debugging a parser issue. +#[test] +#[ignore] +#[allow(clippy::print_stdout)] +fn parser_quick_test() { + let source = "\ +data[*x,] +"; + + let program = Program::parse_str(source, Mode::Module); + + println!("AST:\n----\n{:#?}", program.ast()); + + if !program.is_valid() { + println!("Errors:\n-------"); + + let line_index = LineIndex::from_source_text(source); + let source_code = SourceCode::new(source, &line_index); + + for error in program.errors() { + // Sometimes the code frame doesn't show the error message, so we print + // the message as well. + println!("Syntax Error: {error}"); + println!( + "{}\n", + CodeFrame { + range: error.location, + error, + source_code: &source_code, + } + ); + } + + println!(); + } +} + +struct CodeFrame<'a> { + range: TextRange, + error: &'a ParseErrorType, + source_code: &'a SourceCode<'a, 'a>, +} + +impl std::fmt::Display for CodeFrame<'_> { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + // Copied and modified from ruff_linter/src/message/text.rs + let content_start_index = self.source_code.line_index(self.range.start()); + let mut start_index = content_start_index.saturating_sub(2); + + // Trim leading empty lines. + while start_index < content_start_index { + if !self.source_code.line_text(start_index).trim().is_empty() { + break; + } + start_index = start_index.saturating_add(1); + } + + let content_end_index = self.source_code.line_index(self.range.end()); + let mut end_index = content_end_index + .saturating_add(2) + .min(OneIndexed::from_zero_indexed(self.source_code.line_count())); + + // Trim trailing empty lines. + while end_index > content_end_index { + if !self.source_code.line_text(end_index).trim().is_empty() { + break; + } + + end_index = end_index.saturating_sub(1); + } + + let start_offset = self.source_code.line_start(start_index); + let end_offset = self.source_code.line_end(end_index); + + let annotation_range = self.range - start_offset; + let source = self + .source_code + .slice(TextRange::new(start_offset, end_offset)); + + let start_char = source[TextRange::up_to(annotation_range.start())] + .chars() + .count(); + + let char_length = source[annotation_range].chars().count(); + let label = format!("Syntax Error: {error}", error = self.error); + + let snippet = Snippet { + title: None, + slices: vec![Slice { + source, + line_start: start_index.get(), + annotations: vec![SourceAnnotation { + label: &label, + annotation_type: AnnotationType::Error, + range: (start_char, start_char + char_length), + }], + // The origin (file name, line number, and column number) is already encoded + // in the `label`. + origin: None, + fold: false, + }], + footer: Vec::new(), + opt: FormatOptions::default(), + }; + + writeln!(f, "{message}", message = DisplayList::from(snippet)) + } +} + +/// Verifies that: +/// * the range of the parent node fully encloses all its child nodes +/// * the ranges are strictly increasing when traversing the nodes in pre-order. +/// * all ranges are within the length of the source code. +fn validate_ast(root: &Mod, source_len: TextSize, test_path: &Path) { + walk_module(&mut ValidateAstVisitor::new(source_len, test_path), root); +} + +#[derive(Debug)] +struct ValidateAstVisitor<'a> { + parents: Vec>, + previous: Option>, + source_length: TextSize, + test_path: &'a Path, +} + +impl<'a> ValidateAstVisitor<'a> { + fn new(source_length: TextSize, test_path: &'a Path) -> Self { + Self { + parents: Vec::new(), + previous: None, + source_length, + test_path, + } + } +} + +impl<'ast> PreorderVisitor<'ast> for ValidateAstVisitor<'ast> { + fn enter_node(&mut self, node: AnyNodeRef<'ast>) -> TraversalSignal { + assert!( + node.end() <= self.source_length, + "{path}: The range of the node exceeds the length of the source code. Node: {node:#?}", + path = self.test_path.display() + ); + + if let Some(previous) = self.previous { + assert_ne!(previous.range().ordering(node.range()), Ordering::Greater, + "{path}: The ranges of the nodes are not strictly increasing when traversing the AST in pre-order.\nPrevious node: {previous:#?}\n\nCurrent node: {node:#?}\n\nRoot: {root:#?}", + path = self.test_path.display(), + root = self.parents.first() + ); + } + + if let Some(parent) = self.parents.last() { + assert!(parent.range().contains_range(node.range()), + "{path}: The range of the parent node does not fully enclose the range of the child node.\nParent node: {parent:#?}\n\nChild node: {node:#?}\n\nRoot: {root:#?}", + path = self.test_path.display(), + root = self.parents.first() + ); + } + + self.parents.push(node); + + TraversalSignal::Traverse + } + + fn leave_node(&mut self, node: AnyNodeRef<'ast>) { + self.parents.pop().expect("Expected tree to be balanced"); + + self.previous = Some(node); + } +} diff --git a/crates/ruff_python_parser/tests/generate_inline_tests.rs b/crates/ruff_python_parser/tests/generate_inline_tests.rs new file mode 100644 index 0000000000..7f71d74717 --- /dev/null +++ b/crates/ruff_python_parser/tests/generate_inline_tests.rs @@ -0,0 +1,303 @@ +//! This module takes specially formatted comments from `ruff_python_parser` code +//! and turns them into test fixtures. The code is derived from `rust-analyzer` +//! and `biome`. +//! +//! References: +//! - +//! - +use std::collections::HashMap; +use std::fmt; +use std::fs; +use std::ops::{AddAssign, Deref, DerefMut}; +use std::path::{Path, PathBuf}; + +use anyhow::{Context, Result}; + +fn project_root() -> PathBuf { + PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("../../") + .canonicalize() + .unwrap() +} + +#[test] +fn generate_inline_tests() -> Result<()> { + let parser_dir = project_root().join("crates/ruff_python_parser/src/parser"); + let tests = TestCollection::try_from(parser_dir.as_path())?; + + let mut test_files = TestFiles::default(); + test_files += install_tests(&tests.ok, "crates/ruff_python_parser/resources/inline/ok")?; + test_files += install_tests(&tests.err, "crates/ruff_python_parser/resources/inline/err")?; + + if !test_files.is_empty() { + anyhow::bail!("{}", test_files); + } + + Ok(()) +} + +#[derive(Debug, Default)] +struct TestFiles { + unreferenced: Vec, + updated: Vec, +} + +impl TestFiles { + fn is_empty(&self) -> bool { + self.unreferenced.is_empty() && self.updated.is_empty() + } +} + +impl AddAssign for TestFiles { + fn add_assign(&mut self, other: TestFiles) { + self.unreferenced.extend(other.unreferenced); + self.updated.extend(other.updated); + } +} + +impl fmt::Display for TestFiles { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if self.is_empty() { + writeln!(f, "No unreferenced or updated test files found") + } else { + let root_dir = project_root(); + if !self.unreferenced.is_empty() { + writeln!( + f, + "Unreferenced test files found for which no comment exists:", + )?; + for path in &self.unreferenced { + writeln!(f, " {}", path.strip_prefix(&root_dir).unwrap().display())?; + } + writeln!(f, "Please delete these files manually")?; + } + if !self.updated.is_empty() { + if !self.unreferenced.is_empty() { + writeln!(f)?; + } + writeln!( + f, + "Following files were not up-to date and has been updated:", + )?; + for path in &self.updated { + writeln!(f, " {}", path.strip_prefix(&root_dir).unwrap().display())?; + } + writeln!( + f, + "Re-run the tests with `cargo test` to update the test snapshots" + )?; + if std::env::var("CI").is_ok() { + writeln!( + f, + "NOTE: Run the tests locally and commit the updated files" + )?; + } + } + Ok(()) + } + } +} + +fn install_tests(tests: &HashMap, target_dir: &str) -> Result { + let root_dir = project_root(); + let tests_dir = root_dir.join(target_dir); + if !tests_dir.is_dir() { + fs::create_dir_all(&tests_dir)?; + } + + // Test kind is irrelevant for existing test cases. + let existing = existing_tests(&tests_dir)?; + + let mut updated_files = vec![]; + + for (name, test) in tests { + let path = match existing.get(name) { + Some(path) => path.clone(), + None => tests_dir.join(name).with_extension("py"), + }; + match fs::read_to_string(&path) { + Ok(old_contents) if old_contents == test.contents => continue, + _ => {} + } + fs::write(&path, &test.contents) + .with_context(|| format!("Failed to write to {:?}", path.display()))?; + updated_files.push(path); + } + + Ok(TestFiles { + unreferenced: existing + .into_iter() + .filter(|(name, _)| !tests.contains_key(name)) + .map(|(_, path)| path) + .collect::>(), + updated: updated_files, + }) +} + +#[derive(Default, Debug)] +struct TestCollection { + ok: HashMap, + err: HashMap, +} + +impl TryFrom<&Path> for TestCollection { + type Error = anyhow::Error; + + fn try_from(path: &Path) -> Result { + let mut tests = TestCollection::default(); + + for entry in walkdir::WalkDir::new(path) { + let entry = entry?; + if !entry.file_type().is_file() { + continue; + } + if entry.path().extension().unwrap_or_default() != "rs" { + continue; + } + let text = fs::read_to_string(entry.path())?; + for test in collect_tests(&text) { + if test.is_ok() { + if let Some(old_test) = tests.ok.insert(test.name.clone(), test) { + anyhow::bail!( + "Duplicate test found: {name:?} (search '// test_ok {name}' for the location)\n", + name = old_test.name + ); + } + } else if let Some(old_test) = tests.err.insert(test.name.clone(), test) { + anyhow::bail!( + "Duplicate test found: {name:?} (search '// test_err {name}' for the location)\n", + name = old_test.name + ); + } + } + } + + Ok(tests) + } +} + +#[derive(Debug, Clone, Copy)] +enum TestKind { + Ok, + Err, +} + +/// A test of the following form: +/// +/// ```text +/// // (test_ok|test_err) name +/// // +/// ``` +#[derive(Debug)] +struct Test { + name: String, + contents: String, + kind: TestKind, +} + +impl Test { + const fn is_ok(&self) -> bool { + matches!(self.kind, TestKind::Ok) + } +} + +/// Collect the tests from the given source text. +fn collect_tests(text: &str) -> Vec { + let mut tests = Vec::new(); + + for comment_block in extract_comment_blocks(text) { + let first_line = &comment_block[0]; + + let (kind, name) = match first_line.split_once(' ') { + Some(("test_ok", suffix)) => (TestKind::Ok, suffix), + Some(("test_err", suffix)) => (TestKind::Err, suffix), + _ => continue, + }; + + let text: String = comment_block[1..] + .iter() + .cloned() + .chain([String::new()]) + .collect::>() + .join("\n"); + + assert!(!text.trim().is_empty() && text.ends_with('\n')); + + tests.push(Test { + name: name.to_string(), + contents: text, + kind, + }); + } + + tests +} + +#[derive(Debug, Default)] +struct CommentBlock(Vec); + +impl Deref for CommentBlock { + type Target = Vec; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl DerefMut for CommentBlock { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +/// Extract the comment blocks from the given source text. +/// +/// A comment block is a sequence of lines that start with `// ` and are separated +/// by an empty line. An empty comment line (`//`) is also part of the block. +fn extract_comment_blocks(text: &str) -> Vec { + const COMMENT_PREFIX: &str = "// "; + const COMMENT_PREFIX_LEN: usize = COMMENT_PREFIX.len(); + + let mut comment_blocks = Vec::new(); + let mut block = CommentBlock::default(); + + for line in text.lines().map(str::trim_start) { + if line == "//" { + block.push(String::new()); + continue; + } + + if line.starts_with(COMMENT_PREFIX) { + block.push(line[COMMENT_PREFIX_LEN..].to_string()); + } else { + if !block.is_empty() { + comment_blocks.push(std::mem::take(&mut block)); + } + } + } + if !block.is_empty() { + comment_blocks.push(block); + } + comment_blocks +} + +/// Returns the existing tests in the given directory. +fn existing_tests(dir: &Path) -> Result> { + let mut tests = HashMap::new(); + + for file in fs::read_dir(dir)? { + let path = file?.path(); + if path.extension().unwrap_or_default() != "py" { + continue; + } + let name = path + .file_stem() + .map(|x| x.to_string_lossy().to_string()) + .unwrap(); + if let Some(old) = tests.insert(name, path) { + anyhow::bail!("Multiple test file exists for {old:?}"); + } + } + + Ok(tests) +} diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_annotation.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_annotation.py.snap new file mode 100644 index 0000000000..0b0e968b41 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_annotation.py.snap @@ -0,0 +1,200 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_invalid_annotation.py +--- +## AST + +``` +Module( + ModModule { + range: 0..63, + body: [ + AnnAssign( + StmtAnnAssign { + range: 0..11, + target: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Store, + }, + ), + annotation: Starred( + ExprStarred { + range: 3..7, + value: Name( + ExprName { + range: 4..7, + id: "int", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + value: Some( + NumberLiteral( + ExprNumberLiteral { + range: 10..11, + value: Int( + 1, + ), + }, + ), + ), + simple: true, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 12..26, + target: Name( + ExprName { + range: 12..13, + id: "x", + ctx: Store, + }, + ), + annotation: Yield( + ExprYield { + range: 15..22, + value: Some( + Name( + ExprName { + range: 21..22, + id: "a", + ctx: Load, + }, + ), + ), + }, + ), + value: Some( + NumberLiteral( + ExprNumberLiteral { + range: 25..26, + value: Int( + 1, + ), + }, + ), + ), + simple: true, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 27..46, + target: Name( + ExprName { + range: 27..28, + id: "x", + ctx: Store, + }, + ), + annotation: YieldFrom( + ExprYieldFrom { + range: 30..42, + value: Name( + ExprName { + range: 41..42, + id: "b", + ctx: Load, + }, + ), + }, + ), + value: Some( + NumberLiteral( + ExprNumberLiteral { + range: 45..46, + value: Int( + 1, + ), + }, + ), + ), + simple: true, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 47..51, + target: Name( + ExprName { + range: 47..48, + id: "x", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 50..51, + id: "y", + ctx: Load, + }, + ), + value: None, + simple: true, + }, + ), + Assign( + StmtAssign { + range: 55..62, + targets: [ + Name( + ExprName { + range: 55..58, + id: "int", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 61..62, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x: *int = 1 + | ^^^^ Syntax Error: Starred expression cannot be used here +2 | x: yield a = 1 +3 | x: yield from b = 1 + | + + + | +1 | x: *int = 1 +2 | x: yield a = 1 + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | x: yield from b = 1 +4 | x: y := int = 1 + | + + + | +1 | x: *int = 1 +2 | x: yield a = 1 +3 | x: yield from b = 1 + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +4 | x: y := int = 1 + | + + + | +2 | x: yield a = 1 +3 | x: yield from b = 1 +4 | x: y := int = 1 + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_target.py.snap new file mode 100644 index 0000000000..aa00e7545d --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_target.py.snap @@ -0,0 +1,508 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_invalid_target.py +--- +## AST + +``` +Module( + ModModule { + range: 0..170, + body: [ + AnnAssign( + StmtAnnAssign { + range: 0..18, + target: StringLiteral( + ExprStringLiteral { + range: 0..5, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 0..5, + value: "abc", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + annotation: Name( + ExprName { + range: 7..10, + id: "str", + ctx: Load, + }, + ), + value: Some( + StringLiteral( + ExprStringLiteral { + range: 13..18, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 13..18, + value: "def", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + simple: false, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 19..37, + target: Call( + ExprCall { + range: 19..25, + func: Name( + ExprName { + range: 19..23, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 23..25, + args: [], + keywords: [], + }, + }, + ), + annotation: Name( + ExprName { + range: 27..30, + id: "str", + ctx: Load, + }, + ), + value: Some( + StringLiteral( + ExprStringLiteral { + range: 33..37, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 33..37, + value: "no", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + simple: false, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 38..52, + target: Starred( + ExprStarred { + range: 38..40, + value: Name( + ExprName { + range: 39..40, + id: "x", + ctx: Store, + }, + ), + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 42..45, + id: "int", + ctx: Load, + }, + ), + value: Some( + Tuple( + ExprTuple { + range: 48..52, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 48..49, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 51..52, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + simple: false, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 72..83, + target: Tuple( + ExprTuple { + range: 72..74, + elts: [ + Name( + ExprName { + range: 72..73, + id: "x", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: false, + }, + ), + annotation: Name( + ExprName { + range: 76..79, + id: "int", + ctx: Load, + }, + ), + value: Some( + NumberLiteral( + ExprNumberLiteral { + range: 82..83, + value: Int( + 1, + ), + }, + ), + ), + simple: false, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 84..100, + target: Tuple( + ExprTuple { + range: 84..88, + elts: [ + Name( + ExprName { + range: 84..85, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 87..88, + id: "y", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: false, + }, + ), + annotation: Name( + ExprName { + range: 90..93, + id: "int", + ctx: Load, + }, + ), + value: Some( + Tuple( + ExprTuple { + range: 96..100, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 96..97, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 99..100, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + simple: false, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 101..119, + target: Tuple( + ExprTuple { + range: 101..107, + elts: [ + Name( + ExprName { + range: 102..103, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 105..106, + id: "y", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: true, + }, + ), + annotation: Name( + ExprName { + range: 109..112, + id: "int", + ctx: Load, + }, + ), + value: Some( + Tuple( + ExprTuple { + range: 115..119, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 115..116, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 118..119, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + simple: false, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 138..150, + target: List( + ExprList { + range: 138..141, + elts: [ + Name( + ExprName { + range: 139..140, + id: "x", + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 143..146, + id: "int", + ctx: Load, + }, + ), + value: Some( + NumberLiteral( + ExprNumberLiteral { + range: 149..150, + value: Int( + 1, + ), + }, + ), + ), + simple: false, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 151..169, + target: List( + ExprList { + range: 151..157, + elts: [ + Name( + ExprName { + range: 152..153, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 155..156, + id: "y", + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 159..162, + id: "int", + ctx: Load, + }, + ), + value: Some( + Tuple( + ExprTuple { + range: 165..169, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 165..166, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 168..169, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + simple: false, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | "abc": str = "def" + | ^^^^^ Syntax Error: Invalid annotated assignment target +2 | call(): str = "no" +3 | *x: int = 1, 2 + | + + + | +1 | "abc": str = "def" +2 | call(): str = "no" + | ^^^^^^ Syntax Error: Invalid annotated assignment target +3 | *x: int = 1, 2 +4 | # Tuple assignment + | + + + | +1 | "abc": str = "def" +2 | call(): str = "no" +3 | *x: int = 1, 2 + | ^^ Syntax Error: Invalid annotated assignment target +4 | # Tuple assignment +5 | x,: int = 1 + | + + + | +3 | *x: int = 1, 2 +4 | # Tuple assignment +5 | x,: int = 1 + | ^^ Syntax Error: Only single target (not tuple) can be annotated +6 | x, y: int = 1, 2 +7 | (x, y): int = 1, 2 + | + + + | +4 | # Tuple assignment +5 | x,: int = 1 +6 | x, y: int = 1, 2 + | ^^^^ Syntax Error: Only single target (not tuple) can be annotated +7 | (x, y): int = 1, 2 +8 | # List assignment + | + + + | +5 | x,: int = 1 +6 | x, y: int = 1, 2 +7 | (x, y): int = 1, 2 + | ^^^^^^ Syntax Error: Only single target (not tuple) can be annotated +8 | # List assignment +9 | [x]: int = 1 + | + + + | + 7 | (x, y): int = 1, 2 + 8 | # List assignment + 9 | [x]: int = 1 + | ^^^ Syntax Error: Only single target (not list) can be annotated +10 | [x, y]: int = 1, 2 + | + + + | + 8 | # List assignment + 9 | [x]: int = 1 +10 | [x, y]: int = 1, 2 + | ^^^^^^ Syntax Error: Only single target (not list) can be annotated + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_value.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_value.py.snap new file mode 100644 index 0000000000..0528b96f48 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_value.py.snap @@ -0,0 +1,222 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_invalid_value.py +--- +## AST + +``` +Module( + ModModule { + range: 0..65, + body: [ + AnnAssign( + StmtAnnAssign { + range: 0..17, + target: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 3..6, + id: "Any", + ctx: Load, + }, + ), + value: Some( + Starred( + ExprStarred { + range: 9..17, + value: BoolOp( + ExprBoolOp { + range: 10..17, + op: And, + values: [ + Name( + ExprName { + range: 10..11, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 16..17, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ), + simple: true, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 18..28, + target: Name( + ExprName { + range: 18..19, + id: "x", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 21..24, + id: "Any", + ctx: Load, + }, + ), + value: Some( + Name( + ExprName { + range: 27..28, + id: "x", + ctx: Load, + }, + ), + ), + simple: true, + }, + ), + Expr( + StmtExpr { + range: 32..33, + value: NumberLiteral( + ExprNumberLiteral { + range: 32..33, + value: Int( + 1, + ), + }, + ), + }, + ), + AnnAssign( + StmtAnnAssign { + range: 34..64, + target: Name( + ExprName { + range: 34..35, + id: "x", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 37..41, + id: "list", + ctx: Load, + }, + ), + value: Some( + List( + ExprList { + range: 44..64, + elts: [ + Name( + ExprName { + range: 45..46, + id: "x", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 48..54, + value: BinOp( + ExprBinOp { + range: 49..54, + left: Name( + ExprName { + range: 49..50, + id: "a", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 53..54, + id: "b", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 56..63, + value: BoolOp( + ExprBoolOp { + range: 57..63, + op: Or, + values: [ + Name( + ExprName { + range: 57..58, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 62..63, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + ), + simple: true, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x: Any = *a and b + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here +2 | x: Any = x := 1 +3 | x: list = [x, *a | b, *a or b] + | + + + | +1 | x: Any = *a and b +2 | x: Any = x := 1 + | ^^ Syntax Error: Expected a statement +3 | x: list = [x, *a | b, *a or b] + | + + + | +1 | x: Any = *a and b +2 | x: Any = x := 1 +3 | x: list = [x, *a | b, *a or b] + | ^^^^^^ Syntax Error: Boolean expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_missing_rhs.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_missing_rhs.py.snap new file mode 100644 index 0000000000..be4a891ed0 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_missing_rhs.py.snap @@ -0,0 +1,42 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_missing_rhs.py +--- +## AST + +``` +Module( + ModModule { + range: 0..9, + body: [ + AnnAssign( + StmtAnnAssign { + range: 0..8, + target: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 3..6, + id: "int", + ctx: Load, + }, + ), + value: None, + simple: true, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x: int = + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_type_alias_annotation.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_type_alias_annotation.py.snap new file mode 100644 index 0000000000..43d7ecb186 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_type_alias_annotation.py.snap @@ -0,0 +1,108 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_type_alias_annotation.py +--- +## AST + +``` +Module( + ModModule { + range: 0..37, + body: [ + AnnAssign( + StmtAnnAssign { + range: 0..2, + target: Name( + ExprName { + range: 0..1, + id: "a", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 2..2, + id: "", + ctx: Invalid, + }, + ), + value: None, + simple: true, + }, + ), + TypeAlias( + StmtTypeAlias { + range: 3..15, + name: Name( + ExprName { + range: 8..9, + id: "X", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 12..15, + id: "int", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 16..23, + value: Lambda( + ExprLambda { + range: 16..23, + parameters: None, + body: Name( + ExprName { + range: 23..23, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 24..36, + name: Name( + ExprName { + range: 29..30, + id: "X", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 33..36, + id: "int", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | a: type X = int + | ^^^^ Syntax Error: Expected an expression +2 | lambda: type X = int + | + + + | +1 | a: type X = int +2 | lambda: type X = int + | ^^^^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_msg.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_msg.py.snap new file mode 100644 index 0000000000..56fdd012dd --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_msg.py.snap @@ -0,0 +1,34 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/assert_empty_msg.py +--- +## AST + +``` +Module( + ModModule { + range: 0..10, + body: [ + Assert( + StmtAssert { + range: 0..9, + test: Name( + ExprName { + range: 7..8, + id: "x", + ctx: Load, + }, + ), + msg: None, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | assert x, + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_test.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_test.py.snap new file mode 100644 index 0000000000..fc5b871b2f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_test.py.snap @@ -0,0 +1,34 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/assert_empty_test.py +--- +## AST + +``` +Module( + ModModule { + range: 0..7, + body: [ + Assert( + StmtAssert { + range: 0..6, + test: Name( + ExprName { + range: 6..6, + id: "", + ctx: Invalid, + }, + ), + msg: None, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | assert + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_msg_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_msg_expr.py.snap new file mode 100644 index 0000000000..c2349e7019 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_msg_expr.py.snap @@ -0,0 +1,160 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/assert_invalid_msg_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..83, + body: [ + Assert( + StmtAssert { + range: 0..16, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 7..12, + value: false, + }, + ), + msg: Some( + Starred( + ExprStarred { + range: 14..16, + value: Name( + ExprName { + range: 15..16, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + Assert( + StmtAssert { + range: 17..30, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 24..29, + value: false, + }, + ), + msg: None, + }, + ), + Assert( + StmtAssert { + range: 31..39, + test: Name( + ExprName { + range: 38..39, + id: "x", + ctx: Load, + }, + ), + msg: None, + }, + ), + Assert( + StmtAssert { + range: 40..61, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 47..52, + value: false, + }, + ), + msg: Some( + Yield( + ExprYield { + range: 54..61, + value: Some( + Name( + ExprName { + range: 60..61, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ), + }, + ), + Assert( + StmtAssert { + range: 62..77, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 69..74, + value: false, + }, + ), + msg: Some( + Name( + ExprName { + range: 76..77, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + Expr( + StmtExpr { + range: 81..82, + value: NumberLiteral( + ExprNumberLiteral { + range: 81..82, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | assert False, *x + | ^^ Syntax Error: Starred expression cannot be used here +2 | assert False, assert x +3 | assert False, yield x + | + + + | +1 | assert False, *x +2 | assert False, assert x + | ^^^^^^ Syntax Error: Expected an expression +3 | assert False, yield x +4 | assert False, x := 1 + | + + + | +1 | assert False, *x +2 | assert False, assert x +3 | assert False, yield x + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +4 | assert False, x := 1 + | + + + | +2 | assert False, assert x +3 | assert False, yield x +4 | assert False, x := 1 + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_test_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_test_expr.py.snap new file mode 100644 index 0000000000..238f0fe092 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_test_expr.py.snap @@ -0,0 +1,148 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/assert_invalid_test_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..55, + body: [ + Assert( + StmtAssert { + range: 0..9, + test: Starred( + ExprStarred { + range: 7..9, + value: Name( + ExprName { + range: 8..9, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + msg: None, + }, + ), + Assert( + StmtAssert { + range: 10..23, + test: Name( + ExprName { + range: 17..23, + id: "assert", + ctx: Load, + }, + ), + msg: None, + }, + ), + Expr( + StmtExpr { + range: 24..25, + value: Name( + ExprName { + range: 24..25, + id: "x", + ctx: Load, + }, + ), + }, + ), + Assert( + StmtAssert { + range: 26..40, + test: Yield( + ExprYield { + range: 33..40, + value: Some( + Name( + ExprName { + range: 39..40, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + msg: None, + }, + ), + Assert( + StmtAssert { + range: 41..49, + test: Name( + ExprName { + range: 48..49, + id: "x", + ctx: Load, + }, + ), + msg: None, + }, + ), + Expr( + StmtExpr { + range: 53..54, + value: NumberLiteral( + ExprNumberLiteral { + range: 53..54, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | assert *x + | ^^ Syntax Error: Starred expression cannot be used here +2 | assert assert x +3 | assert yield x + | + + + | +1 | assert *x +2 | assert assert x + | ^^^^^^ Syntax Error: Expected an identifier, but found a keyword 'assert' that cannot be used here +3 | assert yield x +4 | assert x := 1 + | + + + | +1 | assert *x +2 | assert assert x + | ^ Syntax Error: Simple statements must be separated by newlines or semicolons +3 | assert yield x +4 | assert x := 1 + | + + + | +1 | assert *x +2 | assert assert x +3 | assert yield x + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +4 | assert x := 1 + | + + + | +2 | assert assert x +3 | assert yield x +4 | assert x := 1 + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_target.py.snap new file mode 100644 index 0000000000..252a34b009 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_target.py.snap @@ -0,0 +1,258 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/assign_stmt_invalid_target.py +--- +## AST + +``` +Module( + ModModule { + range: 0..58, + body: [ + Assign( + StmtAssign { + range: 0..5, + targets: [ + NumberLiteral( + ExprNumberLiteral { + range: 0..1, + value: Int( + 1, + ), + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 4..5, + value: Int( + 1, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 6..15, + targets: [ + Name( + ExprName { + range: 6..7, + id: "x", + ctx: Store, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 10..11, + value: Int( + 1, + ), + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 14..15, + value: Int( + 2, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 16..33, + targets: [ + Name( + ExprName { + range: 16..17, + id: "x", + ctx: Store, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 20..21, + value: Int( + 1, + ), + }, + ), + Name( + ExprName { + range: 24..25, + id: "y", + ctx: Store, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 28..29, + value: Int( + 2, + ), + }, + ), + ], + value: Name( + ExprName { + range: 32..33, + id: "z", + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 34..57, + targets: [ + List( + ExprList { + range: 34..44, + elts: [ + StringLiteral( + ExprStringLiteral { + range: 35..38, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 35..38, + value: "a", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + StringLiteral( + ExprStringLiteral { + range: 40..43, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 40..43, + value: "b", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + ctx: Store, + }, + ), + ], + value: List( + ExprList { + range: 47..57, + elts: [ + StringLiteral( + ExprStringLiteral { + range: 48..51, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 48..51, + value: "a", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + StringLiteral( + ExprStringLiteral { + range: 53..56, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 53..56, + value: "b", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | 1 = 1 + | ^ Syntax Error: Invalid assignment target +2 | x = 1 = 2 +3 | x = 1 = y = 2 = z + | + + + | +1 | 1 = 1 +2 | x = 1 = 2 + | ^ Syntax Error: Invalid assignment target +3 | x = 1 = y = 2 = z +4 | ["a", "b"] = ["a", "b"] + | + + + | +1 | 1 = 1 +2 | x = 1 = 2 +3 | x = 1 = y = 2 = z + | ^ Syntax Error: Invalid assignment target +4 | ["a", "b"] = ["a", "b"] + | + + + | +1 | 1 = 1 +2 | x = 1 = 2 +3 | x = 1 = y = 2 = z + | ^ Syntax Error: Invalid assignment target +4 | ["a", "b"] = ["a", "b"] + | + + + | +2 | x = 1 = 2 +3 | x = 1 = y = 2 = z +4 | ["a", "b"] = ["a", "b"] + | ^^^ Syntax Error: Invalid assignment target + | + + + | +2 | x = 1 = 2 +3 | x = 1 = y = 2 = z +4 | ["a", "b"] = ["a", "b"] + | ^^^ Syntax Error: Invalid assignment target + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_value_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_value_expr.py.snap new file mode 100644 index 0000000000..2d123c3e33 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_value_expr.py.snap @@ -0,0 +1,256 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/assign_stmt_invalid_value_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..72, + body: [ + Assign( + StmtAssign { + range: 0..12, + targets: [ + Name( + ExprName { + range: 0..1, + id: "x", + ctx: Store, + }, + ), + ], + value: Starred( + ExprStarred { + range: 4..12, + value: BoolOp( + ExprBoolOp { + range: 5..12, + op: And, + values: [ + Name( + ExprName { + range: 5..6, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 11..12, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 13..25, + targets: [ + Name( + ExprName { + range: 13..14, + id: "x", + ctx: Store, + }, + ), + ], + value: Starred( + ExprStarred { + range: 17..25, + value: Yield( + ExprYield { + range: 18..25, + value: Some( + Name( + ExprName { + range: 24..25, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 26..43, + targets: [ + Name( + ExprName { + range: 26..27, + id: "x", + ctx: Store, + }, + ), + ], + value: Starred( + ExprStarred { + range: 30..43, + value: YieldFrom( + ExprYieldFrom { + range: 31..43, + value: Name( + ExprName { + range: 42..43, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 44..60, + targets: [ + Name( + ExprName { + range: 44..45, + id: "x", + ctx: Store, + }, + ), + ], + value: Starred( + ExprStarred { + range: 48..60, + value: Lambda( + ExprLambda { + range: 49..60, + parameters: Some( + Parameters { + range: 56..57, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 56..57, + parameter: Parameter { + range: 56..57, + name: Identifier { + id: "x", + range: 56..57, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 59..60, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 61..66, + targets: [ + Name( + ExprName { + range: 61..62, + id: "x", + ctx: Store, + }, + ), + ], + value: Name( + ExprName { + range: 65..66, + id: "x", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 70..71, + value: NumberLiteral( + ExprNumberLiteral { + range: 70..71, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x = *a and b + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here +2 | x = *yield x +3 | x = *yield from x + | + + + | +1 | x = *a and b +2 | x = *yield x + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | x = *yield from x +4 | x = *lambda x: x + | + + + | +1 | x = *a and b +2 | x = *yield x +3 | x = *yield from x + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +4 | x = *lambda x: x +5 | x = x := 1 + | + + + | +2 | x = *yield x +3 | x = *yield from x +4 | x = *lambda x: x + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +5 | x = x := 1 + | + + + | +3 | x = *yield from x +4 | x = *lambda x: x +5 | x = x := 1 + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_keyword_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_keyword_target.py.snap new file mode 100644 index 0000000000..0b79a3eee8 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_keyword_target.py.snap @@ -0,0 +1,145 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/assign_stmt_keyword_target.py +--- +## AST + +``` +Module( + ModModule { + range: 0..42, + body: [ + Assign( + StmtAssign { + range: 0..12, + targets: [ + Name( + ExprName { + range: 0..1, + id: "a", + ctx: Store, + }, + ), + Name( + ExprName { + range: 4..8, + id: "pass", + ctx: Store, + }, + ), + ], + value: Name( + ExprName { + range: 11..12, + id: "c", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 13..18, + value: BinOp( + ExprBinOp { + range: 13..18, + left: Name( + ExprName { + range: 13..14, + id: "a", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 17..18, + id: "b", + ctx: Load, + }, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 19..35, + targets: [ + Name( + ExprName { + range: 19..20, + id: "a", + ctx: Store, + }, + ), + Name( + ExprName { + range: 23..24, + id: "b", + ctx: Store, + }, + ), + Name( + ExprName { + range: 27..31, + id: "pass", + ctx: Store, + }, + ), + ], + value: Name( + ExprName { + range: 34..35, + id: "c", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 36..41, + value: BinOp( + ExprBinOp { + range: 36..41, + left: Name( + ExprName { + range: 36..37, + id: "a", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 40..41, + id: "b", + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | a = pass = c + | ^^^^ Syntax Error: Expected an identifier, but found a keyword 'pass' that cannot be used here +2 | a + b +3 | a = b = pass = c + | + + + | +1 | a = pass = c +2 | a + b +3 | a = b = pass = c + | ^^^^ Syntax Error: Expected an identifier, but found a keyword 'pass' that cannot be used here +4 | a + b + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_missing_rhs.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_missing_rhs.py.snap new file mode 100644 index 0000000000..ad40136732 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_missing_rhs.py.snap @@ -0,0 +1,202 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/assign_stmt_missing_rhs.py +--- +## AST + +``` +Module( + ModModule { + range: 0..38, + body: [ + Assign( + StmtAssign { + range: 0..3, + targets: [ + Name( + ExprName { + range: 0..1, + id: "x", + ctx: Store, + }, + ), + ], + value: Name( + ExprName { + range: 3..3, + id: "", + ctx: Invalid, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 4..9, + value: BinOp( + ExprBinOp { + range: 4..9, + left: NumberLiteral( + ExprNumberLiteral { + range: 4..5, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 8..9, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 10..17, + targets: [ + Name( + ExprName { + range: 10..11, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 14..15, + id: "y", + ctx: Store, + }, + ), + ], + value: Name( + ExprName { + range: 17..17, + id: "", + ctx: Invalid, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 18..23, + value: BinOp( + ExprBinOp { + range: 18..23, + left: NumberLiteral( + ExprNumberLiteral { + range: 18..19, + value: Int( + 2, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 22..23, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 24..31, + targets: [ + Name( + ExprName { + range: 24..25, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 27..27, + id: "", + ctx: Store, + }, + ), + ], + value: Name( + ExprName { + range: 30..31, + id: "y", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 32..37, + value: BinOp( + ExprBinOp { + range: 32..37, + left: NumberLiteral( + ExprNumberLiteral { + range: 32..33, + value: Int( + 3, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 36..37, + value: Int( + 3, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x = + | ^ Syntax Error: Expected an expression +2 | 1 + 1 +3 | x = y = +4 | 2 + 2 + | + + + | +1 | x = +2 | 1 + 1 +3 | x = y = + | ^ Syntax Error: Expected an expression +4 | 2 + 2 +5 | x = = y +6 | 3 + 3 + | + + + | +3 | x = y = +4 | 2 + 2 +5 | x = = y + | ^ Syntax Error: Expected an expression +6 | 3 + 3 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@async_unexpected_token.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@async_unexpected_token.py.snap new file mode 100644 index 0000000000..d64d49c708 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@async_unexpected_token.py.snap @@ -0,0 +1,257 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/async_unexpected_token.py +--- +## AST + +``` +Module( + ModModule { + range: 0..220, + body: [ + ClassDef( + StmtClassDef { + range: 6..20, + decorator_list: [], + name: Identifier { + id: "Foo", + range: 12..15, + }, + type_params: None, + arguments: None, + body: [ + Expr( + StmtExpr { + range: 17..20, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 17..20, + }, + ), + }, + ), + ], + }, + ), + While( + StmtWhile { + range: 27..42, + test: Name( + ExprName { + range: 33..37, + id: "test", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 39..42, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 39..42, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + Assign( + StmtAssign { + range: 49..54, + targets: [ + Name( + ExprName { + range: 49..50, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 53..54, + value: Int( + 1, + ), + }, + ), + }, + ), + FunctionDef( + StmtFunctionDef { + range: 61..81, + is_async: true, + decorator_list: [], + name: Identifier { + id: "foo", + range: 71..74, + }, + type_params: None, + parameters: Parameters { + range: 74..76, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 78..81, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 78..81, + }, + ), + }, + ), + ], + }, + ), + Expr( + StmtExpr { + range: 192..197, + value: Name( + ExprName { + range: 192..197, + id: "match", + ctx: Load, + }, + ), + }, + ), + AnnAssign( + StmtAnnAssign { + range: 198..203, + target: Name( + ExprName { + range: 198..202, + id: "test", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 203..203, + id: "", + ctx: Invalid, + }, + ), + value: None, + simple: true, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 213..219, + target: Name( + ExprName { + range: 213..214, + id: "_", + ctx: Store, + }, + ), + annotation: EllipsisLiteral( + ExprEllipsisLiteral { + range: 216..219, + }, + ), + value: None, + simple: true, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | async class Foo: ... + | ^^^^^ Syntax Error: Expected 'def', 'with' or 'for' to follow 'async', found 'class' +2 | async while test: ... +3 | async x = 1 + | + + + | +1 | async class Foo: ... +2 | async while test: ... + | ^^^^^ Syntax Error: Expected 'def', 'with' or 'for' to follow 'async', found 'while' +3 | async x = 1 +4 | async async def foo(): ... + | + + + | +1 | async class Foo: ... +2 | async while test: ... +3 | async x = 1 + | ^ Syntax Error: Expected 'def', 'with' or 'for' to follow 'async', found name +4 | async async def foo(): ... +5 | # TODO(dhruvmanila): Here, `match` is actually a Name token because + | + + + | +2 | async while test: ... +3 | async x = 1 +4 | async async def foo(): ... + | ^^^^^ Syntax Error: Expected 'def', 'with' or 'for' to follow 'async', found 'async' +5 | # TODO(dhruvmanila): Here, `match` is actually a Name token because +6 | # of the soft keyword # transformer + | + + + | +5 | # TODO(dhruvmanila): Here, `match` is actually a Name token because +6 | # of the soft keyword # transformer +7 | async match test: + | ^^^^^ Syntax Error: Expected 'def', 'with' or 'for' to follow 'async', found name +8 | case _: ... + | + + + | +5 | # TODO(dhruvmanila): Here, `match` is actually a Name token because +6 | # of the soft keyword # transformer +7 | async match test: + | ^^^^ Syntax Error: Simple statements must be separated by newlines or semicolons +8 | case _: ... + | + + + | +5 | # TODO(dhruvmanila): Here, `match` is actually a Name token because +6 | # of the soft keyword # transformer +7 | async match test: + | ^ Syntax Error: Expected an expression +8 | case _: ... + | + + + | +6 | # of the soft keyword # transformer +7 | async match test: +8 | case _: ... + | ^^^^ Syntax Error: Unexpected indentation + | + + + | +6 | # of the soft keyword # transformer +7 | async match test: +8 | case _: ... + | ^^^^ Syntax Error: Expected a statement + | + + + | +7 | async match test: +8 | case _: ... + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_target.py.snap new file mode 100644 index 0000000000..2b6344ab13 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_target.py.snap @@ -0,0 +1,232 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/aug_assign_stmt_invalid_target.py +--- +## AST + +``` +Module( + ModModule { + range: 0..59, + body: [ + AugAssign( + StmtAugAssign { + range: 0..6, + target: NumberLiteral( + ExprNumberLiteral { + range: 0..1, + value: Int( + 1, + ), + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 5..6, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 7..17, + target: StringLiteral( + ExprStringLiteral { + range: 7..10, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 7..10, + value: "a", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + op: Add, + value: StringLiteral( + ExprStringLiteral { + range: 14..17, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 14..17, + value: "b", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 18..25, + target: Starred( + ExprStarred { + range: 18..20, + value: Name( + ExprName { + range: 19..20, + id: "x", + ctx: Store, + }, + ), + ctx: Store, + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 24..25, + value: Int( + 1, + ), + }, + ), + }, + ), + Pass( + StmtPass { + range: 26..30, + }, + ), + Expr( + StmtExpr { + range: 34..35, + value: NumberLiteral( + ExprNumberLiteral { + range: 34..35, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 36..45, + target: Name( + ExprName { + range: 36..37, + id: "x", + ctx: Store, + }, + ), + op: Add, + value: Name( + ExprName { + range: 41..45, + id: "pass", + ctx: Load, + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 46..58, + target: BinOp( + ExprBinOp { + range: 47..52, + left: Name( + ExprName { + range: 47..48, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 51..52, + id: "y", + ctx: Load, + }, + ), + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 57..58, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | 1 += 1 + | ^ Syntax Error: Invalid augmented assignment target +2 | "a" += "b" +3 | *x += 1 + | + + + | +1 | 1 += 1 +2 | "a" += "b" + | ^^^ Syntax Error: Invalid augmented assignment target +3 | *x += 1 +4 | pass += 1 + | + + + | +1 | 1 += 1 +2 | "a" += "b" +3 | *x += 1 + | ^^ Syntax Error: Invalid augmented assignment target +4 | pass += 1 +5 | x += pass + | + + + | +2 | "a" += "b" +3 | *x += 1 +4 | pass += 1 + | ^^ Syntax Error: Expected a statement +5 | x += pass +6 | (x + y) += 1 + | + + + | +3 | *x += 1 +4 | pass += 1 +5 | x += pass + | ^^^^ Syntax Error: Expected an identifier, but found a keyword 'pass' that cannot be used here +6 | (x + y) += 1 + | + + + | +4 | pass += 1 +5 | x += pass +6 | (x + y) += 1 + | ^^^^^ Syntax Error: Invalid augmented assignment target + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_value.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_value.py.snap new file mode 100644 index 0000000000..203e9e401b --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_value.py.snap @@ -0,0 +1,251 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/aug_assign_stmt_invalid_value.py +--- +## AST + +``` +Module( + ModModule { + range: 0..77, + body: [ + AugAssign( + StmtAugAssign { + range: 0..13, + target: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Store, + }, + ), + op: Add, + value: Starred( + ExprStarred { + range: 5..13, + value: BoolOp( + ExprBoolOp { + range: 6..13, + op: And, + values: [ + Name( + ExprName { + range: 6..7, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 12..13, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 14..27, + target: Name( + ExprName { + range: 14..15, + id: "x", + ctx: Store, + }, + ), + op: Add, + value: Starred( + ExprStarred { + range: 19..27, + value: Yield( + ExprYield { + range: 20..27, + value: Some( + Name( + ExprName { + range: 26..27, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 28..46, + target: Name( + ExprName { + range: 28..29, + id: "x", + ctx: Store, + }, + ), + op: Add, + value: Starred( + ExprStarred { + range: 33..46, + value: YieldFrom( + ExprYieldFrom { + range: 34..46, + value: Name( + ExprName { + range: 45..46, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 47..64, + target: Name( + ExprName { + range: 47..48, + id: "x", + ctx: Store, + }, + ), + op: Add, + value: Starred( + ExprStarred { + range: 52..64, + value: Lambda( + ExprLambda { + range: 53..64, + parameters: Some( + Parameters { + range: 60..61, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 60..61, + parameter: Parameter { + range: 60..61, + name: Identifier { + id: "x", + range: 60..61, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 63..64, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 65..71, + target: Name( + ExprName { + range: 65..66, + id: "x", + ctx: Store, + }, + ), + op: Add, + value: Name( + ExprName { + range: 70..71, + id: "y", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 75..76, + value: NumberLiteral( + ExprNumberLiteral { + range: 75..76, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x += *a and b + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here +2 | x += *yield x +3 | x += *yield from x + | + + + | +1 | x += *a and b +2 | x += *yield x + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | x += *yield from x +4 | x += *lambda x: x + | + + + | +1 | x += *a and b +2 | x += *yield x +3 | x += *yield from x + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +4 | x += *lambda x: x +5 | x += y := 1 + | + + + | +2 | x += *yield x +3 | x += *yield from x +4 | x += *lambda x: x + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +5 | x += y := 1 + | + + + | +3 | x += *yield from x +4 | x += *lambda x: x +5 | x += y := 1 + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_missing_rhs.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_missing_rhs.py.snap new file mode 100644 index 0000000000..df5c25dc7c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_missing_rhs.py.snap @@ -0,0 +1,136 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/aug_assign_stmt_missing_rhs.py +--- +## AST + +``` +Module( + ModModule { + range: 0..27, + body: [ + AugAssign( + StmtAugAssign { + range: 0..4, + target: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Store, + }, + ), + op: Add, + value: Name( + ExprName { + range: 4..4, + id: "", + ctx: Invalid, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5..10, + value: BinOp( + ExprBinOp { + range: 5..10, + left: NumberLiteral( + ExprNumberLiteral { + range: 5..6, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 9..10, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 11..17, + target: Name( + ExprName { + range: 11..12, + id: "x", + ctx: Store, + }, + ), + op: Add, + value: Name( + ExprName { + range: 16..17, + id: "y", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 21..26, + value: BinOp( + ExprBinOp { + range: 21..26, + left: NumberLiteral( + ExprNumberLiteral { + range: 21..22, + value: Int( + 2, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 25..26, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x += + | ^ Syntax Error: Expected an expression +2 | 1 + 1 +3 | x += y += +4 | 2 + 2 + | + + + | +1 | x += +2 | 1 + 1 +3 | x += y += + | ^^ Syntax Error: Expected a statement +4 | 2 + 2 + | + + + | +1 | x += +2 | 1 + 1 +3 | x += y += + | ^ Syntax Error: Expected a statement +4 | 2 + 2 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_empty_body.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_empty_body.py.snap new file mode 100644 index 0000000000..1c4725aa89 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_empty_body.py.snap @@ -0,0 +1,85 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/class_def_empty_body.py +--- +## AST + +``` +Module( + ModModule { + range: 0..31, + body: [ + ClassDef( + StmtClassDef { + range: 0..10, + decorator_list: [], + name: Identifier { + id: "Foo", + range: 6..9, + }, + type_params: None, + arguments: None, + body: [], + }, + ), + ClassDef( + StmtClassDef { + range: 11..23, + decorator_list: [], + name: Identifier { + id: "Foo", + range: 17..20, + }, + type_params: None, + arguments: Some( + Arguments { + range: 20..22, + args: [], + keywords: [], + }, + ), + body: [], + }, + ), + Assign( + StmtAssign { + range: 24..30, + targets: [ + Name( + ExprName { + range: 24..25, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 28..30, + value: Int( + 42, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | class Foo: +2 | class Foo(): + | ^^^^^ Syntax Error: Expected an indented block after `class` definition +3 | x = 42 + | + + + | +1 | class Foo: +2 | class Foo(): +3 | x = 42 + | ^ Syntax Error: Expected an indented block after `class` definition + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_missing_name.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_missing_name.py.snap new file mode 100644 index 0000000000..e254f9523f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_missing_name.py.snap @@ -0,0 +1,140 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/class_def_missing_name.py +--- +## AST + +``` +Module( + ModModule { + range: 0..53, + body: [ + ClassDef( + StmtClassDef { + range: 0..11, + decorator_list: [], + name: Identifier { + id: "", + range: 5..5, + }, + type_params: None, + arguments: None, + body: [ + Expr( + StmtExpr { + range: 8..11, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 8..11, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 12..25, + decorator_list: [], + name: Identifier { + id: "", + range: 17..17, + }, + type_params: None, + arguments: Some( + Arguments { + range: 18..20, + args: [], + keywords: [], + }, + ), + body: [ + Expr( + StmtExpr { + range: 22..25, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 22..25, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 26..52, + decorator_list: [], + name: Identifier { + id: "", + range: 31..31, + }, + type_params: None, + arguments: Some( + Arguments { + range: 32..47, + args: [], + keywords: [ + Keyword { + range: 33..46, + arg: Some( + Identifier { + id: "metaclass", + range: 33..42, + }, + ), + value: Name( + ExprName { + range: 43..46, + id: "ABC", + ctx: Load, + }, + ), + }, + ], + }, + ), + body: [ + Expr( + StmtExpr { + range: 49..52, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 49..52, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | class : ... + | ^ Syntax Error: Expected an identifier +2 | class (): ... +3 | class (metaclass=ABC): ... + | + + + | +1 | class : ... +2 | class (): ... + | ^ Syntax Error: Expected an identifier +3 | class (metaclass=ABC): ... + | + + + | +1 | class : ... +2 | class (): ... +3 | class (metaclass=ABC): ... + | ^ Syntax Error: Expected an identifier + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_unclosed_type_param_list.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_unclosed_type_param_list.py.snap new file mode 100644 index 0000000000..8d75eb452f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_unclosed_type_param_list.py.snap @@ -0,0 +1,124 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/class_def_unclosed_type_param_list.py +--- +## AST + +``` +Module( + ModModule { + range: 0..41, + body: [ + ClassDef( + StmtClassDef { + range: 0..40, + decorator_list: [], + name: Identifier { + id: "Foo", + range: 6..9, + }, + type_params: Some( + TypeParams { + range: 9..17, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 10..12, + name: Identifier { + id: "T1", + range: 10..12, + }, + bound: None, + }, + ), + TypeVarTuple( + TypeParamTypeVarTuple { + range: 14..17, + name: Identifier { + id: "T2", + range: 15..17, + }, + }, + ), + ], + }, + ), + arguments: Some( + Arguments { + range: 17..23, + args: [ + Name( + ExprName { + range: 18..19, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 21..22, + id: "b", + ctx: Load, + }, + ), + ], + keywords: [], + }, + ), + body: [ + Pass( + StmtPass { + range: 29..33, + }, + ), + Assign( + StmtAssign { + range: 34..40, + targets: [ + Name( + ExprName { + range: 34..35, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 38..40, + value: Int( + 10, + ), + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | class Foo[T1, *T2(a, b): + | ^ Syntax Error: Expected ']', found '(' +2 | pass +3 | x = 10 + | + + + | +1 | class Foo[T1, *T2(a, b): +2 | pass +3 | x = 10 + | ^ Syntax Error: Simple statements must be separated by newlines or semicolons + | + + + | +2 | pass +3 | x = 10 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_indented_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_indented_block.py.snap new file mode 100644 index 0000000000..5290039f5e --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_indented_block.py.snap @@ -0,0 +1,64 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/clause_expect_indented_block.py +--- +## AST + +``` +Module( + ModModule { + range: 0..171, + body: [ + If( + StmtIf { + range: 53..61, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 56..60, + value: true, + }, + ), + body: [], + elif_else_clauses: [], + }, + ), + Pass( + StmtPass { + range: 62..66, + }, + ), + If( + StmtIf { + range: 162..170, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 165..169, + value: true, + }, + ), + body: [], + elif_else_clauses: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Here, the error is highlighted at the `pass` token +2 | if True: +3 | pass + | ^^^^ Syntax Error: Expected an indented block after `if` statement +4 | # The parser is at the end of the program, so let's highlight +5 | # at the newline token after `:` + | + + + | +4 | # The parser is at the end of the program, so let's highlight +5 | # at the newline token after `:` +6 | if True: + | ^ Syntax Error: Expected an indented block after `if` statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_single_statement.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_single_statement.py.snap new file mode 100644 index 0000000000..e7068ac10f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_single_statement.py.snap @@ -0,0 +1,53 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/clause_expect_single_statement.py +--- +## AST + +``` +Module( + ModModule { + range: 0..23, + body: [ + If( + StmtIf { + range: 0..8, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 3..7, + value: true, + }, + ), + body: [], + elif_else_clauses: [], + }, + ), + If( + StmtIf { + range: 9..22, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 12..16, + value: true, + }, + ), + body: [ + Pass( + StmtPass { + range: 18..22, + }, + ), + ], + elif_else_clauses: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | if True: if True: pass + | ^^ Syntax Error: Expected a simple statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comprehension_missing_for_after_async.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comprehension_missing_for_after_async.py.snap new file mode 100644 index 0000000000..4297ad0f41 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comprehension_missing_for_after_async.py.snap @@ -0,0 +1,114 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/comprehension_missing_for_after_async.py +--- +## AST + +``` +Module( + ModModule { + range: 0..28, + body: [ + Expr( + StmtExpr { + range: 0..7, + value: Generator( + ExprGenerator { + range: 0..7, + elt: Name( + ExprName { + range: 1..1, + id: "", + ctx: Invalid, + }, + ), + generators: [ + Comprehension { + range: 1..6, + target: Name( + ExprName { + range: 6..6, + id: "", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 6..6, + id: "", + ctx: Invalid, + }, + ), + ifs: [], + is_async: true, + }, + ], + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 8..27, + value: Generator( + ExprGenerator { + range: 8..27, + elt: Name( + ExprName { + range: 9..10, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 11..26, + target: Name( + ExprName { + range: 17..18, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 22..26, + id: "iter", + ctx: Load, + }, + ), + ifs: [], + is_async: true, + }, + ], + parenthesized: true, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | (async) + | ^^^^^ Syntax Error: Expected an expression +2 | (x async x in iter) + | + + + | +1 | (async) + | ^ Syntax Error: Expected 'for', found ')' +2 | (x async x in iter) + | + + + | +1 | (async) +2 | (x async x in iter) + | ^ Syntax Error: Expected 'for', found name + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_invalid_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_invalid_expression.py.snap new file mode 100644 index 0000000000..7ee0145871 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_invalid_expression.py.snap @@ -0,0 +1,175 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/decorator_invalid_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..56, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..55, + is_async: false, + decorator_list: [ + Decorator { + range: 0..3, + expression: Starred( + ExprStarred { + range: 1..3, + value: Name( + ExprName { + range: 2..3, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + Decorator { + range: 4..9, + expression: Starred( + ExprStarred { + range: 6..8, + value: Name( + ExprName { + range: 7..8, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + Decorator { + range: 10..17, + expression: Starred( + ExprStarred { + range: 13..15, + value: Name( + ExprName { + range: 14..15, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + Decorator { + range: 18..26, + expression: Yield( + ExprYield { + range: 19..26, + value: Some( + Name( + ExprName { + range: 25..26, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + }, + Decorator { + range: 27..40, + expression: YieldFrom( + ExprYieldFrom { + range: 28..40, + value: Name( + ExprName { + range: 39..40, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ], + name: Identifier { + id: "foo", + range: 45..48, + }, + type_params: None, + parameters: Parameters { + range: 48..50, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 52..55, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 52..55, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | @*x + | ^^ Syntax Error: Starred expression cannot be used here +2 | @(*x) +3 | @((*x)) + | + + + | +1 | @*x +2 | @(*x) + | ^^ Syntax Error: Starred expression cannot be used here +3 | @((*x)) +4 | @yield x + | + + + | +1 | @*x +2 | @(*x) +3 | @((*x)) + | ^^ Syntax Error: Starred expression cannot be used here +4 | @yield x +5 | @yield from x + | + + + | +2 | @(*x) +3 | @((*x)) +4 | @yield x + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +5 | @yield from x +6 | def foo(): ... + | + + + | +3 | @((*x)) +4 | @yield x +5 | @yield from x + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +6 | def foo(): ... + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_expression.py.snap new file mode 100644 index 0000000000..ea01e8e070 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_expression.py.snap @@ -0,0 +1,189 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/decorator_missing_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..51, + body: [ + AnnAssign( + StmtAnnAssign { + range: 5..15, + target: Call( + ExprCall { + range: 5..10, + func: Name( + ExprName { + range: 5..8, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 8..10, + args: [], + keywords: [], + }, + }, + ), + annotation: EllipsisLiteral( + ExprEllipsisLiteral { + range: 12..15, + }, + ), + value: None, + simple: false, + }, + ), + FunctionDef( + StmtFunctionDef { + range: 16..32, + is_async: false, + decorator_list: [ + Decorator { + range: 16..17, + expression: Name( + ExprName { + range: 17..17, + id: "", + ctx: Invalid, + }, + ), + }, + ], + name: Identifier { + id: "foo", + range: 22..25, + }, + type_params: None, + parameters: Parameters { + range: 25..27, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 29..32, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 29..32, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 33..50, + is_async: false, + decorator_list: [ + Decorator { + range: 33..35, + expression: BinOp( + ExprBinOp { + range: 34..35, + left: Name( + ExprName { + range: 34..34, + id: "", + ctx: Invalid, + }, + ), + op: MatMult, + right: Name( + ExprName { + range: 35..35, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ], + name: Identifier { + id: "foo", + range: 40..43, + }, + type_params: None, + parameters: Parameters { + range: 43..45, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 47..50, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 47..50, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | @def foo(): ... + | ^^^ Syntax Error: Expected an identifier, but found a keyword 'def' that cannot be used here +2 | @ +3 | def foo(): ... + | + + + | +1 | @def foo(): ... + | ^^^ Syntax Error: Expected newline, found name +2 | @ +3 | def foo(): ... + | + + + | +1 | @def foo(): ... +2 | @ + | ^ Syntax Error: Expected an expression +3 | def foo(): ... +4 | @@ +5 | def foo(): ... + | + + + | +2 | @ +3 | def foo(): ... +4 | @@ + | ^ Syntax Error: Expected an expression +5 | def foo(): ... + | + + + | +2 | @ +3 | def foo(): ... +4 | @@ + | ^ Syntax Error: Expected an expression +5 | def foo(): ... + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_newline.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_newline.py.snap new file mode 100644 index 0000000000..16e58deab9 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_newline.py.snap @@ -0,0 +1,162 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/decorator_missing_newline.py +--- +## AST + +``` +Module( + ModModule { + range: 0..60, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..17, + is_async: false, + decorator_list: [ + Decorator { + range: 0..2, + expression: Name( + ExprName { + range: 1..2, + id: "x", + ctx: Load, + }, + ), + }, + ], + name: Identifier { + id: "foo", + range: 7..10, + }, + type_params: None, + parameters: Parameters { + range: 10..12, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 14..17, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 14..17, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 18..41, + is_async: true, + decorator_list: [ + Decorator { + range: 18..20, + expression: Name( + ExprName { + range: 19..20, + id: "x", + ctx: Load, + }, + ), + }, + ], + name: Identifier { + id: "foo", + range: 31..34, + }, + type_params: None, + parameters: Parameters { + range: 34..36, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 38..41, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 38..41, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 42..59, + decorator_list: [ + Decorator { + range: 42..44, + expression: Name( + ExprName { + range: 43..44, + id: "x", + ctx: Load, + }, + ), + }, + ], + name: Identifier { + id: "Foo", + range: 51..54, + }, + type_params: None, + arguments: None, + body: [ + Expr( + StmtExpr { + range: 56..59, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 56..59, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | @x def foo(): ... + | ^^^ Syntax Error: Expected newline, found 'def' +2 | @x async def foo(): ... +3 | @x class Foo: ... + | + + + | +1 | @x def foo(): ... +2 | @x async def foo(): ... + | ^^^^^ Syntax Error: Expected newline, found 'async' +3 | @x class Foo: ... + | + + + | +1 | @x def foo(): ... +2 | @x async def foo(): ... +3 | @x class Foo: ... + | ^^^^^ Syntax Error: Expected newline, found 'class' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_unexpected_token.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_unexpected_token.py.snap new file mode 100644 index 0000000000..c234361321 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_unexpected_token.py.snap @@ -0,0 +1,85 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/decorator_unexpected_token.py +--- +## AST + +``` +Module( + ModModule { + range: 0..34, + body: [ + With( + StmtWith { + range: 5..22, + is_async: true, + items: [ + WithItem { + range: 16..17, + context_expr: Name( + ExprName { + range: 16..17, + id: "x", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 19..22, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 19..22, + }, + ), + }, + ), + ], + }, + ), + Assign( + StmtAssign { + range: 28..33, + targets: [ + Name( + ExprName { + range: 28..29, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 32..33, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | @foo +2 | async with x: ... + | ^^^^^ Syntax Error: Expected class, function definition or async function definition after decorator +3 | @foo +4 | x = 1 + | + + + | +2 | async with x: ... +3 | @foo +4 | x = 1 + | ^ Syntax Error: Expected class, function definition or async function definition after decorator + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_incomplete_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_incomplete_target.py.snap new file mode 100644 index 0000000000..ac45a128e3 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_incomplete_target.py.snap @@ -0,0 +1,124 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/del_incomplete_target.py +--- +## AST + +``` +Module( + ModModule { + range: 0..24, + body: [ + Delete( + StmtDelete { + range: 0..9, + targets: [ + Name( + ExprName { + range: 4..5, + id: "x", + ctx: Del, + }, + ), + Attribute( + ExprAttribute { + range: 7..9, + value: Name( + ExprName { + range: 7..8, + id: "y", + ctx: Load, + }, + ), + attr: Identifier { + id: "", + range: 9..9, + }, + ctx: Del, + }, + ), + ], + }, + ), + Expr( + StmtExpr { + range: 10..11, + value: Name( + ExprName { + range: 10..11, + id: "z", + ctx: Load, + }, + ), + }, + ), + Delete( + StmtDelete { + range: 12..24, + targets: [ + Name( + ExprName { + range: 16..17, + id: "x", + ctx: Del, + }, + ), + Subscript( + ExprSubscript { + range: 19..23, + value: Name( + ExprName { + range: 19..20, + id: "y", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 22..23, + lower: Some( + Name( + ExprName { + range: 22..23, + id: "z", + ctx: Load, + }, + ), + ), + upper: Some( + Name( + ExprName { + range: 23..23, + id: "", + ctx: Invalid, + }, + ), + ), + step: None, + }, + ), + ctx: Del, + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | del x, y. + | ^ Syntax Error: Expected an identifier +2 | z +3 | del x, y[ +4 | z + | + + + | +3 | del x, y[ +4 | z + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_stmt_empty.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_stmt_empty.py.snap new file mode 100644 index 0000000000..f36083fc0c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_stmt_empty.py.snap @@ -0,0 +1,27 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/del_stmt_empty.py +--- +## AST + +``` +Module( + ModModule { + range: 0..4, + body: [ + Delete( + StmtDelete { + range: 0..3, + targets: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | del + | ^ Syntax Error: Delete statement must have at least one target + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@dotted_name_multiple_dots.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@dotted_name_multiple_dots.py.snap new file mode 100644 index 0000000000..7420fb11ba --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@dotted_name_multiple_dots.py.snap @@ -0,0 +1,88 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/dotted_name_multiple_dots.py +--- +## AST + +``` +Module( + ModModule { + range: 0..25, + body: [ + Import( + StmtImport { + range: 0..11, + names: [ + Alias { + range: 7..11, + name: Identifier { + id: "a..b", + range: 7..11, + }, + asname: None, + }, + ], + }, + ), + Import( + StmtImport { + range: 12..20, + names: [ + Alias { + range: 19..20, + name: Identifier { + id: "a", + range: 19..20, + }, + asname: None, + }, + ], + }, + ), + Expr( + StmtExpr { + range: 20..23, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 20..23, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 23..24, + value: Name( + ExprName { + range: 23..24, + id: "b", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | import a..b + | ^ Syntax Error: Expected an identifier +2 | import a...b + | + + + | +1 | import a..b +2 | import a...b + | ^^^ Syntax Error: Expected ',', found '...' + | + + + | +1 | import a..b +2 | import a...b + | ^ Syntax Error: Simple statements must be separated by newlines or semicolons + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_invalid_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_invalid_expression.py.snap new file mode 100644 index 0000000000..ca3cb6b784 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_invalid_expression.py.snap @@ -0,0 +1,125 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/except_stmt_invalid_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..74, + body: [ + Try( + StmtTry { + range: 0..38, + body: [ + Pass( + StmtPass { + range: 9..13, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 14..38, + type_: Some( + Yield( + ExprYield { + range: 21..28, + value: Some( + Name( + ExprName { + range: 27..28, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 34..38, + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: false, + }, + ), + Try( + StmtTry { + range: 39..73, + body: [ + Pass( + StmtPass { + range: 48..52, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 53..73, + type_: Some( + Starred( + ExprStarred { + range: 61..63, + value: Name( + ExprName { + range: 62..63, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 69..73, + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: true, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | try: +2 | pass +3 | except yield x: + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +4 | pass +5 | try: + | + + + | +5 | try: +6 | pass +7 | except* *x: + | ^^ Syntax Error: Starred expression cannot be used here +8 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_missing_as_name.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_missing_as_name.py.snap new file mode 100644 index 0000000000..c9fcabbab0 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_missing_as_name.py.snap @@ -0,0 +1,95 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/except_stmt_missing_as_name.py +--- +## AST + +``` +Module( + ModModule { + range: 0..73, + body: [ + Try( + StmtTry { + range: 0..72, + body: [ + Pass( + StmtPass { + range: 9..13, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 14..43, + type_: Some( + Name( + ExprName { + range: 21..30, + id: "Exception", + ctx: Load, + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 39..43, + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 44..72, + type_: Some( + Name( + ExprName { + range: 51..60, + id: "Exception", + ctx: Load, + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 68..72, + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: false, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | try: +2 | pass +3 | except Exception as: + | ^ Syntax Error: Expected name after `as` +4 | pass +5 | except Exception as + | + + + | +3 | except Exception as: +4 | pass +5 | except Exception as + | ^ Syntax Error: Expected name after `as` +6 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_missing_exception.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_missing_exception.py.snap new file mode 100644 index 0000000000..d30dbd928c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_missing_exception.py.snap @@ -0,0 +1,155 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/except_stmt_missing_exception.py +--- +## AST + +``` +Module( + ModModule { + range: 0..166, + body: [ + Try( + StmtTry { + range: 0..37, + body: [ + Pass( + StmtPass { + range: 9..13, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 14..37, + type_: None, + name: Some( + Identifier { + id: "exc", + range: 24..27, + }, + ), + body: [ + Pass( + StmtPass { + range: 33..37, + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: false, + }, + ), + Try( + StmtTry { + range: 92..165, + body: [ + Pass( + StmtPass { + range: 101..105, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 106..123, + type_: None, + name: None, + body: [ + Pass( + StmtPass { + range: 119..123, + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 124..140, + type_: None, + name: None, + body: [ + Pass( + StmtPass { + range: 136..140, + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 141..165, + type_: None, + name: Some( + Identifier { + id: "exc", + range: 152..155, + }, + ), + body: [ + Pass( + StmtPass { + range: 161..165, + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: true, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | try: +2 | pass +3 | except as exc: + | ^^ Syntax Error: Expected one or more exception types +4 | pass +5 | # If a '*' is present then exception type is required + | + + + | + 6 | try: + 7 | pass + 8 | except*: + | ^ Syntax Error: Expected one or more exception types + 9 | pass +10 | except* + | + + + | + 8 | except*: + 9 | pass +10 | except* + | ^ Syntax Error: Expected one or more exception types +11 | pass +12 | except* as exc: +13 | pass + | + + + | +10 | except* +11 | pass +12 | except* as exc: + | ^^ Syntax Error: Expected one or more exception types +13 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_missing_exception_and_as_name.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_missing_exception_and_as_name.py.snap new file mode 100644 index 0000000000..20805396e6 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_missing_exception_and_as_name.py.snap @@ -0,0 +1,64 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/except_stmt_missing_exception_and_as_name.py +--- +## AST + +``` +Module( + ModModule { + range: 0..34, + body: [ + Try( + StmtTry { + range: 0..33, + body: [ + Pass( + StmtPass { + range: 9..13, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 14..33, + type_: None, + name: None, + body: [ + Pass( + StmtPass { + range: 29..33, + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: false, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | try: +2 | pass +3 | except as: + | ^^ Syntax Error: Expected one or more exception types +4 | pass + | + + + | +1 | try: +2 | pass +3 | except as: + | ^ Syntax Error: Expected name after `as` +4 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_unparenthesized_tuple.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_unparenthesized_tuple.py.snap new file mode 100644 index 0000000000..7e191318af --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_stmt_unparenthesized_tuple.py.snap @@ -0,0 +1,250 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/except_stmt_unparenthesized_tuple.py +--- +## AST + +``` +Module( + ModModule { + range: 0..131, + body: [ + Try( + StmtTry { + range: 0..64, + body: [ + Pass( + StmtPass { + range: 9..13, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 14..35, + type_: Some( + Tuple( + ExprTuple { + range: 21..25, + elts: [ + Name( + ExprName { + range: 21..22, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 24..25, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 31..35, + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 36..64, + type_: Some( + Tuple( + ExprTuple { + range: 43..47, + elts: [ + Name( + ExprName { + range: 43..44, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 46..47, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + name: Some( + Identifier { + id: "exc", + range: 51..54, + }, + ), + body: [ + Pass( + StmtPass { + range: 60..64, + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: false, + }, + ), + Try( + StmtTry { + range: 65..130, + body: [ + Pass( + StmtPass { + range: 74..78, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 79..101, + type_: Some( + Tuple( + ExprTuple { + range: 87..91, + elts: [ + Name( + ExprName { + range: 87..88, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 90..91, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 97..101, + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 102..130, + type_: Some( + Tuple( + ExprTuple { + range: 110..114, + elts: [ + Name( + ExprName { + range: 110..111, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 113..114, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + name: Some( + Identifier { + id: "eg", + range: 118..120, + }, + ), + body: [ + Pass( + StmtPass { + range: 126..130, + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: true, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | try: +2 | pass +3 | except x, y: + | ^^^^ Syntax Error: Multiple exception types must be parenthesized +4 | pass +5 | except x, y as exc: + | + + + | +3 | except x, y: +4 | pass +5 | except x, y as exc: + | ^^^^ Syntax Error: Multiple exception types must be parenthesized +6 | pass +7 | try: + | + + + | + 7 | try: + 8 | pass + 9 | except* x, y: + | ^^^^ Syntax Error: Multiple exception types must be parenthesized +10 | pass +11 | except* x, y as eg: + | + + + | + 9 | except* x, y: +10 | pass +11 | except* x, y as eg: + | ^^^^ Syntax Error: Multiple exception types must be parenthesized +12 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__double_starred.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__double_starred.py.snap new file mode 100644 index 0000000000..2bab550c48 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__double_starred.py.snap @@ -0,0 +1,221 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/arguments/double_starred.py +--- +## AST + +``` +Module( + ModModule { + range: 0..55, + body: [ + Expr( + StmtExpr { + range: 0..15, + value: Call( + ExprCall { + range: 0..15, + func: Name( + ExprName { + range: 0..4, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 4..15, + args: [], + keywords: [ + Keyword { + range: 5..14, + arg: None, + value: Yield( + ExprYield { + range: 7..14, + value: Some( + Name( + ExprName { + range: 13..14, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 16..27, + value: Call( + ExprCall { + range: 16..27, + func: Name( + ExprName { + range: 16..20, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 20..27, + args: [], + keywords: [ + Keyword { + range: 21..26, + arg: None, + value: Starred( + ExprStarred { + range: 24..26, + value: Name( + ExprName { + range: 25..26, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 28..38, + value: Call( + ExprCall { + range: 28..38, + func: Name( + ExprName { + range: 28..32, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 32..38, + args: [], + keywords: [ + Keyword { + range: 33..37, + arg: None, + value: Starred( + ExprStarred { + range: 35..37, + value: Name( + ExprName { + range: 36..37, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 40..54, + value: Call( + ExprCall { + range: 40..54, + func: Name( + ExprName { + range: 40..44, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 44..54, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 52..53, + value: Int( + 1, + ), + }, + ), + ], + keywords: [ + Keyword { + range: 45..48, + arg: None, + value: Name( + ExprName { + range: 47..48, + id: "x", + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | call(**yield x) + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +2 | call(** *x) +3 | call(***x) + | + + + | +1 | call(**yield x) +2 | call(** *x) + | ^^ Syntax Error: Starred expression cannot be used here +3 | call(***x) + | + + + | +1 | call(**yield x) +2 | call(** *x) +3 | call(***x) + | ^^ Syntax Error: Starred expression cannot be used here +4 | +5 | call(**x := 1) + | + + + | +3 | call(***x) +4 | +5 | call(**x := 1) + | ^^ Syntax Error: Expected ',', found ':=' + | + + + | +3 | call(***x) +4 | +5 | call(**x := 1) + | ^ Syntax Error: Positional argument cannot follow keyword argument unpacking + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__duplicate_keyword_arguments.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__duplicate_keyword_arguments.py.snap new file mode 100644 index 0000000000..9b105f6cb3 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__duplicate_keyword_arguments.py.snap @@ -0,0 +1,135 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/arguments/duplicate_keyword_arguments.py +--- +## AST + +``` +Module( + ModModule { + range: 0..28, + body: [ + Expr( + StmtExpr { + range: 0..28, + value: Call( + ExprCall { + range: 0..28, + func: Name( + ExprName { + range: 0..3, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 3..28, + args: [], + keywords: [ + Keyword { + range: 4..7, + arg: Some( + Identifier { + id: "a", + range: 4..5, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 6..7, + value: Int( + 1, + ), + }, + ), + }, + Keyword { + range: 9..12, + arg: Some( + Identifier { + id: "b", + range: 9..10, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 11..12, + value: Int( + 2, + ), + }, + ), + }, + Keyword { + range: 14..17, + arg: Some( + Identifier { + id: "c", + range: 14..15, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 16..17, + value: Int( + 3, + ), + }, + ), + }, + Keyword { + range: 19..22, + arg: Some( + Identifier { + id: "b", + range: 19..20, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 21..22, + value: Int( + 4, + ), + }, + ), + }, + Keyword { + range: 24..27, + arg: Some( + Identifier { + id: "a", + range: 24..25, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 26..27, + value: Int( + 5, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | foo(a=1, b=2, c=3, b=4, a=5) + | ^^^ Syntax Error: Duplicate keyword argument "b" + | + + + | +1 | foo(a=1, b=2, c=3, b=4, a=5) + | ^^^ Syntax Error: Duplicate keyword argument "a" + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_expression.py.snap new file mode 100644 index 0000000000..f904be8edb --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_expression.py.snap @@ -0,0 +1,199 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/arguments/invalid_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..67, + body: [ + Expr( + StmtExpr { + range: 0..15, + value: Call( + ExprCall { + range: 0..15, + func: Name( + ExprName { + range: 0..4, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 4..15, + args: [], + keywords: [ + Keyword { + range: 5..14, + arg: Some( + Identifier { + id: "", + range: 5..10, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 13..14, + value: Int( + 1, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 16..32, + value: Call( + ExprCall { + range: 16..32, + func: Name( + ExprName { + range: 16..20, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 20..32, + args: [], + keywords: [ + Keyword { + range: 21..31, + arg: Some( + Identifier { + id: "", + range: 21..27, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 30..31, + value: Int( + 1, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 34..47, + value: Call( + ExprCall { + range: 34..47, + func: Name( + ExprName { + range: 34..38, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 38..47, + args: [ + Yield( + ExprYield { + range: 39..46, + value: Some( + Name( + ExprName { + range: 45..46, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 48..66, + value: Call( + ExprCall { + range: 48..66, + func: Name( + ExprName { + range: 48..52, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 52..66, + args: [ + YieldFrom( + ExprYieldFrom { + range: 53..65, + value: Name( + ExprName { + range: 64..65, + id: "x", + ctx: Load, + }, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | call(x + y = 1) + | ^^^^^ Syntax Error: Expected a parameter name +2 | call(x := 1 = 1) + | + + + | +1 | call(x + y = 1) +2 | call(x := 1 = 1) + | ^^^^^^ Syntax Error: Expected a parameter name +3 | +4 | call(yield x) + | + + + | +2 | call(x := 1 = 1) +3 | +4 | call(yield x) + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +5 | call(yield from x) + | + + + | +4 | call(yield x) +5 | call(yield from x) + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_keyword_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_keyword_expression.py.snap new file mode 100644 index 0000000000..5200967a60 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_keyword_expression.py.snap @@ -0,0 +1,229 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/arguments/invalid_keyword_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..69, + body: [ + Expr( + StmtExpr { + range: 0..17, + value: Call( + ExprCall { + range: 0..17, + func: Name( + ExprName { + range: 0..4, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 4..17, + args: [], + keywords: [ + Keyword { + range: 5..16, + arg: Some( + Identifier { + id: "x", + range: 5..6, + }, + ), + value: Yield( + ExprYield { + range: 9..16, + value: Some( + Name( + ExprName { + range: 15..16, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 18..40, + value: Call( + ExprCall { + range: 18..40, + func: Name( + ExprName { + range: 18..22, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 22..40, + args: [], + keywords: [ + Keyword { + range: 23..39, + arg: Some( + Identifier { + id: "x", + range: 23..24, + }, + ), + value: YieldFrom( + ExprYieldFrom { + range: 27..39, + value: Name( + ExprName { + range: 38..39, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 41..53, + value: Call( + ExprCall { + range: 41..53, + func: Name( + ExprName { + range: 41..45, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 45..53, + args: [], + keywords: [ + Keyword { + range: 46..52, + arg: Some( + Identifier { + id: "x", + range: 46..47, + }, + ), + value: Starred( + ExprStarred { + range: 50..52, + value: Name( + ExprName { + range: 51..52, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 54..68, + value: Call( + ExprCall { + range: 54..68, + func: Name( + ExprName { + range: 54..58, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 58..68, + args: [], + keywords: [ + Keyword { + range: 59..67, + arg: Some( + Identifier { + id: "x", + range: 59..60, + }, + ), + value: Starred( + ExprStarred { + range: 64..66, + value: Name( + ExprName { + range: 65..66, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | call(x = yield y) + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +2 | call(x = yield from y) +3 | call(x = *y) + | + + + | +1 | call(x = yield y) +2 | call(x = yield from y) + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | call(x = *y) +4 | call(x = (*y)) + | + + + | +1 | call(x = yield y) +2 | call(x = yield from y) +3 | call(x = *y) + | ^^ Syntax Error: Starred expression cannot be used here +4 | call(x = (*y)) + | + + + | +2 | call(x = yield from y) +3 | call(x = *y) +4 | call(x = (*y)) + | ^^ Syntax Error: Starred expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_order.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_order.py.snap new file mode 100644 index 0000000000..0cf3fffafd --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_order.py.snap @@ -0,0 +1,304 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/arguments/invalid_order.py +--- +## AST + +``` +Module( + ModModule { + range: 0..100, + body: [ + Expr( + StmtExpr { + range: 0..17, + value: Call( + ExprCall { + range: 0..17, + func: Name( + ExprName { + range: 0..4, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 4..17, + args: [ + Name( + ExprName { + range: 15..16, + id: "x", + ctx: Load, + }, + ), + ], + keywords: [ + Keyword { + range: 5..13, + arg: None, + value: Name( + ExprName { + range: 7..13, + id: "kwargs", + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 18..30, + value: Call( + ExprCall { + range: 18..30, + func: Name( + ExprName { + range: 18..22, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 22..30, + args: [ + Name( + ExprName { + range: 28..29, + id: "y", + ctx: Load, + }, + ), + ], + keywords: [ + Keyword { + range: 23..26, + arg: Some( + Identifier { + id: "x", + range: 23..24, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 25..26, + value: Int( + 1, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 31..53, + value: Call( + ExprCall { + range: 31..53, + func: Name( + ExprName { + range: 31..35, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 35..53, + args: [ + Name( + ExprName { + range: 51..52, + id: "y", + ctx: Load, + }, + ), + ], + keywords: [ + Keyword { + range: 36..39, + arg: Some( + Identifier { + id: "x", + range: 36..37, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 38..39, + value: Int( + 1, + ), + }, + ), + }, + Keyword { + range: 41..49, + arg: None, + value: Name( + ExprName { + range: 43..49, + id: "kwargs", + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 54..75, + value: Call( + ExprCall { + range: 54..75, + func: Name( + ExprName { + range: 54..58, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 58..75, + args: [ + Starred( + ExprStarred { + range: 69..74, + value: Name( + ExprName { + range: 70..74, + id: "args", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + keywords: [ + Keyword { + range: 59..67, + arg: None, + value: Name( + ExprName { + range: 61..67, + id: "kwargs", + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 76..99, + value: Call( + ExprCall { + range: 76..99, + func: Name( + ExprName { + range: 76..80, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 80..99, + args: [ + Starred( + ExprStarred { + range: 92..97, + value: Name( + ExprName { + range: 93..97, + id: "args", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + keywords: [ + Keyword { + range: 81..89, + arg: None, + value: Name( + ExprName { + range: 83..89, + id: "kwargs", + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | call(**kwargs, x) + | ^ Syntax Error: Positional argument cannot follow keyword argument unpacking +2 | call(x=1, y) +3 | call(x=1, **kwargs, y) + | + + + | +1 | call(**kwargs, x) +2 | call(x=1, y) + | ^ Syntax Error: Positional argument cannot follow keyword argument +3 | call(x=1, **kwargs, y) +4 | call(**kwargs, *args) + | + + + | +1 | call(**kwargs, x) +2 | call(x=1, y) +3 | call(x=1, **kwargs, y) + | ^ Syntax Error: Positional argument cannot follow keyword argument unpacking +4 | call(**kwargs, *args) +5 | call(**kwargs, (*args)) + | + + + | +2 | call(x=1, y) +3 | call(x=1, **kwargs, y) +4 | call(**kwargs, *args) + | ^^^^^ Syntax Error: Iterable argument unpacking cannot follow keyword argument unpacking +5 | call(**kwargs, (*args)) + | + + + | +3 | call(x=1, **kwargs, y) +4 | call(**kwargs, *args) +5 | call(**kwargs, (*args)) + | ^^^^^ Syntax Error: Starred expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_argument.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_argument.py.snap new file mode 100644 index 0000000000..f2749b81a5 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_argument.py.snap @@ -0,0 +1,58 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/arguments/missing_argument.py +--- +## AST + +``` +Module( + ModModule { + range: 0..10, + body: [ + Expr( + StmtExpr { + range: 0..10, + value: Call( + ExprCall { + range: 0..10, + func: Name( + ExprName { + range: 0..4, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 4..10, + args: [ + Name( + ExprName { + range: 5..6, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 8..9, + id: "y", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | call(x,,y) + | ^ Syntax Error: Expected an expression or a ')' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_comma.py.snap new file mode 100644 index 0000000000..d3c83e68ec --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_comma.py.snap @@ -0,0 +1,58 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/arguments/missing_comma.py +--- +## AST + +``` +Module( + ModModule { + range: 0..9, + body: [ + Expr( + StmtExpr { + range: 0..9, + value: Call( + ExprCall { + range: 0..9, + func: Name( + ExprName { + range: 0..4, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 4..9, + args: [ + Name( + ExprName { + range: 5..6, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 7..8, + id: "y", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | call(x y) + | ^ Syntax Error: Expected ',', found name + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_expression.py.snap new file mode 100644 index 0000000000..03fd0e76b9 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_expression.py.snap @@ -0,0 +1,166 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/arguments/missing_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..38, + body: [ + Expr( + StmtExpr { + range: 0..10, + value: Call( + ExprCall { + range: 0..10, + func: Name( + ExprName { + range: 0..4, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 4..10, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 8..9, + value: Int( + 1, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 11..21, + value: Call( + ExprCall { + range: 11..21, + func: Name( + ExprName { + range: 11..15, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 15..21, + args: [], + keywords: [ + Keyword { + range: 16..19, + arg: Some( + Identifier { + id: "x", + range: 16..17, + }, + ), + value: Name( + ExprName { + range: 19..19, + id: "", + ctx: Invalid, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 22..32, + value: Call( + ExprCall { + range: 22..32, + func: Name( + ExprName { + range: 22..26, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 26..32, + args: [ + Starred( + ExprStarred { + range: 27..28, + value: Name( + ExprName { + range: 28..28, + id: "", + ctx: Invalid, + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 30..31, + id: "y", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 34..37, + value: Name( + ExprName { + range: 34..37, + id: "foo", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | call( = 1) + | ^ Syntax Error: Expected an expression or a ')' +2 | call(x = ) +3 | call(*, y) + | + + + | +1 | call( = 1) +2 | call(x = ) + | ^ Syntax Error: Expected an expression +3 | call(*, y) + | + + + | +1 | call( = 1) +2 | call(x = ) +3 | call(*, y) + | ^ Syntax Error: Expected an expression +4 | +5 | foo + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__starred.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__starred.py.snap new file mode 100644 index 0000000000..b8e9b4363e --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__starred.py.snap @@ -0,0 +1,186 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/arguments/starred.py +--- +## AST + +``` +Module( + ModModule { + range: 0..64, + body: [ + Expr( + StmtExpr { + range: 0..28, + value: Call( + ExprCall { + range: 0..28, + func: Name( + ExprName { + range: 0..4, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 4..28, + args: [ + Generator( + ExprGenerator { + range: 5..27, + elt: Starred( + ExprStarred { + range: 5..10, + value: Name( + ExprName { + range: 6..10, + id: "data", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 11..27, + target: Name( + ExprName { + range: 15..19, + id: "data", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 23..27, + id: "iter", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: false, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 29..43, + value: Call( + ExprCall { + range: 29..43, + func: Name( + ExprName { + range: 29..33, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 33..43, + args: [ + Starred( + ExprStarred { + range: 34..42, + value: Yield( + ExprYield { + range: 35..42, + value: Some( + Name( + ExprName { + range: 41..42, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 44..63, + value: Call( + ExprCall { + range: 44..63, + func: Name( + ExprName { + range: 44..48, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 48..63, + args: [ + Starred( + ExprStarred { + range: 49..62, + value: YieldFrom( + ExprYieldFrom { + range: 50..62, + value: Name( + ExprName { + range: 61..62, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | call(*data for data in iter) + | ^^^^^ Syntax Error: Iterable unpacking cannot be used in a comprehension +2 | call(*yield x) +3 | call(*yield from x) + | + + + | +1 | call(*data for data in iter) +2 | call(*yield x) + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | call(*yield from x) + | + + + | +1 | call(*data for data in iter) +2 | call(*yield x) +3 | call(*yield from x) + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__unclosed_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__unclosed_0.py.snap new file mode 100644 index 0000000000..263334f753 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__unclosed_0.py.snap @@ -0,0 +1,81 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..26, + body: [ + Expr( + StmtExpr { + range: 0..5, + value: Call( + ExprCall { + range: 0..5, + func: Name( + ExprName { + range: 0..4, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 4..5, + args: [], + keywords: [], + }, + }, + ), + }, + ), + FunctionDef( + StmtFunctionDef { + range: 7..26, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 11..14, + }, + type_params: None, + parameters: Parameters { + range: 14..16, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 22..26, + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | call( +2 | +3 | def foo(): + | ^^^ Syntax Error: Expected an expression or a ')' +4 | pass + | + + + | +3 | def foo(): +4 | pass + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__unclosed_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__unclosed_1.py.snap new file mode 100644 index 0000000000..e4e21a03bd --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__unclosed_1.py.snap @@ -0,0 +1,89 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..27, + body: [ + Expr( + StmtExpr { + range: 0..6, + value: Call( + ExprCall { + range: 0..6, + func: Name( + ExprName { + range: 0..4, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 4..6, + args: [ + Name( + ExprName { + range: 5..6, + id: "x", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + FunctionDef( + StmtFunctionDef { + range: 8..27, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 12..15, + }, + type_params: None, + parameters: Parameters { + range: 15..17, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 23..27, + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | call(x +2 | +3 | def foo(): + | ^^^ Syntax Error: Expected ',', found 'def' +4 | pass + | + + + | +3 | def foo(): +4 | pass + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__unclosed_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__unclosed_2.py.snap new file mode 100644 index 0000000000..f7ca1d97c7 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__unclosed_2.py.snap @@ -0,0 +1,89 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_2.py +--- +## AST + +``` +Module( + ModModule { + range: 0..28, + body: [ + Expr( + StmtExpr { + range: 0..7, + value: Call( + ExprCall { + range: 0..7, + func: Name( + ExprName { + range: 0..4, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 4..7, + args: [ + Name( + ExprName { + range: 5..6, + id: "x", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + FunctionDef( + StmtFunctionDef { + range: 9..28, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 13..16, + }, + type_params: None, + parameters: Parameters { + range: 16..18, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 24..28, + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | call(x, +2 | +3 | def foo(): + | ^^^ Syntax Error: Expected an expression or a ')' +4 | pass + | + + + | +3 | def foo(): +4 | pass + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__invalid_member.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__invalid_member.py.snap new file mode 100644 index 0000000000..346e2bebcc --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__invalid_member.py.snap @@ -0,0 +1,146 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/attribute/invalid_member.py +--- +## AST + +``` +Module( + ModModule { + range: 0..16, + body: [ + Expr( + StmtExpr { + range: 0..1, + value: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1..3, + value: NumberLiteral( + ExprNumberLiteral { + range: 1..3, + value: Float( + 0.1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 4..5, + value: Name( + ExprName { + range: 4..5, + id: "x", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5..7, + value: NumberLiteral( + ExprNumberLiteral { + range: 5..7, + value: Float( + 0.1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 7..9, + value: NumberLiteral( + ExprNumberLiteral { + range: 7..9, + value: Float( + 0.0, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 10..15, + value: Subscript( + ExprSubscript { + range: 10..15, + value: Attribute( + ExprAttribute { + range: 10..12, + value: Name( + ExprName { + range: 10..11, + id: "x", + ctx: Load, + }, + ), + attr: Identifier { + id: "", + range: 12..12, + }, + ctx: Load, + }, + ), + slice: NumberLiteral( + ExprNumberLiteral { + range: 13..14, + value: Int( + 0, + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x.1 + | ^^ Syntax Error: Simple statements must be separated by newlines or semicolons +2 | x.1.0 +3 | x.[0] + | + + + | +1 | x.1 +2 | x.1.0 + | ^^ Syntax Error: Simple statements must be separated by newlines or semicolons +3 | x.[0] + | + + + | +1 | x.1 +2 | x.1.0 + | ^^ Syntax Error: Simple statements must be separated by newlines or semicolons +3 | x.[0] + | + + + | +1 | x.1 +2 | x.1.0 +3 | x.[0] + | ^ Syntax Error: Expected an identifier + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__multiple_dots.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__multiple_dots.py.snap new file mode 100644 index 0000000000..269efc26dc --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__multiple_dots.py.snap @@ -0,0 +1,153 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/attribute/multiple_dots.py +--- +## AST + +``` +Module( + ModModule { + range: 0..46, + body: [ + Expr( + StmtExpr { + range: 0..10, + value: Attribute( + ExprAttribute { + range: 0..10, + value: Attribute( + ExprAttribute { + range: 0..6, + value: Name( + ExprName { + range: 0..5, + id: "extra", + ctx: Load, + }, + ), + attr: Identifier { + id: "", + range: 6..6, + }, + ctx: Load, + }, + ), + attr: Identifier { + id: "dot", + range: 7..10, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 11..19, + value: Name( + ExprName { + range: 11..19, + id: "multiple", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 19..27, + value: Attribute( + ExprAttribute { + range: 19..27, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 19..22, + }, + ), + attr: Identifier { + id: "dots", + range: 23..27, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 28..36, + value: Name( + ExprName { + range: 28..36, + id: "multiple", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 36..45, + value: Attribute( + ExprAttribute { + range: 36..45, + value: Attribute( + ExprAttribute { + range: 36..40, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 36..39, + }, + ), + attr: Identifier { + id: "", + range: 40..40, + }, + ctx: Load, + }, + ), + attr: Identifier { + id: "dots", + range: 41..45, + }, + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | extra..dot + | ^ Syntax Error: Expected an identifier +2 | multiple....dots +3 | multiple.....dots + | + + + | +1 | extra..dot +2 | multiple....dots + | ^^^ Syntax Error: Simple statements must be separated by newlines or semicolons +3 | multiple.....dots + | + + + | +1 | extra..dot +2 | multiple....dots +3 | multiple.....dots + | ^^^ Syntax Error: Simple statements must be separated by newlines or semicolons + | + + + | +1 | extra..dot +2 | multiple....dots +3 | multiple.....dots + | ^ Syntax Error: Expected an identifier + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__no_member.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__no_member.py.snap new file mode 100644 index 0000000000..e7f213367f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__no_member.py.snap @@ -0,0 +1,88 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/attribute/no_member.py +--- +## AST + +``` +Module( + ModModule { + range: 0..141, + body: [ + Expr( + StmtExpr { + range: 87..93, + value: Attribute( + ExprAttribute { + range: 87..93, + value: Name( + ExprName { + range: 87..92, + id: "first", + ctx: Load, + }, + ), + attr: Identifier { + id: "", + range: 93..93, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 94..100, + value: Name( + ExprName { + range: 94..100, + id: "second", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 136..141, + value: Attribute( + ExprAttribute { + range: 136..141, + value: Name( + ExprName { + range: 136..140, + id: "last", + ctx: Load, + }, + ), + attr: Identifier { + id: "", + range: 141..141, + }, + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # The `second` is a variable on another line and not part of the attribute expression. +2 | first. + | ^ Syntax Error: Expected an identifier +3 | second +4 | +5 | # No member access after the dot. + | + + + | +5 | # No member access after the dot. +6 | last. + | Syntax Error: Expected an identifier + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__await__no_expression_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__await__no_expression_0.py.snap new file mode 100644 index 0000000000..31b383038a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__await__no_expression_0.py.snap @@ -0,0 +1,66 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/await/no_expression_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..73, + body: [ + Expr( + StmtExpr { + range: 61..66, + value: Await( + ExprAwait { + range: 61..66, + value: Name( + ExprName { + range: 66..66, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 68..73, + value: BinOp( + ExprBinOp { + range: 68..73, + left: Name( + ExprName { + range: 68..69, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 72..73, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # No expression after `await`, an expression on another line +2 | await + | ^ Syntax Error: Expected an expression +3 | +4 | x + y + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__await__no_expression_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__await__no_expression_1.py.snap new file mode 100644 index 0000000000..54bda08076 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__await__no_expression_1.py.snap @@ -0,0 +1,70 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/await/no_expression_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..85, + body: [ + Expr( + StmtExpr { + range: 59..64, + value: Await( + ExprAwait { + range: 59..64, + value: Name( + ExprName { + range: 64..64, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + FunctionDef( + StmtFunctionDef { + range: 66..85, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 70..73, + }, + type_params: None, + parameters: Parameters { + range: 73..75, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 81..85, + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # No expression after `await`, a statement on another line +2 | await + | ^ Syntax Error: Expected an expression +3 | +4 | def foo(): +5 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__await__recover.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__await__recover.py.snap new file mode 100644 index 0000000000..416c0b1ddd --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__await__recover.py.snap @@ -0,0 +1,327 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/await/recover.py +--- +## AST + +``` +Module( + ModModule { + range: 0..284, + body: [ + Expr( + StmtExpr { + range: 117..130, + value: Await( + ExprAwait { + range: 117..130, + value: Await( + ExprAwait { + range: 123..130, + value: Name( + ExprName { + range: 129..130, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 154..162, + value: Await( + ExprAwait { + range: 154..162, + value: Starred( + ExprStarred { + range: 160..162, + value: Name( + ExprName { + range: 161..162, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 163..173, + value: Await( + ExprAwait { + range: 163..173, + value: Starred( + ExprStarred { + range: 170..172, + value: Name( + ExprName { + range: 171..172, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 214..227, + value: Await( + ExprAwait { + range: 214..227, + value: Yield( + ExprYield { + range: 220..227, + value: Some( + Name( + ExprName { + range: 226..227, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 228..245, + value: Await( + ExprAwait { + range: 228..245, + value: Lambda( + ExprLambda { + range: 234..245, + parameters: Some( + Parameters { + range: 241..242, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 241..242, + parameter: Parameter { + range: 241..242, + name: Identifier { + id: "x", + range: 241..242, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 244..245, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 246..254, + value: Await( + ExprAwait { + range: 246..254, + value: UnaryOp( + ExprUnaryOp { + range: 252..254, + op: UAdd, + operand: Name( + ExprName { + range: 253..254, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 255..263, + value: Await( + ExprAwait { + range: 255..263, + value: UnaryOp( + ExprUnaryOp { + range: 261..263, + op: USub, + operand: Name( + ExprName { + range: 262..263, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 264..272, + value: Await( + ExprAwait { + range: 264..272, + value: UnaryOp( + ExprUnaryOp { + range: 270..272, + op: Invert, + operand: Name( + ExprName { + range: 271..272, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 273..284, + value: Await( + ExprAwait { + range: 273..284, + value: UnaryOp( + ExprUnaryOp { + range: 279..284, + op: Not, + operand: Name( + ExprName { + range: 283..284, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +4 | # Nested await +5 | await await x + | ^^^^^^^ Syntax Error: Await expression cannot be used here +6 | +7 | # Starred expressions + | + + + | +7 | # Starred expressions +8 | await *x + | ^^ Syntax Error: Starred expression cannot be used here +9 | await (*x) + | + + + | + 7 | # Starred expressions + 8 | await *x + 9 | await (*x) + | ^^ Syntax Error: Starred expression cannot be used here +10 | +11 | # Invalid expression as per precedence + | + + + | +11 | # Invalid expression as per precedence +12 | await yield x + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +13 | await lambda x: x +14 | await +x + | + + + | +11 | # Invalid expression as per precedence +12 | await yield x +13 | await lambda x: x + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +14 | await +x +15 | await -x + | + + + | +12 | await yield x +13 | await lambda x: x +14 | await +x + | ^^ Syntax Error: Unary '+' expression cannot be used here +15 | await -x +16 | await ~x + | + + + | +13 | await lambda x: x +14 | await +x +15 | await -x + | ^^ Syntax Error: Unary '-' expression cannot be used here +16 | await ~x +17 | await not x + | + + + | +14 | await +x +15 | await -x +16 | await ~x + | ^^ Syntax Error: Unary '~' expression cannot be used here +17 | await not x + | + + + | +15 | await -x +16 | await ~x +17 | await not x + | ^^^^^ Syntax Error: Boolean 'not' expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__invalid_rhs_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__invalid_rhs_expression.py.snap new file mode 100644 index 0000000000..cd588a4f70 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__invalid_rhs_expression.py.snap @@ -0,0 +1,116 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/bin_op/invalid_rhs_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..28, + body: [ + Expr( + StmtExpr { + range: 0..15, + value: BinOp( + ExprBinOp { + range: 0..15, + left: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Lambda( + ExprLambda { + range: 4..15, + parameters: Some( + Parameters { + range: 11..12, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 11..12, + parameter: Parameter { + range: 11..12, + name: Identifier { + id: "y", + range: 11..12, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 14..15, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 17..28, + value: BinOp( + ExprBinOp { + range: 17..28, + left: Name( + ExprName { + range: 17..18, + id: "x", + ctx: Load, + }, + ), + op: Sub, + right: Yield( + ExprYield { + range: 21..28, + value: Some( + Name( + ExprName { + range: 27..28, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x + lambda y: y + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +2 | +3 | x - yield y + | + + + | +1 | x + lambda y: y +2 | +3 | x - yield y + | ^^^^^^^ Syntax Error: Yield expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__missing_lhs.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__missing_lhs.py.snap new file mode 100644 index 0000000000..605a1de371 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__missing_lhs.py.snap @@ -0,0 +1,62 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/bin_op/missing_lhs.py +--- +## AST + +``` +Module( + ModModule { + range: 0..10, + body: [ + Expr( + StmtExpr { + range: 2..3, + value: Name( + ExprName { + range: 2..3, + id: "y", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5..10, + value: BinOp( + ExprBinOp { + range: 5..10, + left: NumberLiteral( + ExprNumberLiteral { + range: 5..6, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 9..10, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | / y + | ^ Syntax Error: Expected a statement +2 | +3 | 1 + 2 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__missing_rhs_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__missing_rhs_0.py.snap new file mode 100644 index 0000000000..4b265c72ba --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__missing_rhs_0.py.snap @@ -0,0 +1,76 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/bin_op/missing_rhs_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..10, + body: [ + Expr( + StmtExpr { + range: 0..3, + value: BinOp( + ExprBinOp { + range: 0..3, + left: NumberLiteral( + ExprNumberLiteral { + range: 0..1, + value: Int( + 0, + ), + }, + ), + op: Add, + right: Name( + ExprName { + range: 3..3, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5..10, + value: BinOp( + ExprBinOp { + range: 5..10, + left: NumberLiteral( + ExprNumberLiteral { + range: 5..6, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 9..10, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | 0 + + | ^ Syntax Error: Expected an expression +2 | +3 | 1 + 2 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__missing_rhs_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__missing_rhs_1.py.snap new file mode 100644 index 0000000000..aff9c7fff9 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__missing_rhs_1.py.snap @@ -0,0 +1,104 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/bin_op/missing_rhs_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..18, + body: [ + Expr( + StmtExpr { + range: 0..11, + value: BinOp( + ExprBinOp { + range: 0..11, + left: BinOp( + ExprBinOp { + range: 0..5, + left: NumberLiteral( + ExprNumberLiteral { + range: 0..1, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 4..5, + value: Int( + 2, + ), + }, + ), + }, + ), + op: Sub, + right: BinOp( + ExprBinOp { + range: 8..11, + left: NumberLiteral( + ExprNumberLiteral { + range: 8..9, + value: Int( + 3, + ), + }, + ), + op: Mult, + right: Name( + ExprName { + range: 11..11, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 13..18, + value: BinOp( + ExprBinOp { + range: 13..18, + left: NumberLiteral( + ExprNumberLiteral { + range: 13..14, + value: Int( + 4, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 17..18, + value: Int( + 5, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | 1 + 2 - 3 * + | ^ Syntax Error: Expected an expression +2 | +3 | 4 + 5 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__multiple_ops.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__multiple_ops.py.snap new file mode 100644 index 0000000000..d1e939fd39 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__multiple_ops.py.snap @@ -0,0 +1,149 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/bin_op/multiple_ops.py +--- +## AST + +``` +Module( + ModModule { + range: 0..19, + body: [ + Expr( + StmtExpr { + range: 0..3, + value: BinOp( + ExprBinOp { + range: 0..3, + left: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: UnaryOp( + ExprUnaryOp { + range: 2..3, + op: UAdd, + operand: Name( + ExprName { + range: 3..3, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 4..9, + value: BinOp( + ExprBinOp { + range: 4..9, + left: NumberLiteral( + ExprNumberLiteral { + range: 4..5, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 8..9, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 10..13, + value: BinOp( + ExprBinOp { + range: 10..13, + left: Name( + ExprName { + range: 10..11, + id: "x", + ctx: Load, + }, + ), + op: Sub, + right: UnaryOp( + ExprUnaryOp { + range: 12..13, + op: USub, + operand: Name( + ExprName { + range: 13..13, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 14..19, + value: BinOp( + ExprBinOp { + range: 14..19, + left: NumberLiteral( + ExprNumberLiteral { + range: 14..15, + value: Int( + 1, + ), + }, + ), + op: Sub, + right: NumberLiteral( + ExprNumberLiteral { + range: 18..19, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x++ + | ^ Syntax Error: Expected an expression +2 | 1 + 2 +3 | x-- +4 | 1 - 2 + | + + + | +1 | x++ +2 | 1 + 2 +3 | x-- + | ^ Syntax Error: Expected an expression +4 | 1 - 2 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__named_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__named_expression.py.snap new file mode 100644 index 0000000000..b14cee55b8 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__named_expression.py.snap @@ -0,0 +1,122 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/bin_op/named_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..26, + body: [ + Expr( + StmtExpr { + range: 0..5, + value: BinOp( + ExprBinOp { + range: 0..5, + left: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + op: Sub, + right: Name( + ExprName { + range: 4..5, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 9..15, + value: Tuple( + ExprTuple { + range: 9..15, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 10..11, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 13..14, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 16..21, + value: BinOp( + ExprBinOp { + range: 16..21, + left: Name( + ExprName { + range: 16..17, + id: "x", + ctx: Load, + }, + ), + op: Div, + right: Name( + ExprName { + range: 20..21, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 25..26, + value: NumberLiteral( + ExprNumberLiteral { + range: 25..26, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x - y := (1, 2) + | ^^ Syntax Error: Expected a statement +2 | x / y := 2 + | + + + | +1 | x - y := (1, 2) +2 | x / y := 2 + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__starred_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__starred_expression.py.snap new file mode 100644 index 0000000000..477d4cac07 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__starred_expression.py.snap @@ -0,0 +1,91 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/bin_op/starred_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..14, + body: [ + Expr( + StmtExpr { + range: 0..6, + value: BinOp( + ExprBinOp { + range: 0..6, + left: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Starred( + ExprStarred { + range: 4..6, + value: Name( + ExprName { + range: 5..6, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 7..14, + value: BinOp( + ExprBinOp { + range: 7..14, + left: Name( + ExprName { + range: 7..8, + id: "x", + ctx: Load, + }, + ), + op: Pow, + right: Starred( + ExprStarred { + range: 12..14, + value: Name( + ExprName { + range: 13..14, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x + *y + | ^^ Syntax Error: Starred expression cannot be used here +2 | x ** *y + | + + + | +1 | x + *y +2 | x ** *y + | ^^ Syntax Error: Starred expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__invalid_rhs_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__invalid_rhs_expression.py.snap new file mode 100644 index 0000000000..a7b60a2d3a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__invalid_rhs_expression.py.snap @@ -0,0 +1,120 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/bool_op/invalid_rhs_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..31, + body: [ + Expr( + StmtExpr { + range: 0..17, + value: BoolOp( + ExprBoolOp { + range: 0..17, + op: And, + values: [ + Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + Lambda( + ExprLambda { + range: 6..17, + parameters: Some( + Parameters { + range: 13..14, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 13..14, + parameter: Parameter { + range: 13..14, + name: Identifier { + id: "y", + range: 13..14, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 16..17, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 19..31, + value: BoolOp( + ExprBoolOp { + range: 19..31, + op: Or, + values: [ + Name( + ExprName { + range: 19..20, + id: "x", + ctx: Load, + }, + ), + Yield( + ExprYield { + range: 24..31, + value: Some( + Name( + ExprName { + range: 30..31, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x and lambda y: y + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +2 | +3 | x or yield y + | + + + | +1 | x and lambda y: y +2 | +3 | x or yield y + | ^^^^^^^ Syntax Error: Yield expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__missing_lhs.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__missing_lhs.py.snap new file mode 100644 index 0000000000..6441ac2035 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__missing_lhs.py.snap @@ -0,0 +1,33 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/bool_op/missing_lhs.py +--- +## AST + +``` +Module( + ModModule { + range: 0..5, + body: [ + Expr( + StmtExpr { + range: 4..5, + value: Name( + ExprName { + range: 4..5, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | and y + | ^^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__missing_rhs.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__missing_rhs.py.snap new file mode 100644 index 0000000000..a954ccf5c6 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__missing_rhs.py.snap @@ -0,0 +1,77 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/bool_op/missing_rhs.py +--- +## AST + +``` +Module( + ModModule { + range: 0..12, + body: [ + Expr( + StmtExpr { + range: 0..5, + value: BoolOp( + ExprBoolOp { + range: 0..5, + op: And, + values: [ + Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 5..5, + id: "", + ctx: Invalid, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 7..12, + value: BinOp( + ExprBinOp { + range: 7..12, + left: NumberLiteral( + ExprNumberLiteral { + range: 7..8, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 11..12, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x and + | ^ Syntax Error: Expected an expression +2 | +3 | 1 + 2 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__named_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__named_expression.py.snap new file mode 100644 index 0000000000..55689d68df --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__named_expression.py.snap @@ -0,0 +1,107 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/bool_op/named_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..24, + body: [ + Expr( + StmtExpr { + range: 0..7, + value: BoolOp( + ExprBoolOp { + range: 0..7, + op: And, + values: [ + Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 6..7, + id: "a", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 11..12, + value: Name( + ExprName { + range: 11..12, + id: "b", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 13..19, + value: BoolOp( + ExprBoolOp { + range: 13..19, + op: Or, + values: [ + Name( + ExprName { + range: 13..14, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 18..19, + id: "a", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 23..24, + value: Name( + ExprName { + range: 23..24, + id: "b", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x and a := b + | ^^ Syntax Error: Expected a statement +2 | x or a := b + | + + + | +1 | x and a := b +2 | x or a := b + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__starred_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__starred_expression.py.snap new file mode 100644 index 0000000000..7883b05480 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__starred_expression.py.snap @@ -0,0 +1,95 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/bool_op/starred_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..16, + body: [ + Expr( + StmtExpr { + range: 0..8, + value: BoolOp( + ExprBoolOp { + range: 0..8, + op: And, + values: [ + Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 6..8, + value: Name( + ExprName { + range: 7..8, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 9..16, + value: BoolOp( + ExprBoolOp { + range: 9..16, + op: Or, + values: [ + Name( + ExprName { + range: 9..10, + id: "x", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 14..16, + value: Name( + ExprName { + range: 15..16, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x and *y + | ^^ Syntax Error: Starred expression cannot be used here +2 | x or *y + | + + + | +1 | x and *y +2 | x or *y + | ^^ Syntax Error: Starred expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_order.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_order.py.snap new file mode 100644 index 0000000000..cebbe6465c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_order.py.snap @@ -0,0 +1,168 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/compare/invalid_order.py +--- +## AST + +``` +Module( + ModModule { + range: 0..131, + body: [ + Expr( + StmtExpr { + range: 0..10, + value: Compare( + ExprCompare { + range: 0..10, + left: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + UnaryOp( + ExprUnaryOp { + range: 5..10, + op: Not, + operand: Name( + ExprName { + range: 9..10, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + }, + ), + Assign( + StmtAssign { + range: 35..41, + targets: [ + Name( + ExprName { + range: 35..36, + id: "x", + ctx: Store, + }, + ), + ], + value: Compare( + ExprCompare { + range: 38..41, + left: Name( + ExprName { + range: 38..38, + id: "", + ctx: Invalid, + }, + ), + ops: [ + Gt, + ], + comparators: [ + Name( + ExprName { + range: 40..41, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 120..121, + value: Name( + ExprName { + range: 120..121, + id: "x", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 122..128, + value: UnaryOp( + ExprUnaryOp { + range: 122..128, + op: Not, + operand: Name( + ExprName { + range: 126..128, + id: "is", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 129..130, + value: Name( + ExprName { + range: 129..130, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x in not y + | ^^^^^ Syntax Error: Boolean 'not' expression cannot be used here +2 | +3 | # `=>` instead of `>=` + | + + + | +3 | # `=>` instead of `>=` +4 | x => y + | ^ Syntax Error: Expected an expression +5 | +6 | # Same here as well, `not` without `in` is considered to be a unary operator + | + + + | +6 | # Same here as well, `not` without `in` is considered to be a unary operator +7 | x not is y + | ^^^ Syntax Error: Simple statements must be separated by newlines or semicolons + | + + + | +6 | # Same here as well, `not` without `in` is considered to be a unary operator +7 | x not is y + | ^^ Syntax Error: Expected an identifier, but found a keyword 'is' that cannot be used here + | + + + | +6 | # Same here as well, `not` without `in` is considered to be a unary operator +7 | x not is y + | ^ Syntax Error: Simple statements must be separated by newlines or semicolons + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_rhs_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_rhs_expression.py.snap new file mode 100644 index 0000000000..401865d059 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_rhs_expression.py.snap @@ -0,0 +1,124 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/compare/invalid_rhs_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..34, + body: [ + Expr( + StmtExpr { + range: 0..20, + value: Compare( + ExprCompare { + range: 0..20, + left: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + ops: [ + NotIn, + ], + comparators: [ + Lambda( + ExprLambda { + range: 9..20, + parameters: Some( + Parameters { + range: 16..17, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 16..17, + parameter: Parameter { + range: 16..17, + name: Identifier { + id: "y", + range: 16..17, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 19..20, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 22..34, + value: Compare( + ExprCompare { + range: 22..34, + left: Name( + ExprName { + range: 22..23, + id: "x", + ctx: Load, + }, + ), + ops: [ + Eq, + ], + comparators: [ + Yield( + ExprYield { + range: 27..34, + value: Some( + Name( + ExprName { + range: 33..34, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x not in lambda y: y + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +2 | +3 | x == yield y + | + + + | +1 | x not in lambda y: y +2 | +3 | x == yield y + | ^^^^^^^ Syntax Error: Yield expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__missing_lhs.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__missing_lhs.py.snap new file mode 100644 index 0000000000..31007185b9 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__missing_lhs.py.snap @@ -0,0 +1,62 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/compare/missing_lhs.py +--- +## AST + +``` +Module( + ModModule { + range: 0..10, + body: [ + Expr( + StmtExpr { + range: 2..3, + value: Name( + ExprName { + range: 2..3, + id: "y", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5..10, + value: BinOp( + ExprBinOp { + range: 5..10, + left: NumberLiteral( + ExprNumberLiteral { + range: 5..6, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 9..10, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | > y + | ^ Syntax Error: Expected a statement +2 | +3 | 1 + 2 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__missing_rhs_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__missing_rhs_0.py.snap new file mode 100644 index 0000000000..30a6f6402c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__missing_rhs_0.py.snap @@ -0,0 +1,79 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/compare/missing_rhs_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..10, + body: [ + Expr( + StmtExpr { + range: 0..3, + value: Compare( + ExprCompare { + range: 0..3, + left: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + ops: [ + Gt, + ], + comparators: [ + Name( + ExprName { + range: 3..3, + id: "", + ctx: Invalid, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5..10, + value: BinOp( + ExprBinOp { + range: 5..10, + left: NumberLiteral( + ExprNumberLiteral { + range: 5..6, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 9..10, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x > + | ^ Syntax Error: Expected an expression +2 | +3 | 1 + 2 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__missing_rhs_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__missing_rhs_1.py.snap new file mode 100644 index 0000000000..8a9bf572ac --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__missing_rhs_1.py.snap @@ -0,0 +1,90 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/compare/missing_rhs_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..71, + body: [ + Expr( + StmtExpr { + range: 59..60, + value: Name( + ExprName { + range: 59..60, + id: "x", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 61..64, + value: UnaryOp( + ExprUnaryOp { + range: 61..64, + op: Not, + operand: Name( + ExprName { + range: 64..64, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 66..71, + value: BinOp( + ExprBinOp { + range: 66..71, + left: NumberLiteral( + ExprNumberLiteral { + range: 66..67, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 70..71, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Without the `in`, this is considered to be a unary `not` +2 | x not + | ^^^ Syntax Error: Simple statements must be separated by newlines or semicolons +3 | +4 | 1 + 2 + | + + + | +1 | # Without the `in`, this is considered to be a unary `not` +2 | x not + | ^ Syntax Error: Expected an expression +3 | +4 | 1 + 2 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__missing_rhs_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__missing_rhs_2.py.snap new file mode 100644 index 0000000000..741fd3d2b0 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__missing_rhs_2.py.snap @@ -0,0 +1,79 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/compare/missing_rhs_2.py +--- +## AST + +``` +Module( + ModModule { + range: 0..15, + body: [ + Expr( + StmtExpr { + range: 0..8, + value: Compare( + ExprCompare { + range: 0..8, + left: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + ops: [ + IsNot, + ], + comparators: [ + Name( + ExprName { + range: 8..8, + id: "", + ctx: Invalid, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 10..15, + value: BinOp( + ExprBinOp { + range: 10..15, + left: NumberLiteral( + ExprNumberLiteral { + range: 10..11, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 14..15, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x is not + | ^ Syntax Error: Expected an expression +2 | +3 | 1 + 2 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__multiple_equals.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__multiple_equals.py.snap new file mode 100644 index 0000000000..344a3aa2cf --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__multiple_equals.py.snap @@ -0,0 +1,123 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/compare/multiple_equals.py +--- +## AST + +``` +Module( + ModModule { + range: 0..41, + body: [ + Assign( + StmtAssign { + range: 25..32, + targets: [ + Compare( + ExprCompare { + range: 25..29, + left: Name( + ExprName { + range: 25..26, + id: "x", + ctx: Load, + }, + ), + ops: [ + Eq, + ], + comparators: [ + Name( + ExprName { + range: 29..29, + id: "", + ctx: Invalid, + }, + ), + ], + }, + ), + ], + value: Name( + ExprName { + range: 31..32, + id: "y", + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 33..40, + targets: [ + Compare( + ExprCompare { + range: 33..37, + left: Name( + ExprName { + range: 33..34, + id: "x", + ctx: Load, + }, + ), + ops: [ + NotEq, + ], + comparators: [ + Name( + ExprName { + range: 37..37, + id: "", + ctx: Invalid, + }, + ), + ], + }, + ), + ], + value: Name( + ExprName { + range: 39..40, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # This is not JavaScript +2 | x === y + | ^ Syntax Error: Expected an expression +3 | x !== y + | + + + | +1 | # This is not JavaScript +2 | x === y + | ^^^^ Syntax Error: Invalid assignment target +3 | x !== y + | + + + | +1 | # This is not JavaScript +2 | x === y +3 | x !== y + | ^ Syntax Error: Expected an expression + | + + + | +1 | # This is not JavaScript +2 | x === y +3 | x !== y + | ^^^^ Syntax Error: Invalid assignment target + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__named_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__named_expression.py.snap new file mode 100644 index 0000000000..923f382143 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__named_expression.py.snap @@ -0,0 +1,130 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/compare/named_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..31, + body: [ + Expr( + StmtExpr { + range: 0..10, + value: Compare( + ExprCompare { + range: 0..10, + left: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + ops: [ + NotIn, + ], + comparators: [ + Name( + ExprName { + range: 9..10, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 14..20, + value: Tuple( + ExprTuple { + range: 14..20, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 15..16, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 18..19, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 21..26, + value: Compare( + ExprCompare { + range: 21..26, + left: Name( + ExprName { + range: 21..22, + id: "x", + ctx: Load, + }, + ), + ops: [ + Gt, + ], + comparators: [ + Name( + ExprName { + range: 25..26, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 30..31, + value: NumberLiteral( + ExprNumberLiteral { + range: 30..31, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x not in y := (1, 2) + | ^^ Syntax Error: Expected a statement +2 | x > y := 2 + | + + + | +1 | x not in y := (1, 2) +2 | x > y := 2 + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__starred_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__starred_expression.py.snap new file mode 100644 index 0000000000..cd1ab62b32 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__starred_expression.py.snap @@ -0,0 +1,187 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/compare/starred_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..39, + body: [ + Expr( + StmtExpr { + range: 0..7, + value: Compare( + ExprCompare { + range: 0..7, + left: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + ops: [ + GtE, + ], + comparators: [ + Starred( + ExprStarred { + range: 5..7, + value: Name( + ExprName { + range: 6..7, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 8..19, + value: Compare( + ExprCompare { + range: 8..19, + left: Name( + ExprName { + range: 8..9, + id: "x", + ctx: Load, + }, + ), + ops: [ + NotIn, + ], + comparators: [ + Starred( + ExprStarred { + range: 17..19, + value: Name( + ExprName { + range: 18..19, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 21..27, + value: Starred( + ExprStarred { + range: 21..27, + value: Compare( + ExprCompare { + range: 22..27, + left: Name( + ExprName { + range: 22..23, + id: "x", + ctx: Load, + }, + ), + ops: [ + Lt, + ], + comparators: [ + Name( + ExprName { + range: 26..27, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 28..39, + value: Starred( + ExprStarred { + range: 28..39, + value: Compare( + ExprCompare { + range: 29..39, + left: Name( + ExprName { + range: 29..30, + id: "x", + ctx: Load, + }, + ), + ops: [ + IsNot, + ], + comparators: [ + Name( + ExprName { + range: 38..39, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x >= *y + | ^^ Syntax Error: Starred expression cannot be used here +2 | x not in *y + | + + + | +1 | x >= *y +2 | x not in *y + | ^^ Syntax Error: Starred expression cannot be used here +3 | +4 | *x < y + | + + + | +2 | x not in *y +3 | +4 | *x < y + | ^^^^^ Syntax Error: Comparison expression cannot be used here +5 | *x is not y + | + + + | +4 | *x < y +5 | *x is not y + | ^^^^^^^^^^ Syntax Error: Comparison expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__comprehension.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__comprehension.py.snap new file mode 100644 index 0000000000..d99635f56a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__comprehension.py.snap @@ -0,0 +1,827 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/comprehension.py +--- +## AST + +``` +Module( + ModModule { + range: 0..362, + body: [ + Expr( + StmtExpr { + range: 17..34, + value: DictComp( + ExprDictComp { + range: 17..34, + key: Name( + ExprName { + range: 18..19, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 21..22, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 23..33, + target: NumberLiteral( + ExprNumberLiteral { + range: 27..28, + value: Int( + 1, + ), + }, + ), + iter: Name( + ExprName { + range: 32..33, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 35..54, + value: DictComp( + ExprDictComp { + range: 35..54, + key: Name( + ExprName { + range: 36..37, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 39..40, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 41..53, + target: StringLiteral( + ExprStringLiteral { + range: 45..48, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 45..48, + value: "a", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + iter: Name( + ExprName { + range: 52..53, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 55..77, + value: DictComp( + ExprDictComp { + range: 55..77, + key: Name( + ExprName { + range: 56..57, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 59..60, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 61..76, + target: Call( + ExprCall { + range: 65..71, + func: Name( + ExprName { + range: 65..69, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 69..71, + args: [], + keywords: [], + }, + }, + ), + iter: Name( + ExprName { + range: 75..76, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 78..100, + value: DictComp( + ExprDictComp { + range: 78..100, + key: Name( + ExprName { + range: 79..80, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 82..83, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 84..99, + target: Set( + ExprSet { + range: 88..94, + elts: [ + Name( + ExprName { + range: 89..90, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 92..93, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + iter: Name( + ExprName { + range: 98..99, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 117..135, + value: DictComp( + ExprDictComp { + range: 117..135, + key: Name( + ExprName { + range: 118..119, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 121..122, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 123..134, + target: Name( + ExprName { + range: 127..128, + id: "x", + ctx: Store, + }, + ), + iter: Starred( + ExprStarred { + range: 132..134, + value: Name( + ExprName { + range: 133..134, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 136..159, + value: DictComp( + ExprDictComp { + range: 136..159, + key: Name( + ExprName { + range: 137..138, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 140..141, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 142..158, + target: Name( + ExprName { + range: 146..147, + id: "x", + ctx: Store, + }, + ), + iter: Yield( + ExprYield { + range: 151..158, + value: Some( + Name( + ExprName { + range: 157..158, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 160..188, + value: DictComp( + ExprDictComp { + range: 160..188, + key: Name( + ExprName { + range: 161..162, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 164..165, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 166..187, + target: Name( + ExprName { + range: 170..171, + id: "x", + ctx: Store, + }, + ), + iter: YieldFrom( + ExprYieldFrom { + range: 175..187, + value: Name( + ExprName { + range: 186..187, + id: "y", + ctx: Load, + }, + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 189..216, + value: DictComp( + ExprDictComp { + range: 189..216, + key: Name( + ExprName { + range: 190..191, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 193..194, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 195..215, + target: Name( + ExprName { + range: 199..200, + id: "x", + ctx: Store, + }, + ), + iter: Lambda( + ExprLambda { + range: 204..215, + parameters: Some( + Parameters { + range: 211..212, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 211..212, + parameter: Parameter { + range: 211..212, + name: Identifier { + id: "y", + range: 211..212, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 214..215, + id: "y", + ctx: Load, + }, + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 231..257, + value: DictComp( + ExprDictComp { + range: 231..257, + key: Name( + ExprName { + range: 232..233, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 235..236, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 237..256, + target: Name( + ExprName { + range: 241..242, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 246..250, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Starred( + ExprStarred { + range: 254..256, + value: Name( + ExprName { + range: 255..256, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 258..289, + value: DictComp( + ExprDictComp { + range: 258..289, + key: Name( + ExprName { + range: 259..260, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 262..263, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 264..288, + target: Name( + ExprName { + range: 268..269, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 273..277, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Yield( + ExprYield { + range: 281..288, + value: Some( + Name( + ExprName { + range: 287..288, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 290..326, + value: DictComp( + ExprDictComp { + range: 290..326, + key: Name( + ExprName { + range: 291..292, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 294..295, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 296..325, + target: Name( + ExprName { + range: 300..301, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 305..309, + id: "data", + ctx: Load, + }, + ), + ifs: [ + YieldFrom( + ExprYieldFrom { + range: 313..325, + value: Name( + ExprName { + range: 324..325, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 327..362, + value: DictComp( + ExprDictComp { + range: 327..362, + key: Name( + ExprName { + range: 328..329, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 331..332, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 333..361, + target: Name( + ExprName { + range: 337..338, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 342..346, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Lambda( + ExprLambda { + range: 350..361, + parameters: Some( + Parameters { + range: 357..358, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 357..358, + parameter: Parameter { + range: 357..358, + name: Identifier { + id: "y", + range: 357..358, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 360..361, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Invalid target +2 | {x: y for 1 in y} + | ^ Syntax Error: Invalid assignment target +3 | {x: y for 'a' in y} +4 | {x: y for call() in y} + | + + + | +1 | # Invalid target +2 | {x: y for 1 in y} +3 | {x: y for 'a' in y} + | ^^^ Syntax Error: Invalid assignment target +4 | {x: y for call() in y} +5 | {x: y for {a, b} in y} + | + + + | +2 | {x: y for 1 in y} +3 | {x: y for 'a' in y} +4 | {x: y for call() in y} + | ^^^^^^ Syntax Error: Invalid assignment target +5 | {x: y for {a, b} in y} + | + + + | +3 | {x: y for 'a' in y} +4 | {x: y for call() in y} +5 | {x: y for {a, b} in y} + | ^^^^^^ Syntax Error: Invalid assignment target +6 | +7 | # Invalid iter + | + + + | + 7 | # Invalid iter + 8 | {x: y for x in *y} + | ^^ Syntax Error: Starred expression cannot be used here + 9 | {x: y for x in yield y} +10 | {x: y for x in yield from y} + | + + + | + 7 | # Invalid iter + 8 | {x: y for x in *y} + 9 | {x: y for x in yield y} + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +10 | {x: y for x in yield from y} +11 | {x: y for x in lambda y: y} + | + + + | + 8 | {x: y for x in *y} + 9 | {x: y for x in yield y} +10 | {x: y for x in yield from y} + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +11 | {x: y for x in lambda y: y} + | + + + | + 9 | {x: y for x in yield y} +10 | {x: y for x in yield from y} +11 | {x: y for x in lambda y: y} + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +12 | +13 | # Invalid if + | + + + | +13 | # Invalid if +14 | {x: y for x in data if *y} + | ^^ Syntax Error: Starred expression cannot be used here +15 | {x: y for x in data if yield y} +16 | {x: y for x in data if yield from y} + | + + + | +13 | # Invalid if +14 | {x: y for x in data if *y} +15 | {x: y for x in data if yield y} + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +16 | {x: y for x in data if yield from y} +17 | {x: y for x in data if lambda y: y} + | + + + | +14 | {x: y for x in data if *y} +15 | {x: y for x in data if yield y} +16 | {x: y for x in data if yield from y} + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +17 | {x: y for x in data if lambda y: y} + | + + + | +15 | {x: y for x in data if yield y} +16 | {x: y for x in data if yield from y} +17 | {x: y for x in data if lambda y: y} + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__double_star.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__double_star.py.snap new file mode 100644 index 0000000000..0919f80d12 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__double_star.py.snap @@ -0,0 +1,561 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/double_star.py +--- +## AST + +``` +Module( + ModModule { + range: 0..278, + body: [ + Expr( + StmtExpr { + range: 125..135, + value: Dict( + ExprDict { + range: 125..135, + keys: [ + None, + Some( + NumberLiteral( + ExprNumberLiteral { + range: 133..134, + value: Int( + 1, + ), + }, + ), + ), + ], + values: [ + Name( + ExprName { + range: 128..129, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 134..134, + id: "", + ctx: Invalid, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 136..162, + value: Dict( + ExprDict { + range: 136..162, + keys: [ + Some( + Name( + ExprName { + range: 137..138, + id: "a", + ctx: Load, + }, + ), + ), + None, + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 140..141, + value: Int( + 1, + ), + }, + ), + If( + ExprIf { + range: 145..161, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 150..154, + value: true, + }, + ), + body: Name( + ExprName { + range: 145..146, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 160..161, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 163..184, + value: Dict( + ExprDict { + range: 163..184, + keys: [ + None, + Some( + Name( + ExprName { + range: 179..180, + id: "b", + ctx: Load, + }, + ), + ), + ], + values: [ + Lambda( + ExprLambda { + range: 166..177, + parameters: Some( + Parameters { + range: 173..174, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 173..174, + parameter: Parameter { + range: 173..174, + name: Identifier { + id: "x", + range: 173..174, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 176..177, + id: "x", + ctx: Load, + }, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 182..183, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 185..201, + value: Dict( + ExprDict { + range: 185..201, + keys: [ + Some( + Name( + ExprName { + range: 186..187, + id: "a", + ctx: Load, + }, + ), + ), + None, + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 189..190, + value: Int( + 1, + ), + }, + ), + BoolOp( + ExprBoolOp { + range: 194..200, + op: Or, + values: [ + Name( + ExprName { + range: 194..195, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 199..200, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 202..219, + value: Dict( + ExprDict { + range: 202..219, + keys: [ + None, + Some( + Name( + ExprName { + range: 214..215, + id: "b", + ctx: Load, + }, + ), + ), + ], + values: [ + BoolOp( + ExprBoolOp { + range: 205..212, + op: And, + values: [ + Name( + ExprName { + range: 205..206, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 211..212, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 217..218, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 220..241, + value: Dict( + ExprDict { + range: 220..241, + keys: [ + Some( + Name( + ExprName { + range: 221..222, + id: "a", + ctx: Load, + }, + ), + ), + None, + Some( + Name( + ExprName { + range: 236..237, + id: "b", + ctx: Load, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 224..225, + value: Int( + 1, + ), + }, + ), + UnaryOp( + ExprUnaryOp { + range: 229..234, + op: Not, + operand: Name( + ExprName { + range: 233..234, + id: "x", + ctx: Load, + }, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 239..240, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 242..252, + value: Dict( + ExprDict { + range: 242..252, + keys: [ + None, + ], + values: [ + Compare( + ExprCompare { + range: 245..251, + left: Name( + ExprName { + range: 245..246, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 250..251, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 253..267, + value: Dict( + ExprDict { + range: 253..267, + keys: [ + None, + ], + values: [ + Compare( + ExprCompare { + range: 256..266, + left: Name( + ExprName { + range: 256..257, + id: "x", + ctx: Load, + }, + ), + ops: [ + NotIn, + ], + comparators: [ + Name( + ExprName { + range: 265..266, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 268..277, + value: Dict( + ExprDict { + range: 268..277, + keys: [ + None, + ], + values: [ + Compare( + ExprCompare { + range: 271..276, + left: Name( + ExprName { + range: 271..272, + id: "x", + ctx: Load, + }, + ), + ops: [ + Lt, + ], + comparators: [ + Name( + ExprName { + range: 275..276, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +2 | # the ones which are higher than that. +3 | +4 | {**x := 1} + | ^^ Syntax Error: Expected ',', found ':=' +5 | {a: 1, **x if True else y} +6 | {**lambda x: x, b: 2} + | + + + | +2 | # the ones which are higher than that. +3 | +4 | {**x := 1} + | ^ Syntax Error: Expected ':', found '}' +5 | {a: 1, **x if True else y} +6 | {**lambda x: x, b: 2} + | + + + | +4 | {**x := 1} +5 | {a: 1, **x if True else y} + | ^^^^^^^^^^^^^^^^ Syntax Error: Conditional expression cannot be used here +6 | {**lambda x: x, b: 2} +7 | {a: 1, **x or y} + | + + + | +4 | {**x := 1} +5 | {a: 1, **x if True else y} +6 | {**lambda x: x, b: 2} + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +7 | {a: 1, **x or y} +8 | {**x and y, b: 2} + | + + + | +5 | {a: 1, **x if True else y} +6 | {**lambda x: x, b: 2} +7 | {a: 1, **x or y} + | ^^^^^^ Syntax Error: Boolean expression cannot be used here +8 | {**x and y, b: 2} +9 | {a: 1, **not x, b: 2} + | + + + | + 6 | {**lambda x: x, b: 2} + 7 | {a: 1, **x or y} + 8 | {**x and y, b: 2} + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here + 9 | {a: 1, **not x, b: 2} +10 | {**x in y} + | + + + | + 7 | {a: 1, **x or y} + 8 | {**x and y, b: 2} + 9 | {a: 1, **not x, b: 2} + | ^^^^^ Syntax Error: Boolean expression cannot be used here +10 | {**x in y} +11 | {**x not in y} + | + + + | + 8 | {**x and y, b: 2} + 9 | {a: 1, **not x, b: 2} +10 | {**x in y} + | ^^^^^^ Syntax Error: Comparison expression cannot be used here +11 | {**x not in y} +12 | {**x < y} + | + + + | + 9 | {a: 1, **not x, b: 2} +10 | {**x in y} +11 | {**x not in y} + | ^^^^^^^^^^ Syntax Error: Comparison expression cannot be used here +12 | {**x < y} + | + + + | +10 | {**x in y} +11 | {**x not in y} +12 | {**x < y} + | ^^^^^ Syntax Error: Comparison expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__double_star_comprehension.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__double_star_comprehension.py.snap new file mode 100644 index 0000000000..d1711b33ca --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__double_star_comprehension.py.snap @@ -0,0 +1,152 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/double_star_comprehension.py +--- +## AST + +``` +Module( + ModModule { + range: 0..358, + body: [ + Expr( + StmtExpr { + range: 122..147, + value: Dict( + ExprDict { + range: 122..147, + keys: [ + None, + Some( + Name( + ExprName { + range: 128..129, + id: "y", + ctx: Load, + }, + ), + ), + Some( + Name( + ExprName { + range: 134..135, + id: "x", + ctx: Load, + }, + ), + ), + Some( + Compare( + ExprCompare { + range: 137..146, + left: Name( + ExprName { + range: 137..138, + id: "y", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 142..146, + id: "data", + ctx: Load, + }, + ), + ], + }, + ), + ), + ], + values: [ + Name( + ExprName { + range: 125..126, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 130..133, + id: "for", + ctx: Load, + }, + ), + Name( + ExprName { + range: 135..135, + id: "", + ctx: Invalid, + }, + ), + Name( + ExprName { + range: 146..146, + id: "", + ctx: Invalid, + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +2 | # it's actually a comprehension. +3 | +4 | {**x: y for x, y in data} + | ^ Syntax Error: Expected an expression or a '}' +5 | +6 | # TODO(dhruvmanila): This test case fails because there's no way to represent `**y` + | + + + | +2 | # it's actually a comprehension. +3 | +4 | {**x: y for x, y in data} + | ^^^ Syntax Error: Expected ':', found 'for' +5 | +6 | # TODO(dhruvmanila): This test case fails because there's no way to represent `**y` + | + + + | +2 | # it's actually a comprehension. +3 | +4 | {**x: y for x, y in data} + | ^ Syntax Error: Expected ',', found name +5 | +6 | # TODO(dhruvmanila): This test case fails because there's no way to represent `**y` + | + + + | +2 | # it's actually a comprehension. +3 | +4 | {**x: y for x, y in data} + | ^ Syntax Error: Expected ':', found ',' +5 | +6 | # TODO(dhruvmanila): This test case fails because there's no way to represent `**y` + | + + + | +2 | # it's actually a comprehension. +3 | +4 | {**x: y for x, y in data} + | ^ Syntax Error: Expected ':', found '}' +5 | +6 | # TODO(dhruvmanila): This test case fails because there's no way to represent `**y` + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_0.py.snap new file mode 100644 index 0000000000..0075084040 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_0.py.snap @@ -0,0 +1,103 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..24, + body: [ + Expr( + StmtExpr { + range: 0..24, + value: Dict( + ExprDict { + range: 0..24, + keys: [ + Some( + Name( + ExprName { + range: 1..2, + id: "x", + ctx: Load, + }, + ), + ), + Some( + Call( + ExprCall { + range: 9..14, + func: Name( + ExprName { + range: 9..12, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 12..14, + args: [], + keywords: [], + }, + }, + ), + ), + ], + values: [ + Name( + ExprName { + range: 5..8, + id: "def", + ctx: Load, + }, + ), + Name( + ExprName { + range: 20..24, + id: "pass", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | {x: +2 | +3 | def foo(): + | ^^^ Syntax Error: Expected an identifier, but found a keyword 'def' that cannot be used here +4 | pass + | + + + | +1 | {x: +2 | +3 | def foo(): + | ^^^ Syntax Error: Expected ',', found name +4 | pass + | + + + | +3 | def foo(): +4 | pass + | ^^^^ Syntax Error: Expected an identifier, but found a keyword 'pass' that cannot be used here + | + + + | +3 | def foo(): +4 | pass + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_1.py.snap new file mode 100644 index 0000000000..98278802e7 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_1.py.snap @@ -0,0 +1,68 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..10, + body: [ + Expr( + StmtExpr { + range: 0..10, + value: Dict( + ExprDict { + range: 0..10, + keys: [ + Some( + Name( + ExprName { + range: 1..2, + id: "x", + ctx: Load, + }, + ), + ), + ], + values: [ + BinOp( + ExprBinOp { + range: 5..10, + left: NumberLiteral( + ExprNumberLiteral { + range: 5..6, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 9..10, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | {x: +2 | +3 | 1 + 2 + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_2.py.snap new file mode 100644 index 0000000000..1dd134ac77 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_2.py.snap @@ -0,0 +1,90 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_2.py +--- +## AST + +``` +Module( + ModModule { + range: 0..27, + body: [ + Expr( + StmtExpr { + range: 0..6, + value: Dict( + ExprDict { + range: 0..6, + keys: [ + Some( + Name( + ExprName { + range: 1..2, + id: "x", + ctx: Load, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 4..5, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + }, + ), + FunctionDef( + StmtFunctionDef { + range: 8..27, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 12..15, + }, + type_params: None, + parameters: Parameters { + range: 15..17, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 23..27, + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | {x: 1, +2 | +3 | def foo(): + | ^^^ Syntax Error: Expected an expression or a '}' +4 | pass + | + + + | +3 | def foo(): +4 | pass + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__named_expression_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__named_expression_0.py.snap new file mode 100644 index 0000000000..bddf3d3b1d --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__named_expression_0.py.snap @@ -0,0 +1,136 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/named_expression_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..84, + body: [ + Expr( + StmtExpr { + range: 55..77, + value: Dict( + ExprDict { + range: 55..77, + keys: [ + Some( + Named( + ExprNamed { + range: 56..62, + target: Name( + ExprName { + range: 56..57, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 61..62, + value: Int( + 1, + ), + }, + ), + }, + ), + ), + Some( + Name( + ExprName { + range: 67..68, + id: "z", + ctx: Load, + }, + ), + ), + Some( + NumberLiteral( + ExprNumberLiteral { + range: 72..73, + value: Int( + 2, + ), + }, + ), + ), + ], + values: [ + Name( + ExprName { + range: 64..65, + id: "y", + ctx: Load, + }, + ), + Name( + ExprName { + range: 68..68, + id: "", + ctx: Invalid, + }, + ), + Name( + ExprName { + range: 75..76, + id: "a", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 79..84, + value: BinOp( + ExprBinOp { + range: 79..84, + left: Name( + ExprName { + range: 79..80, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 83..84, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Unparenthesized named expression not allowed in key +2 | +3 | {x := 1: y, z := 2: a} + | ^^^^^^ Syntax Error: Unparenthesized named expression cannot be used here +4 | +5 | x + y + | + + + | +1 | # Unparenthesized named expression not allowed in key +2 | +3 | {x := 1: y, z := 2: a} + | ^^ Syntax Error: Expected ':', found ':=' +4 | +5 | x + y + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__named_expression_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__named_expression_1.py.snap new file mode 100644 index 0000000000..e2aabe28da --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__named_expression_1.py.snap @@ -0,0 +1,160 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/named_expression_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..86, + body: [ + Expr( + StmtExpr { + range: 57..79, + value: Dict( + ExprDict { + range: 57..79, + keys: [ + Some( + Name( + ExprName { + range: 58..59, + id: "x", + ctx: Load, + }, + ), + ), + Some( + NumberLiteral( + ExprNumberLiteral { + range: 66..67, + value: Int( + 1, + ), + }, + ), + ), + Some( + Name( + ExprName { + range: 69..70, + id: "z", + ctx: Load, + }, + ), + ), + Some( + NumberLiteral( + ExprNumberLiteral { + range: 77..78, + value: Int( + 2, + ), + }, + ), + ), + ], + values: [ + Name( + ExprName { + range: 61..62, + id: "y", + ctx: Load, + }, + ), + Name( + ExprName { + range: 67..67, + id: "", + ctx: Invalid, + }, + ), + Name( + ExprName { + range: 72..73, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 78..78, + id: "", + ctx: Invalid, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 81..86, + value: BinOp( + ExprBinOp { + range: 81..86, + left: Name( + ExprName { + range: 81..82, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 85..86, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Unparenthesized named expression not allowed in value +2 | +3 | {x: y := 1, z: a := 2} + | ^^ Syntax Error: Expected ',', found ':=' +4 | +5 | x + y + | + + + | +1 | # Unparenthesized named expression not allowed in value +2 | +3 | {x: y := 1, z: a := 2} + | ^ Syntax Error: Expected ':', found ',' +4 | +5 | x + y + | + + + | +1 | # Unparenthesized named expression not allowed in value +2 | +3 | {x: y := 1, z: a := 2} + | ^^ Syntax Error: Expected ',', found ':=' +4 | +5 | x + y + | + + + | +1 | # Unparenthesized named expression not allowed in value +2 | +3 | {x: y := 1, z: a := 2} + | ^ Syntax Error: Expected ':', found '}' +4 | +5 | x + y + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__recover.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__recover.py.snap new file mode 100644 index 0000000000..c64d7ddf65 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__recover.py.snap @@ -0,0 +1,503 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/recover.py +--- +## AST + +``` +Module( + ModModule { + range: 0..346, + body: [ + Expr( + StmtExpr { + range: 88..91, + value: Set( + ExprSet { + range: 88..91, + elts: [ + Name( + ExprName { + range: 89..89, + id: "", + ctx: Invalid, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 93..105, + value: Dict( + ExprDict { + range: 93..105, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 94..95, + value: Int( + 1, + ), + }, + ), + ), + Some( + NumberLiteral( + ExprNumberLiteral { + range: 100..101, + value: Int( + 3, + ), + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 97..98, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 103..104, + value: Int( + 4, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 107..115, + value: Dict( + ExprDict { + range: 107..115, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 108..109, + value: Int( + 1, + ), + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 111..112, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 133..144, + value: Dict( + ExprDict { + range: 133..144, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 134..135, + value: Int( + 1, + ), + }, + ), + ), + Some( + NumberLiteral( + ExprNumberLiteral { + range: 139..140, + value: Int( + 3, + ), + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 137..138, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 142..143, + value: Int( + 4, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 157..162, + value: Dict( + ExprDict { + range: 157..162, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 158..159, + value: Int( + 1, + ), + }, + ), + ), + ], + values: [ + Name( + ExprName { + range: 160..160, + id: "", + ctx: Invalid, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 201..205, + value: Dict( + ExprDict { + range: 201..205, + keys: [ + None, + ], + values: [ + Name( + ExprName { + range: 204..204, + id: "", + ctx: Invalid, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 206..222, + value: Dict( + ExprDict { + range: 206..222, + keys: [ + Some( + Name( + ExprName { + range: 207..208, + id: "x", + ctx: Load, + }, + ), + ), + None, + Some( + Name( + ExprName { + range: 217..218, + id: "a", + ctx: Load, + }, + ), + ), + ], + values: [ + Name( + ExprName { + range: 210..211, + id: "y", + ctx: Load, + }, + ), + Name( + ExprName { + range: 215..215, + id: "", + ctx: Invalid, + }, + ), + Name( + ExprName { + range: 220..221, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 310..330, + value: Dict( + ExprDict { + range: 310..330, + keys: [ + Some( + Starred( + ExprStarred { + range: 311..313, + value: Name( + ExprName { + range: 312..313, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + Some( + Name( + ExprName { + range: 318..319, + id: "z", + ctx: Load, + }, + ), + ), + Some( + Starred( + ExprStarred { + range: 324..326, + value: Name( + ExprName { + range: 325..326, + id: "b", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + ], + values: [ + Name( + ExprName { + range: 315..316, + id: "y", + ctx: Load, + }, + ), + Name( + ExprName { + range: 321..322, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 328..329, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 331..345, + value: Dict( + ExprDict { + range: 331..345, + keys: [ + Some( + Name( + ExprName { + range: 332..333, + id: "x", + ctx: Load, + }, + ), + ), + Some( + Name( + ExprName { + range: 339..340, + id: "z", + ctx: Load, + }, + ), + ), + ], + values: [ + Starred( + ExprStarred { + range: 335..337, + value: Name( + ExprName { + range: 336..337, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 342..344, + value: Name( + ExprName { + range: 343..344, + id: "a", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Test cases for dictionary expressions where the parser recovers from a syntax error. +2 | +3 | {,} + | ^ Syntax Error: Expected an expression +4 | +5 | {1: 2,,3: 4} + | + + + | +3 | {,} +4 | +5 | {1: 2,,3: 4} + | ^ Syntax Error: Expected an expression or a '}' +6 | +7 | {1: 2,,} + | + + + | +5 | {1: 2,,3: 4} +6 | +7 | {1: 2,,} + | ^ Syntax Error: Expected an expression or a '}' +8 | +9 | # Missing comma + | + + + | + 9 | # Missing comma +10 | {1: 2 3: 4} + | ^ Syntax Error: Expected ',', found int +11 | +12 | # No value + | + + + | +12 | # No value +13 | {1: } + | ^ Syntax Error: Expected an expression +14 | +15 | # No value for double star unpacking + | + + + | +15 | # No value for double star unpacking +16 | {**} + | ^ Syntax Error: Expected an expression +17 | {x: y, **, a: b} + | + + + | +15 | # No value for double star unpacking +16 | {**} +17 | {x: y, **, a: b} + | ^ Syntax Error: Expected an expression +18 | +19 | # This is not a double star unpacking + | + + + | +22 | # Star expression not allowed here +23 | {*x: y, z: a, *b: c} + | ^^ Syntax Error: Starred expression cannot be used here +24 | {x: *y, z: *a} + | + + + | +22 | # Star expression not allowed here +23 | {*x: y, z: a, *b: c} + | ^^ Syntax Error: Starred expression cannot be used here +24 | {x: *y, z: *a} + | + + + | +22 | # Star expression not allowed here +23 | {*x: y, z: a, *b: c} +24 | {x: *y, z: *a} + | ^^ Syntax Error: Starred expression cannot be used here + | + + + | +22 | # Star expression not allowed here +23 | {*x: y, z: a, *b: c} +24 | {x: *y, z: *a} + | ^^ Syntax Error: Starred expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_identifiers.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_identifiers.py.snap new file mode 100644 index 0000000000..0704457cf8 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_identifiers.py.snap @@ -0,0 +1,138 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/emoji_identifiers.py +--- +## AST + +``` +Module( + ModModule { + range: 0..64, + body: [ + Assign( + StmtAssign { + range: 0..5, + targets: [ + Name( + ExprName { + range: 0..1, + id: "a", + ctx: Store, + }, + ), + ], + value: Name( + ExprName { + range: 5..5, + id: "", + ctx: Invalid, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 32..37, + targets: [ + Name( + ExprName { + range: 32..33, + id: "a", + ctx: Store, + }, + ), + ], + value: Name( + ExprName { + range: 37..37, + id: "", + ctx: Invalid, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 42..43, + value: UnaryOp( + ExprUnaryOp { + range: 42..43, + op: UAdd, + operand: Name( + ExprName { + range: 43..43, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | a = (🐶 + | ^^ Syntax Error: Got unexpected token 🐶 +2 | # comment 🐶 +3 | ) + | + + + | +1 | a = (🐶 +2 | # comment 🐶 +3 | ) + | ^ Syntax Error: Expected a statement +4 | +5 | a = (🐶 + + | + + + | +1 | a = (🐶 +2 | # comment 🐶 +3 | ) + | ^ Syntax Error: Expected a statement +4 | +5 | a = (🐶 + +6 | # comment + | + + + | +3 | ) +4 | +5 | a = (🐶 + + | ^^ Syntax Error: Got unexpected token 🐶 +6 | # comment +7 | 🐶) + | + + + | +5 | a = (🐶 + +6 | # comment +7 | 🐶) + | ^^ Syntax Error: Got unexpected token 🐶 + | + + + | +5 | a = (🐶 + +6 | # comment +7 | 🐶) + | ^ Syntax Error: Expected a statement + | + + + | +5 | a = (🐶 + +6 | # comment +7 | 🐶) + | ^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_statement.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_statement.py.snap new file mode 100644 index 0000000000..7956a34adb --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_statement.py.snap @@ -0,0 +1,20 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/emoji_statement.py +--- +## AST + +``` +Module( + ModModule { + range: 0..5, + body: [], + }, +) +``` +## Errors + + | +1 | 👍 + | ^^ Syntax Error: Got unexpected token 👍 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__missing_orelse_expr_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__missing_orelse_expr_0.py.snap new file mode 100644 index 0000000000..6d33d60b21 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__missing_orelse_expr_0.py.snap @@ -0,0 +1,84 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/if/missing_orelse_expr_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..88, + body: [ + Expr( + StmtExpr { + range: 53..67, + value: If( + ExprIf { + range: 53..67, + test: Name( + ExprName { + range: 58..62, + id: "expr", + ctx: Load, + }, + ), + body: Name( + ExprName { + range: 53..54, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 67..67, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + FunctionDef( + StmtFunctionDef { + range: 69..88, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 73..76, + }, + type_params: None, + parameters: Parameters { + range: 76..78, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 84..88, + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Missing orelse expression, followed by a statement +2 | x if expr else + | ^ Syntax Error: Expected an expression +3 | +4 | def foo(): +5 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__missing_orelse_expr_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__missing_orelse_expr_1.py.snap new file mode 100644 index 0000000000..d1108c8dd5 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__missing_orelse_expr_1.py.snap @@ -0,0 +1,82 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/if/missing_orelse_expr_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..76, + body: [ + Expr( + StmtExpr { + range: 55..69, + value: If( + ExprIf { + range: 55..69, + test: Name( + ExprName { + range: 60..64, + id: "expr", + ctx: Load, + }, + ), + body: Name( + ExprName { + range: 55..56, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 69..69, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 71..76, + value: BinOp( + ExprBinOp { + range: 71..76, + left: NumberLiteral( + ExprNumberLiteral { + range: 71..72, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 75..76, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Missing orelse expression, followed by an expression +2 | x if expr else + | ^ Syntax Error: Expected an expression +3 | +4 | 1 + 1 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__missing_test_expr_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__missing_test_expr_0.py.snap new file mode 100644 index 0000000000..6e386a3635 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__missing_test_expr_0.py.snap @@ -0,0 +1,84 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/if/missing_test_expr_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..76, + body: [ + Expr( + StmtExpr { + range: 51..55, + value: If( + ExprIf { + range: 51..55, + test: Name( + ExprName { + range: 55..55, + id: "", + ctx: Invalid, + }, + ), + body: Name( + ExprName { + range: 51..52, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 55..55, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + FunctionDef( + StmtFunctionDef { + range: 57..76, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 61..64, + }, + type_params: None, + parameters: Parameters { + range: 64..66, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 72..76, + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Missing test expression, followed by a statement +2 | x if + | ^ Syntax Error: Expected an expression +3 | +4 | def foo(): +5 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__missing_test_expr_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__missing_test_expr_1.py.snap new file mode 100644 index 0000000000..cca10a7160 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__missing_test_expr_1.py.snap @@ -0,0 +1,82 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/if/missing_test_expr_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..64, + body: [ + Expr( + StmtExpr { + range: 53..57, + value: If( + ExprIf { + range: 53..57, + test: Name( + ExprName { + range: 57..57, + id: "", + ctx: Invalid, + }, + ), + body: Name( + ExprName { + range: 53..54, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 57..57, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 59..64, + value: BinOp( + ExprBinOp { + range: 59..64, + left: NumberLiteral( + ExprNumberLiteral { + range: 59..60, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 63..64, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Missing test expression, followed by an expression +2 | x if + | ^ Syntax Error: Expected an expression +3 | +4 | 1 + 1 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__recover.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__recover.py.snap new file mode 100644 index 0000000000..0a9c25c6ac --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__recover.py.snap @@ -0,0 +1,360 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/if/recover.py +--- +## AST + +``` +Module( + ModModule { + range: 0..215, + body: [ + Expr( + StmtExpr { + range: 26..43, + value: If( + ExprIf { + range: 26..43, + test: Starred( + ExprStarred { + range: 31..36, + value: Name( + ExprName { + range: 32..36, + id: "expr", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + body: Name( + ExprName { + range: 26..27, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 42..43, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 44..67, + value: If( + ExprIf { + range: 44..67, + test: Lambda( + ExprLambda { + range: 49..60, + parameters: Some( + Parameters { + range: 56..57, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 56..57, + parameter: Parameter { + range: 56..57, + name: Identifier { + id: "x", + range: 56..57, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 59..60, + id: "x", + ctx: Load, + }, + ), + }, + ), + body: Name( + ExprName { + range: 44..45, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 66..67, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 68..87, + value: If( + ExprIf { + range: 68..87, + test: Yield( + ExprYield { + range: 73..80, + value: Some( + Name( + ExprName { + range: 79..80, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + body: Name( + ExprName { + range: 68..69, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 86..87, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 88..112, + value: If( + ExprIf { + range: 88..112, + test: YieldFrom( + ExprYieldFrom { + range: 93..105, + value: Name( + ExprName { + range: 104..105, + id: "x", + ctx: Load, + }, + ), + }, + ), + body: Name( + ExprName { + range: 88..89, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 111..112, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 142..164, + value: If( + ExprIf { + range: 142..164, + test: Name( + ExprName { + range: 147..151, + id: "expr", + ctx: Load, + }, + ), + body: Name( + ExprName { + range: 142..143, + id: "x", + ctx: Load, + }, + ), + orelse: Starred( + ExprStarred { + range: 157..164, + value: Name( + ExprName { + range: 158..164, + id: "orelse", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 165..187, + value: If( + ExprIf { + range: 165..187, + test: Name( + ExprName { + range: 170..174, + id: "expr", + ctx: Load, + }, + ), + body: Name( + ExprName { + range: 165..166, + id: "x", + ctx: Load, + }, + ), + orelse: Yield( + ExprYield { + range: 180..187, + value: Some( + Name( + ExprName { + range: 186..187, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 188..215, + value: If( + ExprIf { + range: 188..215, + test: Name( + ExprName { + range: 193..197, + id: "expr", + ctx: Load, + }, + ), + body: Name( + ExprName { + range: 188..189, + id: "x", + ctx: Load, + }, + ), + orelse: YieldFrom( + ExprYieldFrom { + range: 203..215, + value: Name( + ExprName { + range: 214..215, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Invalid test expression +2 | x if *expr else y + | ^^^^^ Syntax Error: Starred expression cannot be used here +3 | x if lambda x: x else y +4 | x if yield x else y + | + + + | +1 | # Invalid test expression +2 | x if *expr else y +3 | x if lambda x: x else y + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +4 | x if yield x else y +5 | x if yield from x else y + | + + + | +2 | x if *expr else y +3 | x if lambda x: x else y +4 | x if yield x else y + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +5 | x if yield from x else y + | + + + | +3 | x if lambda x: x else y +4 | x if yield x else y +5 | x if yield from x else y + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +6 | +7 | # Invalid orelse expression + | + + + | + 7 | # Invalid orelse expression + 8 | x if expr else *orelse + | ^^^^^^^ Syntax Error: Starred expression cannot be used here + 9 | x if expr else yield y +10 | x if expr else yield from y + | + + + | + 7 | # Invalid orelse expression + 8 | x if expr else *orelse + 9 | x if expr else yield y + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +10 | x if expr else yield from y + | + + + | + 8 | x if expr else *orelse + 9 | x if expr else yield y +10 | x if expr else yield from y + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_default_parameters.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_default_parameters.py.snap new file mode 100644 index 0000000000..fa45ab4e24 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_default_parameters.py.snap @@ -0,0 +1,95 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/lambda_default_parameters.py +--- +## AST + +``` +Module( + ModModule { + range: 0..20, + body: [ + Expr( + StmtExpr { + range: 0..20, + value: Lambda( + ExprLambda { + range: 0..20, + parameters: Some( + Parameters { + range: 7..17, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 7..8, + parameter: Parameter { + range: 7..8, + name: Identifier { + id: "a", + range: 7..8, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 10..14, + parameter: Parameter { + range: 10..11, + name: Identifier { + id: "b", + range: 10..11, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 12..14, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 16..17, + parameter: Parameter { + range: 16..17, + name: Identifier { + id: "c", + range: 16..17, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 19..20, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | lambda a, b=20, c: 1 + | ^ Syntax Error: Parameter without a default cannot follow a parameter with a default + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_duplicate_parameters.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_duplicate_parameters.py.snap new file mode 100644 index 0000000000..82f5f6132a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_duplicate_parameters.py.snap @@ -0,0 +1,338 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/lambda_duplicate_parameters.py +--- +## AST + +``` +Module( + ModModule { + range: 0..91, + body: [ + Expr( + StmtExpr { + range: 0..14, + value: Lambda( + ExprLambda { + range: 0..14, + parameters: Some( + Parameters { + range: 7..11, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 7..8, + parameter: Parameter { + range: 7..8, + name: Identifier { + id: "a", + range: 7..8, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 10..11, + parameter: Parameter { + range: 10..11, + name: Identifier { + id: "a", + range: 10..11, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 13..14, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 16..33, + value: Lambda( + ExprLambda { + range: 16..33, + parameters: Some( + Parameters { + range: 23..30, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 23..24, + parameter: Parameter { + range: 23..24, + name: Identifier { + id: "a", + range: 23..24, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 29..30, + parameter: Parameter { + range: 29..30, + name: Identifier { + id: "a", + range: 29..30, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 32..33, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 35..52, + value: Lambda( + ExprLambda { + range: 35..52, + parameters: Some( + Parameters { + range: 42..49, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 42..43, + parameter: Parameter { + range: 42..43, + name: Identifier { + id: "a", + range: 42..43, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 45..49, + parameter: Parameter { + range: 45..46, + name: Identifier { + id: "a", + range: 45..46, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 47..49, + value: Int( + 20, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 51..52, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 54..69, + value: Lambda( + ExprLambda { + range: 54..69, + parameters: Some( + Parameters { + range: 61..66, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 61..62, + parameter: Parameter { + range: 61..62, + name: Identifier { + id: "a", + range: 61..62, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: Some( + Parameter { + range: 64..66, + name: Identifier { + id: "a", + range: 65..66, + }, + annotation: None, + }, + ), + kwonlyargs: [], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 68..69, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 71..90, + value: Lambda( + ExprLambda { + range: 71..90, + parameters: Some( + Parameters { + range: 78..87, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 78..79, + parameter: Parameter { + range: 78..79, + name: Identifier { + id: "a", + range: 78..79, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: Some( + Parameter { + range: 84..87, + name: Identifier { + id: "a", + range: 86..87, + }, + annotation: None, + }, + ), + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 89..90, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | lambda a, a: 1 + | ^ Syntax Error: Duplicate parameter "a" +2 | +3 | lambda a, *, a: 1 + | + + + | +1 | lambda a, a: 1 +2 | +3 | lambda a, *, a: 1 + | ^ Syntax Error: Duplicate parameter "a" +4 | +5 | lambda a, a=20: 1 + | + + + | +3 | lambda a, *, a: 1 +4 | +5 | lambda a, a=20: 1 + | ^ Syntax Error: Duplicate parameter "a" +6 | +7 | lambda a, *a: 1 + | + + + | +5 | lambda a, a=20: 1 +6 | +7 | lambda a, *a: 1 + | ^ Syntax Error: Duplicate parameter "a" +8 | +9 | lambda a, *, **a: 1 + | + + + | +7 | lambda a, *a: 1 +8 | +9 | lambda a, *, **a: 1 + | ^^^ Syntax Error: Expected one or more keyword parameter after '*' separator + | + + + | +7 | lambda a, *a: 1 +8 | +9 | lambda a, *, **a: 1 + | ^ Syntax Error: Duplicate parameter "a" + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__comprehension.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__comprehension.py.snap new file mode 100644 index 0000000000..3c663b1a90 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__comprehension.py.snap @@ -0,0 +1,796 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/list/comprehension.py +--- +## AST + +``` +Module( + ModModule { + range: 0..376, + body: [ + Expr( + StmtExpr { + range: 33..48, + value: ListComp( + ExprListComp { + range: 33..48, + elt: Starred( + ExprStarred { + range: 34..36, + value: Name( + ExprName { + range: 35..36, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 37..47, + target: Name( + ExprName { + range: 41..42, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 46..47, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 67..81, + value: ListComp( + ExprListComp { + range: 67..81, + elt: Name( + ExprName { + range: 68..69, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 70..80, + target: NumberLiteral( + ExprNumberLiteral { + range: 74..75, + value: Int( + 1, + ), + }, + ), + iter: Name( + ExprName { + range: 79..80, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 82..98, + value: ListComp( + ExprListComp { + range: 82..98, + elt: Name( + ExprName { + range: 83..84, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 85..97, + target: StringLiteral( + ExprStringLiteral { + range: 89..92, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 89..92, + value: "a", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + iter: Name( + ExprName { + range: 96..97, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 99..118, + value: ListComp( + ExprListComp { + range: 99..118, + elt: Name( + ExprName { + range: 100..101, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 102..117, + target: Call( + ExprCall { + range: 106..112, + func: Name( + ExprName { + range: 106..110, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 110..112, + args: [], + keywords: [], + }, + }, + ), + iter: Name( + ExprName { + range: 116..117, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 119..138, + value: ListComp( + ExprListComp { + range: 119..138, + elt: Name( + ExprName { + range: 120..121, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 122..137, + target: Set( + ExprSet { + range: 126..132, + elts: [ + Name( + ExprName { + range: 127..128, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 130..131, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + iter: Name( + ExprName { + range: 136..137, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 155..170, + value: ListComp( + ExprListComp { + range: 155..170, + elt: Name( + ExprName { + range: 156..157, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 158..169, + target: Name( + ExprName { + range: 162..163, + id: "x", + ctx: Store, + }, + ), + iter: Starred( + ExprStarred { + range: 167..169, + value: Name( + ExprName { + range: 168..169, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 171..191, + value: ListComp( + ExprListComp { + range: 171..191, + elt: Name( + ExprName { + range: 172..173, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 174..190, + target: Name( + ExprName { + range: 178..179, + id: "x", + ctx: Store, + }, + ), + iter: Yield( + ExprYield { + range: 183..190, + value: Some( + Name( + ExprName { + range: 189..190, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 192..217, + value: ListComp( + ExprListComp { + range: 192..217, + elt: Name( + ExprName { + range: 193..194, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 195..216, + target: Name( + ExprName { + range: 199..200, + id: "x", + ctx: Store, + }, + ), + iter: YieldFrom( + ExprYieldFrom { + range: 204..216, + value: Name( + ExprName { + range: 215..216, + id: "y", + ctx: Load, + }, + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 218..242, + value: ListComp( + ExprListComp { + range: 218..242, + elt: Name( + ExprName { + range: 219..220, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 221..241, + target: Name( + ExprName { + range: 225..226, + id: "x", + ctx: Store, + }, + ), + iter: Lambda( + ExprLambda { + range: 230..241, + parameters: Some( + Parameters { + range: 237..238, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 237..238, + parameter: Parameter { + range: 237..238, + name: Identifier { + id: "y", + range: 237..238, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 240..241, + id: "y", + ctx: Load, + }, + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 257..280, + value: ListComp( + ExprListComp { + range: 257..280, + elt: Name( + ExprName { + range: 258..259, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 260..279, + target: Name( + ExprName { + range: 264..265, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 269..273, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Starred( + ExprStarred { + range: 277..279, + value: Name( + ExprName { + range: 278..279, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 281..309, + value: ListComp( + ExprListComp { + range: 281..309, + elt: Name( + ExprName { + range: 282..283, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 284..308, + target: Name( + ExprName { + range: 288..289, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 293..297, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Yield( + ExprYield { + range: 301..308, + value: Some( + Name( + ExprName { + range: 307..308, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 310..343, + value: ListComp( + ExprListComp { + range: 310..343, + elt: Name( + ExprName { + range: 311..312, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 313..342, + target: Name( + ExprName { + range: 317..318, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 322..326, + id: "data", + ctx: Load, + }, + ), + ifs: [ + YieldFrom( + ExprYieldFrom { + range: 330..342, + value: Name( + ExprName { + range: 341..342, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 344..376, + value: ListComp( + ExprListComp { + range: 344..376, + elt: Name( + ExprName { + range: 345..346, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 347..375, + target: Name( + ExprName { + range: 351..352, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 356..360, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Lambda( + ExprLambda { + range: 364..375, + parameters: Some( + Parameters { + range: 371..372, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 371..372, + parameter: Parameter { + range: 371..372, + name: Identifier { + id: "y", + range: 371..372, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 374..375, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Iterable unpacking not allowed +2 | [*x for x in y] + | ^^ Syntax Error: Iterable unpacking cannot be used in a comprehension +3 | +4 | # Invalid target + | + + + | +4 | # Invalid target +5 | [x for 1 in y] + | ^ Syntax Error: Invalid assignment target +6 | [x for 'a' in y] +7 | [x for call() in y] + | + + + | +4 | # Invalid target +5 | [x for 1 in y] +6 | [x for 'a' in y] + | ^^^ Syntax Error: Invalid assignment target +7 | [x for call() in y] +8 | [x for {a, b} in y] + | + + + | +5 | [x for 1 in y] +6 | [x for 'a' in y] +7 | [x for call() in y] + | ^^^^^^ Syntax Error: Invalid assignment target +8 | [x for {a, b} in y] + | + + + | + 6 | [x for 'a' in y] + 7 | [x for call() in y] + 8 | [x for {a, b} in y] + | ^^^^^^ Syntax Error: Invalid assignment target + 9 | +10 | # Invalid iter + | + + + | +10 | # Invalid iter +11 | [x for x in *y] + | ^^ Syntax Error: Starred expression cannot be used here +12 | [x for x in yield y] +13 | [x for x in yield from y] + | + + + | +10 | # Invalid iter +11 | [x for x in *y] +12 | [x for x in yield y] + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +13 | [x for x in yield from y] +14 | [x for x in lambda y: y] + | + + + | +11 | [x for x in *y] +12 | [x for x in yield y] +13 | [x for x in yield from y] + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +14 | [x for x in lambda y: y] + | + + + | +12 | [x for x in yield y] +13 | [x for x in yield from y] +14 | [x for x in lambda y: y] + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +15 | +16 | # Invalid if + | + + + | +16 | # Invalid if +17 | [x for x in data if *y] + | ^^ Syntax Error: Starred expression cannot be used here +18 | [x for x in data if yield y] +19 | [x for x in data if yield from y] + | + + + | +16 | # Invalid if +17 | [x for x in data if *y] +18 | [x for x in data if yield y] + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +19 | [x for x in data if yield from y] +20 | [x for x in data if lambda y: y] + | + + + | +17 | [x for x in data if *y] +18 | [x for x in data if yield y] +19 | [x for x in data if yield from y] + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +20 | [x for x in data if lambda y: y] + | + + + | +18 | [x for x in data if yield y] +19 | [x for x in data if yield from y] +20 | [x for x in data if lambda y: y] + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_0.py.snap new file mode 100644 index 0000000000..3c3f2be769 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_0.py.snap @@ -0,0 +1,43 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..43, + body: [ + Expr( + StmtExpr { + range: 42..43, + value: List( + ExprList { + range: 42..43, + elts: [ + Name( + ExprName { + range: 43..43, + id: "", + ctx: Invalid, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Missing closing bracket 0: No elements +2 | +3 | [ + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_1.py.snap new file mode 100644 index 0000000000..b343c2c3cc --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_1.py.snap @@ -0,0 +1,56 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..133, + body: [ + Expr( + StmtExpr { + range: 125..133, + value: List( + ExprList { + range: 125..133, + elts: [ + BinOp( + ExprBinOp { + range: 128..133, + left: Name( + ExprName { + range: 128..129, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 132..133, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +4 | [ +5 | +6 | x + y + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_2.py.snap new file mode 100644 index 0000000000..1e42422912 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_2.py.snap @@ -0,0 +1,64 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_2.py +--- +## AST + +``` +Module( + ModModule { + range: 0..141, + body: [ + Expr( + StmtExpr { + range: 131..141, + value: List( + ExprList { + range: 131..141, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 132..133, + value: Int( + 1, + ), + }, + ), + BinOp( + ExprBinOp { + range: 136..141, + left: Name( + ExprName { + range: 136..137, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 140..141, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +4 | [1, +5 | +6 | x + y + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_3.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_3.py.snap new file mode 100644 index 0000000000..3a0898a738 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_3.py.snap @@ -0,0 +1,88 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_3.py +--- +## AST + +``` +Module( + ModModule { + range: 0..140, + body: [ + Expr( + StmtExpr { + range: 114..119, + value: List( + ExprList { + range: 114..119, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 115..116, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 118..119, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + FunctionDef( + StmtFunctionDef { + range: 121..140, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 125..128, + }, + type_params: None, + parameters: Parameters { + range: 128..130, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 136..140, + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +4 | [1, 2 +5 | +6 | def foo(): + | ^^^ Syntax Error: Expected ',', found 'def' +7 | pass + | + + + | +6 | def foo(): +7 | pass + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__recover.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__recover.py.snap new file mode 100644 index 0000000000..2ff84388a9 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__recover.py.snap @@ -0,0 +1,314 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/list/recover.py +--- +## AST + +``` +Module( + ModModule { + range: 0..208, + body: [ + Expr( + StmtExpr { + range: 82..85, + value: List( + ExprList { + range: 82..85, + elts: [ + Name( + ExprName { + range: 83..83, + id: "", + ctx: Invalid, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 87..93, + value: List( + ExprList { + range: 87..93, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 88..89, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 91..92, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 95..100, + value: List( + ExprList { + range: 95..100, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 96..97, + value: Int( + 1, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 118..123, + value: List( + ExprList { + range: 118..123, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 119..120, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 121..122, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 156..162, + value: List( + ExprList { + range: 156..162, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 157..158, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 160..161, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 185..194, + value: List( + ExprList { + range: 185..194, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 186..187, + value: Int( + 1, + ), + }, + ), + BinOp( + ExprBinOp { + range: 189..192, + left: Name( + ExprName { + range: 189..190, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 192..192, + id: "", + ctx: Invalid, + }, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 196..202, + value: List( + ExprList { + range: 196..202, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 197..198, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 200..201, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 204..207, + value: List( + ExprList { + range: 204..207, + elts: [ + Starred( + ExprStarred { + range: 205..206, + value: Name( + ExprName { + range: 206..206, + id: "", + ctx: Invalid, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Test cases for list expressions where the parser recovers from a syntax error. +2 | +3 | [,] + | ^ Syntax Error: Expected an expression +4 | +5 | [1,,2] + | + + + | +3 | [,] +4 | +5 | [1,,2] + | ^ Syntax Error: Expected an expression or a ']' +6 | +7 | [1,,] + | + + + | +5 | [1,,2] +6 | +7 | [1,,] + | ^ Syntax Error: Expected an expression or a ']' +8 | +9 | # Missing comma + | + + + | + 9 | # Missing comma +10 | [1 2] + | ^ Syntax Error: Expected ',', found int +11 | +12 | # Dictionary element in a list + | + + + | +12 | # Dictionary element in a list +13 | [1: 2] + | ^ Syntax Error: Expected an expression or a ']' +14 | +15 | # Missing expression + | + + + | +15 | # Missing expression +16 | [1, x + ] + | ^ Syntax Error: Expected an expression +17 | +18 | [1; 2] + | + + + | +16 | [1, x + ] +17 | +18 | [1; 2] + | ^ Syntax Error: Expected an expression or a ']' +19 | +20 | [*] + | + + + | +18 | [1; 2] +19 | +20 | [*] + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__star_expression_precedence.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__star_expression_precedence.py.snap new file mode 100644 index 0000000000..1c663c7564 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__star_expression_precedence.py.snap @@ -0,0 +1,462 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/list/star_expression_precedence.py +--- +## AST + +``` +Module( + ModModule { + range: 0..200, + body: [ + Expr( + StmtExpr { + range: 84..93, + value: List( + ExprList { + range: 84..93, + elts: [ + Starred( + ExprStarred { + range: 86..88, + value: Name( + ExprName { + range: 87..88, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 91..92, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 94..106, + value: List( + ExprList { + range: 94..106, + elts: [ + Starred( + ExprStarred { + range: 95..102, + value: Compare( + ExprCompare { + range: 96..102, + left: Name( + ExprName { + range: 96..97, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 101..102, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 104..105, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 107..118, + value: List( + ExprList { + range: 107..118, + elts: [ + Starred( + ExprStarred { + range: 108..114, + value: UnaryOp( + ExprUnaryOp { + range: 109..114, + op: Not, + operand: Name( + ExprName { + range: 113..114, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 116..117, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 119..132, + value: List( + ExprList { + range: 119..132, + elts: [ + Starred( + ExprStarred { + range: 120..128, + value: BoolOp( + ExprBoolOp { + range: 121..128, + op: And, + values: [ + Name( + ExprName { + range: 121..122, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 127..128, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 130..131, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 133..145, + value: List( + ExprList { + range: 133..145, + elts: [ + Starred( + ExprStarred { + range: 134..141, + value: BoolOp( + ExprBoolOp { + range: 135..141, + op: Or, + values: [ + Name( + ExprName { + range: 135..136, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 140..141, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 143..144, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 146..168, + value: List( + ExprList { + range: 146..168, + elts: [ + Starred( + ExprStarred { + range: 147..164, + value: If( + ExprIf { + range: 148..164, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 153..157, + value: true, + }, + ), + body: Name( + ExprName { + range: 148..149, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 163..164, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 166..167, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 169..186, + value: List( + ExprList { + range: 169..186, + elts: [ + Starred( + ExprStarred { + range: 170..182, + value: Lambda( + ExprLambda { + range: 171..182, + parameters: Some( + Parameters { + range: 178..179, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 178..179, + parameter: Parameter { + range: 178..179, + name: Identifier { + id: "x", + range: 178..179, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 181..182, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 184..185, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 187..199, + value: List( + ExprList { + range: 187..199, + elts: [ + Starred( + ExprStarred { + range: 188..190, + value: Name( + ExprName { + range: 189..190, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 194..195, + value: Int( + 2, + ), + }, + ), + Name( + ExprName { + range: 197..198, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # For list expression, the minimum binding power of star expression is bitwise or. +2 | +3 | [(*x), y] + | ^^ Syntax Error: Starred expression cannot be used here +4 | [*x in y, z] +5 | [*not x, z] + | + + + | +3 | [(*x), y] +4 | [*x in y, z] + | ^^^^^^ Syntax Error: Comparison expression cannot be used here +5 | [*not x, z] +6 | [*x and y, z] + | + + + | +3 | [(*x), y] +4 | [*x in y, z] +5 | [*not x, z] + | ^^^^^ Syntax Error: Boolean expression cannot be used here +6 | [*x and y, z] +7 | [*x or y, z] + | + + + | +4 | [*x in y, z] +5 | [*not x, z] +6 | [*x and y, z] + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here +7 | [*x or y, z] +8 | [*x if True else y, z] + | + + + | +5 | [*not x, z] +6 | [*x and y, z] +7 | [*x or y, z] + | ^^^^^^ Syntax Error: Boolean expression cannot be used here +8 | [*x if True else y, z] +9 | [*lambda x: x, z] + | + + + | + 6 | [*x and y, z] + 7 | [*x or y, z] + 8 | [*x if True else y, z] + | ^^^^^^^^^^^^^^^^ Syntax Error: Conditional expression cannot be used here + 9 | [*lambda x: x, z] +10 | [*x := 2, z] + | + + + | + 7 | [*x or y, z] + 8 | [*x if True else y, z] + 9 | [*lambda x: x, z] + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +10 | [*x := 2, z] + | + + + | + 8 | [*x if True else y, z] + 9 | [*lambda x: x, z] +10 | [*x := 2, z] + | ^^ Syntax Error: Expected ',', found ':=' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__invalid_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__invalid_target.py.snap new file mode 100644 index 0000000000..fbdfb36360 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__invalid_target.py.snap @@ -0,0 +1,238 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/named/invalid_target.py +--- +## AST + +``` +Module( + ModModule { + range: 0..109, + body: [ + Expr( + StmtExpr { + range: 58..68, + value: Named( + ExprNamed { + range: 59..67, + target: Attribute( + ExprAttribute { + range: 59..62, + value: Name( + ExprName { + range: 59..60, + id: "x", + ctx: Load, + }, + ), + attr: Identifier { + id: "y", + range: 61..62, + }, + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 66..67, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 69..80, + value: Named( + ExprNamed { + range: 70..79, + target: Subscript( + ExprSubscript { + range: 70..74, + value: Name( + ExprName { + range: 70..71, + id: "x", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 72..73, + id: "y", + ctx: Load, + }, + ), + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 78..79, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 81..84, + value: Starred( + ExprStarred { + range: 82..84, + value: Name( + ExprName { + range: 83..84, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 88..89, + value: NumberLiteral( + ExprNumberLiteral { + range: 88..89, + value: Int( + 1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 91..109, + value: Named( + ExprNamed { + range: 92..108, + target: List( + ExprList { + range: 92..98, + elts: [ + Name( + ExprName { + range: 93..94, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 96..97, + id: "y", + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + value: List( + ExprList { + range: 102..108, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 103..104, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 106..107, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Assignment expression target can only be an identifier +2 | +3 | (x.y := 1) + | ^^^ Syntax Error: Assignment expression target must be an identifier +4 | (x[y] := 1) +5 | (*x := 1) + | + + + | +3 | (x.y := 1) +4 | (x[y] := 1) + | ^^^^ Syntax Error: Assignment expression target must be an identifier +5 | (*x := 1) +6 | ([x, y] := [1, 2]) + | + + + | +3 | (x.y := 1) +4 | (x[y] := 1) +5 | (*x := 1) + | ^^ Syntax Error: Starred expression cannot be used here +6 | ([x, y] := [1, 2]) + | + + + | +3 | (x.y := 1) +4 | (x[y] := 1) +5 | (*x := 1) + | ^^ Syntax Error: Expected ')', found ':=' +6 | ([x, y] := [1, 2]) + | + + + | +3 | (x.y := 1) +4 | (x[y] := 1) +5 | (*x := 1) + | ^ Syntax Error: Expected a statement +6 | ([x, y] := [1, 2]) + | + + + | +3 | (x.y := 1) +4 | (x[y] := 1) +5 | (*x := 1) + | ^ Syntax Error: Expected a statement +6 | ([x, y] := [1, 2]) + | + + + | +4 | (x[y] := 1) +5 | (*x := 1) +6 | ([x, y] := [1, 2]) + | ^^^^^^ Syntax Error: Assignment expression target must be an identifier + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_0.py.snap new file mode 100644 index 0000000000..f2583dca28 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_0.py.snap @@ -0,0 +1,43 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..75, + body: [ + Expr( + StmtExpr { + range: 71..72, + value: Name( + ExprName { + range: 71..72, + id: "x", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # There are no parentheses, so this isn't parsed as named expression. +2 | +3 | x := + | ^^ Syntax Error: Expected a statement + | + + + | +1 | # There are no parentheses, so this isn't parsed as named expression. +2 | +3 | x := + | Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_1.py.snap new file mode 100644 index 0000000000..4a3dc48c47 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_1.py.snap @@ -0,0 +1,47 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..33, + body: [ + Expr( + StmtExpr { + range: 28..33, + value: Named( + ExprNamed { + range: 29..33, + target: Name( + ExprName { + range: 29..30, + id: "x", + ctx: Store, + }, + ), + value: Name( + ExprName { + range: 33..33, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # EOF after the `:=` token +2 | +3 | (x := + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_2.py.snap new file mode 100644 index 0000000000..7da176072a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_2.py.snap @@ -0,0 +1,102 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_2.py +--- +## AST + +``` +Module( + ModModule { + range: 0..87, + body: [ + Expr( + StmtExpr { + range: 61..71, + value: Named( + ExprNamed { + range: 62..71, + target: Name( + ExprName { + range: 62..63, + id: "x", + ctx: Store, + }, + ), + value: Name( + ExprName { + range: 68..71, + id: "def", + ctx: Load, + }, + ), + }, + ), + }, + ), + AnnAssign( + StmtAnnAssign { + range: 72..87, + target: Call( + ExprCall { + range: 72..77, + func: Name( + ExprName { + range: 72..75, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 75..77, + args: [], + keywords: [], + }, + }, + ), + annotation: Name( + ExprName { + range: 83..87, + id: "pass", + ctx: Load, + }, + ), + value: None, + simple: false, + }, + ), + ], + }, +) +``` +## Errors + + | +3 | (x := +4 | +5 | def foo(): + | ^^^ Syntax Error: Expected an identifier, but found a keyword 'def' that cannot be used here +6 | pass + | + + + | +3 | (x := +4 | +5 | def foo(): + | ^^^ Syntax Error: Expected ')', found name +6 | pass + | + + + | +5 | def foo(): +6 | pass + | ^^^^ Syntax Error: Expected an identifier, but found a keyword 'pass' that cannot be used here + | + + + | +5 | def foo(): +6 | pass + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_3.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_3.py.snap new file mode 100644 index 0000000000..4fedd3fdad --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_3.py.snap @@ -0,0 +1,60 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_3.py +--- +## AST + +``` +Module( + ModModule { + range: 0..112, + body: [ + Expr( + StmtExpr { + range: 100..112, + value: Named( + ExprNamed { + range: 101..112, + target: Name( + ExprName { + range: 101..102, + id: "x", + ctx: Store, + }, + ), + value: BinOp( + ExprBinOp { + range: 107..112, + left: Name( + ExprName { + range: 107..108, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 111..112, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +4 | (x := +5 | +6 | x + y + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_4.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_4.py.snap new file mode 100644 index 0000000000..916b391933 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_4.py.snap @@ -0,0 +1,74 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_4.py +--- +## AST + +``` +Module( + ModModule { + range: 0..78, + body: [ + Expr( + StmtExpr { + range: 64..71, + value: Named( + ExprNamed { + range: 65..69, + target: Name( + ExprName { + range: 65..66, + id: "x", + ctx: Store, + }, + ), + value: Name( + ExprName { + range: 69..69, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 73..78, + value: BinOp( + ExprBinOp { + range: 73..78, + left: Name( + ExprName { + range: 73..74, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 77..78, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # No expression on the right side of the assignment expression +2 | +3 | (x := ) + | ^ Syntax Error: Expected an expression +4 | +5 | x + y + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__generator.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__generator.py.snap new file mode 100644 index 0000000000..012bbd706f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__generator.py.snap @@ -0,0 +1,144 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/generator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..36, + body: [ + Expr( + StmtExpr { + range: 0..15, + value: Generator( + ExprGenerator { + range: 0..15, + elt: Starred( + ExprStarred { + range: 1..3, + value: Name( + ExprName { + range: 2..3, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 4..14, + target: Name( + ExprName { + range: 8..9, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 13..14, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 16..24, + value: Tuple( + ExprTuple { + range: 16..24, + elts: [ + Named( + ExprNamed { + range: 17..23, + target: Name( + ExprName { + range: 17..18, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 22..23, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + For( + StmtFor { + range: 25..35, + is_async: false, + target: Name( + ExprName { + range: 29..30, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 34..35, + id: "y", + ctx: Load, + }, + ), + body: [], + orelse: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | (*x for x in y) + | ^^ Syntax Error: Iterable unpacking cannot be used in a comprehension +2 | (x := 1, for x in y) + | + + + | +1 | (*x for x in y) +2 | (x := 1, for x in y) + | ^^^ Syntax Error: Expected an expression or a ')' + | + + + | +1 | (*x for x in y) +2 | (x := 1, for x in y) + | ^ Syntax Error: Expected ':', found ')' + | + + + | +1 | (*x for x in y) +2 | (x := 1, for x in y) + | Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_0.py.snap new file mode 100644 index 0000000000..f7c864a265 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_0.py.snap @@ -0,0 +1,35 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..47, + body: [ + Expr( + StmtExpr { + range: 46..47, + value: Name( + ExprName { + range: 47..47, + id: "", + ctx: Invalid, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Missing closing parentheses 0: No elements +2 | +3 | ( + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_1.py.snap new file mode 100644 index 0000000000..37bfd450e0 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_1.py.snap @@ -0,0 +1,48 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..137, + body: [ + Expr( + StmtExpr { + range: 129..137, + value: BinOp( + ExprBinOp { + range: 132..137, + left: Name( + ExprName { + range: 132..133, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 136..137, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +4 | ( +5 | +6 | x + y + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_2.py.snap new file mode 100644 index 0000000000..6c0f8e9524 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_2.py.snap @@ -0,0 +1,65 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_2.py +--- +## AST + +``` +Module( + ModModule { + range: 0..146, + body: [ + Expr( + StmtExpr { + range: 136..146, + value: Tuple( + ExprTuple { + range: 136..146, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 137..138, + value: Int( + 1, + ), + }, + ), + BinOp( + ExprBinOp { + range: 141..146, + left: Name( + ExprName { + range: 141..142, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 145..146, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +4 | (1, +5 | +6 | x + y + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_3.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_3.py.snap new file mode 100644 index 0000000000..4cd851ef5c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_3.py.snap @@ -0,0 +1,89 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_3.py +--- +## AST + +``` +Module( + ModModule { + range: 0..144, + body: [ + Expr( + StmtExpr { + range: 118..123, + value: Tuple( + ExprTuple { + range: 118..123, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 119..120, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 122..123, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + FunctionDef( + StmtFunctionDef { + range: 125..144, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 129..132, + }, + type_params: None, + parameters: Parameters { + range: 132..134, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 140..144, + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +4 | (1, 2 +5 | +6 | def foo(): + | ^^^ Syntax Error: Expected ',', found 'def' +7 | pass + | + + + | +6 | def foo(): +7 | pass + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__parenthesized.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__parenthesized.py.snap new file mode 100644 index 0000000000..363ea16627 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__parenthesized.py.snap @@ -0,0 +1,74 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/parenthesized.py +--- +## AST + +``` +Module( + ModModule { + range: 0..125, + body: [ + Expr( + StmtExpr { + range: 66..70, + value: Starred( + ExprStarred { + range: 67..69, + value: Name( + ExprName { + range: 68..69, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 119..120, + value: Name( + ExprName { + range: 119..120, + id: "x", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 124..125, + value: NumberLiteral( + ExprNumberLiteral { + range: 124..125, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Starred expression isn't allowed in a parenthesized expression. +2 | (*x) + | ^^ Syntax Error: Starred expression cannot be used here +3 | +4 | # Unparenthesized named expression is allowed. + | + + + | +4 | # Unparenthesized named expression is allowed. +5 | x := 1 + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple.py.snap new file mode 100644 index 0000000000..5227204d98 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple.py.snap @@ -0,0 +1,390 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/tuple.py +--- +## AST + +``` +Module( + ModModule { + range: 0..267, + body: [ + Expr( + StmtExpr { + range: 83..86, + value: Tuple( + ExprTuple { + range: 83..86, + elts: [ + Name( + ExprName { + range: 84..84, + id: "", + ctx: Invalid, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 88..94, + value: Tuple( + ExprTuple { + range: 88..94, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 89..90, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 92..93, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 96..101, + value: Tuple( + ExprTuple { + range: 96..101, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 97..98, + value: Int( + 1, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 119..121, + value: NumberLiteral( + ExprNumberLiteral { + range: 120..121, + value: Int( + 1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 122..123, + value: NumberLiteral( + ExprNumberLiteral { + range: 122..123, + value: Int( + 2, + ), + }, + ), + }, + ), + AnnAssign( + StmtAnnAssign { + range: 157..162, + target: NumberLiteral( + ExprNumberLiteral { + range: 158..159, + value: Int( + 1, + ), + }, + ), + annotation: NumberLiteral( + ExprNumberLiteral { + range: 161..162, + value: Int( + 2, + ), + }, + ), + value: None, + simple: false, + }, + ), + Expr( + StmtExpr { + range: 186..195, + value: Tuple( + ExprTuple { + range: 186..195, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 187..188, + value: Int( + 1, + ), + }, + ), + BinOp( + ExprBinOp { + range: 190..193, + left: Name( + ExprName { + range: 190..191, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 193..193, + id: "", + ctx: Invalid, + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 197..199, + value: NumberLiteral( + ExprNumberLiteral { + range: 198..199, + value: Int( + 1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 201..202, + value: NumberLiteral( + ExprNumberLiteral { + range: 201..202, + value: Int( + 2, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 255..267, + value: Tuple( + ExprTuple { + range: 255..267, + elts: [ + Name( + ExprName { + range: 255..256, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 258..259, + id: "y", + ctx: Load, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 263..264, + value: Int( + 2, + ), + }, + ), + Name( + ExprName { + range: 266..267, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Test cases for tuple expressions where the parser recovers from a syntax error. +2 | +3 | (,) + | ^ Syntax Error: Expected an expression +4 | +5 | (1,,2) + | + + + | +3 | (,) +4 | +5 | (1,,2) + | ^ Syntax Error: Expected an expression or a ')' +6 | +7 | (1,,) + | + + + | +5 | (1,,2) +6 | +7 | (1,,) + | ^ Syntax Error: Expected an expression or a ')' +8 | +9 | # Missing comma + | + + + | + 9 | # Missing comma +10 | (1 2) + | ^ Syntax Error: Expected ')', found int +11 | +12 | # Dictionary element in a list + | + + + | + 9 | # Missing comma +10 | (1 2) + | ^ Syntax Error: Expected a statement +11 | +12 | # Dictionary element in a list + | + + + | + 9 | # Missing comma +10 | (1 2) + | ^ Syntax Error: Expected a statement +11 | +12 | # Dictionary element in a list +13 | (1: 2) + | + + + | +12 | # Dictionary element in a list +13 | (1: 2) + | ^ Syntax Error: Expected ')', found ':' +14 | +15 | # Missing expression + | + + + | +12 | # Dictionary element in a list +13 | (1: 2) + | ^ Syntax Error: Invalid annotated assignment target +14 | +15 | # Missing expression + | + + + | +12 | # Dictionary element in a list +13 | (1: 2) + | ^ Syntax Error: Expected a statement +14 | +15 | # Missing expression + | + + + | +12 | # Dictionary element in a list +13 | (1: 2) + | ^ Syntax Error: Expected a statement +14 | +15 | # Missing expression +16 | (1, x + ) + | + + + | +15 | # Missing expression +16 | (1, x + ) + | ^ Syntax Error: Expected an expression +17 | +18 | (1; 2) + | + + + | +16 | (1, x + ) +17 | +18 | (1; 2) + | ^ Syntax Error: Expected ')', found ';' +19 | +20 | # Unparenthesized named expression is not allowed + | + + + | +16 | (1, x + ) +17 | +18 | (1; 2) + | ^ Syntax Error: Expected a statement +19 | +20 | # Unparenthesized named expression is not allowed + | + + + | +16 | (1, x + ) +17 | +18 | (1; 2) + | ^ Syntax Error: Expected a statement +19 | +20 | # Unparenthesized named expression is not allowed +21 | x, y := 2, z + | + + + | +20 | # Unparenthesized named expression is not allowed +21 | x, y := 2, z + | ^^ Syntax Error: Expected ',', found ':=' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple_starred_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple_starred_expr.py.snap new file mode 100644 index 0000000000..21afcfe655 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple_starred_expr.py.snap @@ -0,0 +1,1402 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/tuple_starred_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..536, + body: [ + Expr( + StmtExpr { + range: 161..182, + value: Tuple( + ExprTuple { + range: 161..182, + elts: [ + Starred( + ExprStarred { + range: 162..169, + value: Compare( + ExprCompare { + range: 163..169, + left: Name( + ExprName { + range: 163..164, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 168..169, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 171..172, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 174..181, + value: Compare( + ExprCompare { + range: 175..181, + left: Name( + ExprName { + range: 175..176, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 180..181, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 183..202, + value: Tuple( + ExprTuple { + range: 183..202, + elts: [ + Starred( + ExprStarred { + range: 184..190, + value: UnaryOp( + ExprUnaryOp { + range: 185..190, + op: Not, + operand: Name( + ExprName { + range: 189..190, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 192..193, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 195..201, + value: UnaryOp( + ExprUnaryOp { + range: 196..201, + op: Not, + operand: Name( + ExprName { + range: 200..201, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 203..226, + value: Tuple( + ExprTuple { + range: 203..226, + elts: [ + Starred( + ExprStarred { + range: 204..212, + value: BoolOp( + ExprBoolOp { + range: 205..212, + op: And, + values: [ + Name( + ExprName { + range: 205..206, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 211..212, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 214..215, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 217..225, + value: BoolOp( + ExprBoolOp { + range: 218..225, + op: And, + values: [ + Name( + ExprName { + range: 218..219, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 224..225, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 227..248, + value: Tuple( + ExprTuple { + range: 227..248, + elts: [ + Starred( + ExprStarred { + range: 228..235, + value: BoolOp( + ExprBoolOp { + range: 229..235, + op: Or, + values: [ + Name( + ExprName { + range: 229..230, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 234..235, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 237..238, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 240..247, + value: BoolOp( + ExprBoolOp { + range: 241..247, + op: Or, + values: [ + Name( + ExprName { + range: 241..242, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 246..247, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 249..290, + value: Tuple( + ExprTuple { + range: 249..290, + elts: [ + Starred( + ExprStarred { + range: 250..267, + value: If( + ExprIf { + range: 251..267, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 256..260, + value: true, + }, + ), + body: Name( + ExprName { + range: 251..252, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 266..267, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 269..270, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 272..289, + value: If( + ExprIf { + range: 273..289, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 278..282, + value: true, + }, + ), + body: Name( + ExprName { + range: 273..274, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 288..289, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 291..322, + value: Tuple( + ExprTuple { + range: 291..322, + elts: [ + Starred( + ExprStarred { + range: 292..304, + value: Lambda( + ExprLambda { + range: 293..304, + parameters: Some( + Parameters { + range: 300..301, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 300..301, + parameter: Parameter { + range: 300..301, + name: Identifier { + id: "x", + range: 300..301, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 303..304, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 306..307, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 309..321, + value: Lambda( + ExprLambda { + range: 310..321, + parameters: Some( + Parameters { + range: 317..318, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 317..318, + parameter: Parameter { + range: 317..318, + name: Identifier { + id: "x", + range: 317..318, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 320..321, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 323..326, + value: Starred( + ExprStarred { + range: 324..326, + value: Name( + ExprName { + range: 325..326, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 330..343, + value: Tuple( + ExprTuple { + range: 330..343, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 330..331, + value: Int( + 2, + ), + }, + ), + Name( + ExprName { + range: 333..334, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 336..338, + value: Name( + ExprName { + range: 337..338, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 342..343, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 367..386, + value: Tuple( + ExprTuple { + range: 367..386, + elts: [ + Starred( + ExprStarred { + range: 367..374, + value: Compare( + ExprCompare { + range: 368..374, + left: Name( + ExprName { + range: 368..369, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 373..374, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 376..377, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 379..386, + value: Compare( + ExprCompare { + range: 380..386, + left: Name( + ExprName { + range: 380..381, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 385..386, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 387..404, + value: Tuple( + ExprTuple { + range: 387..404, + elts: [ + Starred( + ExprStarred { + range: 387..393, + value: UnaryOp( + ExprUnaryOp { + range: 388..393, + op: Not, + operand: Name( + ExprName { + range: 392..393, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 395..396, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 398..404, + value: UnaryOp( + ExprUnaryOp { + range: 399..404, + op: Not, + operand: Name( + ExprName { + range: 403..404, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 405..426, + value: Tuple( + ExprTuple { + range: 405..426, + elts: [ + Starred( + ExprStarred { + range: 405..413, + value: BoolOp( + ExprBoolOp { + range: 406..413, + op: And, + values: [ + Name( + ExprName { + range: 406..407, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 412..413, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 415..416, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 418..426, + value: BoolOp( + ExprBoolOp { + range: 419..426, + op: And, + values: [ + Name( + ExprName { + range: 419..420, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 425..426, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 427..446, + value: Tuple( + ExprTuple { + range: 427..446, + elts: [ + Starred( + ExprStarred { + range: 427..434, + value: BoolOp( + ExprBoolOp { + range: 428..434, + op: Or, + values: [ + Name( + ExprName { + range: 428..429, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 433..434, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 436..437, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 439..446, + value: BoolOp( + ExprBoolOp { + range: 440..446, + op: Or, + values: [ + Name( + ExprName { + range: 440..441, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 445..446, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 447..486, + value: Tuple( + ExprTuple { + range: 447..486, + elts: [ + Starred( + ExprStarred { + range: 447..464, + value: If( + ExprIf { + range: 448..464, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 453..457, + value: true, + }, + ), + body: Name( + ExprName { + range: 448..449, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 463..464, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 466..467, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 469..486, + value: If( + ExprIf { + range: 470..486, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 475..479, + value: true, + }, + ), + body: Name( + ExprName { + range: 470..471, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 485..486, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 487..516, + value: Tuple( + ExprTuple { + range: 487..516, + elts: [ + Starred( + ExprStarred { + range: 487..499, + value: Lambda( + ExprLambda { + range: 488..499, + parameters: Some( + Parameters { + range: 495..496, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 495..496, + parameter: Parameter { + range: 495..496, + name: Identifier { + id: "x", + range: 495..496, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 498..499, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 501..502, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 504..516, + value: Lambda( + ExprLambda { + range: 505..516, + parameters: Some( + Parameters { + range: 512..513, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 512..513, + parameter: Parameter { + range: 512..513, + name: Identifier { + id: "x", + range: 512..513, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 515..516, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 517..519, + value: Starred( + ExprStarred { + range: 517..519, + value: Name( + ExprName { + range: 518..519, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 523..536, + value: Tuple( + ExprTuple { + range: 523..536, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 523..524, + value: Int( + 2, + ), + }, + ), + Name( + ExprName { + range: 526..527, + id: "z", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 529..531, + value: Name( + ExprName { + range: 530..531, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 535..536, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +2 | # Test the first and any other element as the there are two separate calls. +3 | +4 | (*x in y, z, *x in y) + | ^^^^^^ Syntax Error: Comparison expression cannot be used here +5 | (*not x, z, *not x) +6 | (*x and y, z, *x and y) + | + + + | +2 | # Test the first and any other element as the there are two separate calls. +3 | +4 | (*x in y, z, *x in y) + | ^^^^^^ Syntax Error: Comparison expression cannot be used here +5 | (*not x, z, *not x) +6 | (*x and y, z, *x and y) + | + + + | +4 | (*x in y, z, *x in y) +5 | (*not x, z, *not x) + | ^^^^^ Syntax Error: Boolean expression cannot be used here +6 | (*x and y, z, *x and y) +7 | (*x or y, z, *x or y) + | + + + | +4 | (*x in y, z, *x in y) +5 | (*not x, z, *not x) + | ^^^^^ Syntax Error: Boolean expression cannot be used here +6 | (*x and y, z, *x and y) +7 | (*x or y, z, *x or y) + | + + + | +4 | (*x in y, z, *x in y) +5 | (*not x, z, *not x) +6 | (*x and y, z, *x and y) + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here +7 | (*x or y, z, *x or y) +8 | (*x if True else y, z, *x if True else y) + | + + + | +4 | (*x in y, z, *x in y) +5 | (*not x, z, *not x) +6 | (*x and y, z, *x and y) + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here +7 | (*x or y, z, *x or y) +8 | (*x if True else y, z, *x if True else y) + | + + + | +5 | (*not x, z, *not x) +6 | (*x and y, z, *x and y) +7 | (*x or y, z, *x or y) + | ^^^^^^ Syntax Error: Boolean expression cannot be used here +8 | (*x if True else y, z, *x if True else y) +9 | (*lambda x: x, z, *lambda x: x) + | + + + | +5 | (*not x, z, *not x) +6 | (*x and y, z, *x and y) +7 | (*x or y, z, *x or y) + | ^^^^^^ Syntax Error: Boolean expression cannot be used here +8 | (*x if True else y, z, *x if True else y) +9 | (*lambda x: x, z, *lambda x: x) + | + + + | + 6 | (*x and y, z, *x and y) + 7 | (*x or y, z, *x or y) + 8 | (*x if True else y, z, *x if True else y) + | ^^^^^^^^^^^^^^^^ Syntax Error: Conditional expression cannot be used here + 9 | (*lambda x: x, z, *lambda x: x) +10 | (*x := 2, z, *x := 2) + | + + + | + 6 | (*x and y, z, *x and y) + 7 | (*x or y, z, *x or y) + 8 | (*x if True else y, z, *x if True else y) + | ^^^^^^^^^^^^^^^^ Syntax Error: Conditional expression cannot be used here + 9 | (*lambda x: x, z, *lambda x: x) +10 | (*x := 2, z, *x := 2) + | + + + | + 7 | (*x or y, z, *x or y) + 8 | (*x if True else y, z, *x if True else y) + 9 | (*lambda x: x, z, *lambda x: x) + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +10 | (*x := 2, z, *x := 2) + | + + + | + 7 | (*x or y, z, *x or y) + 8 | (*x if True else y, z, *x if True else y) + 9 | (*lambda x: x, z, *lambda x: x) + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +10 | (*x := 2, z, *x := 2) + | + + + | + 8 | (*x if True else y, z, *x if True else y) + 9 | (*lambda x: x, z, *lambda x: x) +10 | (*x := 2, z, *x := 2) + | ^^ Syntax Error: Starred expression cannot be used here + | + + + | + 8 | (*x if True else y, z, *x if True else y) + 9 | (*lambda x: x, z, *lambda x: x) +10 | (*x := 2, z, *x := 2) + | ^^ Syntax Error: Expected ')', found ':=' + | + + + | + 8 | (*x if True else y, z, *x if True else y) + 9 | (*lambda x: x, z, *lambda x: x) +10 | (*x := 2, z, *x := 2) + | ^^ Syntax Error: Expected ',', found ':=' + | + + + | + 8 | (*x if True else y, z, *x if True else y) + 9 | (*lambda x: x, z, *lambda x: x) +10 | (*x := 2, z, *x := 2) + | ^ Syntax Error: Expected a statement + | + + + | + 8 | (*x if True else y, z, *x if True else y) + 9 | (*lambda x: x, z, *lambda x: x) +10 | (*x := 2, z, *x := 2) + | ^ Syntax Error: Expected a statement +11 | +12 | +13 | # Non-parenthesized + | + + + | +13 | # Non-parenthesized +14 | *x in y, z, *x in y + | ^^^^^^ Syntax Error: Comparison expression cannot be used here +15 | *not x, z, *not x +16 | *x and y, z, *x and y + | + + + | +13 | # Non-parenthesized +14 | *x in y, z, *x in y + | ^^^^^^ Syntax Error: Comparison expression cannot be used here +15 | *not x, z, *not x +16 | *x and y, z, *x and y + | + + + | +13 | # Non-parenthesized +14 | *x in y, z, *x in y +15 | *not x, z, *not x + | ^^^^^ Syntax Error: Boolean expression cannot be used here +16 | *x and y, z, *x and y +17 | *x or y, z, *x or y + | + + + | +13 | # Non-parenthesized +14 | *x in y, z, *x in y +15 | *not x, z, *not x + | ^^^^^ Syntax Error: Boolean expression cannot be used here +16 | *x and y, z, *x and y +17 | *x or y, z, *x or y + | + + + | +14 | *x in y, z, *x in y +15 | *not x, z, *not x +16 | *x and y, z, *x and y + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here +17 | *x or y, z, *x or y +18 | *x if True else y, z, *x if True else y + | + + + | +14 | *x in y, z, *x in y +15 | *not x, z, *not x +16 | *x and y, z, *x and y + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here +17 | *x or y, z, *x or y +18 | *x if True else y, z, *x if True else y + | + + + | +15 | *not x, z, *not x +16 | *x and y, z, *x and y +17 | *x or y, z, *x or y + | ^^^^^^ Syntax Error: Boolean expression cannot be used here +18 | *x if True else y, z, *x if True else y +19 | *lambda x: x, z, *lambda x: x + | + + + | +15 | *not x, z, *not x +16 | *x and y, z, *x and y +17 | *x or y, z, *x or y + | ^^^^^^ Syntax Error: Boolean expression cannot be used here +18 | *x if True else y, z, *x if True else y +19 | *lambda x: x, z, *lambda x: x + | + + + | +16 | *x and y, z, *x and y +17 | *x or y, z, *x or y +18 | *x if True else y, z, *x if True else y + | ^^^^^^^^^^^^^^^^ Syntax Error: Conditional expression cannot be used here +19 | *lambda x: x, z, *lambda x: x +20 | *x := 2, z, *x := 2 + | + + + | +16 | *x and y, z, *x and y +17 | *x or y, z, *x or y +18 | *x if True else y, z, *x if True else y + | ^^^^^^^^^^^^^^^^ Syntax Error: Conditional expression cannot be used here +19 | *lambda x: x, z, *lambda x: x +20 | *x := 2, z, *x := 2 + | + + + | +17 | *x or y, z, *x or y +18 | *x if True else y, z, *x if True else y +19 | *lambda x: x, z, *lambda x: x + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +20 | *x := 2, z, *x := 2 + | + + + | +17 | *x or y, z, *x or y +18 | *x if True else y, z, *x if True else y +19 | *lambda x: x, z, *lambda x: x + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +20 | *x := 2, z, *x := 2 + | + + + | +18 | *x if True else y, z, *x if True else y +19 | *lambda x: x, z, *lambda x: x +20 | *x := 2, z, *x := 2 + | ^^ Syntax Error: Expected a statement + | + + + | +18 | *x if True else y, z, *x if True else y +19 | *lambda x: x, z, *lambda x: x +20 | *x := 2, z, *x := 2 + | ^^ Syntax Error: Expected ',', found ':=' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__comprehension.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__comprehension.py.snap new file mode 100644 index 0000000000..a4bff441f8 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__comprehension.py.snap @@ -0,0 +1,796 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/set/comprehension.py +--- +## AST + +``` +Module( + ModModule { + range: 0..377, + body: [ + Expr( + StmtExpr { + range: 33..48, + value: SetComp( + ExprSetComp { + range: 33..48, + elt: Starred( + ExprStarred { + range: 34..36, + value: Name( + ExprName { + range: 35..36, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 37..47, + target: Name( + ExprName { + range: 41..42, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 46..47, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 67..81, + value: SetComp( + ExprSetComp { + range: 67..81, + elt: Name( + ExprName { + range: 68..69, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 70..80, + target: NumberLiteral( + ExprNumberLiteral { + range: 74..75, + value: Int( + 1, + ), + }, + ), + iter: Name( + ExprName { + range: 79..80, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 82..98, + value: SetComp( + ExprSetComp { + range: 82..98, + elt: Name( + ExprName { + range: 83..84, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 85..97, + target: StringLiteral( + ExprStringLiteral { + range: 89..92, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 89..92, + value: "a", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + iter: Name( + ExprName { + range: 96..97, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 99..118, + value: SetComp( + ExprSetComp { + range: 99..118, + elt: Name( + ExprName { + range: 100..101, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 102..117, + target: Call( + ExprCall { + range: 106..112, + func: Name( + ExprName { + range: 106..110, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 110..112, + args: [], + keywords: [], + }, + }, + ), + iter: Name( + ExprName { + range: 116..117, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 119..138, + value: SetComp( + ExprSetComp { + range: 119..138, + elt: Name( + ExprName { + range: 120..121, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 122..137, + target: Set( + ExprSet { + range: 126..132, + elts: [ + Name( + ExprName { + range: 127..128, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 130..131, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + iter: Name( + ExprName { + range: 136..137, + id: "y", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 155..170, + value: SetComp( + ExprSetComp { + range: 155..170, + elt: Name( + ExprName { + range: 156..157, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 158..169, + target: Name( + ExprName { + range: 162..163, + id: "x", + ctx: Store, + }, + ), + iter: Starred( + ExprStarred { + range: 167..169, + value: Name( + ExprName { + range: 168..169, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 171..191, + value: SetComp( + ExprSetComp { + range: 171..191, + elt: Name( + ExprName { + range: 172..173, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 174..190, + target: Name( + ExprName { + range: 178..179, + id: "x", + ctx: Store, + }, + ), + iter: Yield( + ExprYield { + range: 183..190, + value: Some( + Name( + ExprName { + range: 189..190, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 192..217, + value: SetComp( + ExprSetComp { + range: 192..217, + elt: Name( + ExprName { + range: 193..194, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 195..216, + target: Name( + ExprName { + range: 199..200, + id: "x", + ctx: Store, + }, + ), + iter: YieldFrom( + ExprYieldFrom { + range: 204..216, + value: Name( + ExprName { + range: 215..216, + id: "y", + ctx: Load, + }, + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 218..242, + value: SetComp( + ExprSetComp { + range: 218..242, + elt: Name( + ExprName { + range: 219..220, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 221..241, + target: Name( + ExprName { + range: 225..226, + id: "x", + ctx: Store, + }, + ), + iter: Lambda( + ExprLambda { + range: 230..241, + parameters: Some( + Parameters { + range: 237..238, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 237..238, + parameter: Parameter { + range: 237..238, + name: Identifier { + id: "y", + range: 237..238, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 240..241, + id: "y", + ctx: Load, + }, + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 257..280, + value: SetComp( + ExprSetComp { + range: 257..280, + elt: Name( + ExprName { + range: 258..259, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 260..279, + target: Name( + ExprName { + range: 264..265, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 269..273, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Starred( + ExprStarred { + range: 277..279, + value: Name( + ExprName { + range: 278..279, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 281..309, + value: SetComp( + ExprSetComp { + range: 281..309, + elt: Name( + ExprName { + range: 282..283, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 284..308, + target: Name( + ExprName { + range: 288..289, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 293..297, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Yield( + ExprYield { + range: 301..308, + value: Some( + Name( + ExprName { + range: 307..308, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 310..343, + value: SetComp( + ExprSetComp { + range: 310..343, + elt: Name( + ExprName { + range: 311..312, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 313..342, + target: Name( + ExprName { + range: 317..318, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 322..326, + id: "data", + ctx: Load, + }, + ), + ifs: [ + YieldFrom( + ExprYieldFrom { + range: 330..342, + value: Name( + ExprName { + range: 341..342, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 344..376, + value: SetComp( + ExprSetComp { + range: 344..376, + elt: Name( + ExprName { + range: 345..346, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 347..375, + target: Name( + ExprName { + range: 351..352, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 356..360, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Lambda( + ExprLambda { + range: 364..375, + parameters: Some( + Parameters { + range: 371..372, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 371..372, + parameter: Parameter { + range: 371..372, + name: Identifier { + id: "y", + range: 371..372, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 374..375, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Iterable unpacking not allowed +2 | {*x for x in y} + | ^^ Syntax Error: Iterable unpacking cannot be used in a comprehension +3 | +4 | # Invalid target + | + + + | +4 | # Invalid target +5 | {x for 1 in y} + | ^ Syntax Error: Invalid assignment target +6 | {x for 'a' in y} +7 | {x for call() in y} + | + + + | +4 | # Invalid target +5 | {x for 1 in y} +6 | {x for 'a' in y} + | ^^^ Syntax Error: Invalid assignment target +7 | {x for call() in y} +8 | {x for {a, b} in y} + | + + + | +5 | {x for 1 in y} +6 | {x for 'a' in y} +7 | {x for call() in y} + | ^^^^^^ Syntax Error: Invalid assignment target +8 | {x for {a, b} in y} + | + + + | + 6 | {x for 'a' in y} + 7 | {x for call() in y} + 8 | {x for {a, b} in y} + | ^^^^^^ Syntax Error: Invalid assignment target + 9 | +10 | # Invalid iter + | + + + | +10 | # Invalid iter +11 | {x for x in *y} + | ^^ Syntax Error: Starred expression cannot be used here +12 | {x for x in yield y} +13 | {x for x in yield from y} + | + + + | +10 | # Invalid iter +11 | {x for x in *y} +12 | {x for x in yield y} + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +13 | {x for x in yield from y} +14 | {x for x in lambda y: y} + | + + + | +11 | {x for x in *y} +12 | {x for x in yield y} +13 | {x for x in yield from y} + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +14 | {x for x in lambda y: y} + | + + + | +12 | {x for x in yield y} +13 | {x for x in yield from y} +14 | {x for x in lambda y: y} + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +15 | +16 | # Invalid if + | + + + | +16 | # Invalid if +17 | {x for x in data if *y} + | ^^ Syntax Error: Starred expression cannot be used here +18 | {x for x in data if yield y} +19 | {x for x in data if yield from y} + | + + + | +16 | # Invalid if +17 | {x for x in data if *y} +18 | {x for x in data if yield y} + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +19 | {x for x in data if yield from y} +20 | {x for x in data if lambda y: y} + | + + + | +17 | {x for x in data if *y} +18 | {x for x in data if yield y} +19 | {x for x in data if yield from y} + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +20 | {x for x in data if lambda y: y} + | + + + | +18 | {x for x in data if yield y} +19 | {x for x in data if yield from y} +20 | {x for x in data if lambda y: y} + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_0.py.snap new file mode 100644 index 0000000000..18c6034e1e --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_0.py.snap @@ -0,0 +1,42 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..47, + body: [ + Expr( + StmtExpr { + range: 46..47, + value: Set( + ExprSet { + range: 46..47, + elts: [ + Name( + ExprName { + range: 47..47, + id: "", + ctx: Invalid, + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Missing closing curly brace 0: No elements +2 | +3 | { + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_1.py.snap new file mode 100644 index 0000000000..340384ab77 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_1.py.snap @@ -0,0 +1,55 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..136, + body: [ + Expr( + StmtExpr { + range: 128..136, + value: Set( + ExprSet { + range: 128..136, + elts: [ + BinOp( + ExprBinOp { + range: 131..136, + left: Name( + ExprName { + range: 131..132, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 135..136, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +4 | { +5 | +6 | x + y + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_2.py.snap new file mode 100644 index 0000000000..9cdfecaceb --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_2.py.snap @@ -0,0 +1,63 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_2.py +--- +## AST + +``` +Module( + ModModule { + range: 0..144, + body: [ + Expr( + StmtExpr { + range: 134..144, + value: Set( + ExprSet { + range: 134..144, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 135..136, + value: Int( + 1, + ), + }, + ), + BinOp( + ExprBinOp { + range: 139..144, + left: Name( + ExprName { + range: 139..140, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 143..144, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +4 | {1, +5 | +6 | x + y + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_3.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_3.py.snap new file mode 100644 index 0000000000..128d499a9a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_3.py.snap @@ -0,0 +1,87 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_3.py +--- +## AST + +``` +Module( + ModModule { + range: 0..144, + body: [ + Expr( + StmtExpr { + range: 118..123, + value: Set( + ExprSet { + range: 118..123, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 119..120, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 122..123, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + }, + ), + FunctionDef( + StmtFunctionDef { + range: 125..144, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 129..132, + }, + type_params: None, + parameters: Parameters { + range: 132..134, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 140..144, + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +4 | {1, 2 +5 | +6 | def foo(): + | ^^^ Syntax Error: Expected ',', found 'def' +7 | pass + | + + + | +6 | def foo(): +7 | pass + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__recover.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__recover.py.snap new file mode 100644 index 0000000000..ba84d23b89 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__recover.py.snap @@ -0,0 +1,302 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/set/recover.py +--- +## AST + +``` +Module( + ModModule { + range: 0..323, + body: [ + Expr( + StmtExpr { + range: 197..200, + value: Set( + ExprSet { + range: 197..200, + elts: [ + Name( + ExprName { + range: 198..198, + id: "", + ctx: Invalid, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 202..208, + value: Set( + ExprSet { + range: 202..208, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 203..204, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 206..207, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 210..215, + value: Set( + ExprSet { + range: 210..215, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 211..212, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 233..238, + value: Set( + ExprSet { + range: 233..238, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 234..235, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 236..237, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 271..277, + value: Dict( + ExprDict { + range: 271..277, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 272..273, + value: Int( + 1, + ), + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 275..276, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 300..309, + value: Set( + ExprSet { + range: 300..309, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 301..302, + value: Int( + 1, + ), + }, + ), + BinOp( + ExprBinOp { + range: 304..307, + left: Name( + ExprName { + range: 304..305, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 307..307, + id: "", + ctx: Invalid, + }, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 311..317, + value: Set( + ExprSet { + range: 311..317, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 312..313, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 315..316, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 319..322, + value: List( + ExprList { + range: 319..322, + elts: [ + Starred( + ExprStarred { + range: 320..321, + value: Name( + ExprName { + range: 321..321, + id: "", + ctx: Invalid, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +3 | # These are same as for the list expressions. +4 | +5 | {,} + | ^ Syntax Error: Expected an expression +6 | +7 | {1,,2} + | + + + | +5 | {,} +6 | +7 | {1,,2} + | ^ Syntax Error: Expected an expression or a '}' +8 | +9 | {1,,} + | + + + | + 7 | {1,,2} + 8 | + 9 | {1,,} + | ^ Syntax Error: Expected an expression or a '}' +10 | +11 | # Missing comma + | + + + | +11 | # Missing comma +12 | {1 2} + | ^ Syntax Error: Expected ',', found int +13 | +14 | # Dictionary element in a list + | + + + | +17 | # Missing expression +18 | {1, x + } + | ^ Syntax Error: Expected an expression +19 | +20 | {1; 2} + | + + + | +18 | {1, x + } +19 | +20 | {1; 2} + | ^ Syntax Error: Expected an expression or a '}' +21 | +22 | [*] + | + + + | +20 | {1; 2} +21 | +22 | [*] + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__star_expression_precedence.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__star_expression_precedence.py.snap new file mode 100644 index 0000000000..baa5df7880 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__star_expression_precedence.py.snap @@ -0,0 +1,454 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/set/star_expression_precedence.py +--- +## AST + +``` +Module( + ModModule { + range: 0..198, + body: [ + Expr( + StmtExpr { + range: 83..92, + value: Set( + ExprSet { + range: 83..92, + elts: [ + Starred( + ExprStarred { + range: 85..87, + value: Name( + ExprName { + range: 86..87, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 90..91, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 93..105, + value: Set( + ExprSet { + range: 93..105, + elts: [ + Starred( + ExprStarred { + range: 94..101, + value: Compare( + ExprCompare { + range: 95..101, + left: Name( + ExprName { + range: 95..96, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 100..101, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 103..104, + id: "z", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 106..117, + value: Set( + ExprSet { + range: 106..117, + elts: [ + Starred( + ExprStarred { + range: 107..113, + value: UnaryOp( + ExprUnaryOp { + range: 108..113, + op: Not, + operand: Name( + ExprName { + range: 112..113, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 115..116, + id: "z", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 118..131, + value: Set( + ExprSet { + range: 118..131, + elts: [ + Starred( + ExprStarred { + range: 119..127, + value: BoolOp( + ExprBoolOp { + range: 120..127, + op: And, + values: [ + Name( + ExprName { + range: 120..121, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 126..127, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 129..130, + id: "z", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 132..144, + value: Set( + ExprSet { + range: 132..144, + elts: [ + Starred( + ExprStarred { + range: 133..140, + value: BoolOp( + ExprBoolOp { + range: 134..140, + op: Or, + values: [ + Name( + ExprName { + range: 134..135, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 139..140, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 142..143, + id: "z", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 145..167, + value: Set( + ExprSet { + range: 145..167, + elts: [ + Starred( + ExprStarred { + range: 146..163, + value: If( + ExprIf { + range: 147..163, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 152..156, + value: true, + }, + ), + body: Name( + ExprName { + range: 147..148, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 162..163, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 165..166, + id: "z", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 168..185, + value: Set( + ExprSet { + range: 168..185, + elts: [ + Starred( + ExprStarred { + range: 169..181, + value: Lambda( + ExprLambda { + range: 170..181, + parameters: Some( + Parameters { + range: 177..178, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 177..178, + parameter: Parameter { + range: 177..178, + name: Identifier { + id: "x", + range: 177..178, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 180..181, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 183..184, + id: "z", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 186..198, + value: Set( + ExprSet { + range: 186..198, + elts: [ + Starred( + ExprStarred { + range: 187..189, + value: Name( + ExprName { + range: 188..189, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 193..194, + value: Int( + 2, + ), + }, + ), + Name( + ExprName { + range: 196..197, + id: "z", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # For set expression, the minimum binding power of star expression is bitwise or. +2 | +3 | {(*x), y} + | ^^ Syntax Error: Starred expression cannot be used here +4 | {*x in y, z} +5 | {*not x, z} + | + + + | +3 | {(*x), y} +4 | {*x in y, z} + | ^^^^^^ Syntax Error: Comparison expression cannot be used here +5 | {*not x, z} +6 | {*x and y, z} + | + + + | +3 | {(*x), y} +4 | {*x in y, z} +5 | {*not x, z} + | ^^^^^ Syntax Error: Boolean expression cannot be used here +6 | {*x and y, z} +7 | {*x or y, z} + | + + + | +4 | {*x in y, z} +5 | {*not x, z} +6 | {*x and y, z} + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here +7 | {*x or y, z} +8 | {*x if True else y, z} + | + + + | +5 | {*not x, z} +6 | {*x and y, z} +7 | {*x or y, z} + | ^^^^^^ Syntax Error: Boolean expression cannot be used here +8 | {*x if True else y, z} +9 | {*lambda x: x, z} + | + + + | + 6 | {*x and y, z} + 7 | {*x or y, z} + 8 | {*x if True else y, z} + | ^^^^^^^^^^^^^^^^ Syntax Error: Conditional expression cannot be used here + 9 | {*lambda x: x, z} +10 | {*x := 2, z} + | + + + | + 7 | {*x or y, z} + 8 | {*x if True else y, z} + 9 | {*lambda x: x, z} + | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here +10 | {*x := 2, z} + | + + + | + 8 | {*x if True else y, z} + 9 | {*lambda x: x, z} +10 | {*x := 2, z} + | ^^ Syntax Error: Expected ',', found ':=' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__invalid_slice_element.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__invalid_slice_element.py.snap new file mode 100644 index 0000000000..45fbf9dad6 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__invalid_slice_element.py.snap @@ -0,0 +1,303 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/subscript/invalid_slice_element.py +--- +## AST + +``` +Module( + ModModule { + range: 0..133, + body: [ + Expr( + StmtExpr { + range: 0..10, + value: Subscript( + ExprSubscript { + range: 0..10, + value: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 2..9, + lower: Some( + Named( + ExprNamed { + range: 2..8, + target: Name( + ExprName { + range: 2..3, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 7..8, + value: Int( + 1, + ), + }, + ), + }, + ), + ), + upper: None, + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 33..39, + value: Subscript( + ExprSubscript { + range: 33..39, + value: Name( + ExprName { + range: 33..34, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 35..38, + lower: Some( + Starred( + ExprStarred { + range: 35..37, + value: Name( + ExprName { + range: 36..37, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + upper: None, + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 40..46, + value: Subscript( + ExprSubscript { + range: 40..46, + value: Name( + ExprName { + range: 40..41, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 42..45, + lower: None, + upper: Some( + Starred( + ExprStarred { + range: 43..45, + value: Name( + ExprName { + range: 44..45, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 47..54, + value: Subscript( + ExprSubscript { + range: 47..54, + value: Name( + ExprName { + range: 47..48, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 49..53, + lower: None, + upper: None, + step: Some( + Starred( + ExprStarred { + range: 51..53, + value: Name( + ExprName { + range: 52..53, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 70..73, + value: Subscript( + ExprSubscript { + range: 70..73, + value: Name( + ExprName { + range: 70..71, + id: "x", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 72..73, + id: "", + ctx: Invalid, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 123..133, + value: Subscript( + ExprSubscript { + range: 123..133, + value: Name( + ExprName { + range: 123..124, + id: "x", + ctx: Load, + }, + ), + slice: Named( + ExprNamed { + range: 125..132, + target: Starred( + ExprStarred { + range: 125..127, + value: Name( + ExprName { + range: 126..127, + id: "x", + ctx: Store, + }, + ), + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 131..132, + value: Int( + 1, + ), + }, + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x[x := 1:] + | ^^^^^^ Syntax Error: Unparenthesized named expression cannot be used here +2 | +3 | # Starred expression + | + + + | +3 | # Starred expression +4 | x[*x:] + | ^^ Syntax Error: Starred expression cannot be used here +5 | x[:*x] +6 | x[::*x] + | + + + | +3 | # Starred expression +4 | x[*x:] +5 | x[:*x] + | ^^ Syntax Error: Starred expression cannot be used here +6 | x[::*x] + | + + + | +4 | x[*x:] +5 | x[:*x] +6 | x[::*x] + | ^^ Syntax Error: Starred expression cannot be used here +7 | +8 | # Empty slice + | + + + | + 8 | # Empty slice + 9 | x[] + | ^ Syntax Error: Expected index or slice expression +10 | +11 | # Mixed starred expression and named expression + | + + + | +11 | # Mixed starred expression and named expression +12 | x[*x := 1] + | ^^ Syntax Error: Assignment expression target must be an identifier + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_0.py.snap new file mode 100644 index 0000000000..19fe8dd3ed --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_0.py.snap @@ -0,0 +1,70 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..10, + body: [ + Expr( + StmtExpr { + range: 0..10, + value: Subscript( + ExprSubscript { + range: 0..10, + value: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 2..10, + lower: None, + upper: Some( + BinOp( + ExprBinOp { + range: 5..10, + left: Name( + ExprName { + range: 5..6, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 9..10, + id: "y", + ctx: Load, + }, + ), + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x[: +2 | +3 | x + y + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_1.py.snap new file mode 100644 index 0000000000..25e36ee3de --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_1.py.snap @@ -0,0 +1,112 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..25, + body: [ + Expr( + StmtExpr { + range: 0..9, + value: Subscript( + ExprSubscript { + range: 0..9, + value: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 2..9, + lower: None, + upper: None, + step: Some( + Name( + ExprName { + range: 6..9, + id: "def", + ctx: Load, + }, + ), + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + AnnAssign( + StmtAnnAssign { + range: 10..25, + target: Call( + ExprCall { + range: 10..15, + func: Name( + ExprName { + range: 10..13, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 13..15, + args: [], + keywords: [], + }, + }, + ), + annotation: Name( + ExprName { + range: 21..25, + id: "pass", + ctx: Load, + }, + ), + value: None, + simple: false, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | x[:: +2 | +3 | def foo(): + | ^^^ Syntax Error: Expected an identifier, but found a keyword 'def' that cannot be used here +4 | pass + | + + + | +1 | x[:: +2 | +3 | def foo(): + | ^^^ Syntax Error: Expected ']', found name +4 | pass + | + + + | +3 | def foo(): +4 | pass + | ^^^^ Syntax Error: Expected an identifier, but found a keyword 'pass' that cannot be used here + | + + + | +3 | def foo(): +4 | pass + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary.py.snap new file mode 100644 index 0000000000..1f4c963db2 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary.py.snap @@ -0,0 +1,52 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/unary.py +--- +## AST + +``` +Module( + ModModule { + range: 0..10, + body: [ + Expr( + StmtExpr { + range: 0..5, + value: UnaryOp( + ExprUnaryOp { + range: 0..5, + op: Not, + operand: Name( + ExprName { + range: 4..5, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 9..10, + value: NumberLiteral( + ExprNumberLiteral { + range: 9..10, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | not x := 1 + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary__named_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary__named_expression.py.snap new file mode 100644 index 0000000000..89a46ff73e --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary__named_expression.py.snap @@ -0,0 +1,91 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/unary/named_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..18, + body: [ + Expr( + StmtExpr { + range: 0..2, + value: UnaryOp( + ExprUnaryOp { + range: 0..2, + op: USub, + operand: Name( + ExprName { + range: 1..2, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 6..7, + value: NumberLiteral( + ExprNumberLiteral { + range: 6..7, + value: Int( + 1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 8..13, + value: UnaryOp( + ExprUnaryOp { + range: 8..13, + op: Not, + operand: Name( + ExprName { + range: 12..13, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 17..18, + value: NumberLiteral( + ExprNumberLiteral { + range: 17..18, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | -x := 1 + | ^^ Syntax Error: Expected a statement +2 | not x := 1 + | + + + | +1 | -x := 1 +2 | not x := 1 + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary__no_expression_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary__no_expression_0.py.snap new file mode 100644 index 0000000000..bc8357cc3c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary__no_expression_0.py.snap @@ -0,0 +1,66 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/unary/no_expression_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..10, + body: [ + Expr( + StmtExpr { + range: 0..3, + value: UnaryOp( + ExprUnaryOp { + range: 0..3, + op: Not, + operand: Name( + ExprName { + range: 3..3, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5..10, + value: BinOp( + ExprBinOp { + range: 5..10, + left: Name( + ExprName { + range: 5..6, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 9..10, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | not + | ^ Syntax Error: Expected an expression +2 | +3 | x + y + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary__no_expression_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary__no_expression_1.py.snap new file mode 100644 index 0000000000..c53f05dc10 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary__no_expression_1.py.snap @@ -0,0 +1,66 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/unary/no_expression_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..8, + body: [ + Expr( + StmtExpr { + range: 0..1, + value: UnaryOp( + ExprUnaryOp { + range: 0..1, + op: UAdd, + operand: Name( + ExprName { + range: 1..1, + id: "", + ctx: Invalid, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 3..8, + value: BinOp( + ExprBinOp { + range: 3..8, + left: Name( + ExprName { + range: 3..4, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 7..8, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | + + | ^ Syntax Error: Expected an expression +2 | +3 | x + y + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__named_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__named_expression.py.snap new file mode 100644 index 0000000000..933fd61a1d --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__named_expression.py.snap @@ -0,0 +1,116 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/yield/named_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..85, + body: [ + Expr( + StmtExpr { + range: 52..59, + value: Yield( + ExprYield { + range: 52..59, + value: Some( + Name( + ExprName { + range: 58..59, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 63..64, + value: NumberLiteral( + ExprNumberLiteral { + range: 63..64, + value: Int( + 1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 66..84, + value: Yield( + ExprYield { + range: 66..84, + value: Some( + Tuple( + ExprTuple { + range: 72..84, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 72..73, + value: Int( + 1, + ), + }, + ), + Name( + ExprName { + range: 75..76, + id: "x", + ctx: Load, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 80..81, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 83..84, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Unparenthesized named expressions are not allowed +2 | yield x := 1 + | ^^ Syntax Error: Expected a statement +3 | +4 | yield 1, x := 2, 3 + | + + + | +2 | yield x := 1 +3 | +4 | yield 1, x := 2, 3 + | ^^ Syntax Error: Expected ',', found ':=' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__star_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__star_expression.py.snap new file mode 100644 index 0000000000..69d607d703 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__star_expression.py.snap @@ -0,0 +1,113 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/yield/star_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..67, + body: [ + Expr( + StmtExpr { + range: 37..47, + value: Yield( + ExprYield { + range: 37..47, + value: Some( + Starred( + ExprStarred { + range: 44..46, + value: Name( + ExprName { + range: 45..46, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 49..66, + value: Yield( + ExprYield { + range: 49..66, + value: Some( + Tuple( + ExprTuple { + range: 55..66, + elts: [ + Starred( + ExprStarred { + range: 55..63, + value: BoolOp( + ExprBoolOp { + range: 56..63, + op: And, + values: [ + Name( + ExprName { + range: 56..57, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 62..63, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 65..66, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Cannot use starred expression here +2 | yield (*x) + | ^^ Syntax Error: Starred expression cannot be used here +3 | +4 | yield *x and y, z + | + + + | +2 | yield (*x) +3 | +4 | yield *x and y, z + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__starred_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__starred_expression.py.snap new file mode 100644 index 0000000000..866aae89fc --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__starred_expression.py.snap @@ -0,0 +1,93 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/yield_from/starred_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..100, + body: [ + Expr( + StmtExpr { + range: 70..83, + value: YieldFrom( + ExprYieldFrom { + range: 70..83, + value: Starred( + ExprStarred { + range: 81..83, + value: Name( + ExprName { + range: 82..83, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 84..100, + value: YieldFrom( + ExprYieldFrom { + range: 84..100, + value: Tuple( + ExprTuple { + range: 95..100, + elts: [ + Starred( + ExprStarred { + range: 95..97, + value: Name( + ExprName { + range: 96..97, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 99..100, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Yield from doesn't allow top-level starred expression unlike yield +2 | +3 | yield from *x + | ^^ Syntax Error: Starred expression cannot be used here +4 | yield from *x, y + | + + + | +3 | yield from *x +4 | yield from *x, y + | ^^ Syntax Error: Starred expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__unparenthesized.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__unparenthesized.py.snap new file mode 100644 index 0000000000..8ee4ab27c5 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__unparenthesized.py.snap @@ -0,0 +1,158 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/expressions/yield_from/unparenthesized.py +--- +## AST + +``` +Module( + ModModule { + range: 0..192, + body: [ + Expr( + StmtExpr { + range: 35..47, + value: YieldFrom( + ExprYieldFrom { + range: 35..47, + value: Name( + ExprName { + range: 46..47, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 51..52, + value: NumberLiteral( + ExprNumberLiteral { + range: 51..52, + value: Int( + 1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 89..104, + value: YieldFrom( + ExprYieldFrom { + range: 89..104, + value: Tuple( + ExprTuple { + range: 100..104, + elts: [ + Name( + ExprName { + range: 100..101, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 103..104, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 168..192, + value: YieldFrom( + ExprYieldFrom { + range: 168..192, + value: Tuple( + ExprTuple { + range: 179..192, + elts: [ + Name( + ExprName { + range: 180..181, + id: "x", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 183..191, + value: BoolOp( + ExprBoolOp { + range: 184..191, + op: And, + values: [ + Name( + ExprName { + range: 184..185, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 190..191, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Unparenthesized named expression +2 | yield from x := 1 + | ^^ Syntax Error: Expected a statement +3 | +4 | # Unparenthesized tuple expression + | + + + | +4 | # Unparenthesized tuple expression +5 | yield from x, y + | ^^^^ Syntax Error: Unparenthesized tuple expression cannot be used here +6 | +7 | # This is a tuple expression parsing + | + + + | +7 | # This is a tuple expression parsing +8 | # vvvvvvvvvvvvv +9 | yield from (x, *x and y) + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_empty_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_empty_expression.py.snap new file mode 100644 index 0000000000..6f8fdf7b09 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_empty_expression.py.snap @@ -0,0 +1,111 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/f_string_empty_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..14, + body: [ + Expr( + StmtExpr { + range: 0..5, + value: FString( + ExprFString { + range: 0..5, + value: FStringValue { + inner: Single( + FString( + FString { + range: 0..5, + elements: [ + Expression( + FStringExpressionElement { + range: 2..4, + expression: Name( + ExprName { + range: 3..3, + id: "", + ctx: Invalid, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 6..13, + value: FString( + ExprFString { + range: 6..13, + value: FStringValue { + inner: Single( + FString( + FString { + range: 6..13, + elements: [ + Expression( + FStringExpressionElement { + range: 8..12, + expression: Name( + ExprName { + range: 9..9, + id: "", + ctx: Invalid, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | f"{}" + | ^ Syntax Error: Expected an expression +2 | f"{ }" + | + + + | +1 | f"{}" +2 | f"{ }" + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_name_tok.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_name_tok.py.snap new file mode 100644 index 0000000000..43b521ce6a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_name_tok.py.snap @@ -0,0 +1,62 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/f_string_invalid_conversion_flag_name_tok.py +--- +## AST + +``` +Module( + ModModule { + range: 0..9, + body: [ + Expr( + StmtExpr { + range: 0..8, + value: FString( + ExprFString { + range: 0..8, + value: FStringValue { + inner: Single( + FString( + FString { + range: 0..8, + elements: [ + Expression( + FStringExpressionElement { + range: 2..7, + expression: Name( + ExprName { + range: 3..4, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | f"{x!z}" + | ^ Syntax Error: f-string: invalid conversion character + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_other_tok.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_other_tok.py.snap new file mode 100644 index 0000000000..7376ec2087 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_other_tok.py.snap @@ -0,0 +1,111 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/f_string_invalid_conversion_flag_other_tok.py +--- +## AST + +``` +Module( + ModModule { + range: 0..22, + body: [ + Expr( + StmtExpr { + range: 0..10, + value: FString( + ExprFString { + range: 0..10, + value: FStringValue { + inner: Single( + FString( + FString { + range: 0..10, + elements: [ + Expression( + FStringExpressionElement { + range: 2..9, + expression: Name( + ExprName { + range: 3..4, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 11..21, + value: FString( + ExprFString { + range: 11..21, + value: FStringValue { + inner: Single( + FString( + FString { + range: 11..21, + elements: [ + Expression( + FStringExpressionElement { + range: 13..20, + expression: Name( + ExprName { + range: 14..15, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | f"{x!123}" + | ^^^ Syntax Error: f-string: invalid conversion character +2 | f"{x!'a'}" + | + + + | +1 | f"{x!123}" +2 | f"{x!'a'}" + | ^^^ Syntax Error: f-string: invalid conversion character + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_starred_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_starred_expr.py.snap new file mode 100644 index 0000000000..df5f3b0e8d --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_starred_expr.py.snap @@ -0,0 +1,204 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/f_string_invalid_starred_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..112, + body: [ + Expr( + StmtExpr { + range: 77..83, + value: FString( + ExprFString { + range: 77..83, + value: FStringValue { + inner: Single( + FString( + FString { + range: 77..83, + elements: [ + Expression( + FStringExpressionElement { + range: 79..82, + expression: Starred( + ExprStarred { + range: 80..81, + value: Name( + ExprName { + range: 81..81, + id: "", + ctx: Invalid, + }, + ), + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 84..97, + value: FString( + ExprFString { + range: 84..97, + value: FStringValue { + inner: Single( + FString( + FString { + range: 84..97, + elements: [ + Expression( + FStringExpressionElement { + range: 86..96, + expression: Starred( + ExprStarred { + range: 87..95, + value: BoolOp( + ExprBoolOp { + range: 88..95, + op: And, + values: [ + Name( + ExprName { + range: 88..89, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 94..95, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 98..111, + value: FString( + ExprFString { + range: 98..111, + value: FStringValue { + inner: Single( + FString( + FString { + range: 98..111, + elements: [ + Expression( + FStringExpressionElement { + range: 100..110, + expression: Starred( + ExprStarred { + range: 101..109, + value: Yield( + ExprYield { + range: 102..109, + value: Some( + Name( + ExprName { + range: 108..109, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Starred expression inside f-string has a minimum precedence of bitwise or. +2 | f"{*}" + | ^ Syntax Error: Expected an expression +3 | f"{*x and y}" +4 | f"{*yield x}" + | + + + | +1 | # Starred expression inside f-string has a minimum precedence of bitwise or. +2 | f"{*}" +3 | f"{*x and y}" + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here +4 | f"{*yield x}" + | + + + | +2 | f"{*}" +3 | f"{*x and y}" +4 | f"{*yield x}" + | ^^^^^^^ Syntax Error: Yield expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_lambda_without_parentheses.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_lambda_without_parentheses.py.snap new file mode 100644 index 0000000000..90b9de228f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_lambda_without_parentheses.py.snap @@ -0,0 +1,126 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/f_string_lambda_without_parentheses.py +--- +## AST + +``` +Module( + ModModule { + range: 0..17, + body: [ + Expr( + StmtExpr { + range: 0..14, + value: FString( + ExprFString { + range: 0..14, + value: FStringValue { + inner: Single( + FString( + FString { + range: 0..14, + elements: [ + Expression( + FStringExpressionElement { + range: 2..12, + expression: Lambda( + ExprLambda { + range: 3..12, + parameters: Some( + Parameters { + range: 10..11, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 10..11, + parameter: Parameter { + range: 10..11, + name: Identifier { + id: "x", + range: 10..11, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 12..12, + id: "", + ctx: Invalid, + }, + ), + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 12..14, + value: " x", + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | f"{lambda x: x}" + | ^^ Syntax Error: Expected an expression + | + + + | +1 | f"{lambda x: x}" + | ^^^^^^^^^ Syntax Error: f-string: lambda expressions are not allowed without parentheses + | + + + | +1 | f"{lambda x: x}" + | ^^ Syntax Error: f-string: expecting '}' + | + + + | +1 | f"{lambda x: x}" + | ^ Syntax Error: Expected FStringEnd, found '}' + | + + + | +1 | f"{lambda x: x}" + | ^ Syntax Error: Expected a statement + | + + + | +1 | f"{lambda x: x}" + | ^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace.py.snap new file mode 100644 index 0000000000..58c1d48d6b --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace.py.snap @@ -0,0 +1,293 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/f_string_unclosed_lbrace.py +--- +## AST + +``` +Module( + ModModule { + range: 0..38, + body: [ + Expr( + StmtExpr { + range: 0..38, + value: FString( + ExprFString { + range: 0..38, + value: FStringValue { + inner: Concatenated( + [ + FString( + FString { + range: 0..5, + elements: [ + Expression( + FStringExpressionElement { + range: 2..3, + expression: Name( + ExprName { + range: 3..3, + id: "", + ctx: Invalid, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 5..15, + elements: [ + Expression( + FStringExpressionElement { + range: 7..15, + expression: Name( + ExprName { + range: 8..11, + id: "foo", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 15..24, + elements: [ + Expression( + FStringExpressionElement { + range: 17..22, + expression: Name( + ExprName { + range: 18..21, + id: "foo", + ctx: Load, + }, + ), + debug_text: Some( + DebugText { + leading: "", + trailing: "=", + }, + ), + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 24..29, + elements: [ + Expression( + FStringExpressionElement { + range: 26..27, + expression: Name( + ExprName { + range: 27..27, + id: "", + ctx: Invalid, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 29..38, + elements: [ + Expression( + FStringExpressionElement { + range: 33..34, + expression: Name( + ExprName { + range: 34..34, + id: "", + ctx: Invalid, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: true, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | f"{" + | ____^ +2 | | f"{foo!r" + | |_^ Syntax Error: missing closing quote in string literal +3 | f"{foo=" +4 | f"{" + | + + + | +1 | f"{" +2 | f"{foo!r" + | ^^ Syntax Error: Expected an f-string element or the end of the f-string +3 | f"{foo=" +4 | f"{" + | + + + | +1 | f"{" +2 | f"{foo!r" + | ________^ +3 | | f"{foo=" + | |_^ Syntax Error: missing closing quote in string literal +4 | f"{" +5 | f"""{""" + | + + + | +1 | f"{" +2 | f"{foo!r" +3 | f"{foo=" + | ^^ Syntax Error: f-string: expecting '}' +4 | f"{" +5 | f"""{""" + | + + + | +1 | f"{" +2 | f"{foo!r" +3 | f"{foo=" + | ________^ +4 | | f"{" + | |_^ Syntax Error: missing closing quote in string literal +5 | f"""{""" + | + + + | +2 | f"{foo!r" +3 | f"{foo=" +4 | f"{" + | ^^ Syntax Error: Expected an f-string element or the end of the f-string +5 | f"""{""" + | + + + | +2 | f"{foo!r" +3 | f"{foo=" +4 | f"{" + | ____^ +5 | | f"""{""" + | |_^ Syntax Error: missing closing quote in string literal + | + + + | +3 | f"{foo=" +4 | f"{" +5 | f"""{""" + | ^^^^ Syntax Error: Expected an f-string element or the end of the f-string + | + + + | +3 | f"{foo=" +4 | f"{" +5 | f"""{""" + |______^ + | + + + | +4 | f"{" +5 | f"""{""" + | + + + | +4 | f"{" +5 | f"""{""" + | + + + | +4 | f"{" +5 | f"""{""" + | + + + | +4 | f"{" +5 | f"""{""" + | + + + | +4 | f"{" +5 | f"""{""" + | + + + | +4 | f"{" +5 | f"""{""" + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace_in_format_spec.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace_in_format_spec.py.snap new file mode 100644 index 0000000000..d7827da843 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace_in_format_spec.py.snap @@ -0,0 +1,134 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/f_string_unclosed_lbrace_in_format_spec.py +--- +## AST + +``` +Module( + ModModule { + range: 0..29, + body: [ + Expr( + StmtExpr { + range: 0..28, + value: FString( + ExprFString { + range: 0..28, + value: FStringValue { + inner: Concatenated( + [ + FString( + FString { + range: 0..12, + elements: [ + Literal( + FStringLiteralElement { + range: 2..8, + value: "hello ", + }, + ), + Expression( + FStringExpressionElement { + range: 8..11, + expression: Name( + ExprName { + range: 9..10, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 11..11, + elements: [], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 13..28, + elements: [ + Literal( + FStringLiteralElement { + range: 15..21, + value: "hello ", + }, + ), + Expression( + FStringExpressionElement { + range: 21..27, + expression: Name( + ExprName { + range: 22..23, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 24..27, + elements: [ + Literal( + FStringLiteralElement { + range: 24..27, + value: ".3f", + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | f"hello {x:" + | ^ Syntax Error: f-string: expecting '}' +2 | f"hello {x:.3f" + | + + + | +1 | f"hello {x:" +2 | f"hello {x:.3f" + | ^ Syntax Error: f-string: expecting '}' + | + + + | +1 | f"hello {x:" +2 | f"hello {x:.3f" + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_iter_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_iter_expr.py.snap new file mode 100644 index 0000000000..13d3c6dca1 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_iter_expr.py.snap @@ -0,0 +1,183 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/for_stmt_invalid_iter_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..71, + body: [ + For( + StmtFor { + range: 0..22, + is_async: false, + target: Name( + ExprName { + range: 4..5, + id: "x", + ctx: Store, + }, + ), + iter: Starred( + ExprStarred { + range: 9..17, + value: BoolOp( + ExprBoolOp { + range: 10..17, + op: And, + values: [ + Name( + ExprName { + range: 10..11, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 16..17, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 19..22, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 19..22, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 23..44, + is_async: false, + target: Name( + ExprName { + range: 27..28, + id: "x", + ctx: Store, + }, + ), + iter: Yield( + ExprYield { + range: 32..39, + value: Some( + Name( + ExprName { + range: 38..39, + id: "a", + ctx: Load, + }, + ), + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 41..44, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 41..44, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 45..60, + is_async: false, + target: Name( + ExprName { + range: 49..55, + id: "target", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 59..60, + id: "x", + ctx: Load, + }, + ), + body: [], + orelse: [], + }, + ), + AnnAssign( + StmtAnnAssign { + range: 64..70, + target: NumberLiteral( + ExprNumberLiteral { + range: 64..65, + value: Int( + 1, + ), + }, + ), + annotation: EllipsisLiteral( + ExprEllipsisLiteral { + range: 67..70, + }, + ), + value: None, + simple: false, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | for x in *a and b: ... + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here +2 | for x in yield a: ... +3 | for target in x := 1: ... + | + + + | +1 | for x in *a and b: ... +2 | for x in yield a: ... + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | for target in x := 1: ... + | + + + | +1 | for x in *a and b: ... +2 | for x in yield a: ... +3 | for target in x := 1: ... + | ^^ Syntax Error: Expected ':', found ':=' + | + + + | +1 | for x in *a and b: ... +2 | for x in yield a: ... +3 | for target in x := 1: ... + | ^ Syntax Error: Invalid annotated assignment target + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target.py.snap new file mode 100644 index 0000000000..ae0cfbfda8 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target.py.snap @@ -0,0 +1,387 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/for_stmt_invalid_target.py +--- +## AST + +``` +Module( + ModModule { + range: 0..132, + body: [ + For( + StmtFor { + range: 0..15, + is_async: false, + target: NumberLiteral( + ExprNumberLiteral { + range: 4..5, + value: Int( + 1, + ), + }, + ), + iter: Name( + ExprName { + range: 9..10, + id: "x", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 12..15, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 12..15, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 16..33, + is_async: false, + target: StringLiteral( + ExprStringLiteral { + range: 20..23, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 20..23, + value: "a", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + iter: Name( + ExprName { + range: 27..28, + id: "x", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 30..33, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 30..33, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 34..56, + is_async: false, + target: Starred( + ExprStarred { + range: 38..46, + value: BoolOp( + ExprBoolOp { + range: 39..46, + op: And, + values: [ + Name( + ExprName { + range: 39..40, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 45..46, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 50..51, + id: "z", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 53..56, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 53..56, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 57..77, + is_async: false, + target: Starred( + ExprStarred { + range: 61..67, + value: BinOp( + ExprBinOp { + range: 62..67, + left: Name( + ExprName { + range: 62..63, + id: "x", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 66..67, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 71..72, + id: "z", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 74..77, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 74..77, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 78..99, + is_async: false, + target: Await( + ExprAwait { + range: 82..89, + value: Name( + ExprName { + range: 88..89, + id: "x", + ctx: Load, + }, + ), + }, + ), + iter: Name( + ExprName { + range: 93..94, + id: "z", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 96..99, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 96..99, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 100..131, + is_async: false, + target: List( + ExprList { + range: 104..121, + elts: [ + Name( + ExprName { + range: 105..106, + id: "x", + ctx: Store, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 108..109, + value: Int( + 1, + ), + }, + ), + Name( + ExprName { + range: 111..112, + id: "y", + ctx: Store, + }, + ), + Starred( + ExprStarred { + range: 114..120, + value: List( + ExprList { + range: 115..120, + elts: [ + StringLiteral( + ExprStringLiteral { + range: 116..119, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 116..119, + value: "a", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + ctx: Store, + }, + ), + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 125..126, + id: "z", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 128..131, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 128..131, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | for 1 in x: ... + | ^ Syntax Error: Invalid assignment target +2 | for "a" in x: ... +3 | for *x and y in z: ... + | + + + | +1 | for 1 in x: ... +2 | for "a" in x: ... + | ^^^ Syntax Error: Invalid assignment target +3 | for *x and y in z: ... +4 | for *x | y in z: ... + | + + + | +1 | for 1 in x: ... +2 | for "a" in x: ... +3 | for *x and y in z: ... + | ^^^^^^^ Syntax Error: Invalid assignment target +4 | for *x | y in z: ... +5 | for await x in z: ... + | + + + | +2 | for "a" in x: ... +3 | for *x and y in z: ... +4 | for *x | y in z: ... + | ^^^^^ Syntax Error: Invalid assignment target +5 | for await x in z: ... +6 | for [x, 1, y, *["a"]] in z: ... + | + + + | +3 | for *x and y in z: ... +4 | for *x | y in z: ... +5 | for await x in z: ... + | ^^^^^^^ Syntax Error: Invalid assignment target +6 | for [x, 1, y, *["a"]] in z: ... + | + + + | +4 | for *x | y in z: ... +5 | for await x in z: ... +6 | for [x, 1, y, *["a"]] in z: ... + | ^ Syntax Error: Invalid assignment target + | + + + | +4 | for *x | y in z: ... +5 | for await x in z: ... +6 | for [x, 1, y, *["a"]] in z: ... + | ^^^ Syntax Error: Invalid assignment target + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_in_keyword.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_in_keyword.py.snap new file mode 100644 index 0000000000..007a4ef75d --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_in_keyword.py.snap @@ -0,0 +1,95 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/for_stmt_missing_in_keyword.py +--- +## AST + +``` +Module( + ModModule { + range: 0..24, + body: [ + For( + StmtFor { + range: 0..12, + is_async: false, + target: Name( + ExprName { + range: 4..5, + id: "a", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 6..7, + id: "b", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 9..12, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 9..12, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 13..23, + is_async: false, + target: Name( + ExprName { + range: 17..18, + id: "a", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 18..18, + id: "", + ctx: Invalid, + }, + ), + body: [ + Expr( + StmtExpr { + range: 20..23, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 20..23, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | for a b: ... + | ^ Syntax Error: Expected 'in', found name +2 | for a: ... + | + + + | +1 | for a b: ... +2 | for a: ... + | ^ Syntax Error: Expected 'in', found ':' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_iter.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_iter.py.snap new file mode 100644 index 0000000000..93821ecf7c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_iter.py.snap @@ -0,0 +1,67 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/for_stmt_missing_iter.py +--- +## AST + +``` +Module( + ModModule { + range: 0..20, + body: [ + For( + StmtFor { + range: 0..19, + is_async: false, + target: Name( + ExprName { + range: 4..5, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 8..8, + id: "", + ctx: Invalid, + }, + ), + body: [ + Assign( + StmtAssign { + range: 14..19, + targets: [ + Name( + ExprName { + range: 14..15, + id: "a", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 18..19, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + orelse: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | for x in: + | ^ Syntax Error: Expected an expression +2 | a = 1 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_target.py.snap new file mode 100644 index 0000000000..dd0bb8cfe4 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_target.py.snap @@ -0,0 +1,60 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/for_stmt_missing_target.py +--- +## AST + +``` +Module( + ModModule { + range: 0..14, + body: [ + For( + StmtFor { + range: 0..13, + is_async: false, + target: Name( + ExprName { + range: 4..6, + id: "in", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 7..8, + id: "x", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 10..13, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 10..13, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | for in x: ... + | ^^ Syntax Error: Expected an identifier, but found a keyword 'in' that cannot be used here + | + + + | +1 | for in x: ... + | ^ Syntax Error: Expected 'in', found name + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_dotted_names.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_dotted_names.py.snap new file mode 100644 index 0000000000..9ef1a656c6 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_dotted_names.py.snap @@ -0,0 +1,175 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/from_import_dotted_names.py +--- +## AST + +``` +Module( + ModModule { + range: 0..67, + body: [ + ImportFrom( + StmtImportFrom { + range: 0..16, + module: Some( + Identifier { + id: "x", + range: 5..6, + }, + ), + names: [ + Alias { + range: 14..15, + name: Identifier { + id: "a", + range: 14..15, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 17..34, + module: Some( + Identifier { + id: "x", + range: 22..23, + }, + ), + names: [ + Alias { + range: 31..32, + name: Identifier { + id: "a", + range: 31..32, + }, + asname: None, + }, + Alias { + range: 33..34, + name: Identifier { + id: "b", + range: 33..34, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 35..66, + module: Some( + Identifier { + id: "x", + range: 40..41, + }, + ), + names: [ + Alias { + range: 49..50, + name: Identifier { + id: "a", + range: 49..50, + }, + asname: None, + }, + Alias { + range: 52..53, + name: Identifier { + id: "b", + range: 52..53, + }, + asname: None, + }, + Alias { + range: 54..55, + name: Identifier { + id: "c", + range: 54..55, + }, + asname: None, + }, + Alias { + range: 57..58, + name: Identifier { + id: "d", + range: 57..58, + }, + asname: None, + }, + Alias { + range: 60..61, + name: Identifier { + id: "e", + range: 60..61, + }, + asname: None, + }, + Alias { + range: 62..63, + name: Identifier { + id: "f", + range: 62..63, + }, + asname: None, + }, + Alias { + range: 65..66, + name: Identifier { + id: "g", + range: 65..66, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | from x import a. + | ^ Syntax Error: Expected ',', found '.' +2 | from x import a.b +3 | from x import a, b.c, d, e.f, g + | + + + | +1 | from x import a. +2 | from x import a.b + | ^ Syntax Error: Expected ',', found '.' +3 | from x import a, b.c, d, e.f, g + | + + + | +1 | from x import a. +2 | from x import a.b +3 | from x import a, b.c, d, e.f, g + | ^ Syntax Error: Expected ',', found '.' + | + + + | +1 | from x import a. +2 | from x import a.b +3 | from x import a, b.c, d, e.f, g + | ^ Syntax Error: Expected ',', found '.' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_empty_names.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_empty_names.py.snap new file mode 100644 index 0000000000..d4ce9a4e9f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_empty_names.py.snap @@ -0,0 +1,100 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/from_import_empty_names.py +--- +## AST + +``` +Module( + ModModule { + range: 0..48, + body: [ + ImportFrom( + StmtImportFrom { + range: 0..13, + module: Some( + Identifier { + id: "x", + range: 5..6, + }, + ), + names: [], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 14..30, + module: Some( + Identifier { + id: "x", + range: 19..20, + }, + ), + names: [], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 31..47, + module: Some( + Identifier { + id: "x", + range: 36..37, + }, + ), + names: [], + level: Some( + 0, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | from x import + | ^ Syntax Error: Expected one or more symbol names after import +2 | from x import () +3 | from x import ,, + | + + + | +1 | from x import +2 | from x import () + | ^ Syntax Error: Expected one or more symbol names after import +3 | from x import ,, + | + + + | +1 | from x import +2 | from x import () +3 | from x import ,, + | ^ Syntax Error: Expected an import name + | + + + | +1 | from x import +2 | from x import () +3 | from x import ,, + | ^ Syntax Error: Expected an import name + | + + + | +1 | from x import +2 | from x import () +3 | from x import ,, + | ^ Syntax Error: Expected one or more symbol names after import + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_missing_module.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_missing_module.py.snap new file mode 100644 index 0000000000..c858526670 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_missing_module.py.snap @@ -0,0 +1,58 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/from_import_missing_module.py +--- +## AST + +``` +Module( + ModModule { + range: 0..19, + body: [ + ImportFrom( + StmtImportFrom { + range: 0..4, + module: None, + names: [], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 5..18, + module: None, + names: [ + Alias { + range: 17..18, + name: Identifier { + id: "x", + range: 17..18, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | from + | ^ Syntax Error: Expected a module name +2 | from import x + | + + + | +1 | from +2 | from import x + | ^^^^^^ Syntax Error: Expected a module name + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_missing_rpar.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_missing_rpar.py.snap new file mode 100644 index 0000000000..3aaf8eb394 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_missing_rpar.py.snap @@ -0,0 +1,165 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/from_import_missing_rpar.py +--- +## AST + +``` +Module( + ModModule { + range: 0..53, + body: [ + ImportFrom( + StmtImportFrom { + range: 0..19, + module: Some( + Identifier { + id: "x", + range: 5..6, + }, + ), + names: [ + Alias { + range: 15..16, + name: Identifier { + id: "a", + range: 15..16, + }, + asname: None, + }, + Alias { + range: 18..19, + name: Identifier { + id: "b", + range: 18..19, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + Expr( + StmtExpr { + range: 20..25, + value: BinOp( + ExprBinOp { + range: 20..25, + left: NumberLiteral( + ExprNumberLiteral { + range: 20..21, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 24..25, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 26..46, + module: Some( + Identifier { + id: "x", + range: 31..32, + }, + ), + names: [ + Alias { + range: 41..42, + name: Identifier { + id: "a", + range: 41..42, + }, + asname: None, + }, + Alias { + range: 44..45, + name: Identifier { + id: "b", + range: 44..45, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + Expr( + StmtExpr { + range: 47..52, + value: BinOp( + ExprBinOp { + range: 47..52, + left: NumberLiteral( + ExprNumberLiteral { + range: 47..48, + value: Int( + 2, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 51..52, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | from x import (a, b +2 | 1 + 1 + | ^ Syntax Error: Expected ',', found int +3 | from x import (a, b, +4 | 2 + 2 + | + + + | +1 | from x import (a, b +2 | 1 + 1 +3 | from x import (a, b, + | ^^^^ Syntax Error: Simple statements must be separated by newlines or semicolons +4 | 2 + 2 + | + + + | +2 | 1 + 1 +3 | from x import (a, b, +4 | 2 + 2 + | ^ Syntax Error: Expected an import name or a ')' + | + + + | +3 | from x import (a, b, +4 | 2 + 2 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_star_with_other_names.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_star_with_other_names.py.snap new file mode 100644 index 0000000000..674c47d735 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_star_with_other_names.py.snap @@ -0,0 +1,198 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/from_import_star_with_other_names.py +--- +## AST + +``` +Module( + ModModule { + range: 0..87, + body: [ + ImportFrom( + StmtImportFrom { + range: 0..18, + module: Some( + Identifier { + id: "x", + range: 5..6, + }, + ), + names: [ + Alias { + range: 14..15, + name: Identifier { + id: "*", + range: 14..15, + }, + asname: None, + }, + Alias { + range: 17..18, + name: Identifier { + id: "a", + range: 17..18, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 19..40, + module: Some( + Identifier { + id: "x", + range: 24..25, + }, + ), + names: [ + Alias { + range: 33..34, + name: Identifier { + id: "a", + range: 33..34, + }, + asname: None, + }, + Alias { + range: 36..37, + name: Identifier { + id: "*", + range: 36..37, + }, + asname: None, + }, + Alias { + range: 39..40, + name: Identifier { + id: "b", + range: 39..40, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 41..64, + module: Some( + Identifier { + id: "x", + range: 46..47, + }, + ), + names: [ + Alias { + range: 55..56, + name: Identifier { + id: "*", + range: 55..56, + }, + asname: None, + }, + Alias { + range: 58..64, + name: Identifier { + id: "a", + range: 58..59, + }, + asname: Some( + Identifier { + id: "b", + range: 63..64, + }, + ), + }, + ], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 65..86, + module: Some( + Identifier { + id: "x", + range: 70..71, + }, + ), + names: [ + Alias { + range: 79..80, + name: Identifier { + id: "*", + range: 79..80, + }, + asname: None, + }, + Alias { + range: 82..83, + name: Identifier { + id: "*", + range: 82..83, + }, + asname: None, + }, + Alias { + range: 85..86, + name: Identifier { + id: "a", + range: 85..86, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | from x import *, a + | ^^^^ Syntax Error: Star import must be the only import +2 | from x import a, *, b +3 | from x import *, a as b + | + + + | +1 | from x import *, a +2 | from x import a, *, b + | ^^^^^^^ Syntax Error: Star import must be the only import +3 | from x import *, a as b +4 | from x import *, *, a + | + + + | +1 | from x import *, a +2 | from x import a, *, b +3 | from x import *, a as b + | ^^^^^^^^^ Syntax Error: Star import must be the only import +4 | from x import *, *, a + | + + + | +2 | from x import a, *, b +3 | from x import *, a as b +4 | from x import *, *, a + | ^^^^^^^ Syntax Error: Star import must be the only import + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_unparenthesized_trailing_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_unparenthesized_trailing_comma.py.snap new file mode 100644 index 0000000000..4fa4e7dbc6 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_unparenthesized_trailing_comma.py.snap @@ -0,0 +1,124 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/from_import_unparenthesized_trailing_comma.py +--- +## AST + +``` +Module( + ModModule { + range: 0..59, + body: [ + ImportFrom( + StmtImportFrom { + range: 0..16, + module: Some( + Identifier { + id: "a", + range: 5..6, + }, + ), + names: [ + Alias { + range: 14..15, + name: Identifier { + id: "b", + range: 14..15, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 17..38, + module: Some( + Identifier { + id: "a", + range: 22..23, + }, + ), + names: [ + Alias { + range: 31..37, + name: Identifier { + id: "b", + range: 31..32, + }, + asname: Some( + Identifier { + id: "c", + range: 36..37, + }, + ), + }, + ], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 39..58, + module: Some( + Identifier { + id: "a", + range: 44..45, + }, + ), + names: [ + Alias { + range: 53..54, + name: Identifier { + id: "b", + range: 53..54, + }, + asname: None, + }, + Alias { + range: 56..57, + name: Identifier { + id: "c", + range: 56..57, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | from a import b, + | ^ Syntax Error: Trailing comma not allowed +2 | from a import b as c, +3 | from a import b, c, + | + + + | +1 | from a import b, +2 | from a import b as c, + | ^ Syntax Error: Trailing comma not allowed +3 | from a import b, c, + | + + + | +1 | from a import b, +2 | from a import b as c, +3 | from a import b, c, + | ^ Syntax Error: Trailing comma not allowed + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_empty_body.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_empty_body.py.snap new file mode 100644 index 0000000000..66550f4675 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_empty_body.py.snap @@ -0,0 +1,105 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/function_def_empty_body.py +--- +## AST + +``` +Module( + ModModule { + range: 0..36, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..10, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..9, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 11..28, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 15..18, + }, + type_params: None, + parameters: Parameters { + range: 18..20, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Name( + ExprName { + range: 24..27, + id: "int", + ctx: Load, + }, + ), + ), + body: [], + }, + ), + Assign( + StmtAssign { + range: 29..35, + targets: [ + Name( + ExprName { + range: 29..30, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 33..35, + value: Int( + 42, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(): +2 | def foo() -> int: + | ^^^ Syntax Error: Expected an indented block after function definition +3 | x = 42 + | + + + | +1 | def foo(): +2 | def foo() -> int: +3 | x = 42 + | ^ Syntax Error: Expected an indented block after function definition + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_invalid_return_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_invalid_return_expr.py.snap new file mode 100644 index 0000000000..c96a223891 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_invalid_return_expr.py.snap @@ -0,0 +1,181 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/function_def_invalid_return_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..74, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..22, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..9, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Starred( + ExprStarred { + range: 13..17, + value: Name( + ExprName { + range: 14..17, + id: "int", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 19..22, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 19..22, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 23..47, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 27..30, + }, + type_params: None, + parameters: Parameters { + range: 30..32, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Starred( + ExprStarred { + range: 37..41, + value: Name( + ExprName { + range: 38..41, + id: "int", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 44..47, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 44..47, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 48..73, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 52..55, + }, + type_params: None, + parameters: Parameters { + range: 55..57, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Yield( + ExprYield { + range: 61..68, + value: Some( + Name( + ExprName { + range: 67..68, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 70..73, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 70..73, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo() -> *int: ... + | ^^^^ Syntax Error: Starred expression cannot be used here +2 | def foo() -> (*int): ... +3 | def foo() -> yield x: ... + | + + + | +1 | def foo() -> *int: ... +2 | def foo() -> (*int): ... + | ^^^^ Syntax Error: Starred expression cannot be used here +3 | def foo() -> yield x: ... + | + + + | +1 | def foo() -> *int: ... +2 | def foo() -> (*int): ... +3 | def foo() -> yield x: ... + | ^^^^^^^ Syntax Error: Yield expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_identifier.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_identifier.py.snap new file mode 100644 index 0000000000..68e3130a86 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_identifier.py.snap @@ -0,0 +1,103 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/function_def_missing_identifier.py +--- +## AST + +``` +Module( + ModModule { + range: 0..31, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..11, + is_async: false, + decorator_list: [], + name: Identifier { + id: "", + range: 3..3, + }, + type_params: None, + parameters: Parameters { + range: 4..6, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 8..11, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 8..11, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 12..30, + is_async: false, + decorator_list: [], + name: Identifier { + id: "", + range: 15..15, + }, + type_params: None, + parameters: Parameters { + range: 16..18, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Name( + ExprName { + range: 22..25, + id: "int", + ctx: Load, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 27..30, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 27..30, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def (): ... + | ^ Syntax Error: Expected an identifier +2 | def () -> int: ... + | + + + | +1 | def (): ... +2 | def () -> int: ... + | ^ Syntax Error: Expected an identifier + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_return_type.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_return_type.py.snap new file mode 100644 index 0000000000..192bbfdd74 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_return_type.py.snap @@ -0,0 +1,54 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/function_def_missing_return_type.py +--- +## AST + +``` +Module( + ModModule { + range: 0..19, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..18, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..9, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 15..18, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 15..18, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo() -> : ... + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unclosed_parameter_list.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unclosed_parameter_list.py.snap new file mode 100644 index 0000000000..fb6c53e224 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unclosed_parameter_list.py.snap @@ -0,0 +1,224 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/function_def_unclosed_parameter_list.py +--- +## AST + +``` +Module( + ModModule { + range: 0..74, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..18, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..18, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..14, + parameter: Parameter { + range: 8..14, + name: Identifier { + id: "a", + range: 8..9, + }, + annotation: Some( + Name( + ExprName { + range: 11..14, + id: "int", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ParameterWithDefault { + range: 16..18, + parameter: Parameter { + range: 16..18, + name: Identifier { + id: "b", + range: 16..17, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 19..43, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 23..26, + }, + type_params: None, + parameters: Parameters { + range: 26..28, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Return( + StmtReturn { + range: 34..43, + value: Some( + NumberLiteral( + ExprNumberLiteral { + range: 41..43, + value: Int( + 42, + ), + }, + ), + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 44..74, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 48..51, + }, + type_params: None, + parameters: Parameters { + range: 51..74, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 52..58, + parameter: Parameter { + range: 52..58, + name: Identifier { + id: "a", + range: 52..53, + }, + annotation: Some( + Name( + ExprName { + range: 55..58, + id: "int", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ParameterWithDefault { + range: 60..66, + parameter: Parameter { + range: 60..66, + name: Identifier { + id: "b", + range: 60..61, + }, + annotation: Some( + Name( + ExprName { + range: 63..66, + id: "str", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ParameterWithDefault { + range: 67..73, + parameter: Parameter { + range: 67..68, + name: Identifier { + id: "x", + range: 67..68, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 71..73, + value: Int( + 10, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(a: int, b: +2 | def foo(): + | ^^^ Syntax Error: Expected an expression +3 | return 42 +4 | def foo(a: int, b: str + | + + + | +2 | def foo(): +3 | return 42 +4 | def foo(a: int, b: str + | ^^^ Syntax Error: Compound statements are not allowed on the same line as simple statements +5 | x = 10 + | + + + | +3 | return 42 +4 | def foo(a: int, b: str +5 | x = 10 + | ^ Syntax Error: Expected ',', found name + | + + + | +4 | def foo(a: int, b: str +5 | x = 10 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unclosed_type_param_list.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unclosed_type_param_list.py.snap new file mode 100644 index 0000000000..6f68449899 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unclosed_type_param_list.py.snap @@ -0,0 +1,159 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/function_def_unclosed_type_param_list.py +--- +## AST + +``` +Module( + ModModule { + range: 0..47, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..46, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: Some( + TypeParams { + range: 7..15, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 8..10, + name: Identifier { + id: "T1", + range: 8..10, + }, + bound: None, + }, + ), + TypeVarTuple( + TypeParamTypeVarTuple { + range: 12..15, + name: Identifier { + id: "T2", + range: 13..15, + }, + }, + ), + ], + }, + ), + parameters: Parameters { + range: 15..21, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 16..17, + parameter: Parameter { + range: 16..17, + name: Identifier { + id: "a", + range: 16..17, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 19..20, + parameter: Parameter { + range: 19..20, + name: Identifier { + id: "b", + range: 19..20, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Return( + StmtReturn { + range: 27..39, + value: Some( + BinOp( + ExprBinOp { + range: 34..39, + left: Name( + ExprName { + range: 34..35, + id: "a", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 38..39, + id: "b", + ctx: Load, + }, + ), + }, + ), + ), + }, + ), + Assign( + StmtAssign { + range: 40..46, + targets: [ + Name( + ExprName { + range: 40..41, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 44..46, + value: Int( + 10, + ), + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo[T1, *T2(a, b): + | ^ Syntax Error: Expected ']', found '(' +2 | return a + b +3 | x = 10 + | + + + | +1 | def foo[T1, *T2(a, b): +2 | return a + b +3 | x = 10 + | ^ Syntax Error: Simple statements must be separated by newlines or semicolons + | + + + | +2 | return a + b +3 | x = 10 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unparenthesized_return_types.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unparenthesized_return_types.py.snap new file mode 100644 index 0000000000..202748b993 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unparenthesized_return_types.py.snap @@ -0,0 +1,136 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/function_def_unparenthesized_return_types.py +--- +## AST + +``` +Module( + ModModule { + range: 0..50, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..22, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..9, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Tuple( + ExprTuple { + range: 13..17, + elts: [ + Name( + ExprName { + range: 13..16, + id: "int", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 19..22, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 19..22, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 23..49, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 27..30, + }, + type_params: None, + parameters: Parameters { + range: 30..32, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Tuple( + ExprTuple { + range: 36..44, + elts: [ + Name( + ExprName { + range: 36..39, + id: "int", + ctx: Load, + }, + ), + Name( + ExprName { + range: 41..44, + id: "str", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 46..49, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 46..49, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo() -> int,: ... + | ^^^^ Syntax Error: Multiple return types must be parenthesized +2 | def foo() -> int, str: ... + | + + + | +1 | def foo() -> int,: ... +2 | def foo() -> int, str: ... + | ^^^^^^^^ Syntax Error: Multiple return types must be parenthesized + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_empty.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_empty.py.snap new file mode 100644 index 0000000000..687d4df198 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_empty.py.snap @@ -0,0 +1,27 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/global_stmt_empty.py +--- +## AST + +``` +Module( + ModModule { + range: 0..7, + body: [ + Global( + StmtGlobal { + range: 0..6, + names: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | global + | ^ Syntax Error: Global statement must have at least one name + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_expression.py.snap new file mode 100644 index 0000000000..86352d88cc --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_expression.py.snap @@ -0,0 +1,51 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/global_stmt_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..13, + body: [ + Global( + StmtGlobal { + range: 0..8, + names: [ + Identifier { + id: "x", + range: 7..8, + }, + ], + }, + ), + Expr( + StmtExpr { + range: 9..12, + value: UnaryOp( + ExprUnaryOp { + range: 9..12, + op: UAdd, + operand: NumberLiteral( + ExprNumberLiteral { + range: 11..12, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | global x + 1 + | ^ Syntax Error: Expected ',', found '+' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_trailing_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_trailing_comma.py.snap new file mode 100644 index 0000000000..d84efa6480 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_trailing_comma.py.snap @@ -0,0 +1,79 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/global_stmt_trailing_comma.py +--- +## AST + +``` +Module( + ModModule { + range: 0..32, + body: [ + Global( + StmtGlobal { + range: 0..8, + names: [], + }, + ), + Global( + StmtGlobal { + range: 9..18, + names: [ + Identifier { + id: "x", + range: 16..17, + }, + ], + }, + ), + Global( + StmtGlobal { + range: 19..31, + names: [ + Identifier { + id: "x", + range: 26..27, + }, + Identifier { + id: "y", + range: 29..30, + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | global , + | ^ Syntax Error: Expected an identifier +2 | global x, +3 | global x, y, + | + + + | +1 | global , + | ^ Syntax Error: Global statement must have at least one name +2 | global x, +3 | global x, y, + | + + + | +1 | global , +2 | global x, + | ^ Syntax Error: Trailing comma not allowed +3 | global x, y, + | + + + | +1 | global , +2 | global x, +3 | global x, y, + | ^ Syntax Error: Trailing comma not allowed + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_elif_missing_colon.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_elif_missing_colon.py.snap new file mode 100644 index 0000000000..94ad569a4f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_elif_missing_colon.py.snap @@ -0,0 +1,77 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/if_stmt_elif_missing_colon.py +--- +## AST + +``` +Module( + ModModule { + range: 0..46, + body: [ + If( + StmtIf { + range: 0..45, + test: Name( + ExprName { + range: 3..4, + id: "x", + ctx: Load, + }, + ), + body: [ + Pass( + StmtPass { + range: 10..14, + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 15..30, + test: Some( + Name( + ExprName { + range: 20..21, + id: "y", + ctx: Load, + }, + ), + ), + body: [ + Pass( + StmtPass { + range: 26..30, + }, + ), + ], + }, + ElifElseClause { + range: 31..45, + test: None, + body: [ + Pass( + StmtPass { + range: 41..45, + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | if x: +2 | pass +3 | elif y + | ^ Syntax Error: Expected ':', found newline +4 | pass +5 | else: +6 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_empty_body.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_empty_body.py.snap new file mode 100644 index 0000000000..4e11284a27 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_empty_body.py.snap @@ -0,0 +1,62 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/if_stmt_empty_body.py +--- +## AST + +``` +Module( + ModModule { + range: 0..15, + body: [ + If( + StmtIf { + range: 0..8, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 3..7, + value: true, + }, + ), + body: [], + elif_else_clauses: [], + }, + ), + Expr( + StmtExpr { + range: 9..14, + value: BinOp( + ExprBinOp { + range: 9..14, + left: NumberLiteral( + ExprNumberLiteral { + range: 9..10, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 13..14, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | if True: +2 | 1 + 1 + | ^ Syntax Error: Expected an indented block after `if` statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_invalid_elif_test_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_invalid_elif_test_expr.py.snap new file mode 100644 index 0000000000..a80c406018 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_invalid_elif_test_expr.py.snap @@ -0,0 +1,106 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/if_stmt_invalid_elif_test_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..56, + body: [ + If( + StmtIf { + range: 0..55, + test: Name( + ExprName { + range: 3..4, + id: "x", + ctx: Load, + }, + ), + body: [ + Pass( + StmtPass { + range: 10..14, + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 15..32, + test: Some( + Starred( + ExprStarred { + range: 20..22, + value: Name( + ExprName { + range: 21..22, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + body: [ + Pass( + StmtPass { + range: 28..32, + }, + ), + ], + }, + ElifElseClause { + range: 33..55, + test: Some( + Yield( + ExprYield { + range: 38..45, + value: Some( + Name( + ExprName { + range: 44..45, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ), + body: [ + Pass( + StmtPass { + range: 51..55, + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | if x: +2 | pass +3 | elif *x: + | ^^ Syntax Error: Starred expression cannot be used here +4 | pass +5 | elif yield x: + | + + + | +3 | elif *x: +4 | pass +5 | elif yield x: + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +6 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_invalid_test_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_invalid_test_expr.py.snap new file mode 100644 index 0000000000..cf7c49e04c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_invalid_test_expr.py.snap @@ -0,0 +1,132 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/if_stmt_invalid_test_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..48, + body: [ + If( + StmtIf { + range: 0..10, + test: Starred( + ExprStarred { + range: 3..5, + value: Name( + ExprName { + range: 4..5, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 7..10, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 7..10, + }, + ), + }, + ), + ], + elif_else_clauses: [], + }, + ), + If( + StmtIf { + range: 11..26, + test: Yield( + ExprYield { + range: 14..21, + value: Some( + Name( + ExprName { + range: 20..21, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 23..26, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 23..26, + }, + ), + }, + ), + ], + elif_else_clauses: [], + }, + ), + If( + StmtIf { + range: 27..47, + test: YieldFrom( + ExprYieldFrom { + range: 30..42, + value: Name( + ExprName { + range: 41..42, + id: "x", + ctx: Load, + }, + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 44..47, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 44..47, + }, + ), + }, + ), + ], + elif_else_clauses: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | if *x: ... + | ^^ Syntax Error: Starred expression cannot be used here +2 | if yield x: ... +3 | if yield from x: ... + | + + + | +1 | if *x: ... +2 | if yield x: ... + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | if yield from x: ... + | + + + | +1 | if *x: ... +2 | if yield x: ... +3 | if yield from x: ... + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_missing_colon.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_missing_colon.py.snap new file mode 100644 index 0000000000..80f43b4bd6 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_missing_colon.py.snap @@ -0,0 +1,98 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/if_stmt_missing_colon.py +--- +## AST + +``` +Module( + ModModule { + range: 0..25, + body: [ + If( + StmtIf { + range: 0..4, + test: Name( + ExprName { + range: 3..4, + id: "x", + ctx: Load, + }, + ), + body: [], + elif_else_clauses: [], + }, + ), + If( + StmtIf { + range: 5..18, + test: Name( + ExprName { + range: 8..9, + id: "x", + ctx: Load, + }, + ), + body: [ + Pass( + StmtPass { + range: 14..18, + }, + ), + ], + elif_else_clauses: [], + }, + ), + Assign( + StmtAssign { + range: 19..24, + targets: [ + Name( + ExprName { + range: 19..20, + id: "a", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 23..24, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | if x + | ^ Syntax Error: Expected ':', found newline +2 | if x +3 | pass +4 | a = 1 + | + + + | +1 | if x +2 | if x + | ^^ Syntax Error: Expected an indented block after `if` statement +3 | pass +4 | a = 1 + | + + + | +1 | if x +2 | if x + | ^ Syntax Error: Expected ':', found newline +3 | pass +4 | a = 1 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_missing_test.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_missing_test.py.snap new file mode 100644 index 0000000000..973d6d7707 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_missing_test.py.snap @@ -0,0 +1,46 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/if_stmt_missing_test.py +--- +## AST + +``` +Module( + ModModule { + range: 0..9, + body: [ + If( + StmtIf { + range: 0..8, + test: Name( + ExprName { + range: 2..2, + id: "", + ctx: Invalid, + }, + ), + body: [ + Expr( + StmtExpr { + range: 5..8, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 5..8, + }, + ), + }, + ), + ], + elif_else_clauses: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | if : ... + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_misspelled_elif.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_misspelled_elif.py.snap new file mode 100644 index 0000000000..b36d6f97ea --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_misspelled_elif.py.snap @@ -0,0 +1,127 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/if_stmt_misspelled_elif.py +--- +## AST + +``` +Module( + ModModule { + range: 0..47, + body: [ + If( + StmtIf { + range: 0..17, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 3..7, + value: true, + }, + ), + body: [ + Pass( + StmtPass { + range: 13..17, + }, + ), + ], + elif_else_clauses: [], + }, + ), + AnnAssign( + StmtAnnAssign { + range: 18..22, + target: Name( + ExprName { + range: 18..21, + id: "elf", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 22..22, + id: "", + ctx: Invalid, + }, + ), + value: None, + simple: true, + }, + ), + Pass( + StmtPass { + range: 27..31, + }, + ), + Pass( + StmtPass { + range: 42..46, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | if True: +2 | pass +3 | elf: + | ^ Syntax Error: Expected an expression +4 | pass +5 | else: +6 | pass + | + + + | +2 | pass +3 | elf: +4 | pass + | ^^^^ Syntax Error: Unexpected indentation +5 | else: +6 | pass + | + + + | +3 | elf: +4 | pass +5 | else: + | Syntax Error: Expected a statement +6 | pass + | + + + | +3 | elf: +4 | pass +5 | else: + | ^ Syntax Error: Expected a statement +6 | pass + | + + + | +3 | elf: +4 | pass +5 | else: + | ^ Syntax Error: Expected a statement +6 | pass + | + + + | +4 | pass +5 | else: +6 | pass + | ^^^^ Syntax Error: Unexpected indentation + | + + + | +5 | else: +6 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@implicitly_concatenated_unterminated_string.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@implicitly_concatenated_unterminated_string.py.snap new file mode 100644 index 0000000000..ac5a0a2bb8 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@implicitly_concatenated_unterminated_string.py.snap @@ -0,0 +1,171 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string.py +--- +## AST + +``` +Module( + ModModule { + range: 0..47, + body: [ + Expr( + StmtExpr { + range: 0..7, + value: StringLiteral( + ExprStringLiteral { + range: 0..7, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 0..7, + value: "hello", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 15..20, + value: BinOp( + ExprBinOp { + range: 15..20, + left: NumberLiteral( + ExprNumberLiteral { + range: 15..16, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 19..20, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 21..40, + value: FString( + ExprFString { + range: 21..40, + value: FStringValue { + inner: Concatenated( + [ + Literal( + StringLiteral { + range: 21..28, + value: "hello", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 29..40, + elements: [ + Literal( + FStringLiteralElement { + range: 31..37, + value: "world ", + }, + ), + Expression( + FStringExpressionElement { + range: 37..40, + expression: Name( + ExprName { + range: 38..39, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 41..46, + value: BinOp( + ExprBinOp { + range: 41..46, + left: NumberLiteral( + ExprNumberLiteral { + range: 41..42, + value: Int( + 2, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 45..46, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | 'hello' 'world + | _________^ +2 | | 1 + 1 + | |_^ Syntax Error: missing closing quote in string literal +3 | 'hello' f'world {x} +4 | 2 + 2 + | + + + | +1 | 'hello' 'world +2 | 1 + 1 +3 | 'hello' f'world {x} + | Syntax Error: f-string: unterminated string +4 | 2 + 2 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@implicitly_concatenated_unterminated_string_multiline.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@implicitly_concatenated_unterminated_string_multiline.py.snap new file mode 100644 index 0000000000..c29558f594 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@implicitly_concatenated_unterminated_string_multiline.py.snap @@ -0,0 +1,245 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string_multiline.py +--- +## AST + +``` +Module( + ModModule { + range: 0..85, + body: [ + Expr( + StmtExpr { + range: 0..31, + value: FString( + ExprFString { + range: 6..31, + value: FStringValue { + inner: Concatenated( + [ + Literal( + StringLiteral { + range: 6..13, + value: "hello", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 18..31, + elements: [ + Literal( + FStringLiteralElement { + range: 20..26, + value: "world ", + }, + ), + Expression( + FStringExpressionElement { + range: 26..29, + expression: Name( + ExprName { + range: 27..28, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 32..37, + value: BinOp( + ExprBinOp { + range: 32..37, + left: NumberLiteral( + ExprNumberLiteral { + range: 32..33, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 36..37, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 38..51, + value: StringLiteral( + ExprStringLiteral { + range: 44..51, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 44..51, + value: "first", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 68..76, + value: FString( + ExprFString { + range: 68..76, + value: FStringValue { + inner: Single( + FString( + FString { + range: 68..76, + elements: [ + Literal( + FStringLiteralElement { + range: 70..75, + value: "third", + }, + ), + ], + flags: FStringFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 79..84, + value: BinOp( + ExprBinOp { + range: 79..84, + left: NumberLiteral( + ExprNumberLiteral { + range: 79..80, + value: Int( + 2, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 83..84, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | ( +2 | 'hello' +3 | f'world {x} + | Syntax Error: f-string: unterminated string +4 | ) +5 | 1 + 1 + | + + + | +2 | 'hello' +3 | f'world {x} +4 | ) + | ^ Syntax Error: Expected an f-string element or the end of the f-string +5 | 1 + 1 +6 | ( + | + + + | +2 | 'hello' +3 | f'world {x} +4 | ) + | ^ Syntax Error: Expected FStringEnd, found newline +5 | 1 + 1 +6 | ( +7 | 'first' + | + + + | + 6 | ( + 7 | 'first' + 8 | 'second + | _____^ + 9 | | f'third' + | |_^ Syntax Error: missing closing quote in string literal +10 | ) +11 | 2 + 2 + | + + + | + 8 | 'second + 9 | f'third' +10 | ) + | ^ Syntax Error: Expected a statement +11 | 2 + 2 + | + + + | + 8 | 'second + 9 | f'third' +10 | ) + | ^ Syntax Error: Expected a statement +11 | 2 + 2 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_alias_missing_asname.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_alias_missing_asname.py.snap new file mode 100644 index 0000000000..0b5fdda550 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_alias_missing_asname.py.snap @@ -0,0 +1,36 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/import_alias_missing_asname.py +--- +## AST + +``` +Module( + ModModule { + range: 0..12, + body: [ + Import( + StmtImport { + range: 0..11, + names: [ + Alias { + range: 7..11, + name: Identifier { + id: "x", + range: 7..8, + }, + asname: None, + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | import x as + | ^ Syntax Error: Expected symbol after `as` + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_empty.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_empty.py.snap new file mode 100644 index 0000000000..f63fa83d70 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_empty.py.snap @@ -0,0 +1,27 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/import_stmt_empty.py +--- +## AST + +``` +Module( + ModModule { + range: 0..7, + body: [ + Import( + StmtImport { + range: 0..6, + names: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | import + | ^ Syntax Error: Expected one or more symbol names after import + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_parenthesized_names.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_parenthesized_names.py.snap new file mode 100644 index 0000000000..d4254fd657 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_parenthesized_names.py.snap @@ -0,0 +1,81 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/import_stmt_parenthesized_names.py +--- +## AST + +``` +Module( + ModModule { + range: 0..25, + body: [ + Import( + StmtImport { + range: 0..6, + names: [], + }, + ), + Expr( + StmtExpr { + range: 7..10, + value: Name( + ExprName { + range: 8..9, + id: "a", + ctx: Load, + }, + ), + }, + ), + Import( + StmtImport { + range: 11..17, + names: [], + }, + ), + Expr( + StmtExpr { + range: 18..24, + value: Tuple( + ExprTuple { + range: 18..24, + elts: [ + Name( + ExprName { + range: 19..20, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 22..23, + id: "b", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | import (a) + | ^ Syntax Error: Expected an import name +2 | import (a, b) + | + + + | +1 | import (a) +2 | import (a, b) + | ^ Syntax Error: Expected an import name + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_star_import.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_star_import.py.snap new file mode 100644 index 0000000000..703cc005e3 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_star_import.py.snap @@ -0,0 +1,130 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/import_stmt_star_import.py +--- +## AST + +``` +Module( + ModModule { + range: 0..24, + body: [ + Import( + StmtImport { + range: 0..6, + names: [], + }, + ), + Expr( + StmtExpr { + range: 7..8, + value: Starred( + ExprStarred { + range: 7..8, + value: Name( + ExprName { + range: 8..8, + id: "", + ctx: Invalid, + }, + ), + ctx: Load, + }, + ), + }, + ), + Import( + StmtImport { + range: 9..18, + names: [ + Alias { + range: 16..17, + name: Identifier { + id: "x", + range: 16..17, + }, + asname: None, + }, + ], + }, + ), + Expr( + StmtExpr { + range: 19..23, + value: Tuple( + ExprTuple { + range: 19..23, + elts: [ + Starred( + ExprStarred { + range: 19..20, + value: Name( + ExprName { + range: 20..20, + id: "", + ctx: Invalid, + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 22..23, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | import * + | ^ Syntax Error: Expected an import name +2 | import x, *, y + | + + + | +1 | import * + | ^ Syntax Error: Expected an expression +2 | import x, *, y + | + + + | +1 | import * +2 | import x, *, y + | ^ Syntax Error: Expected an import name + | + + + | +1 | import * +2 | import x, *, y + | ^ Syntax Error: Trailing comma not allowed + | + + + | +1 | import * +2 | import x, *, y + | ^ Syntax Error: Simple statements must be separated by newlines or semicolons + | + + + | +1 | import * +2 | import x, *, y + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_trailing_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_trailing_comma.py.snap new file mode 100644 index 0000000000..513a22fac0 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_trailing_comma.py.snap @@ -0,0 +1,65 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/import_stmt_trailing_comma.py +--- +## AST + +``` +Module( + ModModule { + range: 0..22, + body: [ + Import( + StmtImport { + range: 0..8, + names: [], + }, + ), + Import( + StmtImport { + range: 9..21, + names: [ + Alias { + range: 16..17, + name: Identifier { + id: "x", + range: 16..17, + }, + asname: None, + }, + Alias { + range: 19..20, + name: Identifier { + id: "y", + range: 19..20, + }, + asname: None, + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | import , + | ^ Syntax Error: Expected an import name +2 | import x, y, + | + + + | +1 | import , + | ^ Syntax Error: Expected one or more symbol names after import +2 | import x, y, + | + + + | +1 | import , +2 | import x, y, + | ^ Syntax Error: Trailing comma not allowed + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_byte_literal.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_byte_literal.py.snap new file mode 100644 index 0000000000..e8cbf9ac5d --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_byte_literal.py.snap @@ -0,0 +1,110 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/invalid_byte_literal.py +--- +## AST + +``` +Module( + ModModule { + range: 0..44, + body: [ + Expr( + StmtExpr { + range: 0..12, + value: BytesLiteral( + ExprBytesLiteral { + range: 0..12, + value: BytesLiteralValue { + inner: Single( + BytesLiteral { + range: 0..12, + value: [], + flags: BytesLiteralFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 13..26, + value: BytesLiteral( + ExprBytesLiteral { + range: 13..26, + value: BytesLiteralValue { + inner: Single( + BytesLiteral { + range: 13..26, + value: [], + flags: BytesLiteralFlags { + quote_style: Double, + prefix: Raw { + uppercase_r: false, + }, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 27..43, + value: BytesLiteral( + ExprBytesLiteral { + range: 27..43, + value: BytesLiteralValue { + inner: Single( + BytesLiteral { + range: 27..43, + value: [], + flags: BytesLiteralFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: true, + }, + }, + ), + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | b'123a𝐁c' + | ^ Syntax Error: bytes can only contain ASCII literal characters +2 | rb"a𝐁c123" +3 | b"""123a𝐁c""" + | + + + | +1 | b'123a𝐁c' +2 | rb"a𝐁c123" + | ^ Syntax Error: bytes can only contain ASCII literal characters +3 | b"""123a𝐁c""" + | + + + | +1 | b'123a𝐁c' +2 | rb"a𝐁c123" +3 | b"""123a𝐁c""" + | ^ Syntax Error: bytes can only contain ASCII literal characters + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_del_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_del_target.py.snap new file mode 100644 index 0000000000..1b2fcfa110 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_del_target.py.snap @@ -0,0 +1,269 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/invalid_del_target.py +--- +## AST + +``` +Module( + ModModule { + range: 0..75, + body: [ + Delete( + StmtDelete { + range: 0..9, + targets: [ + BinOp( + ExprBinOp { + range: 4..9, + left: Name( + ExprName { + range: 4..5, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 8..9, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + ), + Delete( + StmtDelete { + range: 10..22, + targets: [ + Dict( + ExprDict { + range: 14..22, + keys: [ + Some( + StringLiteral( + ExprStringLiteral { + range: 15..18, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 15..18, + value: "x", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 20..21, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + ], + }, + ), + Delete( + StmtDelete { + range: 23..37, + targets: [ + Set( + ExprSet { + range: 27..37, + elts: [ + StringLiteral( + ExprStringLiteral { + range: 28..31, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 28..31, + value: "x", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + StringLiteral( + ExprStringLiteral { + range: 33..36, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 33..36, + value: "y", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + }, + ), + ], + }, + ), + Delete( + StmtDelete { + range: 38..74, + targets: [ + NoneLiteral( + ExprNoneLiteral { + range: 42..46, + }, + ), + BooleanLiteral( + ExprBooleanLiteral { + range: 48..52, + value: true, + }, + ), + BooleanLiteral( + ExprBooleanLiteral { + range: 54..59, + value: false, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 61..62, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 64..67, + value: Float( + 1.0, + ), + }, + ), + StringLiteral( + ExprStringLiteral { + range: 69..74, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 69..74, + value: "abc", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | del x + 1 + | ^^^^^ Syntax Error: Invalid delete target +2 | del {'x': 1} +3 | del {'x', 'y'} + | + + + | +1 | del x + 1 +2 | del {'x': 1} + | ^^^^^^^^ Syntax Error: Invalid delete target +3 | del {'x', 'y'} +4 | del None, True, False, 1, 1.0, "abc" + | + + + | +1 | del x + 1 +2 | del {'x': 1} +3 | del {'x', 'y'} + | ^^^^^^^^^^ Syntax Error: Invalid delete target +4 | del None, True, False, 1, 1.0, "abc" + | + + + | +2 | del {'x': 1} +3 | del {'x', 'y'} +4 | del None, True, False, 1, 1.0, "abc" + | ^^^^ Syntax Error: Invalid delete target + | + + + | +2 | del {'x': 1} +3 | del {'x', 'y'} +4 | del None, True, False, 1, 1.0, "abc" + | ^^^^ Syntax Error: Invalid delete target + | + + + | +2 | del {'x': 1} +3 | del {'x', 'y'} +4 | del None, True, False, 1, 1.0, "abc" + | ^^^^^ Syntax Error: Invalid delete target + | + + + | +2 | del {'x': 1} +3 | del {'x', 'y'} +4 | del None, True, False, 1, 1.0, "abc" + | ^ Syntax Error: Invalid delete target + | + + + | +2 | del {'x': 1} +3 | del {'x', 'y'} +4 | del None, True, False, 1, 1.0, "abc" + | ^^^ Syntax Error: Invalid delete target + | + + + | +2 | del {'x': 1} +3 | del {'x', 'y'} +4 | del None, True, False, 1, 1.0, "abc" + | ^^^^^ Syntax Error: Invalid delete target + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_fstring_literal_element.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_fstring_literal_element.py.snap new file mode 100644 index 0000000000..58211f349b --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_fstring_literal_element.py.snap @@ -0,0 +1,93 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/invalid_fstring_literal_element.py +--- +## AST + +``` +Module( + ModModule { + range: 0..58, + body: [ + Expr( + StmtExpr { + range: 0..26, + value: FString( + ExprFString { + range: 0..26, + value: FStringValue { + inner: Single( + FString( + FString { + range: 0..26, + elements: [ + Literal( + FStringLiteralElement { + range: 2..25, + value: "", + }, + ), + ], + flags: FStringFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 27..57, + value: FString( + ExprFString { + range: 27..57, + value: FStringValue { + inner: Single( + FString( + FString { + range: 27..57, + elements: [ + Literal( + FStringLiteralElement { + range: 31..54, + value: "", + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: true, + }, + }, + ), + ), + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | f'hello \N{INVALID} world' + | ^^^^^^^ Syntax Error: Got unexpected unicode +2 | f"""hello \N{INVALID} world""" + | + + + | +1 | f'hello \N{INVALID} world' +2 | f"""hello \N{INVALID} world""" + | ^^^^^^^ Syntax Error: Got unexpected unicode + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_string_literal.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_string_literal.py.snap new file mode 100644 index 0000000000..4847bbe2ef --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_string_literal.py.snap @@ -0,0 +1,75 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/invalid_string_literal.py +--- +## AST + +``` +Module( + ModModule { + range: 0..56, + body: [ + Expr( + StmtExpr { + range: 0..25, + value: StringLiteral( + ExprStringLiteral { + range: 0..25, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 0..25, + value: "", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 26..55, + value: StringLiteral( + ExprStringLiteral { + range: 26..55, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 26..55, + value: "", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: true, + }, + }, + ), + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | 'hello \N{INVALID} world' + | ^^^^^^^ Syntax Error: Got unexpected unicode +2 | """hello \N{INVALID} world""" + | + + + | +1 | 'hello \N{INVALID} world' +2 | """hello \N{INVALID} world""" + | ^^^^^^^ Syntax Error: Got unexpected unicode + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_starred_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_starred_expr.py.snap new file mode 100644 index 0000000000..05fbaf22c9 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_starred_expr.py.snap @@ -0,0 +1,273 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/lambda_body_with_starred_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..62, + body: [ + Expr( + StmtExpr { + range: 0..12, + value: Lambda( + ExprLambda { + range: 0..12, + parameters: Some( + Parameters { + range: 7..8, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 7..8, + parameter: Parameter { + range: 7..8, + name: Identifier { + id: "x", + range: 7..8, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Starred( + ExprStarred { + range: 10..12, + value: Name( + ExprName { + range: 11..12, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 13..26, + value: Tuple( + ExprTuple { + range: 13..26, + elts: [ + Lambda( + ExprLambda { + range: 13..25, + parameters: Some( + Parameters { + range: 20..21, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 20..21, + parameter: Parameter { + range: 20..21, + name: Identifier { + id: "x", + range: 20..21, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Starred( + ExprStarred { + range: 23..25, + value: Name( + ExprName { + range: 24..25, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 27..42, + value: Tuple( + ExprTuple { + range: 27..42, + elts: [ + Lambda( + ExprLambda { + range: 27..39, + parameters: Some( + Parameters { + range: 34..35, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 34..35, + parameter: Parameter { + range: 34..35, + name: Identifier { + id: "x", + range: 34..35, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Starred( + ExprStarred { + range: 37..39, + value: Name( + ExprName { + range: 38..39, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + Name( + ExprName { + range: 41..42, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 43..61, + value: Lambda( + ExprLambda { + range: 43..61, + parameters: Some( + Parameters { + range: 50..51, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 50..51, + parameter: Parameter { + range: 50..51, + name: Identifier { + id: "x", + range: 50..51, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Starred( + ExprStarred { + range: 53..61, + value: BoolOp( + ExprBoolOp { + range: 54..61, + op: And, + values: [ + Name( + ExprName { + range: 54..55, + id: "y", + ctx: Load, + }, + ), + Name( + ExprName { + range: 60..61, + id: "z", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | lambda x: *y + | ^^ Syntax Error: Starred expression cannot be used here +2 | lambda x: *y, +3 | lambda x: *y, z + | + + + | +1 | lambda x: *y +2 | lambda x: *y, + | ^^ Syntax Error: Starred expression cannot be used here +3 | lambda x: *y, z +4 | lambda x: *y and z + | + + + | +1 | lambda x: *y +2 | lambda x: *y, +3 | lambda x: *y, z + | ^^ Syntax Error: Starred expression cannot be used here +4 | lambda x: *y and z + | + + + | +2 | lambda x: *y, +3 | lambda x: *y, z +4 | lambda x: *y and z + | ^^^^^^^^ Syntax Error: Starred expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_yield_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_yield_expr.py.snap new file mode 100644 index 0000000000..2267582592 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_yield_expr.py.snap @@ -0,0 +1,121 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/lambda_body_with_yield_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..41, + body: [ + Expr( + StmtExpr { + range: 0..17, + value: Lambda( + ExprLambda { + range: 0..17, + parameters: Some( + Parameters { + range: 7..8, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 7..8, + parameter: Parameter { + range: 7..8, + name: Identifier { + id: "x", + range: 7..8, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Yield( + ExprYield { + range: 10..17, + value: Some( + Name( + ExprName { + range: 16..17, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 18..40, + value: Lambda( + ExprLambda { + range: 18..40, + parameters: Some( + Parameters { + range: 25..26, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 25..26, + parameter: Parameter { + range: 25..26, + name: Identifier { + id: "x", + range: 25..26, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: YieldFrom( + ExprYieldFrom { + range: 28..40, + value: Name( + ExprName { + range: 39..40, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | lambda x: yield y + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +2 | lambda x: yield from y + | + + + | +1 | lambda x: yield y +2 | lambda x: yield from y + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expect_indented_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expect_indented_block.py.snap new file mode 100644 index 0000000000..2b4bd18bfc --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expect_indented_block.py.snap @@ -0,0 +1,65 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/match_stmt_expect_indented_block.py +--- +## AST + +``` +Module( + ModModule { + range: 0..23, + body: [ + Match( + StmtMatch { + range: 0..22, + subject: Name( + ExprName { + range: 6..9, + id: "foo", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 11..22, + pattern: MatchAs( + PatternMatchAs { + range: 16..17, + pattern: None, + name: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 19..22, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 19..22, + }, + ), + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | match foo: +2 | case _: ... + | ^^^^ Syntax Error: Expected an indented block after `match` statement + | + + + | +1 | match foo: +2 | case _: ... + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap new file mode 100644 index 0000000000..af91bab864 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap @@ -0,0 +1,134 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/match_stmt_expected_case_block.py +--- +## AST + +``` +Module( + ModModule { + range: 0..61, + body: [ + Match( + StmtMatch { + range: 0..13, + subject: Name( + ExprName { + range: 6..7, + id: "x", + ctx: Load, + }, + ), + cases: [], + }, + ), + Assign( + StmtAssign { + range: 13..18, + targets: [ + Name( + ExprName { + range: 13..14, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 17..18, + value: Int( + 1, + ), + }, + ), + }, + ), + Match( + StmtMatch { + range: 19..32, + subject: Name( + ExprName { + range: 25..26, + id: "x", + ctx: Load, + }, + ), + cases: [], + }, + ), + Match( + StmtMatch { + range: 32..60, + subject: Name( + ExprName { + range: 38..39, + id: "y", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 49..60, + pattern: MatchAs( + PatternMatchAs { + range: 54..55, + pattern: None, + name: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 57..60, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 57..60, + }, + ), + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | match x: +2 | x = 1 + | ^ Syntax Error: Expected `case` block +3 | match x: +4 | match y: + | + + + | +1 | match x: +2 | x = 1 +3 | match x: + | Syntax Error: Expected a statement +4 | match y: +5 | case _: ... + | + + + | +2 | x = 1 +3 | match x: +4 | match y: + | ^^^^^ Syntax Error: Expected `case` block +5 | case _: ... + | + + + | +4 | match y: +5 | case _: ... + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_guard_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_guard_expr.py.snap new file mode 100644 index 0000000000..b697fd9a52 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_guard_expr.py.snap @@ -0,0 +1,211 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/match_stmt_invalid_guard_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..100, + body: [ + Match( + StmtMatch { + range: 0..30, + subject: Name( + ExprName { + range: 6..7, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 13..30, + pattern: MatchAs( + PatternMatchAs { + range: 18..19, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 18..19, + }, + ), + }, + ), + guard: Some( + Starred( + ExprStarred { + range: 23..25, + value: Name( + ExprName { + range: 24..25, + id: "a", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 27..30, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 27..30, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 31..63, + subject: Name( + ExprName { + range: 37..38, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 44..63, + pattern: MatchAs( + PatternMatchAs { + range: 49..50, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 49..50, + }, + ), + }, + ), + guard: Some( + Starred( + ExprStarred { + range: 55..57, + value: Name( + ExprName { + range: 56..57, + id: "a", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 60..63, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 60..63, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 64..99, + subject: Name( + ExprName { + range: 70..71, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 77..99, + pattern: MatchAs( + PatternMatchAs { + range: 82..83, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 82..83, + }, + ), + }, + ), + guard: Some( + Yield( + ExprYield { + range: 87..94, + value: Some( + Name( + ExprName { + range: 93..94, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 96..99, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 96..99, + }, + ), + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | match x: +2 | case y if *a: ... + | ^^ Syntax Error: Starred expression cannot be used here +3 | match x: +4 | case y if (*a): ... + | + + + | +2 | case y if *a: ... +3 | match x: +4 | case y if (*a): ... + | ^^ Syntax Error: Starred expression cannot be used here +5 | match x: +6 | case y if yield x: ... + | + + + | +4 | case y if (*a): ... +5 | match x: +6 | case y if yield x: ... + | ^^^^^^^ Syntax Error: Yield expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_subject_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_subject_expr.py.snap new file mode 100644 index 0000000000..f5d5a8223a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_subject_expr.py.snap @@ -0,0 +1,203 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/match_stmt_invalid_subject_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..131, + body: [ + Match( + StmtMatch { + range: 0..27, + subject: Starred( + ExprStarred { + range: 7..9, + value: Name( + ExprName { + range: 8..9, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 16..27, + pattern: MatchAs( + PatternMatchAs { + range: 21..22, + pattern: None, + name: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 24..27, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 24..27, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 65..99, + subject: Tuple( + ExprTuple { + range: 71..82, + elts: [ + Starred( + ExprStarred { + range: 71..79, + value: BoolOp( + ExprBoolOp { + range: 72..79, + op: And, + values: [ + Name( + ExprName { + range: 72..73, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 78..79, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 81..82, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + cases: [ + MatchCase { + range: 88..99, + pattern: MatchAs( + PatternMatchAs { + range: 93..94, + pattern: None, + name: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 96..99, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 96..99, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 100..130, + subject: Yield( + ExprYield { + range: 106..113, + value: Some( + Name( + ExprName { + range: 112..113, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + cases: [ + MatchCase { + range: 119..130, + pattern: MatchAs( + PatternMatchAs { + range: 124..125, + pattern: None, + name: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 127..130, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 127..130, + }, + ), + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | match (*x): + | ^^ Syntax Error: Starred expression cannot be used here +2 | case _: ... +3 | # Starred expression precedence test + | + + + | +2 | case _: ... +3 | # Starred expression precedence test +4 | match *x and y, z: + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here +5 | case _: ... +6 | match yield x: + | + + + | +4 | match *x and y, z: +5 | case _: ... +6 | match yield x: + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +7 | case _: ... + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_guard_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_guard_expr.py.snap new file mode 100644 index 0000000000..f21bb60978 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_guard_expr.py.snap @@ -0,0 +1,64 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/match_stmt_missing_guard_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..28, + body: [ + Match( + StmtMatch { + range: 0..27, + subject: Name( + ExprName { + range: 6..7, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 13..27, + pattern: MatchAs( + PatternMatchAs { + range: 18..19, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 18..19, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 24..27, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 24..27, + }, + ), + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | match x: +2 | case y if: ... + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_pattern.py.snap new file mode 100644 index 0000000000..4736985e44 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_pattern.py.snap @@ -0,0 +1,61 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/match_stmt_missing_pattern.py +--- +## AST + +``` +Module( + ModModule { + range: 0..110, + body: [ + Match( + StmtMatch { + range: 86..99, + subject: Name( + ExprName { + range: 92..93, + id: "x", + ctx: Load, + }, + ), + cases: [], + }, + ), + AnnAssign( + StmtAnnAssign { + range: 99..109, + target: Name( + ExprName { + range: 99..103, + id: "case", + ctx: Store, + }, + ), + annotation: EllipsisLiteral( + ExprEllipsisLiteral { + range: 106..109, + }, + ), + value: None, + simple: true, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # TODO(dhruvmanila): Here, `case` is a name token because of soft keyword transformer +2 | match x: +3 | case : ... + | ^^^^ Syntax Error: Expected `case` block + | + + + | +2 | match x: +3 | case : ... + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_no_newline_before_case.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_no_newline_before_case.py.snap new file mode 100644 index 0000000000..0d11f2c94c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_no_newline_before_case.py.snap @@ -0,0 +1,71 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/match_stmt_no_newline_before_case.py +--- +## AST + +``` +Module( + ModModule { + range: 0..23, + body: [ + Match( + StmtMatch { + range: 0..10, + subject: Name( + ExprName { + range: 6..9, + id: "foo", + ctx: Load, + }, + ), + cases: [], + }, + ), + Expr( + StmtExpr { + range: 11..15, + value: Name( + ExprName { + range: 11..15, + id: "case", + ctx: Load, + }, + ), + }, + ), + AnnAssign( + StmtAnnAssign { + range: 16..22, + target: Name( + ExprName { + range: 16..17, + id: "_", + ctx: Store, + }, + ), + annotation: EllipsisLiteral( + ExprEllipsisLiteral { + range: 19..22, + }, + ), + value: None, + simple: true, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | match foo: case _: ... + | ^^^^ Syntax Error: Expected newline, found name + | + + + | +1 | match foo: case _: ... + | ^ Syntax Error: Simple statements must be separated by newlines or semicolons + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_single_starred_subject.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_single_starred_subject.py.snap new file mode 100644 index 0000000000..aeed10c675 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_single_starred_subject.py.snap @@ -0,0 +1,65 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/match_stmt_single_starred_subject.py +--- +## AST + +``` +Module( + ModModule { + range: 0..28, + body: [ + Match( + StmtMatch { + range: 0..27, + subject: Starred( + ExprStarred { + range: 6..10, + value: Name( + ExprName { + range: 7..10, + id: "foo", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 16..27, + pattern: MatchAs( + PatternMatchAs { + range: 21..22, + pattern: None, + name: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 24..27, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 24..27, + }, + ), + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | match *foo: + | ^^^^ Syntax Error: Starred expression cannot be used here +2 | case _: ... + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@mixed_bytes_and_non_bytes_literals.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@mixed_bytes_and_non_bytes_literals.py.snap new file mode 100644 index 0000000000..0a8782484f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@mixed_bytes_and_non_bytes_literals.py.snap @@ -0,0 +1,177 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/mixed_bytes_and_non_bytes_literals.py +--- +## AST + +``` +Module( + ModModule { + range: 0..64, + body: [ + Expr( + StmtExpr { + range: 0..17, + value: StringLiteral( + ExprStringLiteral { + range: 0..17, + value: StringLiteralValue { + inner: Concatenated( + ConcatenatedStringLiteral { + strings: [ + StringLiteral { + range: 0..7, + value: "first", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + StringLiteral { + range: 8..17, + value: "", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ], + value: "first", + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 18..36, + value: FString( + ExprFString { + range: 18..36, + value: FStringValue { + inner: Concatenated( + [ + FString( + FString { + range: 18..26, + elements: [ + Literal( + FStringLiteralElement { + range: 20..25, + value: "first", + }, + ), + ], + flags: FStringFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 27..36, + value: "", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 37..63, + value: FString( + ExprFString { + range: 37..63, + value: FStringValue { + inner: Concatenated( + [ + Literal( + StringLiteral { + range: 37..44, + value: "first", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 45..54, + elements: [ + Literal( + FStringLiteralElement { + range: 47..53, + value: "second", + }, + ), + ], + flags: FStringFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 55..63, + value: "", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | 'first' b'second' + | ^^^^^^^^^^^^^^^^^ Syntax Error: Bytes literal cannot be mixed with non-bytes literals +2 | f'first' b'second' +3 | 'first' f'second' b'third' + | + + + | +1 | 'first' b'second' +2 | f'first' b'second' + | ^^^^^^^^^^^^^^^^^^ Syntax Error: Bytes literal cannot be mixed with non-bytes literals +3 | 'first' f'second' b'third' + | + + + | +1 | 'first' b'second' +2 | f'first' b'second' +3 | 'first' f'second' b'third' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ Syntax Error: Bytes literal cannot be mixed with non-bytes literals + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_clauses_on_same_line.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_clauses_on_same_line.py.snap new file mode 100644 index 0000000000..2a3a470fad --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_clauses_on_same_line.py.snap @@ -0,0 +1,388 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/multiple_clauses_on_same_line.py +--- +## AST + +``` +Module( + ModModule { + range: 0..258, + body: [ + If( + StmtIf { + range: 0..41, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 3..7, + value: true, + }, + ), + body: [ + Pass( + StmtPass { + range: 9..13, + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 14..30, + test: Some( + BooleanLiteral( + ExprBooleanLiteral { + range: 19..24, + value: false, + }, + ), + ), + body: [ + Pass( + StmtPass { + range: 26..30, + }, + ), + ], + }, + ElifElseClause { + range: 31..41, + test: None, + body: [ + Pass( + StmtPass { + range: 37..41, + }, + ), + ], + }, + ], + }, + ), + If( + StmtIf { + range: 42..85, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 45..49, + value: true, + }, + ), + body: [ + Pass( + StmtPass { + range: 51..55, + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 57..73, + test: Some( + BooleanLiteral( + ExprBooleanLiteral { + range: 62..67, + value: false, + }, + ), + ), + body: [ + Pass( + StmtPass { + range: 69..73, + }, + ), + ], + }, + ElifElseClause { + range: 75..85, + test: None, + body: [ + Pass( + StmtPass { + range: 81..85, + }, + ), + ], + }, + ], + }, + ), + For( + StmtFor { + range: 86..117, + is_async: false, + target: Name( + ExprName { + range: 90..91, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 95..99, + id: "iter", + ctx: Load, + }, + ), + body: [ + Break( + StmtBreak { + range: 101..106, + }, + ), + ], + orelse: [ + Pass( + StmtPass { + range: 113..117, + }, + ), + ], + }, + ), + For( + StmtFor { + range: 118..150, + is_async: false, + target: Name( + ExprName { + range: 122..123, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 127..131, + id: "iter", + ctx: Load, + }, + ), + body: [ + Break( + StmtBreak { + range: 133..138, + }, + ), + ], + orelse: [ + Pass( + StmtPass { + range: 146..150, + }, + ), + ], + }, + ), + Try( + StmtTry { + range: 151..202, + body: [ + Pass( + StmtPass { + range: 156..160, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 161..177, + type_: Some( + Name( + ExprName { + range: 168..171, + id: "exc", + ctx: Load, + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 173..177, + }, + ), + ], + }, + ), + ], + orelse: [ + Pass( + StmtPass { + range: 184..188, + }, + ), + ], + finalbody: [ + Pass( + StmtPass { + range: 198..202, + }, + ), + ], + is_star: false, + }, + ), + Try( + StmtTry { + range: 203..257, + body: [ + Pass( + StmtPass { + range: 208..212, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 214..230, + type_: Some( + Name( + ExprName { + range: 221..224, + id: "exc", + ctx: Load, + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 226..230, + }, + ), + ], + }, + ), + ], + orelse: [ + Pass( + StmtPass { + range: 238..242, + }, + ), + ], + finalbody: [ + Pass( + StmtPass { + range: 253..257, + }, + ), + ], + is_star: false, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | if True: pass elif False: pass else: pass + | ^^^^ Syntax Error: Expected newline, found 'elif' +2 | if True: pass; elif False: pass; else: pass +3 | for x in iter: break else: pass + | + + + | +1 | if True: pass elif False: pass else: pass + | ^^^^ Syntax Error: Expected newline, found 'else' +2 | if True: pass; elif False: pass; else: pass +3 | for x in iter: break else: pass + | + + + | +1 | if True: pass elif False: pass else: pass +2 | if True: pass; elif False: pass; else: pass + | ^^^^ Syntax Error: Expected newline, found 'elif' +3 | for x in iter: break else: pass +4 | for x in iter: break; else: pass + | + + + | +1 | if True: pass elif False: pass else: pass +2 | if True: pass; elif False: pass; else: pass + | ^^^^ Syntax Error: Expected newline, found 'else' +3 | for x in iter: break else: pass +4 | for x in iter: break; else: pass + | + + + | +1 | if True: pass elif False: pass else: pass +2 | if True: pass; elif False: pass; else: pass +3 | for x in iter: break else: pass + | ^^^^ Syntax Error: Expected newline, found 'else' +4 | for x in iter: break; else: pass +5 | try: pass except exc: pass else: pass finally: pass + | + + + | +2 | if True: pass; elif False: pass; else: pass +3 | for x in iter: break else: pass +4 | for x in iter: break; else: pass + | ^^^^ Syntax Error: Expected newline, found 'else' +5 | try: pass except exc: pass else: pass finally: pass +6 | try: pass; except exc: pass; else: pass; finally: pass + | + + + | +3 | for x in iter: break else: pass +4 | for x in iter: break; else: pass +5 | try: pass except exc: pass else: pass finally: pass + | ^^^^^^ Syntax Error: Expected newline, found 'except' +6 | try: pass; except exc: pass; else: pass; finally: pass + | + + + | +3 | for x in iter: break else: pass +4 | for x in iter: break; else: pass +5 | try: pass except exc: pass else: pass finally: pass + | ^^^^ Syntax Error: Expected newline, found 'else' +6 | try: pass; except exc: pass; else: pass; finally: pass + | + + + | +3 | for x in iter: break else: pass +4 | for x in iter: break; else: pass +5 | try: pass except exc: pass else: pass finally: pass + | ^^^^^^^ Syntax Error: Expected newline, found 'finally' +6 | try: pass; except exc: pass; else: pass; finally: pass + | + + + | +4 | for x in iter: break; else: pass +5 | try: pass except exc: pass else: pass finally: pass +6 | try: pass; except exc: pass; else: pass; finally: pass + | ^^^^^^ Syntax Error: Expected newline, found 'except' + | + + + | +4 | for x in iter: break; else: pass +5 | try: pass except exc: pass else: pass finally: pass +6 | try: pass; except exc: pass; else: pass; finally: pass + | ^^^^ Syntax Error: Expected newline, found 'else' + | + + + | +4 | for x in iter: break; else: pass +5 | try: pass except exc: pass else: pass finally: pass +6 | try: pass; except exc: pass; else: pass; finally: pass + | ^^^^^^^ Syntax Error: Expected newline, found 'finally' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_empty.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_empty.py.snap new file mode 100644 index 0000000000..63bb39d57c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_empty.py.snap @@ -0,0 +1,27 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/nonlocal_stmt_empty.py +--- +## AST + +``` +Module( + ModModule { + range: 0..9, + body: [ + Nonlocal( + StmtNonlocal { + range: 0..8, + names: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | nonlocal + | ^ Syntax Error: Nonlocal statement must have at least one name + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_expression.py.snap new file mode 100644 index 0000000000..1838963632 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_expression.py.snap @@ -0,0 +1,51 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/nonlocal_stmt_expression.py +--- +## AST + +``` +Module( + ModModule { + range: 0..15, + body: [ + Nonlocal( + StmtNonlocal { + range: 0..10, + names: [ + Identifier { + id: "x", + range: 9..10, + }, + ], + }, + ), + Expr( + StmtExpr { + range: 11..14, + value: UnaryOp( + ExprUnaryOp { + range: 11..14, + op: UAdd, + operand: NumberLiteral( + ExprNumberLiteral { + range: 13..14, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | nonlocal x + 1 + | ^ Syntax Error: Expected ',', found '+' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_trailing_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_trailing_comma.py.snap new file mode 100644 index 0000000000..de8910ccb6 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_trailing_comma.py.snap @@ -0,0 +1,79 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/nonlocal_stmt_trailing_comma.py +--- +## AST + +``` +Module( + ModModule { + range: 0..38, + body: [ + Nonlocal( + StmtNonlocal { + range: 0..10, + names: [], + }, + ), + Nonlocal( + StmtNonlocal { + range: 11..22, + names: [ + Identifier { + id: "x", + range: 20..21, + }, + ], + }, + ), + Nonlocal( + StmtNonlocal { + range: 23..37, + names: [ + Identifier { + id: "x", + range: 32..33, + }, + Identifier { + id: "y", + range: 35..36, + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | nonlocal , + | ^ Syntax Error: Expected an identifier +2 | nonlocal x, +3 | nonlocal x, y, + | + + + | +1 | nonlocal , + | ^ Syntax Error: Nonlocal statement must have at least one name +2 | nonlocal x, +3 | nonlocal x, y, + | + + + | +1 | nonlocal , +2 | nonlocal x, + | ^ Syntax Error: Trailing comma not allowed +3 | nonlocal x, y, + | + + + | +1 | nonlocal , +2 | nonlocal x, +3 | nonlocal x, y, + | ^ Syntax Error: Trailing comma not allowed + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_annotation.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_annotation.py.snap new file mode 100644 index 0000000000..d8b202163a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_annotation.py.snap @@ -0,0 +1,121 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/param_missing_annotation.py +--- +## AST + +``` +Module( + ModModule { + range: 0..35, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..16, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..11, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..10, + parameter: Parameter { + range: 8..10, + name: Identifier { + id: "x", + range: 8..9, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 13..16, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 13..16, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 17..34, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 21..24, + }, + type_params: None, + parameters: Parameters { + range: 24..29, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 25..27, + parameter: Parameter { + range: 25..27, + name: Identifier { + id: "x", + range: 25..26, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 31..34, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 31..34, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(x:): ... + | ^ Syntax Error: Expected an expression +2 | def foo(x:,): ... + | + + + | +1 | def foo(x:): ... +2 | def foo(x:,): ... + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_default.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_default.py.snap new file mode 100644 index 0000000000..b648cc9fdd --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_default.py.snap @@ -0,0 +1,129 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/param_missing_default.py +--- +## AST + +``` +Module( + ModModule { + range: 0..41, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..16, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..11, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..10, + parameter: Parameter { + range: 8..9, + name: Identifier { + id: "x", + range: 8..9, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 13..16, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 13..16, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 17..40, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 21..24, + }, + type_params: None, + parameters: Parameters { + range: 24..35, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 25..33, + parameter: Parameter { + range: 25..31, + name: Identifier { + id: "x", + range: 25..26, + }, + annotation: Some( + Name( + ExprName { + range: 28..31, + id: "int", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 37..40, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 37..40, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(x=): ... + | ^ Syntax Error: Expected an expression +2 | def foo(x: int = ): ... + | + + + | +1 | def foo(x=): ... +2 | def foo(x: int = ): ... + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_annotation.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_annotation.py.snap new file mode 100644 index 0000000000..eea04d9778 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_annotation.py.snap @@ -0,0 +1,226 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/param_with_invalid_annotation.py +--- +## AST + +``` +Module( + ModModule { + range: 0..81, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..23, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..18, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..17, + parameter: Parameter { + range: 8..17, + name: Identifier { + id: "arg", + range: 8..11, + }, + annotation: Some( + Starred( + ExprStarred { + range: 13..17, + value: Name( + ExprName { + range: 14..17, + id: "int", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 20..23, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 20..23, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 24..52, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 28..31, + }, + type_params: None, + parameters: Parameters { + range: 31..47, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 32..46, + parameter: Parameter { + range: 32..46, + name: Identifier { + id: "arg", + range: 32..35, + }, + annotation: Some( + Yield( + ExprYield { + range: 37..46, + value: Some( + Name( + ExprName { + range: 43..46, + id: "int", + ctx: Load, + }, + ), + ), + }, + ), + ), + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 49..52, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 49..52, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 53..80, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 57..60, + }, + type_params: None, + parameters: Parameters { + range: 60..75, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 61..67, + parameter: Parameter { + range: 61..67, + name: Identifier { + id: "arg", + range: 61..64, + }, + annotation: Some( + Name( + ExprName { + range: 66..67, + id: "x", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ParameterWithDefault { + range: 71..74, + parameter: Parameter { + range: 71..74, + name: Identifier { + id: "int", + range: 71..74, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 77..80, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 77..80, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(arg: *int): ... + | ^^^^ Syntax Error: Starred expression cannot be used here +2 | def foo(arg: yield int): ... +3 | def foo(arg: x := int): ... + | + + + | +1 | def foo(arg: *int): ... +2 | def foo(arg: yield int): ... + | ^^^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | def foo(arg: x := int): ... + | + + + | +1 | def foo(arg: *int): ... +2 | def foo(arg: yield int): ... +3 | def foo(arg: x := int): ... + | ^^ Syntax Error: Expected ',', found ':=' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_default.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_default.py.snap new file mode 100644 index 0000000000..ad562a053f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_default.py.snap @@ -0,0 +1,220 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/param_with_invalid_default.py +--- +## AST + +``` +Module( + ModModule { + range: 0..68, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..20, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..15, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..14, + parameter: Parameter { + range: 8..9, + name: Identifier { + id: "x", + range: 8..9, + }, + annotation: None, + }, + default: Some( + Starred( + ExprStarred { + range: 10..14, + value: Name( + ExprName { + range: 11..14, + id: "int", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 17..20, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 17..20, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 21..43, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 25..28, + }, + type_params: None, + parameters: Parameters { + range: 28..38, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 29..37, + parameter: Parameter { + range: 29..30, + name: Identifier { + id: "x", + range: 29..30, + }, + annotation: None, + }, + default: Some( + Starred( + ExprStarred { + range: 32..36, + value: Name( + ExprName { + range: 33..36, + id: "int", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 40..43, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 40..43, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 44..67, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 48..51, + }, + type_params: None, + parameters: Parameters { + range: 51..62, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 52..61, + parameter: Parameter { + range: 52..53, + name: Identifier { + id: "x", + range: 52..53, + }, + annotation: None, + }, + default: Some( + Yield( + ExprYield { + range: 54..61, + value: Some( + Name( + ExprName { + range: 60..61, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 64..67, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 64..67, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(x=*int): ... + | ^^^^ Syntax Error: Starred expression cannot be used here +2 | def foo(x=(*int)): ... +3 | def foo(x=yield y): ... + | + + + | +1 | def foo(x=*int): ... +2 | def foo(x=(*int)): ... + | ^^^^ Syntax Error: Starred expression cannot be used here +3 | def foo(x=yield y): ... + | + + + | +1 | def foo(x=*int): ... +2 | def foo(x=(*int)): ... +3 | def foo(x=yield y): ... + | ^^^^^^^ Syntax Error: Yield expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_star_annotation.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_star_annotation.py.snap new file mode 100644 index 0000000000..388c8c721a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_star_annotation.py.snap @@ -0,0 +1,310 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/param_with_invalid_star_annotation.py +--- +## AST + +``` +Module( + ModModule { + range: 0..150, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..22, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..17, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 8..16, + name: Identifier { + id: "args", + range: 9..13, + }, + annotation: Some( + Starred( + ExprStarred { + range: 15..16, + value: Name( + ExprName { + range: 16..16, + id: "", + ctx: Invalid, + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 19..22, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 19..22, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 23..57, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 27..30, + }, + type_params: None, + parameters: Parameters { + range: 30..52, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 31..51, + name: Identifier { + id: "args", + range: 32..36, + }, + annotation: Some( + Starred( + ExprStarred { + range: 39..50, + value: Subscript( + ExprSubscript { + range: 40..50, + value: Name( + ExprName { + range: 40..45, + id: "tuple", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 46..49, + id: "int", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 54..57, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 54..57, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 58..90, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 62..65, + }, + type_params: None, + parameters: Parameters { + range: 65..85, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 66..84, + name: Identifier { + id: "args", + range: 67..71, + }, + annotation: Some( + Starred( + ExprStarred { + range: 73..84, + value: BoolOp( + ExprBoolOp { + range: 74..84, + op: Or, + values: [ + Name( + ExprName { + range: 74..77, + id: "int", + ctx: Load, + }, + ), + Name( + ExprName { + range: 81..84, + id: "str", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 87..90, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 87..90, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 91..120, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 95..98, + }, + type_params: None, + parameters: Parameters { + range: 98..115, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 99..114, + name: Identifier { + id: "args", + range: 100..104, + }, + annotation: Some( + Starred( + ExprStarred { + range: 106..114, + value: Yield( + ExprYield { + range: 107..114, + value: Some( + Name( + ExprName { + range: 113..114, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 117..120, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 117..120, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(*args: *): ... + | ^ Syntax Error: Expected an expression +2 | def foo(*args: (*tuple[int])): ... +3 | def foo(*args: *int or str): ... + | + + + | +1 | def foo(*args: *): ... +2 | def foo(*args: (*tuple[int])): ... + | ^^^^^^^^^^^ Syntax Error: Starred expression cannot be used here +3 | def foo(*args: *int or str): ... +4 | def foo(*args: *yield x): ... + | + + + | +1 | def foo(*args: *): ... +2 | def foo(*args: (*tuple[int])): ... +3 | def foo(*args: *int or str): ... + | ^^^^^^^^^^ Syntax Error: Boolean expression cannot be used here +4 | def foo(*args: *yield x): ... +5 | # def foo(*args: **int): ... + | + + + | +2 | def foo(*args: (*tuple[int])): ... +3 | def foo(*args: *int or str): ... +4 | def foo(*args: *yield x): ... + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +5 | # def foo(*args: **int): ... + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_duplicate_names.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_duplicate_names.py.snap new file mode 100644 index 0000000000..5d244c2b06 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_duplicate_names.py.snap @@ -0,0 +1,163 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/params_duplicate_names.py +--- +## AST + +``` +Module( + ModModule { + range: 0..42, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..41, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..36, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..9, + parameter: Parameter { + range: 8..9, + name: Identifier { + id: "a", + range: 8..9, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 11..15, + parameter: Parameter { + range: 11..12, + name: Identifier { + id: "a", + range: 11..12, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 13..15, + value: Int( + 10, + ), + }, + ), + ), + }, + ], + vararg: Some( + Parameter { + range: 17..19, + name: Identifier { + id: "a", + range: 18..19, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 21..22, + parameter: Parameter { + range: 21..22, + name: Identifier { + id: "a", + range: 21..22, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 24..30, + parameter: Parameter { + range: 24..30, + name: Identifier { + id: "a", + range: 24..25, + }, + annotation: Some( + Name( + ExprName { + range: 27..30, + id: "str", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ], + kwarg: Some( + Parameter { + range: 32..35, + name: Identifier { + id: "a", + range: 34..35, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 38..41, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 38..41, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(a, a=10, *a, a, a: str, **a): ... + | ^ Syntax Error: Duplicate parameter "a" + | + + + | +1 | def foo(a, a=10, *a, a, a: str, **a): ... + | ^ Syntax Error: Duplicate parameter "a" + | + + + | +1 | def foo(a, a=10, *a, a, a: str, **a): ... + | ^ Syntax Error: Duplicate parameter "a" + | + + + | +1 | def foo(a, a=10, *a, a, a: str, **a): ... + | ^ Syntax Error: Duplicate parameter "a" + | + + + | +1 | def foo(a, a=10, *a, a, a: str, **a): ... + | ^ Syntax Error: Duplicate parameter "a" + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_expected_after_star_separator.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_expected_after_star_separator.py.snap new file mode 100644 index 0000000000..110d02ed1b --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_expected_after_star_separator.py.snap @@ -0,0 +1,259 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/params_expected_after_star_separator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..98, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..15, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..10, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 12..15, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 12..15, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 16..32, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 20..23, + }, + type_params: None, + parameters: Parameters { + range: 23..27, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 29..32, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 29..32, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 33..51, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 37..40, + }, + type_params: None, + parameters: Parameters { + range: 40..46, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 41..42, + parameter: Parameter { + range: 41..42, + name: Identifier { + id: "a", + range: 41..42, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 48..51, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 48..51, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 52..71, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 56..59, + }, + type_params: None, + parameters: Parameters { + range: 59..66, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 60..61, + parameter: Parameter { + range: 60..61, + name: Identifier { + id: "a", + range: 60..61, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 68..71, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 68..71, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 72..97, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 76..79, + }, + type_params: None, + parameters: Parameters { + range: 79..92, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: Some( + Parameter { + range: 83..91, + name: Identifier { + id: "kwargs", + range: 85..91, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 94..97, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 94..97, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(*): ... + | ^ Syntax Error: Expected one or more keyword parameter after '*' separator +2 | def foo(*,): ... +3 | def foo(a, *): ... + | + + + | +1 | def foo(*): ... +2 | def foo(*,): ... + | ^ Syntax Error: Expected one or more keyword parameter after '*' separator +3 | def foo(a, *): ... +4 | def foo(a, *,): ... + | + + + | +1 | def foo(*): ... +2 | def foo(*,): ... +3 | def foo(a, *): ... + | ^ Syntax Error: Expected one or more keyword parameter after '*' separator +4 | def foo(a, *,): ... +5 | def foo(*, **kwargs): ... + | + + + | +2 | def foo(*,): ... +3 | def foo(a, *): ... +4 | def foo(a, *,): ... + | ^ Syntax Error: Expected one or more keyword parameter after '*' separator +5 | def foo(*, **kwargs): ... + | + + + | +3 | def foo(a, *): ... +4 | def foo(a, *,): ... +5 | def foo(*, **kwargs): ... + | ^^^^^^^^ Syntax Error: Expected one or more keyword parameter after '*' separator + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_kwarg_after_star_separator.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_kwarg_after_star_separator.py.snap new file mode 100644 index 0000000000..cd77b73780 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_kwarg_after_star_separator.py.snap @@ -0,0 +1,63 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/params_kwarg_after_star_separator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..26, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..25, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..20, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: Some( + Parameter { + range: 11..19, + name: Identifier { + id: "kwargs", + range: 13..19, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 22..25, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 22..25, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(*, **kwargs): ... + | ^^^^^^^^ Syntax Error: Expected one or more keyword parameter after '*' separator + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_kwargs.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_kwargs.py.snap new file mode 100644 index 0000000000..4f1c1d8613 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_kwargs.py.snap @@ -0,0 +1,76 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/params_multiple_kwargs.py +--- +## AST + +``` +Module( + ModModule { + range: 0..38, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..37, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..32, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..9, + parameter: Parameter { + range: 8..9, + name: Identifier { + id: "a", + range: 8..9, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: Some( + Parameter { + range: 22..31, + name: Identifier { + id: "kwargs2", + range: 24..31, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 34..37, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 34..37, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(a, **kwargs1, **kwargs2): ... + | ^^ Syntax Error: Parameter cannot follow var-keyword parameter + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_slash_separator.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_slash_separator.py.snap new file mode 100644 index 0000000000..df14cc04f7 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_slash_separator.py.snap @@ -0,0 +1,159 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/params_multiple_slash_separator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..53, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..24, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..19, + posonlyargs: [ + ParameterWithDefault { + range: 8..9, + parameter: Parameter { + range: 8..9, + name: Identifier { + id: "a", + range: 8..9, + }, + annotation: None, + }, + default: None, + }, + ], + args: [ + ParameterWithDefault { + range: 17..18, + parameter: Parameter { + range: 17..18, + name: Identifier { + id: "b", + range: 17..18, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 21..24, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 21..24, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 25..52, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 29..32, + }, + type_params: None, + parameters: Parameters { + range: 32..47, + posonlyargs: [ + ParameterWithDefault { + range: 33..34, + parameter: Parameter { + range: 33..34, + name: Identifier { + id: "a", + range: 33..34, + }, + annotation: None, + }, + default: None, + }, + ], + args: [ + ParameterWithDefault { + range: 39..40, + parameter: Parameter { + range: 39..40, + name: Identifier { + id: "b", + range: 39..40, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 42..43, + parameter: Parameter { + range: 42..43, + name: Identifier { + id: "c", + range: 42..43, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 49..52, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 49..52, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(a, /, /, b): ... + | ^ Syntax Error: Only one '/' separator allowed +2 | def foo(a, /, b, c, /): ... + | + + + | +1 | def foo(a, /, /, b): ... +2 | def foo(a, /, b, c, /): ... + | ^ Syntax Error: Only one '/' separator allowed + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_star_separator.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_star_separator.py.snap new file mode 100644 index 0000000000..7db636e923 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_star_separator.py.snap @@ -0,0 +1,159 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/params_multiple_star_separator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..53, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..24, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..19, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..9, + parameter: Parameter { + range: 8..9, + name: Identifier { + id: "a", + range: 8..9, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 17..18, + parameter: Parameter { + range: 17..18, + name: Identifier { + id: "b", + range: 17..18, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 21..24, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 21..24, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 25..52, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 29..32, + }, + type_params: None, + parameters: Parameters { + range: 32..47, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 33..34, + parameter: Parameter { + range: 33..34, + name: Identifier { + id: "a", + range: 33..34, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 39..40, + parameter: Parameter { + range: 39..40, + name: Identifier { + id: "b", + range: 39..40, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 42..43, + parameter: Parameter { + range: 42..43, + name: Identifier { + id: "c", + range: 42..43, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 49..52, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 49..52, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(a, *, *, b): ... + | ^ Syntax Error: Only one '*' separator allowed +2 | def foo(a, *, b, c, *): ... + | + + + | +1 | def foo(a, *, *, b): ... +2 | def foo(a, *, b, c, *): ... + | ^ Syntax Error: Only one '*' separator allowed + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_varargs.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_varargs.py.snap new file mode 100644 index 0000000000..a74e1988f2 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_varargs.py.snap @@ -0,0 +1,256 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/params_multiple_varargs.py +--- +## AST + +``` +Module( + ModModule { + range: 0..136, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..28, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..23, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..9, + parameter: Parameter { + range: 8..9, + name: Identifier { + id: "a", + range: 8..9, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: Some( + Parameter { + range: 14..19, + name: Identifier { + id: "args", + range: 15..19, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 21..22, + parameter: Parameter { + range: 21..22, + name: Identifier { + id: "b", + range: 21..22, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 25..28, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 25..28, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 63..97, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 67..70, + }, + type_params: None, + parameters: Parameters { + range: 70..92, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 71..72, + parameter: Parameter { + range: 71..72, + name: Identifier { + id: "a", + range: 71..72, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: Some( + Parameter { + range: 74..80, + name: Identifier { + id: "args1", + range: 75..80, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 90..91, + parameter: Parameter { + range: 90..91, + name: Identifier { + id: "b", + range: 90..91, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 94..97, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 94..97, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 98..135, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 102..105, + }, + type_params: None, + parameters: Parameters { + range: 105..130, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 106..107, + parameter: Parameter { + range: 106..107, + name: Identifier { + id: "a", + range: 106..107, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: Some( + Parameter { + range: 109..115, + name: Identifier { + id: "args1", + range: 110..115, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 117..118, + parameter: Parameter { + range: 117..118, + name: Identifier { + id: "b", + range: 117..118, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 120..121, + parameter: Parameter { + range: 120..121, + name: Identifier { + id: "c", + range: 120..121, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 132..135, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 132..135, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(a, *, *args, b): ... + | ^^^^^ Syntax Error: Only one '*' parameter allowed +2 | # def foo(a, *, b, c, *args): ... +3 | def foo(a, *args1, *args2, b): ... + | + + + | +1 | def foo(a, *, *args, b): ... +2 | # def foo(a, *, b, c, *args): ... +3 | def foo(a, *args1, *args2, b): ... + | ^^^^^^ Syntax Error: Only one '*' parameter allowed +4 | def foo(a, *args1, b, c, *args2): ... + | + + + | +2 | # def foo(a, *, b, c, *args): ... +3 | def foo(a, *args1, *args2, b): ... +4 | def foo(a, *args1, b, c, *args2): ... + | ^^^^^^ Syntax Error: Only one '*' parameter allowed + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_no_arg_before_slash.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_no_arg_before_slash.py.snap new file mode 100644 index 0000000000..e469e48e38 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_no_arg_before_slash.py.snap @@ -0,0 +1,108 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/params_no_arg_before_slash.py +--- +## AST + +``` +Module( + ModModule { + range: 0..35, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..15, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..10, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 12..15, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 12..15, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 16..34, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 20..23, + }, + type_params: None, + parameters: Parameters { + range: 23..29, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 27..28, + parameter: Parameter { + range: 27..28, + name: Identifier { + id: "a", + range: 27..28, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 31..34, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 31..34, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(/): ... + | ^ Syntax Error: Position-only parameter separator not allowed as first parameter +2 | def foo(/, a): ... + | + + + | +1 | def foo(/): ... +2 | def foo(/, a): ... + | ^ Syntax Error: Position-only parameter separator not allowed as first parameter + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_non_default_after_default.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_non_default_after_default.py.snap new file mode 100644 index 0000000000..641923a7a0 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_non_default_after_default.py.snap @@ -0,0 +1,114 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/params_non_default_after_default.py +--- +## AST + +``` +Module( + ModModule { + range: 0..30, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..29, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..24, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..12, + parameter: Parameter { + range: 8..9, + name: Identifier { + id: "a", + range: 8..9, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 10..12, + value: Int( + 10, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 14..15, + parameter: Parameter { + range: 14..15, + name: Identifier { + id: "b", + range: 14..15, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 17..23, + parameter: Parameter { + range: 17..23, + name: Identifier { + id: "c", + range: 17..18, + }, + annotation: Some( + Name( + ExprName { + range: 20..23, + id: "int", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 26..29, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 26..29, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(a=10, b, c: int): ... + | ^ Syntax Error: Parameter without a default cannot follow a parameter with a default + | + + + | +1 | def foo(a=10, b, c: int): ... + | ^^^^^^ Syntax Error: Parameter without a default cannot follow a parameter with a default + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_after_slash.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_after_slash.py.snap new file mode 100644 index 0000000000..a22c22b5bf --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_after_slash.py.snap @@ -0,0 +1,301 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/params_star_after_slash.py +--- +## AST + +``` +Module( + ModModule { + range: 0..105, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..19, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..14, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 8..10, + name: Identifier { + id: "a", + range: 9..10, + }, + annotation: None, + }, + ), + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 16..19, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 16..19, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 20..48, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 24..27, + }, + type_params: None, + parameters: Parameters { + range: 27..43, + posonlyargs: [ + ParameterWithDefault { + range: 28..29, + parameter: Parameter { + range: 28..29, + name: Identifier { + id: "a", + range: 28..29, + }, + annotation: None, + }, + default: None, + }, + ], + args: [], + vararg: Some( + Parameter { + range: 31..36, + name: Identifier { + id: "args", + range: 32..36, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 38..39, + parameter: Parameter { + range: 38..39, + name: Identifier { + id: "b", + range: 38..39, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 45..48, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 45..48, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 49..73, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 53..56, + }, + type_params: None, + parameters: Parameters { + range: 56..68, + posonlyargs: [ + ParameterWithDefault { + range: 57..58, + parameter: Parameter { + range: 57..58, + name: Identifier { + id: "a", + range: 57..58, + }, + annotation: None, + }, + default: None, + }, + ], + args: [], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 66..67, + parameter: Parameter { + range: 66..67, + name: Identifier { + id: "b", + range: 66..67, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 70..73, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 70..73, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 74..104, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 78..81, + }, + type_params: None, + parameters: Parameters { + range: 81..99, + posonlyargs: [ + ParameterWithDefault { + range: 82..83, + parameter: Parameter { + range: 82..83, + name: Identifier { + id: "a", + range: 82..83, + }, + annotation: None, + }, + default: None, + }, + ], + args: [], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 88..89, + parameter: Parameter { + range: 88..89, + name: Identifier { + id: "b", + range: 88..89, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 91..92, + parameter: Parameter { + range: 91..92, + name: Identifier { + id: "c", + range: 91..92, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 97..98, + parameter: Parameter { + range: 97..98, + name: Identifier { + id: "d", + range: 97..98, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 101..104, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 101..104, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(*a, /): ... + | ^ Syntax Error: '/' parameter must appear before '*' parameter +2 | def foo(a, *args, b, /): ... +3 | def foo(a, *, /, b): ... + | + + + | +1 | def foo(*a, /): ... +2 | def foo(a, *args, b, /): ... + | ^ Syntax Error: '/' parameter must appear before '*' parameter +3 | def foo(a, *, /, b): ... +4 | def foo(a, *, b, c, /, d): ... + | + + + | +1 | def foo(*a, /): ... +2 | def foo(a, *args, b, /): ... +3 | def foo(a, *, /, b): ... + | ^ Syntax Error: '/' parameter must appear before '*' parameter +4 | def foo(a, *, b, c, /, d): ... + | + + + | +2 | def foo(a, *args, b, /): ... +3 | def foo(a, *, /, b): ... +4 | def foo(a, *, b, c, /, d): ... + | ^ Syntax Error: '/' parameter must appear before '*' parameter + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_separator_after_star_param.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_separator_after_star_param.py.snap new file mode 100644 index 0000000000..4f43b9e0f1 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_separator_after_star_param.py.snap @@ -0,0 +1,177 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/params_star_separator_after_star_param.py +--- +## AST + +``` +Module( + ModModule { + range: 0..61, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..28, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..23, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..9, + parameter: Parameter { + range: 8..9, + name: Identifier { + id: "a", + range: 8..9, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: Some( + Parameter { + range: 11..16, + name: Identifier { + id: "args", + range: 12..16, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 21..22, + parameter: Parameter { + range: 21..22, + name: Identifier { + id: "b", + range: 21..22, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 25..28, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 25..28, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 29..60, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 33..36, + }, + type_params: None, + parameters: Parameters { + range: 36..55, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 37..38, + parameter: Parameter { + range: 37..38, + name: Identifier { + id: "a", + range: 37..38, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: Some( + Parameter { + range: 40..45, + name: Identifier { + id: "args", + range: 41..45, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 47..48, + parameter: Parameter { + range: 47..48, + name: Identifier { + id: "b", + range: 47..48, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 50..51, + parameter: Parameter { + range: 50..51, + name: Identifier { + id: "c", + range: 50..51, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 57..60, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 57..60, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(a, *args, *, b): ... + | ^ Syntax Error: Keyword-only parameter separator not allowed after '*' parameter +2 | def foo(a, *args, b, c, *): ... + | + + + | +1 | def foo(a, *args, *, b): ... +2 | def foo(a, *args, b, c, *): ... + | ^ Syntax Error: Keyword-only parameter separator not allowed after '*' parameter + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_keyword_with_default.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_keyword_with_default.py.snap new file mode 100644 index 0000000000..1c83da2091 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_keyword_with_default.py.snap @@ -0,0 +1,164 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/params_var_keyword_with_default.py +--- +## AST + +``` +Module( + ModModule { + range: 0..43, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..36, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..20, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..9, + parameter: Parameter { + range: 8..9, + name: Identifier { + id: "a", + range: 8..9, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: Some( + Parameter { + range: 11..19, + name: Identifier { + id: "kwargs", + range: 13..19, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 20..36, + value: Dict( + ExprDict { + range: 20..36, + keys: [ + Some( + StringLiteral( + ExprStringLiteral { + range: 21..24, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 21..24, + value: "b", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + Some( + StringLiteral( + ExprStringLiteral { + range: 29..32, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 29..32, + value: "c", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 26..27, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 34..35, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + }, + ), + ], + }, + ), + Expr( + StmtExpr { + range: 39..42, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 39..42, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(a, **kwargs={'b': 1, 'c': 2}): ... + | ^ Syntax Error: Parameter with '*' or '**' cannot have default value + | + + + | +1 | def foo(a, **kwargs={'b': 1, 'c': 2}): ... + | ^ Syntax Error: Expected a parameter or the end of the parameter list + | + + + | +1 | def foo(a, **kwargs={'b': 1, 'c': 2}): ... + | ^ Syntax Error: Expected newline, found ')' + | + + + | +1 | def foo(a, **kwargs={'b': 1, 'c': 2}): ... + | ^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_positional_with_default.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_positional_with_default.py.snap new file mode 100644 index 0000000000..b8bd4bfecc --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_positional_with_default.py.snap @@ -0,0 +1,124 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/params_var_positional_with_default.py +--- +## AST + +``` +Module( + ModModule { + range: 0..30, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..23, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..17, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..9, + parameter: Parameter { + range: 8..9, + name: Identifier { + id: "a", + range: 8..9, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: Some( + Parameter { + range: 11..16, + name: Identifier { + id: "args", + range: 12..16, + }, + annotation: None, + }, + ), + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 17..23, + value: Tuple( + ExprTuple { + range: 17..23, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 18..19, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 21..22, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + ], + }, + ), + Expr( + StmtExpr { + range: 26..29, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 26..29, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | def foo(a, *args=(1, 2)): ... + | ^ Syntax Error: Parameter with '*' or '**' cannot have default value + | + + + | +1 | def foo(a, *args=(1, 2)): ... + | ^ Syntax Error: Expected a parameter or the end of the parameter list + | + + + | +1 | def foo(a, *args=(1, 2)): ... + | ^ Syntax Error: Expected newline, found ')' + | + + + | +1 | def foo(a, *args=(1, 2)): ... + | ^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@parenthesized_compare_expr_in_for.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@parenthesized_compare_expr_in_for.py.snap new file mode 100644 index 0000000000..12f380eece --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@parenthesized_compare_expr_in_for.py.snap @@ -0,0 +1,139 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/parenthesized_compare_expr_in_for.py +--- +## AST + +``` +Module( + ModModule { + range: 0..54, + body: [ + For( + StmtFor { + range: 0..27, + is_async: false, + target: Call( + ExprCall { + range: 4..14, + func: Compare( + ExprCompare { + range: 5..11, + left: Name( + ExprName { + range: 5..6, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 10..11, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + arguments: Arguments { + range: 12..14, + args: [], + keywords: [], + }, + }, + ), + iter: Name( + ExprName { + range: 18..22, + id: "iter", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 24..27, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 24..27, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 28..53, + is_async: false, + target: Compare( + ExprCompare { + range: 33..39, + left: Name( + ExprName { + range: 33..34, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 38..39, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + iter: Name( + ExprName { + range: 44..48, + id: "iter", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 50..53, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 50..53, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | for (x in y)() in iter: ... + | ^^^^^^^^^^ Syntax Error: Invalid assignment target +2 | for (x in y) in iter: ... + | + + + | +1 | for (x in y)() in iter: ... +2 | for (x in y) in iter: ... + | ^^^^^^ Syntax Error: Invalid assignment target + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_cause.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_cause.py.snap new file mode 100644 index 0000000000..ea3cd182b7 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_cause.py.snap @@ -0,0 +1,134 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/raise_stmt_invalid_cause.py +--- +## AST + +``` +Module( + ModModule { + range: 0..57, + body: [ + Raise( + StmtRaise { + range: 0..15, + exc: Some( + Name( + ExprName { + range: 6..7, + id: "x", + ctx: Load, + }, + ), + ), + cause: Some( + Starred( + ExprStarred { + range: 13..15, + value: Name( + ExprName { + range: 14..15, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + Raise( + StmtRaise { + range: 16..36, + exc: Some( + Name( + ExprName { + range: 22..23, + id: "x", + ctx: Load, + }, + ), + ), + cause: Some( + Yield( + ExprYield { + range: 29..36, + value: Some( + Name( + ExprName { + range: 35..36, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ), + }, + ), + Raise( + StmtRaise { + range: 37..51, + exc: Some( + Name( + ExprName { + range: 43..44, + id: "x", + ctx: Load, + }, + ), + ), + cause: Some( + Name( + ExprName { + range: 50..51, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + Expr( + StmtExpr { + range: 55..56, + value: NumberLiteral( + ExprNumberLiteral { + range: 55..56, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | raise x from *y + | ^^ Syntax Error: Starred expression cannot be used here +2 | raise x from yield y +3 | raise x from y := 1 + | + + + | +1 | raise x from *y +2 | raise x from yield y + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | raise x from y := 1 + | + + + | +1 | raise x from *y +2 | raise x from yield y +3 | raise x from y := 1 + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_exc.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_exc.py.snap new file mode 100644 index 0000000000..0fe739737d --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_exc.py.snap @@ -0,0 +1,110 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/raise_stmt_invalid_exc.py +--- +## AST + +``` +Module( + ModModule { + range: 0..36, + body: [ + Raise( + StmtRaise { + range: 0..8, + exc: Some( + Starred( + ExprStarred { + range: 6..8, + value: Name( + ExprName { + range: 7..8, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + cause: None, + }, + ), + Raise( + StmtRaise { + range: 9..22, + exc: Some( + Yield( + ExprYield { + range: 15..22, + value: Some( + Name( + ExprName { + range: 21..22, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ), + cause: None, + }, + ), + Raise( + StmtRaise { + range: 23..30, + exc: Some( + Name( + ExprName { + range: 29..30, + id: "x", + ctx: Load, + }, + ), + ), + cause: None, + }, + ), + Expr( + StmtExpr { + range: 34..35, + value: NumberLiteral( + ExprNumberLiteral { + range: 34..35, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | raise *x + | ^^ Syntax Error: Starred expression cannot be used here +2 | raise yield x +3 | raise x := 1 + | + + + | +1 | raise *x +2 | raise yield x + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | raise x := 1 + | + + + | +1 | raise *x +2 | raise yield x +3 | raise x := 1 + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_cause.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_cause.py.snap new file mode 100644 index 0000000000..0e6aec6ac5 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_cause.py.snap @@ -0,0 +1,100 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/raise_stmt_unparenthesized_tuple_cause.py +--- +## AST + +``` +Module( + ModModule { + range: 0..34, + body: [ + Raise( + StmtRaise { + range: 0..15, + exc: Some( + Name( + ExprName { + range: 6..7, + id: "x", + ctx: Load, + }, + ), + ), + cause: Some( + Tuple( + ExprTuple { + range: 13..15, + elts: [ + Name( + ExprName { + range: 13..14, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + }, + ), + Raise( + StmtRaise { + range: 16..33, + exc: Some( + Name( + ExprName { + range: 22..23, + id: "x", + ctx: Load, + }, + ), + ), + cause: Some( + Tuple( + ExprTuple { + range: 29..33, + elts: [ + Name( + ExprName { + range: 29..30, + id: "y", + ctx: Load, + }, + ), + Name( + ExprName { + range: 32..33, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | raise x from y, + | ^^ Syntax Error: Unparenthesized tuple expression cannot be used here +2 | raise x from y, z + | + + + | +1 | raise x from y, +2 | raise x from y, z + | ^^^^ Syntax Error: Unparenthesized tuple expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_exc.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_exc.py.snap new file mode 100644 index 0000000000..4e97be6971 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_exc.py.snap @@ -0,0 +1,133 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/raise_stmt_unparenthesized_tuple_exc.py +--- +## AST + +``` +Module( + ModModule { + range: 0..38, + body: [ + Raise( + StmtRaise { + range: 0..8, + exc: Some( + Tuple( + ExprTuple { + range: 6..8, + elts: [ + Name( + ExprName { + range: 6..7, + id: "x", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + cause: None, + }, + ), + Raise( + StmtRaise { + range: 9..19, + exc: Some( + Tuple( + ExprTuple { + range: 15..19, + elts: [ + Name( + ExprName { + range: 15..16, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 18..19, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + cause: None, + }, + ), + Raise( + StmtRaise { + range: 20..37, + exc: Some( + Tuple( + ExprTuple { + range: 26..30, + elts: [ + Name( + ExprName { + range: 26..27, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 29..30, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + cause: Some( + Name( + ExprName { + range: 36..37, + id: "z", + ctx: Load, + }, + ), + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | raise x, + | ^^ Syntax Error: Unparenthesized tuple expression cannot be used here +2 | raise x, y +3 | raise x, y from z + | + + + | +1 | raise x, +2 | raise x, y + | ^^^^ Syntax Error: Unparenthesized tuple expression cannot be used here +3 | raise x, y from z + | + + + | +1 | raise x, +2 | raise x, y +3 | raise x, y from z + | ^^^^ Syntax Error: Unparenthesized tuple expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@return_stmt_invalid_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@return_stmt_invalid_expr.py.snap new file mode 100644 index 0000000000..1c3fdfc0d0 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@return_stmt_invalid_expr.py.snap @@ -0,0 +1,182 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/return_stmt_invalid_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..74, + body: [ + Return( + StmtReturn { + range: 0..8, + value: Some( + Starred( + ExprStarred { + range: 7..8, + value: Name( + ExprName { + range: 8..8, + id: "", + ctx: Invalid, + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 9..23, + value: Some( + Yield( + ExprYield { + range: 16..23, + value: Some( + Name( + ExprName { + range: 22..23, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 24..43, + value: Some( + YieldFrom( + ExprYieldFrom { + range: 31..43, + value: Name( + ExprName { + range: 42..43, + id: "x", + ctx: Load, + }, + ), + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 44..52, + value: Some( + Name( + ExprName { + range: 51..52, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + Expr( + StmtExpr { + range: 56..57, + value: NumberLiteral( + ExprNumberLiteral { + range: 56..57, + value: Int( + 1, + ), + }, + ), + }, + ), + Return( + StmtReturn { + range: 58..73, + value: Some( + Starred( + ExprStarred { + range: 65..73, + value: BoolOp( + ExprBoolOp { + range: 66..73, + op: And, + values: [ + Name( + ExprName { + range: 66..67, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 72..73, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | return * + | ^ Syntax Error: Expected an expression +2 | return yield x +3 | return yield from x +4 | return x := 1 + | + + + | +1 | return * +2 | return yield x + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | return yield from x +4 | return x := 1 + | + + + | +1 | return * +2 | return yield x +3 | return yield from x + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +4 | return x := 1 +5 | return *x and y + | + + + | +2 | return yield x +3 | return yield from x +4 | return x := 1 + | ^^ Syntax Error: Expected a statement +5 | return *x and y + | + + + | +3 | return yield from x +4 | return x := 1 +5 | return *x and y + | ^^^^^^^ Syntax Error: Boolean expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line.py.snap new file mode 100644 index 0000000000..1ba39f2032 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line.py.snap @@ -0,0 +1,65 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/simple_and_compound_stmt_on_same_line.py +--- +## AST + +``` +Module( + ModModule { + range: 0..17, + body: [ + Expr( + StmtExpr { + range: 0..1, + value: Name( + ExprName { + range: 0..1, + id: "a", + ctx: Load, + }, + ), + }, + ), + If( + StmtIf { + range: 3..16, + test: Name( + ExprName { + range: 6..7, + id: "b", + ctx: Load, + }, + ), + body: [ + Pass( + StmtPass { + range: 9..13, + }, + ), + Expr( + StmtExpr { + range: 15..16, + value: Name( + ExprName { + range: 15..16, + id: "b", + ctx: Load, + }, + ), + }, + ), + ], + elif_else_clauses: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | a; if b: pass; b + | ^^ Syntax Error: Compound statements are not allowed on the same line as simple statements + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line_in_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line_in_block.py.snap new file mode 100644 index 0000000000..da202a0eee --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line_in_block.py.snap @@ -0,0 +1,105 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/simple_and_compound_stmt_on_same_line_in_block.py +--- +## AST + +``` +Module( + ModModule { + range: 0..59, + body: [ + If( + StmtIf { + range: 0..13, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 3..7, + value: true, + }, + ), + body: [ + Pass( + StmtPass { + range: 9..13, + }, + ), + ], + elif_else_clauses: [], + }, + ), + If( + StmtIf { + range: 14..28, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 17..22, + value: false, + }, + ), + body: [ + Pass( + StmtPass { + range: 24..28, + }, + ), + ], + elif_else_clauses: [], + }, + ), + If( + StmtIf { + range: 29..42, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 32..36, + value: true, + }, + ), + body: [ + Pass( + StmtPass { + range: 38..42, + }, + ), + ], + elif_else_clauses: [], + }, + ), + If( + StmtIf { + range: 44..58, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 47..52, + value: false, + }, + ), + body: [ + Pass( + StmtPass { + range: 54..58, + }, + ), + ], + elif_else_clauses: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | if True: pass if False: pass + | ^^ Syntax Error: Compound statements are not allowed on the same line as simple statements +2 | if True: pass; if False: pass + | + + + | +1 | if True: pass if False: pass +2 | if True: pass; if False: pass + | ^^ Syntax Error: Compound statements are not allowed on the same line as simple statements + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line.py.snap new file mode 100644 index 0000000000..4e626de9d3 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line.py.snap @@ -0,0 +1,146 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/simple_stmts_on_same_line.py +--- +## AST + +``` +Module( + ModModule { + range: 0..53, + body: [ + Expr( + StmtExpr { + range: 0..1, + value: Name( + ExprName { + range: 0..1, + id: "a", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 2..3, + value: Name( + ExprName { + range: 2..3, + id: "b", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 4..9, + value: BinOp( + ExprBinOp { + range: 4..9, + left: Name( + ExprName { + range: 4..5, + id: "a", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 8..9, + id: "b", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 10..15, + value: BinOp( + ExprBinOp { + range: 10..15, + left: Name( + ExprName { + range: 10..11, + id: "c", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 14..15, + id: "d", + ctx: Load, + }, + ), + }, + ), + }, + ), + Break( + StmtBreak { + range: 16..21, + }, + ), + Continue( + StmtContinue { + range: 23..31, + }, + ), + Pass( + StmtPass { + range: 32..36, + }, + ), + Continue( + StmtContinue { + range: 38..46, + }, + ), + Break( + StmtBreak { + range: 47..52, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | a b + | ^ Syntax Error: Simple statements must be separated by newlines or semicolons +2 | a + b c + d +3 | break; continue pass; continue break + | + + + | +1 | a b +2 | a + b c + d + | ^ Syntax Error: Simple statements must be separated by newlines or semicolons +3 | break; continue pass; continue break + | + + + | +1 | a b +2 | a + b c + d +3 | break; continue pass; continue break + | ^^^^ Syntax Error: Simple statements must be separated by newlines or semicolons + | + + + | +1 | a b +2 | a + b c + d +3 | break; continue pass; continue break + | ^^^^^ Syntax Error: Simple statements must be separated by newlines or semicolons + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line_in_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line_in_block.py.snap new file mode 100644 index 0000000000..36445719b4 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line_in_block.py.snap @@ -0,0 +1,66 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/simple_stmts_on_same_line_in_block.py +--- +## AST + +``` +Module( + ModModule { + range: 0..46, + body: [ + If( + StmtIf { + range: 0..45, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 3..7, + value: true, + }, + ), + body: [ + Break( + StmtBreak { + range: 9..14, + }, + ), + Continue( + StmtContinue { + range: 16..24, + }, + ), + Pass( + StmtPass { + range: 25..29, + }, + ), + Continue( + StmtContinue { + range: 31..39, + }, + ), + Break( + StmtBreak { + range: 40..45, + }, + ), + ], + elif_else_clauses: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | if True: break; continue pass; continue break + | ^^^^ Syntax Error: Simple statements must be separated by newlines or semicolons + | + + + | +1 | if True: break; continue pass; continue break + | ^^^^^ Syntax Error: Simple statements must be separated by newlines or semicolons + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__function_type_parameters.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__function_type_parameters.py.snap new file mode 100644 index 0000000000..6256a009bb --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__function_type_parameters.py.snap @@ -0,0 +1,395 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/function_type_parameters.py +--- +## AST + +``` +Module( + ModModule { + range: 0..986, + body: [ + FunctionDef( + StmtFunctionDef { + range: 795..823, + is_async: false, + decorator_list: [], + name: Identifier { + id: "keyword", + range: 799..806, + }, + type_params: Some( + TypeParams { + range: 806..816, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 807..808, + name: Identifier { + id: "A", + range: 807..808, + }, + bound: None, + }, + ), + TypeVar( + TypeParamTypeVar { + range: 810..815, + name: Identifier { + id: "await", + range: 810..815, + }, + bound: None, + }, + ), + ], + }, + ), + parameters: Parameters { + range: 816..818, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 820..823, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 820..823, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 825..861, + is_async: false, + decorator_list: [], + name: Identifier { + id: "not_a_type_param", + range: 829..845, + }, + type_params: Some( + TypeParams { + range: 845..854, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 846..847, + name: Identifier { + id: "A", + range: 846..847, + }, + bound: None, + }, + ), + TypeVar( + TypeParamTypeVar { + range: 852..853, + name: Identifier { + id: "B", + range: 852..853, + }, + bound: None, + }, + ), + ], + }, + ), + parameters: Parameters { + range: 854..856, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 858..861, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 858..861, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 863..895, + is_async: false, + decorator_list: [], + name: Identifier { + id: "multiple_commas", + range: 867..882, + }, + type_params: Some( + TypeParams { + range: 882..888, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 883..884, + name: Identifier { + id: "A", + range: 883..884, + }, + bound: None, + }, + ), + TypeVar( + TypeParamTypeVar { + range: 886..887, + name: Identifier { + id: "B", + range: 886..887, + }, + bound: None, + }, + ), + ], + }, + ), + parameters: Parameters { + range: 888..890, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 892..895, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 892..895, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 897..937, + is_async: false, + decorator_list: [], + name: Identifier { + id: "multiple_trailing_commas", + range: 901..925, + }, + type_params: Some( + TypeParams { + range: 925..930, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 926..927, + name: Identifier { + id: "A", + range: 926..927, + }, + bound: None, + }, + ), + ], + }, + ), + parameters: Parameters { + range: 930..932, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 934..937, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 934..937, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 939..978, + is_async: false, + decorator_list: [], + name: Identifier { + id: "multiple_commas_and_recovery", + range: 943..971, + }, + type_params: Some( + TypeParams { + range: 971..975, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 972..973, + name: Identifier { + id: "A", + range: 972..973, + }, + bound: None, + }, + ), + ], + }, + ), + parameters: Parameters { + range: 975..975, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 975..978, + value: NumberLiteral( + ExprNumberLiteral { + range: 975..978, + value: Int( + 100, + ), + }, + ), + }, + ), + ], + }, + ), + AnnAssign( + StmtAnnAssign { + range: 979..986, + target: Tuple( + ExprTuple { + range: 979..981, + elts: [], + ctx: Store, + parenthesized: true, + }, + ), + annotation: EllipsisLiteral( + ExprEllipsisLiteral { + range: 983..986, + }, + ), + value: None, + simple: false, + }, + ), + ], + }, +) +``` +## Errors + + | + 9 | # on following lines. +10 | +11 | def keyword[A, await](): ... + | ^^^^^ Syntax Error: Expected an identifier, but found a keyword 'await' that cannot be used here +12 | +13 | def not_a_type_param[A, |, B](): ... + | + + + | +11 | def keyword[A, await](): ... +12 | +13 | def not_a_type_param[A, |, B](): ... + | ^ Syntax Error: Expected a type parameter or the end of the type parameter list +14 | +15 | def multiple_commas[A,,B](): ... + | + + + | +11 | def keyword[A, await](): ... +12 | +13 | def not_a_type_param[A, |, B](): ... + | ^ Syntax Error: Expected a type parameter or the end of the type parameter list +14 | +15 | def multiple_commas[A,,B](): ... + | + + + | +13 | def not_a_type_param[A, |, B](): ... +14 | +15 | def multiple_commas[A,,B](): ... + | ^ Syntax Error: Expected a type parameter or the end of the type parameter list +16 | +17 | def multiple_trailing_commas[A,,](): ... + | + + + | +15 | def multiple_commas[A,,B](): ... +16 | +17 | def multiple_trailing_commas[A,,](): ... + | ^ Syntax Error: Expected a type parameter or the end of the type parameter list +18 | +19 | def multiple_commas_and_recovery[A,,100](): ... + | + + + | +17 | def multiple_trailing_commas[A,,](): ... +18 | +19 | def multiple_commas_and_recovery[A,,100](): ... + | ^ Syntax Error: Expected a type parameter or the end of the type parameter list + | + + + | +17 | def multiple_trailing_commas[A,,](): ... +18 | +19 | def multiple_commas_and_recovery[A,,100](): ... + | ^^^ Syntax Error: Expected a type parameter or the end of the type parameter list + | + + + | +17 | def multiple_trailing_commas[A,,](): ... +18 | +19 | def multiple_commas_and_recovery[A,,100](): ... + | ^ Syntax Error: Expected newline, found ']' + | + + + | +17 | def multiple_trailing_commas[A,,](): ... +18 | +19 | def multiple_commas_and_recovery[A,,100](): ... + | ^^ Syntax Error: Only single target (not tuple) can be annotated + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_closing_parentheses.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_closing_parentheses.py.snap new file mode 100644 index 0000000000..7170e28dbe --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_closing_parentheses.py.snap @@ -0,0 +1,79 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/if_extra_closing_parentheses.py +--- +## AST + +``` +Module( + ModModule { + range: 0..110, + body: [ + If( + StmtIf { + range: 90..97, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 93..97, + value: true, + }, + ), + body: [], + elif_else_clauses: [], + }, + ), + Pass( + StmtPass { + range: 105..109, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # FIXME(micha): This creates two syntax errors instead of just one (and overlapping ones) +2 | if True)): + | ^ Syntax Error: Expected ':', found ')' +3 | pass + | + + + | +1 | # FIXME(micha): This creates two syntax errors instead of just one (and overlapping ones) +2 | if True)): + | ^ Syntax Error: Expected a statement +3 | pass + | + + + | +1 | # FIXME(micha): This creates two syntax errors instead of just one (and overlapping ones) +2 | if True)): + | ^ Syntax Error: Expected a statement +3 | pass + | + + + | +1 | # FIXME(micha): This creates two syntax errors instead of just one (and overlapping ones) +2 | if True)): + | ^ Syntax Error: Expected a statement +3 | pass + | + + + | +1 | # FIXME(micha): This creates two syntax errors instead of just one (and overlapping ones) +2 | if True)): +3 | pass + | ^^^^ Syntax Error: Unexpected indentation + | + + + | +2 | if True)): +3 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_indent.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_indent.py.snap new file mode 100644 index 0000000000..bff02e86c4 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_indent.py.snap @@ -0,0 +1,104 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/if_extra_indent.py +--- +## AST + +``` +Module( + ModModule { + range: 0..153, + body: [ + If( + StmtIf { + range: 103..134, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 106..110, + value: true, + }, + ), + body: [ + Pass( + StmtPass { + range: 116..120, + }, + ), + Expr( + StmtExpr { + range: 129..134, + value: BinOp( + ExprBinOp { + range: 129..134, + left: Name( + ExprName { + range: 129..130, + id: "a", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 133..134, + id: "b", + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + elif_else_clauses: [], + }, + ), + Pass( + StmtPass { + range: 140..144, + }, + ), + Assign( + StmtAssign { + range: 146..152, + targets: [ + Name( + ExprName { + range: 146..147, + id: "a", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 150..152, + value: Int( + 10, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +2 | if True: +3 | pass +4 | a + b + | ^^^^^^^^ Syntax Error: Unexpected indentation +5 | +6 | pass + | + + + | +6 | pass +7 | +8 | a = 10 + | Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_assignment_targets.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_assignment_targets.py.snap new file mode 100644 index 0000000000..d7812bcae5 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_assignment_targets.py.snap @@ -0,0 +1,1692 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/invalid_assignment_targets.py +--- +## AST + +``` +Module( + ModModule { + range: 0..788, + body: [ + Assign( + StmtAssign { + range: 201..206, + targets: [ + NumberLiteral( + ExprNumberLiteral { + range: 201..202, + value: Int( + 5, + ), + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 205..206, + value: Int( + 3, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 208..214, + target: NumberLiteral( + ExprNumberLiteral { + range: 208..209, + value: Int( + 5, + ), + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 213..214, + value: Int( + 3, + ), + }, + ), + }, + ), + AnnAssign( + StmtAnnAssign { + range: 216..228, + target: NumberLiteral( + ExprNumberLiteral { + range: 217..218, + value: Int( + 5, + ), + }, + ), + annotation: Name( + ExprName { + range: 221..224, + id: "int", + ctx: Load, + }, + ), + value: Some( + NumberLiteral( + ExprNumberLiteral { + range: 227..228, + value: Int( + 3, + ), + }, + ), + ), + simple: false, + }, + ), + Assign( + StmtAssign { + range: 303..314, + targets: [ + BoolOp( + ExprBoolOp { + range: 303..309, + op: Or, + values: [ + Name( + ExprName { + range: 303..304, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 308..309, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 312..314, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 315..328, + targets: [ + Named( + ExprNamed { + range: 316..322, + target: Name( + ExprName { + range: 316..317, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 321..322, + value: Int( + 5, + ), + }, + ), + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 326..328, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 329..339, + targets: [ + BinOp( + ExprBinOp { + range: 329..334, + left: Name( + ExprName { + range: 329..330, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 333..334, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 337..339, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 340..347, + targets: [ + UnaryOp( + ExprUnaryOp { + range: 340..342, + op: USub, + operand: Name( + ExprName { + range: 341..342, + id: "x", + ctx: Store, + }, + ), + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 345..347, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 348..366, + targets: [ + Lambda( + ExprLambda { + range: 349..360, + parameters: Some( + Parameters { + range: 356..357, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 356..357, + parameter: Parameter { + range: 356..357, + name: Identifier { + id: "_", + range: 356..357, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 359..360, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 364..366, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 367..385, + targets: [ + If( + ExprIf { + range: 367..380, + test: Name( + ExprName { + range: 372..373, + id: "b", + ctx: Load, + }, + ), + body: Name( + ExprName { + range: 367..368, + id: "a", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 379..380, + id: "c", + ctx: Load, + }, + ), + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 383..385, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 386..399, + targets: [ + Dict( + ExprDict { + range: 386..394, + keys: [ + Some( + StringLiteral( + ExprStringLiteral { + range: 387..390, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 387..390, + value: "a", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 392..393, + value: Int( + 5, + ), + }, + ), + ], + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 397..399, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 400..408, + targets: [ + Set( + ExprSet { + range: 400..403, + elts: [ + Name( + ExprName { + range: 401..402, + id: "a", + ctx: Load, + }, + ), + ], + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 406..408, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 409..429, + targets: [ + ListComp( + ExprListComp { + range: 409..424, + elt: Name( + ExprName { + range: 410..411, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 412..423, + target: Name( + ExprName { + range: 416..417, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 421..423, + id: "xs", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 427..429, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 430..450, + targets: [ + SetComp( + ExprSetComp { + range: 430..445, + elt: Name( + ExprName { + range: 431..432, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 433..444, + target: Name( + ExprName { + range: 437..438, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 442..444, + id: "xs", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 448..450, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 451..478, + targets: [ + DictComp( + ExprDictComp { + range: 451..473, + key: Name( + ExprName { + range: 452..453, + id: "x", + ctx: Load, + }, + ), + value: BinOp( + ExprBinOp { + range: 455..460, + left: Name( + ExprName { + range: 455..456, + id: "x", + ctx: Load, + }, + ), + op: Mult, + right: NumberLiteral( + ExprNumberLiteral { + range: 459..460, + value: Int( + 2, + ), + }, + ), + }, + ), + generators: [ + Comprehension { + range: 461..472, + target: Name( + ExprName { + range: 465..466, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 470..472, + id: "xs", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 476..478, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 479..499, + targets: [ + Generator( + ExprGenerator { + range: 479..494, + elt: Name( + ExprName { + range: 480..481, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 482..493, + target: Name( + ExprName { + range: 486..487, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 491..493, + id: "xs", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 497..499, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 500..512, + targets: [ + Await( + ExprAwait { + range: 500..507, + value: Name( + ExprName { + range: 506..507, + id: "x", + ctx: Load, + }, + ), + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 510..512, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 513..527, + targets: [ + Yield( + ExprYield { + range: 514..521, + value: Some( + Name( + ExprName { + range: 520..521, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 525..527, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 528..548, + targets: [ + YieldFrom( + ExprYieldFrom { + range: 529..542, + value: Name( + ExprName { + range: 540..542, + id: "xs", + ctx: Load, + }, + ), + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 546..548, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 549..563, + targets: [ + Compare( + ExprCompare { + range: 549..558, + left: Name( + ExprName { + range: 549..550, + id: "a", + ctx: Load, + }, + ), + ops: [ + Lt, + Lt, + ], + comparators: [ + Name( + ExprName { + range: 553..554, + id: "b", + ctx: Load, + }, + ), + Name( + ExprName { + range: 557..558, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 561..563, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 564..574, + targets: [ + Call( + ExprCall { + range: 564..569, + func: Name( + ExprName { + range: 564..567, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 567..569, + args: [], + keywords: [], + }, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 572..574, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 576..590, + targets: [ + FString( + ExprFString { + range: 576..585, + value: FStringValue { + inner: Single( + FString( + FString { + range: 576..585, + elements: [ + Expression( + FStringExpressionElement { + range: 578..584, + expression: Name( + ExprName { + range: 579..583, + id: "quux", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 588..590, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 591..614, + targets: [ + FString( + ExprFString { + range: 591..609, + value: FStringValue { + inner: Single( + FString( + FString { + range: 591..609, + elements: [ + Expression( + FStringExpressionElement { + range: 593..598, + expression: Name( + ExprName { + range: 594..597, + id: "foo", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 598..603, + value: " and ", + }, + ), + Expression( + FStringExpressionElement { + range: 603..608, + expression: Name( + ExprName { + range: 604..607, + id: "bar", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 612..614, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 616..626, + targets: [ + StringLiteral( + ExprStringLiteral { + range: 616..621, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 616..621, + value: "foo", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 624..626, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 627..638, + targets: [ + BytesLiteral( + ExprBytesLiteral { + range: 627..633, + value: BytesLiteralValue { + inner: Single( + BytesLiteral { + range: 627..633, + value: [ + 102, + 111, + 111, + ], + flags: BytesLiteralFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 636..638, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 639..647, + targets: [ + NumberLiteral( + ExprNumberLiteral { + range: 639..642, + value: Int( + 123, + ), + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 645..647, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 648..657, + targets: [ + BooleanLiteral( + ExprBooleanLiteral { + range: 648..652, + value: true, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 655..657, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 658..667, + targets: [ + NoneLiteral( + ExprNoneLiteral { + range: 658..662, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 665..667, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 668..676, + targets: [ + EllipsisLiteral( + ExprEllipsisLiteral { + range: 668..671, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 674..676, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 677..688, + targets: [ + Starred( + ExprStarred { + range: 677..683, + value: Call( + ExprCall { + range: 678..683, + func: Name( + ExprName { + range: 678..681, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 681..683, + args: [], + keywords: [], + }, + }, + ), + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 686..688, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 689..717, + targets: [ + List( + ExprList { + range: 689..702, + elts: [ + Name( + ExprName { + range: 690..691, + id: "x", + ctx: Store, + }, + ), + Call( + ExprCall { + range: 693..698, + func: Name( + ExprName { + range: 693..696, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 696..698, + args: [], + keywords: [], + }, + }, + ), + Name( + ExprName { + range: 700..701, + id: "y", + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + ], + value: List( + ExprList { + range: 705..717, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 706..708, + value: Int( + 42, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 710..712, + value: Int( + 42, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 714..716, + value: Int( + 42, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 718..758, + targets: [ + List( + ExprList { + range: 718..737, + elts: [ + List( + ExprList { + range: 719..725, + elts: [ + Name( + ExprName { + range: 720..721, + id: "a", + ctx: Store, + }, + ), + Name( + ExprName { + range: 723..724, + id: "b", + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + List( + ExprList { + range: 727..733, + elts: [ + List( + ExprList { + range: 728..732, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 729..731, + value: Int( + 42, + ), + }, + ), + ], + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + Name( + ExprName { + range: 735..736, + id: "d", + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + ], + value: List( + ExprList { + range: 740..758, + elts: [ + List( + ExprList { + range: 741..747, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 742..743, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 745..746, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + List( + ExprList { + range: 749..754, + elts: [ + List( + ExprList { + range: 750..753, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 751..752, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 756..757, + value: Int( + 4, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 759..787, + targets: [ + Tuple( + ExprTuple { + range: 759..772, + elts: [ + Name( + ExprName { + range: 760..761, + id: "x", + ctx: Store, + }, + ), + Call( + ExprCall { + range: 763..768, + func: Name( + ExprName { + range: 763..766, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 766..768, + args: [], + keywords: [], + }, + }, + ), + Name( + ExprName { + range: 770..771, + id: "y", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: true, + }, + ), + ], + value: Tuple( + ExprTuple { + range: 775..787, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 776..778, + value: Int( + 42, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 780..782, + value: Int( + 42, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 784..786, + value: Int( + 42, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +3 | # rejected by the parser. e.g., `5 = 3`, `5 += 3`, `(5): int = 3`. +4 | +5 | 5 = 3 + | ^ Syntax Error: Invalid assignment target +6 | +7 | 5 += 3 + | + + + | +5 | 5 = 3 +6 | +7 | 5 += 3 + | ^ Syntax Error: Invalid augmented assignment target +8 | +9 | (5): int = 3 + | + + + | + 7 | 5 += 3 + 8 | + 9 | (5): int = 3 + | ^ Syntax Error: Invalid annotated assignment target +10 | +11 | # Now we exhaustively test all possible cases where assignment can fail. + | + + + | +11 | # Now we exhaustively test all possible cases where assignment can fail. +12 | x or y = 42 + | ^^^^^^ Syntax Error: Invalid assignment target +13 | (x := 5) = 42 +14 | x + y = 42 + | + + + | +11 | # Now we exhaustively test all possible cases where assignment can fail. +12 | x or y = 42 +13 | (x := 5) = 42 + | ^^^^^^ Syntax Error: Invalid assignment target +14 | x + y = 42 +15 | -x = 42 + | + + + | +12 | x or y = 42 +13 | (x := 5) = 42 +14 | x + y = 42 + | ^^^^^ Syntax Error: Invalid assignment target +15 | -x = 42 +16 | (lambda _: 1) = 42 + | + + + | +13 | (x := 5) = 42 +14 | x + y = 42 +15 | -x = 42 + | ^^ Syntax Error: Invalid assignment target +16 | (lambda _: 1) = 42 +17 | a if b else c = 42 + | + + + | +14 | x + y = 42 +15 | -x = 42 +16 | (lambda _: 1) = 42 + | ^^^^^^^^^^^ Syntax Error: Invalid assignment target +17 | a if b else c = 42 +18 | {"a": 5} = 42 + | + + + | +15 | -x = 42 +16 | (lambda _: 1) = 42 +17 | a if b else c = 42 + | ^^^^^^^^^^^^^ Syntax Error: Invalid assignment target +18 | {"a": 5} = 42 +19 | {a} = 42 + | + + + | +16 | (lambda _: 1) = 42 +17 | a if b else c = 42 +18 | {"a": 5} = 42 + | ^^^^^^^^ Syntax Error: Invalid assignment target +19 | {a} = 42 +20 | [x for x in xs] = 42 + | + + + | +17 | a if b else c = 42 +18 | {"a": 5} = 42 +19 | {a} = 42 + | ^^^ Syntax Error: Invalid assignment target +20 | [x for x in xs] = 42 +21 | {x for x in xs} = 42 + | + + + | +18 | {"a": 5} = 42 +19 | {a} = 42 +20 | [x for x in xs] = 42 + | ^^^^^^^^^^^^^^^ Syntax Error: Invalid assignment target +21 | {x for x in xs} = 42 +22 | {x: x * 2 for x in xs} = 42 + | + + + | +19 | {a} = 42 +20 | [x for x in xs] = 42 +21 | {x for x in xs} = 42 + | ^^^^^^^^^^^^^^^ Syntax Error: Invalid assignment target +22 | {x: x * 2 for x in xs} = 42 +23 | (x for x in xs) = 42 + | + + + | +20 | [x for x in xs] = 42 +21 | {x for x in xs} = 42 +22 | {x: x * 2 for x in xs} = 42 + | ^^^^^^^^^^^^^^^^^^^^^^ Syntax Error: Invalid assignment target +23 | (x for x in xs) = 42 +24 | await x = 42 + | + + + | +21 | {x for x in xs} = 42 +22 | {x: x * 2 for x in xs} = 42 +23 | (x for x in xs) = 42 + | ^^^^^^^^^^^^^^^ Syntax Error: Invalid assignment target +24 | await x = 42 +25 | (yield x) = 42 + | + + + | +22 | {x: x * 2 for x in xs} = 42 +23 | (x for x in xs) = 42 +24 | await x = 42 + | ^^^^^^^ Syntax Error: Invalid assignment target +25 | (yield x) = 42 +26 | (yield from xs) = 42 + | + + + | +23 | (x for x in xs) = 42 +24 | await x = 42 +25 | (yield x) = 42 + | ^^^^^^^ Syntax Error: Invalid assignment target +26 | (yield from xs) = 42 +27 | a < b < c = 42 + | + + + | +24 | await x = 42 +25 | (yield x) = 42 +26 | (yield from xs) = 42 + | ^^^^^^^^^^^^^ Syntax Error: Invalid assignment target +27 | a < b < c = 42 +28 | foo() = 42 + | + + + | +25 | (yield x) = 42 +26 | (yield from xs) = 42 +27 | a < b < c = 42 + | ^^^^^^^^^ Syntax Error: Invalid assignment target +28 | foo() = 42 + | + + + | +26 | (yield from xs) = 42 +27 | a < b < c = 42 +28 | foo() = 42 + | ^^^^^ Syntax Error: Invalid assignment target +29 | +30 | f"{quux}" = 42 + | + + + | +28 | foo() = 42 +29 | +30 | f"{quux}" = 42 + | ^^^^^^^^^ Syntax Error: Invalid assignment target +31 | f"{foo} and {bar}" = 42 + | + + + | +30 | f"{quux}" = 42 +31 | f"{foo} and {bar}" = 42 + | ^^^^^^^^^^^^^^^^^^ Syntax Error: Invalid assignment target +32 | +33 | "foo" = 42 + | + + + | +31 | f"{foo} and {bar}" = 42 +32 | +33 | "foo" = 42 + | ^^^^^ Syntax Error: Invalid assignment target +34 | b"foo" = 42 +35 | 123 = 42 + | + + + | +33 | "foo" = 42 +34 | b"foo" = 42 + | ^^^^^^ Syntax Error: Invalid assignment target +35 | 123 = 42 +36 | True = 42 + | + + + | +33 | "foo" = 42 +34 | b"foo" = 42 +35 | 123 = 42 + | ^^^ Syntax Error: Invalid assignment target +36 | True = 42 +37 | None = 42 + | + + + | +34 | b"foo" = 42 +35 | 123 = 42 +36 | True = 42 + | ^^^^ Syntax Error: Invalid assignment target +37 | None = 42 +38 | ... = 42 + | + + + | +35 | 123 = 42 +36 | True = 42 +37 | None = 42 + | ^^^^ Syntax Error: Invalid assignment target +38 | ... = 42 +39 | *foo() = 42 + | + + + | +36 | True = 42 +37 | None = 42 +38 | ... = 42 + | ^^^ Syntax Error: Invalid assignment target +39 | *foo() = 42 +40 | [x, foo(), y] = [42, 42, 42] + | + + + | +37 | None = 42 +38 | ... = 42 +39 | *foo() = 42 + | ^^^^^ Syntax Error: Invalid assignment target +40 | [x, foo(), y] = [42, 42, 42] +41 | [[a, b], [[42]], d] = [[1, 2], [[3]], 4] + | + + + | +38 | ... = 42 +39 | *foo() = 42 +40 | [x, foo(), y] = [42, 42, 42] + | ^^^^^ Syntax Error: Invalid assignment target +41 | [[a, b], [[42]], d] = [[1, 2], [[3]], 4] +42 | (x, foo(), y) = (42, 42, 42) + | + + + | +39 | *foo() = 42 +40 | [x, foo(), y] = [42, 42, 42] +41 | [[a, b], [[42]], d] = [[1, 2], [[3]], 4] + | ^^ Syntax Error: Invalid assignment target +42 | (x, foo(), y) = (42, 42, 42) + | + + + | +40 | [x, foo(), y] = [42, 42, 42] +41 | [[a, b], [[42]], d] = [[1, 2], [[3]], 4] +42 | (x, foo(), y) = (42, 42, 42) + | ^^^^^ Syntax Error: Invalid assignment target + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_augmented_assignment_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_augmented_assignment_target.py.snap new file mode 100644 index 0000000000..9681d152d4 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_augmented_assignment_target.py.snap @@ -0,0 +1,1557 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/invalid_augmented_assignment_target.py +--- +## AST + +``` +Module( + ModModule { + range: 0..611, + body: [ + AugAssign( + StmtAugAssign { + range: 97..109, + target: BoolOp( + ExprBoolOp { + range: 97..103, + op: Or, + values: [ + Name( + ExprName { + range: 97..98, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 102..103, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 107..109, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 110..124, + target: Named( + ExprNamed { + range: 111..117, + target: Name( + ExprName { + range: 111..112, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 116..117, + value: Int( + 5, + ), + }, + ), + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 122..124, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 125..136, + target: BinOp( + ExprBinOp { + range: 125..130, + left: Name( + ExprName { + range: 125..126, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 129..130, + id: "y", + ctx: Load, + }, + ), + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 134..136, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 137..145, + target: UnaryOp( + ExprUnaryOp { + range: 137..139, + op: USub, + operand: Name( + ExprName { + range: 138..139, + id: "x", + ctx: Store, + }, + ), + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 143..145, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 146..165, + target: Lambda( + ExprLambda { + range: 147..158, + parameters: Some( + Parameters { + range: 154..155, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 154..155, + parameter: Parameter { + range: 154..155, + name: Identifier { + id: "_", + range: 154..155, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 157..158, + value: Int( + 1, + ), + }, + ), + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 163..165, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 166..185, + target: If( + ExprIf { + range: 166..179, + test: Name( + ExprName { + range: 171..172, + id: "b", + ctx: Load, + }, + ), + body: Name( + ExprName { + range: 166..167, + id: "a", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 178..179, + id: "c", + ctx: Load, + }, + ), + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 183..185, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 186..200, + target: Dict( + ExprDict { + range: 186..194, + keys: [ + Some( + StringLiteral( + ExprStringLiteral { + range: 187..190, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 187..190, + value: "a", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 192..193, + value: Int( + 5, + ), + }, + ), + ], + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 198..200, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 201..210, + target: Set( + ExprSet { + range: 201..204, + elts: [ + Name( + ExprName { + range: 202..203, + id: "a", + ctx: Load, + }, + ), + ], + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 208..210, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 211..232, + target: ListComp( + ExprListComp { + range: 211..226, + elt: Name( + ExprName { + range: 212..213, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 214..225, + target: Name( + ExprName { + range: 218..219, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 223..225, + id: "xs", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 230..232, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 233..254, + target: SetComp( + ExprSetComp { + range: 233..248, + elt: Name( + ExprName { + range: 234..235, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 236..247, + target: Name( + ExprName { + range: 240..241, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 245..247, + id: "xs", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 252..254, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 255..283, + target: DictComp( + ExprDictComp { + range: 255..277, + key: Name( + ExprName { + range: 256..257, + id: "x", + ctx: Load, + }, + ), + value: BinOp( + ExprBinOp { + range: 259..264, + left: Name( + ExprName { + range: 259..260, + id: "x", + ctx: Load, + }, + ), + op: Mult, + right: NumberLiteral( + ExprNumberLiteral { + range: 263..264, + value: Int( + 2, + ), + }, + ), + }, + ), + generators: [ + Comprehension { + range: 265..276, + target: Name( + ExprName { + range: 269..270, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 274..276, + id: "xs", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 281..283, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 284..305, + target: Generator( + ExprGenerator { + range: 284..299, + elt: Name( + ExprName { + range: 285..286, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 287..298, + target: Name( + ExprName { + range: 291..292, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 296..298, + id: "xs", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 303..305, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 306..319, + target: Await( + ExprAwait { + range: 306..313, + value: Name( + ExprName { + range: 312..313, + id: "x", + ctx: Load, + }, + ), + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 317..319, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 320..335, + target: Yield( + ExprYield { + range: 321..328, + value: Some( + Name( + ExprName { + range: 327..328, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 333..335, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 336..357, + target: YieldFrom( + ExprYieldFrom { + range: 337..350, + value: Name( + ExprName { + range: 348..350, + id: "xs", + ctx: Load, + }, + ), + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 355..357, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 358..373, + target: Compare( + ExprCompare { + range: 358..367, + left: Name( + ExprName { + range: 358..359, + id: "a", + ctx: Load, + }, + ), + ops: [ + Lt, + Lt, + ], + comparators: [ + Name( + ExprName { + range: 362..363, + id: "b", + ctx: Load, + }, + ), + Name( + ExprName { + range: 366..367, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 371..373, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 374..385, + target: Call( + ExprCall { + range: 374..379, + func: Name( + ExprName { + range: 374..377, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 377..379, + args: [], + keywords: [], + }, + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 383..385, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 387..402, + target: FString( + ExprFString { + range: 387..396, + value: FStringValue { + inner: Single( + FString( + FString { + range: 387..396, + elements: [ + Expression( + FStringExpressionElement { + range: 389..395, + expression: Name( + ExprName { + range: 390..394, + id: "quux", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 400..402, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 403..427, + target: FString( + ExprFString { + range: 403..421, + value: FStringValue { + inner: Single( + FString( + FString { + range: 403..421, + elements: [ + Expression( + FStringExpressionElement { + range: 405..410, + expression: Name( + ExprName { + range: 406..409, + id: "foo", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 410..415, + value: " and ", + }, + ), + Expression( + FStringExpressionElement { + range: 415..420, + expression: Name( + ExprName { + range: 416..419, + id: "bar", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 425..427, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 429..440, + target: StringLiteral( + ExprStringLiteral { + range: 429..434, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 429..434, + value: "foo", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 438..440, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 441..453, + target: BytesLiteral( + ExprBytesLiteral { + range: 441..447, + value: BytesLiteralValue { + inner: Single( + BytesLiteral { + range: 441..447, + value: [ + 102, + 111, + 111, + ], + flags: BytesLiteralFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 451..453, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 454..463, + target: NumberLiteral( + ExprNumberLiteral { + range: 454..457, + value: Int( + 123, + ), + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 461..463, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 464..474, + target: BooleanLiteral( + ExprBooleanLiteral { + range: 464..468, + value: true, + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 472..474, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 475..485, + target: NoneLiteral( + ExprNoneLiteral { + range: 475..479, + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 483..485, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 486..495, + target: EllipsisLiteral( + ExprEllipsisLiteral { + range: 486..489, + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 493..495, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 496..508, + target: Starred( + ExprStarred { + range: 496..502, + value: Call( + ExprCall { + range: 497..502, + func: Name( + ExprName { + range: 497..500, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 500..502, + args: [], + keywords: [], + }, + }, + ), + ctx: Store, + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 506..508, + value: Int( + 42, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 509..538, + target: List( + ExprList { + range: 509..522, + elts: [ + Name( + ExprName { + range: 510..511, + id: "x", + ctx: Store, + }, + ), + Call( + ExprCall { + range: 513..518, + func: Name( + ExprName { + range: 513..516, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 516..518, + args: [], + keywords: [], + }, + }, + ), + Name( + ExprName { + range: 520..521, + id: "y", + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + op: Add, + value: List( + ExprList { + range: 526..538, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 527..529, + value: Int( + 42, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 531..533, + value: Int( + 42, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 535..537, + value: Int( + 42, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 539..580, + target: List( + ExprList { + range: 539..558, + elts: [ + List( + ExprList { + range: 540..546, + elts: [ + Name( + ExprName { + range: 541..542, + id: "a", + ctx: Store, + }, + ), + Name( + ExprName { + range: 544..545, + id: "b", + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + List( + ExprList { + range: 548..554, + elts: [ + List( + ExprList { + range: 549..553, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 550..552, + value: Int( + 42, + ), + }, + ), + ], + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + Name( + ExprName { + range: 556..557, + id: "d", + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + op: Add, + value: List( + ExprList { + range: 562..580, + elts: [ + List( + ExprList { + range: 563..569, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 564..565, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 567..568, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + List( + ExprList { + range: 571..576, + elts: [ + List( + ExprList { + range: 572..575, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 573..574, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 578..579, + value: Int( + 4, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 581..610, + target: Tuple( + ExprTuple { + range: 581..594, + elts: [ + Name( + ExprName { + range: 582..583, + id: "x", + ctx: Store, + }, + ), + Call( + ExprCall { + range: 585..590, + func: Name( + ExprName { + range: 585..588, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 588..590, + args: [], + keywords: [], + }, + }, + ), + Name( + ExprName { + range: 592..593, + id: "y", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: true, + }, + ), + op: Add, + value: Tuple( + ExprTuple { + range: 598..610, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 599..601, + value: Int( + 42, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 603..605, + value: Int( + 42, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 607..609, + value: Int( + 42, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +2 | # assignment targets. +3 | +4 | x or y += 42 + | ^^^^^^ Syntax Error: Invalid augmented assignment target +5 | (x := 5) += 42 +6 | x + y += 42 + | + + + | +4 | x or y += 42 +5 | (x := 5) += 42 + | ^^^^^^ Syntax Error: Invalid augmented assignment target +6 | x + y += 42 +7 | -x += 42 + | + + + | +4 | x or y += 42 +5 | (x := 5) += 42 +6 | x + y += 42 + | ^^^^^ Syntax Error: Invalid augmented assignment target +7 | -x += 42 +8 | (lambda _: 1) += 42 + | + + + | +5 | (x := 5) += 42 +6 | x + y += 42 +7 | -x += 42 + | ^^ Syntax Error: Invalid augmented assignment target +8 | (lambda _: 1) += 42 +9 | a if b else c += 42 + | + + + | + 6 | x + y += 42 + 7 | -x += 42 + 8 | (lambda _: 1) += 42 + | ^^^^^^^^^^^ Syntax Error: Invalid augmented assignment target + 9 | a if b else c += 42 +10 | {"a": 5} += 42 + | + + + | + 7 | -x += 42 + 8 | (lambda _: 1) += 42 + 9 | a if b else c += 42 + | ^^^^^^^^^^^^^ Syntax Error: Invalid augmented assignment target +10 | {"a": 5} += 42 +11 | {a} += 42 + | + + + | + 8 | (lambda _: 1) += 42 + 9 | a if b else c += 42 +10 | {"a": 5} += 42 + | ^^^^^^^^ Syntax Error: Invalid augmented assignment target +11 | {a} += 42 +12 | [x for x in xs] += 42 + | + + + | + 9 | a if b else c += 42 +10 | {"a": 5} += 42 +11 | {a} += 42 + | ^^^ Syntax Error: Invalid augmented assignment target +12 | [x for x in xs] += 42 +13 | {x for x in xs} += 42 + | + + + | +10 | {"a": 5} += 42 +11 | {a} += 42 +12 | [x for x in xs] += 42 + | ^^^^^^^^^^^^^^^ Syntax Error: Invalid augmented assignment target +13 | {x for x in xs} += 42 +14 | {x: x * 2 for x in xs} += 42 + | + + + | +11 | {a} += 42 +12 | [x for x in xs] += 42 +13 | {x for x in xs} += 42 + | ^^^^^^^^^^^^^^^ Syntax Error: Invalid augmented assignment target +14 | {x: x * 2 for x in xs} += 42 +15 | (x for x in xs) += 42 + | + + + | +12 | [x for x in xs] += 42 +13 | {x for x in xs} += 42 +14 | {x: x * 2 for x in xs} += 42 + | ^^^^^^^^^^^^^^^^^^^^^^ Syntax Error: Invalid augmented assignment target +15 | (x for x in xs) += 42 +16 | await x += 42 + | + + + | +13 | {x for x in xs} += 42 +14 | {x: x * 2 for x in xs} += 42 +15 | (x for x in xs) += 42 + | ^^^^^^^^^^^^^^^ Syntax Error: Invalid augmented assignment target +16 | await x += 42 +17 | (yield x) += 42 + | + + + | +14 | {x: x * 2 for x in xs} += 42 +15 | (x for x in xs) += 42 +16 | await x += 42 + | ^^^^^^^ Syntax Error: Invalid augmented assignment target +17 | (yield x) += 42 +18 | (yield from xs) += 42 + | + + + | +15 | (x for x in xs) += 42 +16 | await x += 42 +17 | (yield x) += 42 + | ^^^^^^^ Syntax Error: Invalid augmented assignment target +18 | (yield from xs) += 42 +19 | a < b < c += 42 + | + + + | +16 | await x += 42 +17 | (yield x) += 42 +18 | (yield from xs) += 42 + | ^^^^^^^^^^^^^ Syntax Error: Invalid augmented assignment target +19 | a < b < c += 42 +20 | foo() += 42 + | + + + | +17 | (yield x) += 42 +18 | (yield from xs) += 42 +19 | a < b < c += 42 + | ^^^^^^^^^ Syntax Error: Invalid augmented assignment target +20 | foo() += 42 + | + + + | +18 | (yield from xs) += 42 +19 | a < b < c += 42 +20 | foo() += 42 + | ^^^^^ Syntax Error: Invalid augmented assignment target +21 | +22 | f"{quux}" += 42 + | + + + | +20 | foo() += 42 +21 | +22 | f"{quux}" += 42 + | ^^^^^^^^^ Syntax Error: Invalid augmented assignment target +23 | f"{foo} and {bar}" += 42 + | + + + | +22 | f"{quux}" += 42 +23 | f"{foo} and {bar}" += 42 + | ^^^^^^^^^^^^^^^^^^ Syntax Error: Invalid augmented assignment target +24 | +25 | "foo" += 42 + | + + + | +23 | f"{foo} and {bar}" += 42 +24 | +25 | "foo" += 42 + | ^^^^^ Syntax Error: Invalid augmented assignment target +26 | b"foo" += 42 +27 | 123 += 42 + | + + + | +25 | "foo" += 42 +26 | b"foo" += 42 + | ^^^^^^ Syntax Error: Invalid augmented assignment target +27 | 123 += 42 +28 | True += 42 + | + + + | +25 | "foo" += 42 +26 | b"foo" += 42 +27 | 123 += 42 + | ^^^ Syntax Error: Invalid augmented assignment target +28 | True += 42 +29 | None += 42 + | + + + | +26 | b"foo" += 42 +27 | 123 += 42 +28 | True += 42 + | ^^^^ Syntax Error: Invalid augmented assignment target +29 | None += 42 +30 | ... += 42 + | + + + | +27 | 123 += 42 +28 | True += 42 +29 | None += 42 + | ^^^^ Syntax Error: Invalid augmented assignment target +30 | ... += 42 +31 | *foo() += 42 + | + + + | +28 | True += 42 +29 | None += 42 +30 | ... += 42 + | ^^^ Syntax Error: Invalid augmented assignment target +31 | *foo() += 42 +32 | [x, foo(), y] += [42, 42, 42] + | + + + | +29 | None += 42 +30 | ... += 42 +31 | *foo() += 42 + | ^^^^^^ Syntax Error: Invalid augmented assignment target +32 | [x, foo(), y] += [42, 42, 42] +33 | [[a, b], [[42]], d] += [[1, 2], [[3]], 4] + | + + + | +30 | ... += 42 +31 | *foo() += 42 +32 | [x, foo(), y] += [42, 42, 42] + | ^^^^^^^^^^^^^ Syntax Error: Invalid augmented assignment target +33 | [[a, b], [[42]], d] += [[1, 2], [[3]], 4] +34 | (x, foo(), y) += (42, 42, 42) + | + + + | +31 | *foo() += 42 +32 | [x, foo(), y] += [42, 42, 42] +33 | [[a, b], [[42]], d] += [[1, 2], [[3]], 4] + | ^^^^^^^^^^^^^^^^^^^ Syntax Error: Invalid augmented assignment target +34 | (x, foo(), y) += (42, 42, 42) + | + + + | +32 | [x, foo(), y] += [42, 42, 42] +33 | [[a, b], [[42]], d] += [[1, 2], [[3]], 4] +34 | (x, foo(), y) += (42, 42, 42) + | ^^^^^^^^^^^^^ Syntax Error: Invalid augmented assignment target + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_0.py.snap new file mode 100644 index 0000000000..3baeb69fe7 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_0.py.snap @@ -0,0 +1,92 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_0.py +--- +## AST + +``` +Module( + ModModule { + range: 0..198, + body: [ + Match( + StmtMatch { + range: 0..197, + subject: Name( + ExprName { + range: 6..13, + id: "subject", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 127..197, + pattern: MatchClass( + PatternMatchClass { + range: 132..146, + cls: Name( + ExprName { + range: 133..139, + id: "", + ctx: Invalid, + }, + ), + arguments: PatternArguments { + range: 140..146, + patterns: [ + MatchAs( + PatternMatchAs { + range: 141..142, + pattern: None, + name: Some( + Identifier { + id: "a", + range: 141..142, + }, + ), + }, + ), + MatchAs( + PatternMatchAs { + range: 144..145, + pattern: None, + name: Some( + Identifier { + id: "b", + range: 144..145, + }, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 193..197, + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +3 | # class pattern +4 | # v +5 | case (x as y)(a, b): + | ^^^^^^ Syntax Error: Invalid value for a class pattern +6 | # ^^^^^^ +7 | # as-pattern + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_1.py.snap new file mode 100644 index 0000000000..78c3315401 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_1.py.snap @@ -0,0 +1,77 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_1.py +--- +## AST + +``` +Module( + ModModule { + range: 0..210, + body: [ + Match( + StmtMatch { + range: 0..209, + subject: Name( + ExprName { + range: 6..13, + id: "subject", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 140..209, + pattern: MatchValue( + PatternMatchValue { + range: 145..158, + value: BinOp( + ExprBinOp { + range: 145..158, + left: Name( + ExprName { + range: 146..152, + id: "", + ctx: Invalid, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 156..158, + value: Complex { + real: 0.0, + imag: 1.0, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 205..209, + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +3 | # complex literal pattern +4 | # v +5 | case (x as y) + 1j: + | ^^^^^^ Syntax Error: Expected a real number in complex literal pattern +6 | # ^^^^^^ +7 | # as-pattern + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_2.py.snap new file mode 100644 index 0000000000..736d318dfb --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_2.py.snap @@ -0,0 +1,126 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_2.py +--- +## AST + +``` +Module( + ModModule { + range: 0..190, + body: [ + Match( + StmtMatch { + range: 0..176, + subject: Name( + ExprName { + range: 6..13, + id: "subject", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 159..176, + pattern: MatchAs( + PatternMatchAs { + range: 164..170, + pattern: Some( + MatchAs( + PatternMatchAs { + range: 164..165, + pattern: None, + name: Some( + Identifier { + id: "x", + range: 164..165, + }, + ), + }, + ), + ), + name: Some( + Identifier { + id: "y", + range: 169..170, + }, + ), + }, + ), + guard: None, + body: [ + AnnAssign( + StmtAnnAssign { + range: 171..176, + target: UnaryOp( + ExprUnaryOp { + range: 171..175, + op: UAdd, + operand: NumberLiteral( + ExprNumberLiteral { + range: 173..175, + value: Complex { + real: 0.0, + imag: 1.0, + }, + }, + ), + }, + ), + annotation: Name( + ExprName { + range: 176..176, + id: "", + ctx: Invalid, + }, + ), + value: None, + simple: false, + }, + ), + ], + }, + ], + }, + ), + Pass( + StmtPass { + range: 185..189, + }, + ), + ], + }, +) +``` +## Errors + + | +2 | # This `as` pattern is unparenthesied so the parser never takes the path +3 | # where it might be confused as a complex literal pattern. +4 | case x as y + 1j: + | ^ Syntax Error: Expected ':', found '+' +5 | pass + | + + + | +2 | # This `as` pattern is unparenthesied so the parser never takes the path +3 | # where it might be confused as a complex literal pattern. +4 | case x as y + 1j: + | ^ Syntax Error: Expected an expression +5 | pass + | + + + | +3 | # where it might be confused as a complex literal pattern. +4 | case x as y + 1j: +5 | pass + | ^^^^^^^^ Syntax Error: Expected dedent, found indent + | + + + | +4 | case x as y + 1j: +5 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_3.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_3.py.snap new file mode 100644 index 0000000000..857ca2e275 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_3.py.snap @@ -0,0 +1,155 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_3.py +--- +## AST + +``` +Module( + ModModule { + range: 0..136, + body: [ + Match( + StmtMatch { + range: 0..120, + subject: Name( + ExprName { + range: 6..13, + id: "subject", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 103..120, + pattern: MatchClass( + PatternMatchClass { + range: 108..117, + cls: Dict( + ExprDict { + range: 108..109, + keys: [], + values: [], + }, + ), + arguments: PatternArguments { + range: 109..117, + patterns: [ + MatchAs( + PatternMatchAs { + range: 110..116, + pattern: Some( + MatchAs( + PatternMatchAs { + range: 110..111, + pattern: None, + name: Some( + Identifier { + id: "x", + range: 110..111, + }, + ), + }, + ), + ), + name: Some( + Identifier { + id: "y", + range: 115..116, + }, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 119..120, + value: NumberLiteral( + ExprNumberLiteral { + range: 119..120, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Pass( + StmtPass { + range: 131..135, + }, + ), + ], + }, +) +``` +## Errors + + | +2 | # Not in the mapping start token set, so the list parsing bails +3 | # v +4 | case {(x as y): 1}: + | ^ Syntax Error: Expected a mapping pattern or the end of the mapping pattern +5 | pass + | + + + | +2 | # Not in the mapping start token set, so the list parsing bails +3 | # v +4 | case {(x as y): 1}: + | ^ Syntax Error: Invalid value for a class pattern +5 | pass + | + + + | +2 | # Not in the mapping start token set, so the list parsing bails +3 | # v +4 | case {(x as y): 1}: + | ^ Syntax Error: Expected newline, found '}' +5 | pass + | + + + | +2 | # Not in the mapping start token set, so the list parsing bails +3 | # v +4 | case {(x as y): 1}: + | ^ Syntax Error: Expected a statement +5 | pass + | + + + | +2 | # Not in the mapping start token set, so the list parsing bails +3 | # v +4 | case {(x as y): 1}: + | ^ Syntax Error: Expected a statement +5 | pass + | + + + | +3 | # v +4 | case {(x as y): 1}: +5 | pass + | ^^^^^^^^ Syntax Error: Unexpected indentation + | + + + | +4 | case {(x as y): 1}: +5 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_4.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_4.py.snap new file mode 100644 index 0000000000..d8e9b3da91 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_4.py.snap @@ -0,0 +1,116 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_4.py +--- +## AST + +``` +Module( + ModModule { + range: 0..187, + body: [ + Match( + StmtMatch { + range: 0..186, + subject: Name( + ExprName { + range: 6..13, + id: "subject", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 156..186, + pattern: MatchMapping( + PatternMatchMapping { + range: 161..172, + keys: [ + Name( + ExprName { + range: 162..163, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 167..168, + id: "y", + ctx: Store, + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 164..166, + value: Name( + ExprName { + range: 164..166, + id: "as", + ctx: Load, + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 170..171, + value: NumberLiteral( + ExprNumberLiteral { + range: 170..171, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 182..186, + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +2 | # This `as` pattern is unparenthesized so the parser never takes the path +3 | # where it might be confused as a mapping key pattern. +4 | case {x as y: 1}: + | ^ Syntax Error: Invalid mapping pattern key +5 | pass + | + + + | +2 | # This `as` pattern is unparenthesized so the parser never takes the path +3 | # where it might be confused as a mapping key pattern. +4 | case {x as y: 1}: + | ^^ Syntax Error: Expected ':', found 'as' +5 | pass + | + + + | +2 | # This `as` pattern is unparenthesized so the parser never takes the path +3 | # where it might be confused as a mapping key pattern. +4 | case {x as y: 1}: + | ^ Syntax Error: Expected ',', found name +5 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_class_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_class_pattern.py.snap new file mode 100644 index 0000000000..288f3909d4 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_class_pattern.py.snap @@ -0,0 +1,383 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/match/invalid_class_pattern.py +--- +## AST + +``` +Module( + ModModule { + range: 0..383, + body: [ + Match( + StmtMatch { + range: 44..285, + subject: Name( + ExprName { + range: 50..57, + id: "subject", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 63..97, + pattern: MatchClass( + PatternMatchClass { + range: 68..83, + cls: Name( + ExprName { + range: 68..71, + id: "Foo", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 71..83, + patterns: [], + keywords: [ + PatternKeyword { + range: 72..82, + attr: Identifier { + id: "", + range: 80..80, + }, + pattern: MatchValue( + PatternMatchValue { + range: 81..82, + value: NumberLiteral( + ExprNumberLiteral { + range: 81..82, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ], + }, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 93..97, + }, + ), + ], + }, + MatchCase { + range: 102..135, + pattern: MatchClass( + PatternMatchClass { + range: 107..121, + cls: Name( + ExprName { + range: 107..110, + id: "Foo", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 110..121, + patterns: [], + keywords: [ + PatternKeyword { + range: 111..120, + attr: Identifier { + id: "", + range: 118..118, + }, + pattern: MatchValue( + PatternMatchValue { + range: 119..120, + value: NumberLiteral( + ExprNumberLiteral { + range: 119..120, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ], + }, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 131..135, + }, + ), + ], + }, + MatchCase { + range: 140..174, + pattern: MatchClass( + PatternMatchClass { + range: 145..160, + cls: Name( + ExprName { + range: 145..148, + id: "Foo", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 148..160, + patterns: [], + keywords: [ + PatternKeyword { + range: 149..159, + attr: Identifier { + id: "", + range: 157..157, + }, + pattern: MatchValue( + PatternMatchValue { + range: 158..159, + value: NumberLiteral( + ExprNumberLiteral { + range: 158..159, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ], + }, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 170..174, + }, + ), + ], + }, + MatchCase { + range: 179..217, + pattern: MatchClass( + PatternMatchClass { + range: 184..203, + cls: Name( + ExprName { + range: 184..187, + id: "Foo", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 187..203, + patterns: [], + keywords: [ + PatternKeyword { + range: 188..202, + attr: Identifier { + id: "", + range: 200..200, + }, + pattern: MatchValue( + PatternMatchValue { + range: 201..202, + value: NumberLiteral( + ExprNumberLiteral { + range: 201..202, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ], + }, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 213..217, + }, + ), + ], + }, + MatchCase { + range: 222..249, + pattern: MatchClass( + PatternMatchClass { + range: 227..235, + cls: Name( + ExprName { + range: 227..230, + id: "Foo", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 230..235, + patterns: [], + keywords: [ + PatternKeyword { + range: 231..234, + attr: Identifier { + id: "", + range: 233..233, + }, + pattern: MatchValue( + PatternMatchValue { + range: 233..234, + value: NumberLiteral( + ExprNumberLiteral { + range: 233..234, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ], + }, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 245..249, + }, + ), + ], + }, + MatchCase { + range: 254..285, + pattern: MatchClass( + PatternMatchClass { + range: 259..271, + cls: Name( + ExprName { + range: 259..262, + id: "Foo", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 262..271, + patterns: [], + keywords: [ + PatternKeyword { + range: 263..270, + attr: Identifier { + id: "", + range: 269..269, + }, + pattern: MatchValue( + PatternMatchValue { + range: 269..270, + value: NumberLiteral( + ExprNumberLiteral { + range: 269..270, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ], + }, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 281..285, + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Invalid keyword pattern in class argument +2 | match subject: +3 | case Foo(x as y = 1): + | ^^^^^^ Syntax Error: Expected an identifier for the keyword pattern +4 | pass +5 | case Foo(x | y = 1): + | + + + | +3 | case Foo(x as y = 1): +4 | pass +5 | case Foo(x | y = 1): + | ^^^^^ Syntax Error: Expected an identifier for the keyword pattern +6 | pass +7 | case Foo([x, y] = 1): + | + + + | +5 | case Foo(x | y = 1): +6 | pass +7 | case Foo([x, y] = 1): + | ^^^^^^ Syntax Error: Expected an identifier for the keyword pattern +8 | pass +9 | case Foo({False: 0} = 1): + | + + + | + 7 | case Foo([x, y] = 1): + 8 | pass + 9 | case Foo({False: 0} = 1): + | ^^^^^^^^^^ Syntax Error: Expected an identifier for the keyword pattern +10 | pass +11 | case Foo(1=1): + | + + + | + 9 | case Foo({False: 0} = 1): +10 | pass +11 | case Foo(1=1): + | ^ Syntax Error: Expected an identifier for the keyword pattern +12 | pass +13 | case Foo(Bar()=1): + | + + + | +11 | case Foo(1=1): +12 | pass +13 | case Foo(Bar()=1): + | ^^^^^ Syntax Error: Expected an identifier for the keyword pattern +14 | pass +15 | # Positional pattern cannot follow keyword pattern + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_lhs_or_rhs_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_lhs_or_rhs_pattern.py.snap new file mode 100644 index 0000000000..ef1241b3a7 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_lhs_or_rhs_pattern.py.snap @@ -0,0 +1,1100 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/match/invalid_lhs_or_rhs_pattern.py +--- +## AST + +``` +Module( + ModModule { + range: 0..695, + body: [ + Match( + StmtMatch { + range: 0..332, + subject: Name( + ExprName { + range: 6..25, + id: "invalid_lhs_pattern", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 31..60, + pattern: MatchValue( + PatternMatchValue { + range: 36..46, + value: BinOp( + ExprBinOp { + range: 36..46, + left: Call( + ExprCall { + range: 36..41, + func: Name( + ExprName { + range: 36..39, + id: "Foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 39..41, + args: [], + keywords: [], + }, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 44..46, + value: Complex { + real: 0.0, + imag: 1.0, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 56..60, + }, + ), + ], + }, + MatchCase { + range: 65..90, + pattern: MatchValue( + PatternMatchValue { + range: 70..76, + value: BinOp( + ExprBinOp { + range: 70..76, + left: Name( + ExprName { + range: 70..71, + id: "x", + ctx: Store, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 74..76, + value: Complex { + real: 0.0, + imag: 2.0, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 86..90, + }, + ), + ], + }, + MatchCase { + range: 95..120, + pattern: MatchValue( + PatternMatchValue { + range: 100..106, + value: BinOp( + ExprBinOp { + range: 100..106, + left: Name( + ExprName { + range: 100..101, + id: "_", + ctx: Store, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 104..106, + value: Complex { + real: 0.0, + imag: 3.0, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 116..120, + }, + ), + ], + }, + MatchCase { + range: 125..156, + pattern: MatchValue( + PatternMatchValue { + range: 130..142, + value: BinOp( + ExprBinOp { + range: 130..142, + left: BinOp( + ExprBinOp { + range: 131..136, + left: NumberLiteral( + ExprNumberLiteral { + range: 131..132, + value: Int( + 1, + ), + }, + ), + op: BitOr, + right: NumberLiteral( + ExprNumberLiteral { + range: 135..136, + value: Int( + 2, + ), + }, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 140..142, + value: Complex { + real: 0.0, + imag: 4.0, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 152..156, + }, + ), + ], + }, + MatchCase { + range: 161..191, + pattern: MatchValue( + PatternMatchValue { + range: 166..177, + value: BinOp( + ExprBinOp { + range: 166..177, + left: List( + ExprList { + range: 166..172, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 167..168, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 170..171, + value: Int( + 2, + ), + }, + ), + ], + ctx: Store, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 175..177, + value: Complex { + real: 0.0, + imag: 5.0, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 187..191, + }, + ), + ], + }, + MatchCase { + range: 196..229, + pattern: MatchValue( + PatternMatchValue { + range: 201..215, + value: BinOp( + ExprBinOp { + range: 201..215, + left: Dict( + ExprDict { + range: 201..210, + keys: [ + Some( + BooleanLiteral( + ExprBooleanLiteral { + range: 202..206, + value: true, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 208..209, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 213..215, + value: Complex { + real: 0.0, + imag: 6.0, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 225..229, + }, + ), + ], + }, + MatchCase { + range: 234..260, + pattern: MatchValue( + PatternMatchValue { + range: 239..246, + value: BinOp( + ExprBinOp { + range: 239..246, + left: NumberLiteral( + ExprNumberLiteral { + range: 239..241, + value: Complex { + real: 0.0, + imag: 1.0, + }, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 244..246, + value: Complex { + real: 0.0, + imag: 2.0, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 256..260, + }, + ), + ], + }, + MatchCase { + range: 265..292, + pattern: MatchValue( + PatternMatchValue { + range: 270..278, + value: BinOp( + ExprBinOp { + range: 270..278, + left: UnaryOp( + ExprUnaryOp { + range: 270..273, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 271..273, + value: Complex { + real: 0.0, + imag: 1.0, + }, + }, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 276..278, + value: Complex { + real: 0.0, + imag: 2.0, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 288..292, + }, + ), + ], + }, + MatchCase { + range: 297..332, + pattern: MatchValue( + PatternMatchValue { + range: 302..318, + value: BinOp( + ExprBinOp { + range: 302..318, + left: Call( + ExprCall { + range: 302..313, + func: Name( + ExprName { + range: 302..305, + id: "Foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 305..313, + args: [ + Name( + ExprName { + range: 306..312, + id: "", + ctx: Invalid, + }, + ), + ], + keywords: [], + }, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 316..318, + value: Complex { + real: 0.0, + imag: 1.0, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 328..332, + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 334..625, + subject: Name( + ExprName { + range: 340..359, + id: "invalid_rhs_pattern", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 365..393, + pattern: MatchValue( + PatternMatchValue { + range: 370..379, + value: BinOp( + ExprBinOp { + range: 370..379, + left: NumberLiteral( + ExprNumberLiteral { + range: 370..371, + value: Int( + 1, + ), + }, + ), + op: Add, + right: Call( + ExprCall { + range: 374..379, + func: Name( + ExprName { + range: 374..377, + id: "Foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 377..379, + args: [], + keywords: [], + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 389..393, + }, + ), + ], + }, + MatchCase { + range: 398..422, + pattern: MatchValue( + PatternMatchValue { + range: 403..408, + value: BinOp( + ExprBinOp { + range: 403..408, + left: NumberLiteral( + ExprNumberLiteral { + range: 403..404, + value: Int( + 2, + ), + }, + ), + op: Add, + right: Name( + ExprName { + range: 407..408, + id: "x", + ctx: Store, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 418..422, + }, + ), + ], + }, + MatchCase { + range: 427..451, + pattern: MatchValue( + PatternMatchValue { + range: 432..437, + value: BinOp( + ExprBinOp { + range: 432..437, + left: NumberLiteral( + ExprNumberLiteral { + range: 432..433, + value: Int( + 3, + ), + }, + ), + op: Add, + right: Name( + ExprName { + range: 436..437, + id: "_", + ctx: Store, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 447..451, + }, + ), + ], + }, + MatchCase { + range: 456..486, + pattern: MatchValue( + PatternMatchValue { + range: 461..472, + value: BinOp( + ExprBinOp { + range: 461..472, + left: NumberLiteral( + ExprNumberLiteral { + range: 461..462, + value: Int( + 4, + ), + }, + ), + op: Add, + right: BinOp( + ExprBinOp { + range: 466..471, + left: NumberLiteral( + ExprNumberLiteral { + range: 466..467, + value: Int( + 1, + ), + }, + ), + op: BitOr, + right: NumberLiteral( + ExprNumberLiteral { + range: 470..471, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 482..486, + }, + ), + ], + }, + MatchCase { + range: 491..520, + pattern: MatchValue( + PatternMatchValue { + range: 496..506, + value: BinOp( + ExprBinOp { + range: 496..506, + left: NumberLiteral( + ExprNumberLiteral { + range: 496..497, + value: Int( + 5, + ), + }, + ), + op: Add, + right: List( + ExprList { + range: 500..506, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 501..502, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 504..505, + value: Int( + 2, + ), + }, + ), + ], + ctx: Store, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 516..520, + }, + ), + ], + }, + MatchCase { + range: 525..557, + pattern: MatchValue( + PatternMatchValue { + range: 530..543, + value: BinOp( + ExprBinOp { + range: 530..543, + left: NumberLiteral( + ExprNumberLiteral { + range: 530..531, + value: Int( + 6, + ), + }, + ), + op: Add, + right: Dict( + ExprDict { + range: 534..543, + keys: [ + Some( + BooleanLiteral( + ExprBooleanLiteral { + range: 535..539, + value: true, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 541..542, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 553..557, + }, + ), + ], + }, + MatchCase { + range: 562..586, + pattern: MatchValue( + PatternMatchValue { + range: 567..572, + value: BinOp( + ExprBinOp { + range: 567..572, + left: NumberLiteral( + ExprNumberLiteral { + range: 567..568, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 571..572, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 582..586, + }, + ), + ], + }, + MatchCase { + range: 591..625, + pattern: MatchValue( + PatternMatchValue { + range: 596..611, + value: BinOp( + ExprBinOp { + range: 596..611, + left: NumberLiteral( + ExprNumberLiteral { + range: 596..597, + value: Int( + 1, + ), + }, + ), + op: Add, + right: Call( + ExprCall { + range: 600..611, + func: Name( + ExprName { + range: 600..603, + id: "Foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 603..611, + args: [ + Name( + ExprName { + range: 604..610, + id: "", + ctx: Invalid, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 621..625, + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 627..694, + subject: Name( + ExprName { + range: 633..656, + id: "invalid_lhs_rhs_pattern", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 662..694, + pattern: MatchValue( + PatternMatchValue { + range: 667..680, + value: BinOp( + ExprBinOp { + range: 667..680, + left: Call( + ExprCall { + range: 667..672, + func: Name( + ExprName { + range: 667..670, + id: "Foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 670..672, + args: [], + keywords: [], + }, + }, + ), + op: Add, + right: Call( + ExprCall { + range: 675..680, + func: Name( + ExprName { + range: 675..678, + id: "Bar", + ctx: Load, + }, + ), + arguments: Arguments { + range: 678..680, + args: [], + keywords: [], + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 690..694, + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | match invalid_lhs_pattern: +2 | case Foo() + 1j: + | ^^^^^ Syntax Error: Expected a real number in complex literal pattern +3 | pass +4 | case x + 2j: + | + + + | +2 | case Foo() + 1j: +3 | pass +4 | case x + 2j: + | ^ Syntax Error: Expected a real number in complex literal pattern +5 | pass +6 | case _ + 3j: + | + + + | +4 | case x + 2j: +5 | pass +6 | case _ + 3j: + | ^ Syntax Error: Expected a real number in complex literal pattern +7 | pass +8 | case (1 | 2) + 4j: + | + + + | + 6 | case _ + 3j: + 7 | pass + 8 | case (1 | 2) + 4j: + | ^^^^^ Syntax Error: Expected a real number in complex literal pattern + 9 | pass +10 | case [1, 2] + 5j: + | + + + | + 8 | case (1 | 2) + 4j: + 9 | pass +10 | case [1, 2] + 5j: + | ^^^^^^ Syntax Error: Expected a real number in complex literal pattern +11 | pass +12 | case {True: 1} + 6j: + | + + + | +10 | case [1, 2] + 5j: +11 | pass +12 | case {True: 1} + 6j: + | ^^^^^^^^^ Syntax Error: Expected a real number in complex literal pattern +13 | pass +14 | case 1j + 2j: + | + + + | +12 | case {True: 1} + 6j: +13 | pass +14 | case 1j + 2j: + | ^^ Syntax Error: Expected a real number in complex literal pattern +15 | pass +16 | case -1j + 2j: + | + + + | +14 | case 1j + 2j: +15 | pass +16 | case -1j + 2j: + | ^^^ Syntax Error: Expected a real number in complex literal pattern +17 | pass +18 | case Foo(a as b) + 1j: + | + + + | +16 | case -1j + 2j: +17 | pass +18 | case Foo(a as b) + 1j: + | ^^^^^^^^^^^ Syntax Error: Expected a real number in complex literal pattern +19 | pass + | + + + | +21 | match invalid_rhs_pattern: +22 | case 1 + Foo(): + | ^^^^^ Syntax Error: Expected an imaginary number in complex literal pattern +23 | pass +24 | case 2 + x: + | + + + | +22 | case 1 + Foo(): +23 | pass +24 | case 2 + x: + | ^ Syntax Error: Expected an imaginary number in complex literal pattern +25 | pass +26 | case 3 + _: + | + + + | +24 | case 2 + x: +25 | pass +26 | case 3 + _: + | ^ Syntax Error: Expected an imaginary number in complex literal pattern +27 | pass +28 | case 4 + (1 | 2): + | + + + | +26 | case 3 + _: +27 | pass +28 | case 4 + (1 | 2): + | ^^^^^ Syntax Error: Expected an imaginary number in complex literal pattern +29 | pass +30 | case 5 + [1, 2]: + | + + + | +28 | case 4 + (1 | 2): +29 | pass +30 | case 5 + [1, 2]: + | ^^^^^^ Syntax Error: Expected an imaginary number in complex literal pattern +31 | pass +32 | case 6 + {True: 1}: + | + + + | +30 | case 5 + [1, 2]: +31 | pass +32 | case 6 + {True: 1}: + | ^^^^^^^^^ Syntax Error: Expected an imaginary number in complex literal pattern +33 | pass +34 | case 1 + 2: + | + + + | +32 | case 6 + {True: 1}: +33 | pass +34 | case 1 + 2: + | ^ Syntax Error: Expected an imaginary number in complex literal pattern +35 | pass +36 | case 1 + Foo(a as b): + | + + + | +34 | case 1 + 2: +35 | pass +36 | case 1 + Foo(a as b): + | ^^^^^^^^^^^ Syntax Error: Expected an imaginary number in complex literal pattern +37 | pass + | + + + | +39 | match invalid_lhs_rhs_pattern: +40 | case Foo() + Bar(): + | ^^^^^ Syntax Error: Expected a real number in complex literal pattern +41 | pass + | + + + | +39 | match invalid_lhs_rhs_pattern: +40 | case Foo() + Bar(): + | ^^^^^ Syntax Error: Expected an imaginary number in complex literal pattern +41 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_mapping_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_mapping_pattern.py.snap new file mode 100644 index 0000000000..c86688b9b0 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_mapping_pattern.py.snap @@ -0,0 +1,580 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/match/invalid_mapping_pattern.py +--- +## AST + +``` +Module( + ModModule { + range: 0..509, + body: [ + Match( + StmtMatch { + range: 61..209, + subject: Name( + ExprName { + range: 67..74, + id: "subject", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 80..105, + pattern: MatchMapping( + PatternMatchMapping { + range: 85..91, + keys: [ + Starred( + ExprStarred { + range: 86..90, + value: Name( + ExprName { + range: 87..90, + id: "key", + ctx: Store, + }, + ), + ctx: Store, + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 90..90, + value: Name( + ExprName { + range: 90..90, + id: "", + ctx: Invalid, + }, + ), + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 101..105, + }, + ), + ], + }, + MatchCase { + range: 110..138, + pattern: MatchMapping( + PatternMatchMapping { + range: 115..124, + keys: [ + Starred( + ExprStarred { + range: 116..120, + value: Name( + ExprName { + range: 117..120, + id: "key", + ctx: Store, + }, + ), + ctx: Store, + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 122..123, + value: NumberLiteral( + ExprNumberLiteral { + range: 122..123, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 134..138, + }, + ), + ], + }, + MatchCase { + range: 143..170, + pattern: MatchMapping( + PatternMatchMapping { + range: 148..156, + keys: [ + Starred( + ExprStarred { + range: 149..153, + value: Name( + ExprName { + range: 150..153, + id: "key", + ctx: Store, + }, + ), + ctx: Store, + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 154..155, + value: NumberLiteral( + ExprNumberLiteral { + range: 154..155, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 166..170, + }, + ), + ], + }, + MatchCase { + range: 175..209, + pattern: MatchMapping( + PatternMatchMapping { + range: 180..195, + keys: [ + Starred( + ExprStarred { + range: 181..185, + value: Name( + ExprName { + range: 182..185, + id: "key", + ctx: Store, + }, + ), + ctx: Store, + }, + ), + NoneLiteral( + ExprNoneLiteral { + range: 187..191, + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 185..185, + value: Name( + ExprName { + range: 185..185, + id: "", + ctx: Invalid, + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 193..194, + value: NumberLiteral( + ExprNumberLiteral { + range: 193..194, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 205..209, + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 305..462, + subject: Name( + ExprName { + range: 311..318, + id: "subject", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 324..360, + pattern: MatchMapping( + PatternMatchMapping { + range: 329..346, + keys: [ + NoneLiteral( + ExprNoneLiteral { + range: 338..342, + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 344..345, + value: NumberLiteral( + ExprNumberLiteral { + range: 344..345, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + rest: Some( + Identifier { + id: "rest", + range: 332..336, + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 356..360, + }, + ), + ], + }, + MatchCase { + range: 365..411, + pattern: MatchMapping( + PatternMatchMapping { + range: 370..397, + keys: [ + NoneLiteral( + ExprNoneLiteral { + range: 389..393, + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 395..396, + value: NumberLiteral( + ExprNumberLiteral { + range: 395..396, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + rest: Some( + Identifier { + id: "rest2", + range: 382..387, + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 407..411, + }, + ), + ], + }, + MatchCase { + range: 416..462, + pattern: MatchMapping( + PatternMatchMapping { + range: 421..448, + keys: [ + NoneLiteral( + ExprNoneLiteral { + range: 431..435, + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 437..438, + value: NumberLiteral( + ExprNumberLiteral { + range: 437..438, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + rest: Some( + Identifier { + id: "rest2", + range: 442..447, + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 458..462, + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 464..509, + subject: Name( + ExprName { + range: 470..477, + id: "subject", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 483..509, + pattern: MatchMapping( + PatternMatchMapping { + range: 488..504, + keys: [ + Call( + ExprCall { + range: 489..500, + func: Name( + ExprName { + range: 489..492, + id: "Foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 492..500, + args: [ + Name( + ExprName { + range: 493..499, + id: "", + ctx: Invalid, + }, + ), + ], + keywords: [], + }, + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 502..503, + value: NumberLiteral( + ExprNumberLiteral { + range: 502..503, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 506..509, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 506..509, + }, + ), + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Starred expression is not allowed as a mapping pattern key +2 | match subject: +3 | case {*key}: + | ^^^^ Syntax Error: Star pattern cannot be used here +4 | pass +5 | case {*key: 1}: + | + + + | +1 | # Starred expression is not allowed as a mapping pattern key +2 | match subject: +3 | case {*key}: + | ^ Syntax Error: Expected ':', found '}' +4 | pass +5 | case {*key: 1}: + | + + + | +3 | case {*key}: +4 | pass +5 | case {*key: 1}: + | ^^^^ Syntax Error: Star pattern cannot be used here +6 | pass +7 | case {*key 1}: + | + + + | +5 | case {*key: 1}: +6 | pass +7 | case {*key 1}: + | ^^^^ Syntax Error: Star pattern cannot be used here +8 | pass +9 | case {*key, None: 1}: + | + + + | +5 | case {*key: 1}: +6 | pass +7 | case {*key 1}: + | ^ Syntax Error: Expected ':', found int +8 | pass +9 | case {*key, None: 1}: + | + + + | + 7 | case {*key 1}: + 8 | pass + 9 | case {*key, None: 1}: + | ^^^^ Syntax Error: Star pattern cannot be used here +10 | pass + | + + + | + 7 | case {*key 1}: + 8 | pass + 9 | case {*key, None: 1}: + | ^ Syntax Error: Expected ':', found ',' +10 | pass + | + + + | +13 | # Multiple double star patterns are not allowed +14 | match subject: +15 | case {**rest, None: 1}: + | ^^^^^^^ Syntax Error: Pattern cannot follow a double star pattern +16 | pass +17 | case {**rest1, **rest2, None: 1}: + | + + + | +15 | case {**rest, None: 1}: +16 | pass +17 | case {**rest1, **rest2, None: 1}: + | ^^^^^^^ Syntax Error: Only one double star pattern is allowed +18 | pass +19 | case {**rest1, None: 1, **rest2}: + | + + + | +15 | case {**rest, None: 1}: +16 | pass +17 | case {**rest1, **rest2, None: 1}: + | ^^^^^^^ Syntax Error: Pattern cannot follow a double star pattern +18 | pass +19 | case {**rest1, None: 1, **rest2}: + | + + + | +17 | case {**rest1, **rest2, None: 1}: +18 | pass +19 | case {**rest1, None: 1, **rest2}: + | ^^^^^^^ Syntax Error: Pattern cannot follow a double star pattern +20 | pass + | + + + | +17 | case {**rest1, **rest2, None: 1}: +18 | pass +19 | case {**rest1, None: 1, **rest2}: + | ^^^^^^^ Syntax Error: Only one double star pattern is allowed +20 | pass + | + + + | +22 | match subject: +23 | case {Foo(a as b): 1}: ... + | ^^^^^^^^^^^ Syntax Error: Invalid mapping pattern key + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__star_pattern_usage.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__star_pattern_usage.py.snap new file mode 100644 index 0000000000..ed6a2f1cdc --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__star_pattern_usage.py.snap @@ -0,0 +1,546 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/match/star_pattern_usage.py +--- +## AST + +``` +Module( + ModModule { + range: 0..408, + body: [ + Match( + StmtMatch { + range: 57..407, + subject: Name( + ExprName { + range: 63..70, + id: "subject", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 76..97, + pattern: MatchStar( + PatternMatchStar { + range: 81..83, + name: None, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 93..97, + }, + ), + ], + }, + MatchCase { + range: 102..128, + pattern: MatchAs( + PatternMatchAs { + range: 107..114, + pattern: Some( + MatchStar( + PatternMatchStar { + range: 107..109, + name: None, + }, + ), + ), + name: Some( + Identifier { + id: "x", + range: 113..114, + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 124..128, + }, + ), + ], + }, + MatchCase { + range: 133..156, + pattern: MatchStar( + PatternMatchStar { + range: 138..142, + name: Some( + Identifier { + id: "foo", + range: 139..142, + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 152..156, + }, + ), + ], + }, + MatchCase { + range: 161..188, + pattern: MatchOr( + PatternMatchOr { + range: 166..174, + patterns: [ + MatchStar( + PatternMatchStar { + range: 166..170, + name: Some( + Identifier { + id: "foo", + range: 167..170, + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 173..174, + value: NumberLiteral( + ExprNumberLiteral { + range: 173..174, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 184..188, + }, + ), + ], + }, + MatchCase { + range: 193..220, + pattern: MatchOr( + PatternMatchOr { + range: 198..206, + patterns: [ + MatchValue( + PatternMatchValue { + range: 198..199, + value: NumberLiteral( + ExprNumberLiteral { + range: 198..199, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchStar( + PatternMatchStar { + range: 202..206, + name: Some( + Identifier { + id: "foo", + range: 203..206, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 216..220, + }, + ), + ], + }, + MatchCase { + range: 225..251, + pattern: MatchClass( + PatternMatchClass { + range: 230..237, + cls: Name( + ExprName { + range: 230..233, + id: "Foo", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 233..237, + patterns: [ + MatchStar( + PatternMatchStar { + range: 234..236, + name: None, + }, + ), + ], + keywords: [], + }, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 247..251, + }, + ), + ], + }, + MatchCase { + range: 256..284, + pattern: MatchClass( + PatternMatchClass { + range: 261..270, + cls: Name( + ExprName { + range: 261..264, + id: "Foo", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 264..270, + patterns: [], + keywords: [ + PatternKeyword { + range: 265..269, + attr: Identifier { + id: "x", + range: 265..266, + }, + pattern: MatchStar( + PatternMatchStar { + range: 267..269, + name: None, + }, + ), + }, + ], + }, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 280..284, + }, + ), + ], + }, + MatchCase { + range: 289..312, + pattern: MatchMapping( + PatternMatchMapping { + range: 294..298, + keys: [ + Starred( + ExprStarred { + range: 295..297, + value: Name( + ExprName { + range: 296..297, + id: "_", + ctx: Store, + }, + ), + ctx: Store, + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 297..297, + value: Name( + ExprName { + range: 297..297, + id: "", + ctx: Invalid, + }, + ), + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 308..312, + }, + ), + ], + }, + MatchCase { + range: 317..343, + pattern: MatchMapping( + PatternMatchMapping { + range: 322..329, + keys: [ + Starred( + ExprStarred { + range: 323..325, + value: Name( + ExprName { + range: 324..325, + id: "_", + ctx: Store, + }, + ), + ctx: Store, + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 327..328, + value: NumberLiteral( + ExprNumberLiteral { + range: 327..328, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 339..343, + }, + ), + ], + }, + MatchCase { + range: 348..377, + pattern: MatchMapping( + PatternMatchMapping { + range: 353..363, + keys: [ + NoneLiteral( + ExprNoneLiteral { + range: 354..358, + }, + ), + ], + patterns: [ + MatchStar( + PatternMatchStar { + range: 360..362, + name: None, + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 373..377, + }, + ), + ], + }, + MatchCase { + range: 382..407, + pattern: MatchValue( + PatternMatchValue { + range: 387..393, + value: BinOp( + ExprBinOp { + range: 387..393, + left: NumberLiteral( + ExprNumberLiteral { + range: 387..388, + value: Int( + 1, + ), + }, + ), + op: Add, + right: Starred( + ExprStarred { + range: 391..393, + value: Name( + ExprName { + range: 392..393, + id: "_", + ctx: Store, + }, + ), + ctx: Store, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 403..407, + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Star pattern is only allowed inside a sequence pattern +2 | match subject: +3 | case *_: + | ^^ Syntax Error: Star pattern cannot be used here +4 | pass +5 | case *_ as x: + | + + + | +3 | case *_: +4 | pass +5 | case *_ as x: + | ^^ Syntax Error: Star pattern cannot be used here +6 | pass +7 | case *foo: + | + + + | +5 | case *_ as x: +6 | pass +7 | case *foo: + | ^^^^ Syntax Error: Star pattern cannot be used here +8 | pass +9 | case *foo | 1: + | + + + | + 7 | case *foo: + 8 | pass + 9 | case *foo | 1: + | ^^^^ Syntax Error: Star pattern cannot be used here +10 | pass +11 | case 1 | *foo: + | + + + | + 9 | case *foo | 1: +10 | pass +11 | case 1 | *foo: + | ^^^^ Syntax Error: Star pattern cannot be used here +12 | pass +13 | case Foo(*_): + | + + + | +11 | case 1 | *foo: +12 | pass +13 | case Foo(*_): + | ^^ Syntax Error: Star pattern cannot be used here +14 | pass +15 | case Foo(x=*_): + | + + + | +13 | case Foo(*_): +14 | pass +15 | case Foo(x=*_): + | ^^ Syntax Error: Star pattern cannot be used here +16 | pass +17 | case {*_}: + | + + + | +15 | case Foo(x=*_): +16 | pass +17 | case {*_}: + | ^^ Syntax Error: Star pattern cannot be used here +18 | pass +19 | case {*_: 1}: + | + + + | +15 | case Foo(x=*_): +16 | pass +17 | case {*_}: + | ^ Syntax Error: Expected ':', found '}' +18 | pass +19 | case {*_: 1}: + | + + + | +17 | case {*_}: +18 | pass +19 | case {*_: 1}: + | ^^ Syntax Error: Star pattern cannot be used here +20 | pass +21 | case {None: *_}: + | + + + | +19 | case {*_: 1}: +20 | pass +21 | case {None: *_}: + | ^^ Syntax Error: Star pattern cannot be used here +22 | pass +23 | case 1 + *_: + | + + + | +21 | case {None: *_}: +22 | pass +23 | case 1 + *_: + | ^^ Syntax Error: Star pattern cannot be used here +24 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__unary_add_usage.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__unary_add_usage.py.snap new file mode 100644 index 0000000000..b17e7f476e --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__unary_add_usage.py.snap @@ -0,0 +1,398 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/match/unary_add_usage.py +--- +## AST + +``` +Module( + ModModule { + range: 0..269, + body: [ + Match( + StmtMatch { + range: 74..268, + subject: Name( + ExprName { + range: 80..87, + id: "subject", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 93..114, + pattern: MatchValue( + PatternMatchValue { + range: 98..100, + value: UnaryOp( + ExprUnaryOp { + range: 98..100, + op: UAdd, + operand: NumberLiteral( + ExprNumberLiteral { + range: 99..100, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 110..114, + }, + ), + ], + }, + MatchCase { + range: 119..149, + pattern: MatchOr( + PatternMatchOr { + range: 124..135, + patterns: [ + MatchValue( + PatternMatchValue { + range: 124..125, + value: NumberLiteral( + ExprNumberLiteral { + range: 124..125, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 128..130, + value: UnaryOp( + ExprUnaryOp { + range: 128..130, + op: UAdd, + operand: NumberLiteral( + ExprNumberLiteral { + range: 129..130, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 133..135, + value: UnaryOp( + ExprUnaryOp { + range: 133..135, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 134..135, + value: Int( + 3, + ), + }, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 145..149, + }, + ), + ], + }, + MatchCase { + range: 154..184, + pattern: MatchSequence( + PatternMatchSequence { + range: 159..170, + patterns: [ + MatchValue( + PatternMatchValue { + range: 160..161, + value: NumberLiteral( + ExprNumberLiteral { + range: 160..161, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 163..165, + value: UnaryOp( + ExprUnaryOp { + range: 163..165, + op: UAdd, + operand: NumberLiteral( + ExprNumberLiteral { + range: 164..165, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 167..169, + value: UnaryOp( + ExprUnaryOp { + range: 167..169, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 168..169, + value: Int( + 3, + ), + }, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 180..184, + }, + ), + ], + }, + MatchCase { + range: 189..223, + pattern: MatchClass( + PatternMatchClass { + range: 194..209, + cls: Name( + ExprName { + range: 194..197, + id: "Foo", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 197..209, + patterns: [], + keywords: [ + PatternKeyword { + range: 198..202, + attr: Identifier { + id: "x", + range: 198..199, + }, + pattern: MatchValue( + PatternMatchValue { + range: 200..202, + value: UnaryOp( + ExprUnaryOp { + range: 200..202, + op: UAdd, + operand: NumberLiteral( + ExprNumberLiteral { + range: 201..202, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + }, + PatternKeyword { + range: 204..208, + attr: Identifier { + id: "y", + range: 204..205, + }, + pattern: MatchValue( + PatternMatchValue { + range: 206..208, + value: UnaryOp( + ExprUnaryOp { + range: 206..208, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 207..208, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + }, + ], + }, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 219..223, + }, + ), + ], + }, + MatchCase { + range: 228..268, + pattern: MatchMapping( + PatternMatchMapping { + range: 233..254, + keys: [ + BooleanLiteral( + ExprBooleanLiteral { + range: 234..238, + value: true, + }, + ), + BooleanLiteral( + ExprBooleanLiteral { + range: 244..249, + value: false, + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 240..242, + value: UnaryOp( + ExprUnaryOp { + range: 240..242, + op: UAdd, + operand: NumberLiteral( + ExprNumberLiteral { + range: 241..242, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 251..253, + value: UnaryOp( + ExprUnaryOp { + range: 251..253, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 252..253, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 264..268, + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # Unary addition isn't allowed but we parse it for better error recovery. +2 | match subject: +3 | case +1: + | ^^ Syntax Error: Unary '+' is not allowed as a literal pattern +4 | pass +5 | case 1 | +2 | -3: + | + + + | +3 | case +1: +4 | pass +5 | case 1 | +2 | -3: + | ^^ Syntax Error: Unary '+' is not allowed as a literal pattern +6 | pass +7 | case [1, +2, -3]: + | + + + | +5 | case 1 | +2 | -3: +6 | pass +7 | case [1, +2, -3]: + | ^^ Syntax Error: Unary '+' is not allowed as a literal pattern +8 | pass +9 | case Foo(x=+1, y=-2): + | + + + | + 7 | case [1, +2, -3]: + 8 | pass + 9 | case Foo(x=+1, y=-2): + | ^^ Syntax Error: Unary '+' is not allowed as a literal pattern +10 | pass +11 | case {True: +1, False: -2}: + | + + + | + 9 | case Foo(x=+1, y=-2): +10 | pass +11 | case {True: +1, False: -2}: + | ^^ Syntax Error: Unary '+' is not allowed as a literal pattern +12 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__ambiguous_lpar_with_items.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__ambiguous_lpar_with_items.py.snap new file mode 100644 index 0000000000..92b3a5916b --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__ambiguous_lpar_with_items.py.snap @@ -0,0 +1,1594 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/with/ambiguous_lpar_with_items.py +--- +## AST + +``` +Module( + ModModule { + range: 0..950, + body: [ + With( + StmtWith { + range: 163..188, + is_async: false, + items: [ + WithItem { + range: 168..182, + context_expr: Tuple( + ExprTuple { + range: 168..182, + elts: [ + Name( + ExprName { + range: 169..174, + id: "item1", + ctx: Load, + }, + ), + Name( + ExprName { + range: 176..181, + id: "item2", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 185..188, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 185..188, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 189..219, + is_async: false, + items: [ + WithItem { + range: 194..208, + context_expr: Tuple( + ExprTuple { + range: 194..208, + elts: [ + Name( + ExprName { + range: 195..200, + id: "item1", + ctx: Load, + }, + ), + Name( + ExprName { + range: 202..207, + id: "item2", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + WithItem { + range: 213..214, + context_expr: Name( + ExprName { + range: 213..214, + id: "f", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 216..219, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 216..219, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 220..252, + is_async: false, + items: [ + WithItem { + range: 225..239, + context_expr: Tuple( + ExprTuple { + range: 225..239, + elts: [ + Name( + ExprName { + range: 226..231, + id: "item1", + ctx: Load, + }, + ), + Name( + ExprName { + range: 233..238, + id: "item2", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + WithItem { + range: 241..246, + context_expr: Name( + ExprName { + range: 241..246, + id: "item3", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 249..252, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 249..252, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 253..270, + is_async: false, + items: [ + WithItem { + range: 258..265, + context_expr: Starred( + ExprStarred { + range: 259..264, + value: Name( + ExprName { + range: 260..264, + id: "item", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 267..270, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 267..270, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 271..293, + is_async: false, + items: [ + WithItem { + range: 276..288, + context_expr: Starred( + ExprStarred { + range: 277..282, + value: Name( + ExprName { + range: 278..282, + id: "item", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 287..288, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 290..293, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 290..293, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 294..321, + is_async: false, + items: [ + WithItem { + range: 300..315, + context_expr: Named( + ExprNamed { + range: 300..310, + target: Name( + ExprName { + range: 300..304, + id: "item", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 308..310, + value: Int( + 10, + ), + }, + ), + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 314..315, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 318..321, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 318..321, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 322..357, + is_async: false, + items: [ + WithItem { + range: 328..333, + context_expr: Name( + ExprName { + range: 328..333, + id: "item1", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 335..351, + context_expr: Named( + ExprNamed { + range: 335..346, + target: Name( + ExprName { + range: 335..340, + id: "item2", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 344..346, + value: Int( + 10, + ), + }, + ), + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 350..351, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 354..357, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 354..357, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 358..396, + is_async: false, + items: [ + WithItem { + range: 364..384, + context_expr: Generator( + ExprGenerator { + range: 364..384, + elt: Name( + ExprName { + range: 364..365, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 366..384, + target: Name( + ExprName { + range: 370..371, + id: "x", + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 375..384, + func: Name( + ExprName { + range: 375..380, + id: "range", + ctx: Load, + }, + ), + arguments: Arguments { + range: 380..384, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 381..383, + value: Int( + 10, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: false, + }, + ), + optional_vars: None, + }, + WithItem { + range: 386..390, + context_expr: Name( + ExprName { + range: 386..390, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 393..396, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 393..396, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 397..435, + is_async: false, + items: [ + WithItem { + range: 403..407, + context_expr: Name( + ExprName { + range: 403..407, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 409..429, + context_expr: Generator( + ExprGenerator { + range: 409..429, + elt: Name( + ExprName { + range: 409..410, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 411..429, + target: Name( + ExprName { + range: 415..416, + id: "x", + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 420..429, + func: Name( + ExprName { + range: 420..425, + id: "range", + ctx: Load, + }, + ), + arguments: Arguments { + range: 425..429, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 426..428, + value: Int( + 10, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: false, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 432..435, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 432..435, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 496..515, + is_async: false, + items: [ + WithItem { + range: 502..509, + context_expr: Starred( + ExprStarred { + range: 503..508, + value: Name( + ExprName { + range: 504..508, + id: "item", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 512..515, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 512..515, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 517..551, + is_async: false, + items: [ + WithItem { + range: 523..539, + context_expr: Generator( + ExprGenerator { + range: 523..539, + elt: Starred( + ExprStarred { + range: 523..525, + value: Name( + ExprName { + range: 524..525, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 526..539, + target: Name( + ExprName { + range: 530..531, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 535..539, + id: "iter", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: false, + }, + ), + optional_vars: None, + }, + WithItem { + range: 541..545, + context_expr: Name( + ExprName { + range: 541..545, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 548..551, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 548..551, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 552..594, + is_async: false, + items: [ + WithItem { + range: 558..563, + context_expr: Name( + ExprName { + range: 558..563, + id: "item1", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 565..581, + context_expr: Generator( + ExprGenerator { + range: 565..581, + elt: Starred( + ExprStarred { + range: 565..567, + value: Name( + ExprName { + range: 566..567, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 568..581, + target: Name( + ExprName { + range: 572..573, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 577..581, + id: "iter", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: false, + }, + ), + optional_vars: None, + }, + WithItem { + range: 583..588, + context_expr: Name( + ExprName { + range: 583..588, + id: "item2", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 591..594, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 591..594, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 595..617, + is_async: false, + items: [ + WithItem { + range: 601..607, + context_expr: Name( + ExprName { + range: 601..602, + id: "x", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 606..607, + id: "f", + ctx: Store, + }, + ), + ), + }, + WithItem { + range: 609..611, + context_expr: Starred( + ExprStarred { + range: 609..611, + value: Name( + ExprName { + range: 610..611, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 614..617, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 614..617, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 618..640, + is_async: false, + items: [ + WithItem { + range: 624..626, + context_expr: Starred( + ExprStarred { + range: 624..626, + value: Name( + ExprName { + range: 625..626, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 628..634, + context_expr: Name( + ExprName { + range: 628..629, + id: "y", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 633..634, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 637..640, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 637..640, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 641..663, + is_async: false, + items: [ + WithItem { + range: 646..658, + context_expr: Tuple( + ExprTuple { + range: 646..658, + elts: [ + Name( + ExprName { + range: 647..648, + id: "x", + ctx: Load, + }, + ), + Yield( + ExprYield { + range: 650..657, + value: Some( + Name( + ExprName { + range: 656..657, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 660..663, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 660..663, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 664..689, + is_async: false, + items: [ + WithItem { + range: 669..684, + context_expr: Tuple( + ExprTuple { + range: 669..684, + elts: [ + Name( + ExprName { + range: 670..671, + id: "x", + ctx: Load, + }, + ), + Yield( + ExprYield { + range: 673..683, + value: Some( + Tuple( + ExprTuple { + range: 679..683, + elts: [ + Name( + ExprName { + range: 679..680, + id: "y", + ctx: Load, + }, + ), + Name( + ExprName { + range: 682..683, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 686..689, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 686..689, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 690..717, + is_async: false, + items: [ + WithItem { + range: 695..712, + context_expr: Tuple( + ExprTuple { + range: 695..712, + elts: [ + Name( + ExprName { + range: 696..697, + id: "x", + ctx: Load, + }, + ), + YieldFrom( + ExprYieldFrom { + range: 699..711, + value: Name( + ExprName { + range: 710..711, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 714..717, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 714..717, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 718..734, + is_async: false, + items: [ + WithItem { + range: 724..730, + context_expr: Name( + ExprName { + range: 724..725, + id: "x", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 729..730, + id: "f", + ctx: Store, + }, + ), + ), + }, + WithItem { + range: 732..733, + context_expr: Name( + ExprName { + range: 732..733, + id: "y", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [], + }, + ), + AnnAssign( + StmtAnnAssign { + range: 738..744, + target: Name( + ExprName { + range: 738..739, + id: "f", + ctx: Store, + }, + ), + annotation: EllipsisLiteral( + ExprEllipsisLiteral { + range: 741..744, + }, + ), + value: None, + simple: true, + }, + ), + With( + StmtWith { + range: 745..777, + is_async: false, + items: [ + WithItem { + range: 751..771, + context_expr: Generator( + ExprGenerator { + range: 751..766, + elt: Name( + ExprName { + range: 751..752, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 753..766, + target: Name( + ExprName { + range: 757..758, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 762..766, + id: "iter", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: false, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 770..771, + id: "y", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 774..777, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 774..777, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 837..854, + is_async: false, + items: [ + WithItem { + range: 843..853, + context_expr: Name( + ExprName { + range: 844..848, + id: "item", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 852..853, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [], + }, + ), + Expr( + StmtExpr { + range: 857..860, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 857..860, + }, + ), + }, + ), + With( + StmtWith { + range: 862..878, + is_async: false, + items: [ + WithItem { + range: 868..877, + context_expr: Name( + ExprName { + range: 868..872, + id: "item", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 876..877, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [], + }, + ), + AnnAssign( + StmtAnnAssign { + range: 880..886, + target: Name( + ExprName { + range: 880..881, + id: "x", + ctx: Store, + }, + ), + annotation: EllipsisLiteral( + ExprEllipsisLiteral { + range: 883..886, + }, + ), + value: None, + simple: true, + }, + ), + With( + StmtWith { + range: 887..904, + is_async: false, + items: [ + WithItem { + range: 893..903, + context_expr: Name( + ExprName { + range: 893..897, + id: "item", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 901..903, + id: "f1", + ctx: Store, + }, + ), + ), + }, + ], + body: [], + }, + ), + AnnAssign( + StmtAnnAssign { + range: 908..915, + target: Name( + ExprName { + range: 908..910, + id: "f2", + ctx: Store, + }, + ), + annotation: EllipsisLiteral( + ExprEllipsisLiteral { + range: 912..915, + }, + ), + value: None, + simple: true, + }, + ), + With( + StmtWith { + range: 916..950, + is_async: false, + items: [ + WithItem { + range: 922..932, + context_expr: Name( + ExprName { + range: 922..927, + id: "item1", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 931..932, + id: "f", + ctx: Store, + }, + ), + ), + }, + WithItem { + range: 934..944, + context_expr: Named( + ExprNamed { + range: 934..944, + target: Name( + ExprName { + range: 934..939, + id: "item2", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 943..944, + value: Int( + 0, + ), + }, + ), + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 947..950, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 947..950, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +2 | # These cases should raise the correct syntax error and recover properly. +3 | +4 | with (item1, item2),: ... + | ^ Syntax Error: Expected an expression +5 | with (item1, item2), as f: ... +6 | with (item1, item2), item3,: ... + | + + + | +4 | with (item1, item2),: ... +5 | with (item1, item2), as f: ... + | ^^ Syntax Error: Expected an expression +6 | with (item1, item2), item3,: ... +7 | with (*item): ... + | + + + | +4 | with (item1, item2),: ... +5 | with (item1, item2), as f: ... +6 | with (item1, item2), item3,: ... + | ^ Syntax Error: Trailing comma not allowed +7 | with (*item): ... +8 | with (*item) as f: ... + | + + + | +5 | with (item1, item2), as f: ... +6 | with (item1, item2), item3,: ... +7 | with (*item): ... + | ^^^^^ Syntax Error: Starred expression cannot be used here +8 | with (*item) as f: ... +9 | with (item := 10 as f): ... + | + + + | + 6 | with (item1, item2), item3,: ... + 7 | with (*item): ... + 8 | with (*item) as f: ... + | ^^^^^ Syntax Error: Starred expression cannot be used here + 9 | with (item := 10 as f): ... +10 | with (item1, item2 := 10 as f): ... + | + + + | + 7 | with (*item): ... + 8 | with (*item) as f: ... + 9 | with (item := 10 as f): ... + | ^^^^^^^^^^ Syntax Error: Unparenthesized named expression cannot be used here +10 | with (item1, item2 := 10 as f): ... +11 | with (x for x in range(10), item): ... + | + + + | + 8 | with (*item) as f: ... + 9 | with (item := 10 as f): ... +10 | with (item1, item2 := 10 as f): ... + | ^^^^^^^^^^^ Syntax Error: Unparenthesized named expression cannot be used here +11 | with (x for x in range(10), item): ... +12 | with (item, x for x in range(10)): ... + | + + + | + 9 | with (item := 10 as f): ... +10 | with (item1, item2 := 10 as f): ... +11 | with (x for x in range(10), item): ... + | ^^^^^^^^^^^^^^^^^^^^ Syntax Error: Unparenthesized generator expression cannot be used here +12 | with (item, x for x in range(10)): ... + | + + + | +10 | with (item1, item2 := 10 as f): ... +11 | with (x for x in range(10), item): ... +12 | with (item, x for x in range(10)): ... + | ^^^^^^^^^^^^^^^^^^^^ Syntax Error: Unparenthesized generator expression cannot be used here +13 | +14 | # Make sure the parser doesn't report the same error twice + | + + + | +14 | # Make sure the parser doesn't report the same error twice +15 | with ((*item)): ... + | ^^^^^ Syntax Error: Starred expression cannot be used here +16 | +17 | with (*x for x in iter, item): ... + | + + + | +15 | with ((*item)): ... +16 | +17 | with (*x for x in iter, item): ... + | ^^ Syntax Error: Iterable unpacking cannot be used in a comprehension +18 | with (item1, *x for x in iter, item2): ... +19 | with (x as f, *y): ... + | + + + | +17 | with (*x for x in iter, item): ... +18 | with (item1, *x for x in iter, item2): ... + | ^^ Syntax Error: Iterable unpacking cannot be used in a comprehension +19 | with (x as f, *y): ... +20 | with (*x, y as f): ... + | + + + | +17 | with (*x for x in iter, item): ... +18 | with (item1, *x for x in iter, item2): ... +19 | with (x as f, *y): ... + | ^^ Syntax Error: Starred expression cannot be used here +20 | with (*x, y as f): ... +21 | with (x, yield y): ... + | + + + | +18 | with (item1, *x for x in iter, item2): ... +19 | with (x as f, *y): ... +20 | with (*x, y as f): ... + | ^^ Syntax Error: Starred expression cannot be used here +21 | with (x, yield y): ... +22 | with (x, yield y, z): ... + | + + + | +19 | with (x as f, *y): ... +20 | with (*x, y as f): ... +21 | with (x, yield y): ... + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +22 | with (x, yield y, z): ... +23 | with (x, yield from y): ... + | + + + | +20 | with (*x, y as f): ... +21 | with (x, yield y): ... +22 | with (x, yield y, z): ... + | ^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +23 | with (x, yield from y): ... +24 | with (x as f, y) as f: ... + | + + + | +21 | with (x, yield y): ... +22 | with (x, yield y, z): ... +23 | with (x, yield from y): ... + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +24 | with (x as f, y) as f: ... +25 | with (x for x in iter as y): ... + | + + + | +22 | with (x, yield y, z): ... +23 | with (x, yield from y): ... +24 | with (x as f, y) as f: ... + | ^^ Syntax Error: Expected ':', found 'as' +25 | with (x for x in iter as y): ... + | + + + | +23 | with (x, yield from y): ... +24 | with (x as f, y) as f: ... +25 | with (x for x in iter as y): ... + | ^^^^^^^^^^^^^^^ Syntax Error: Unparenthesized generator expression cannot be used here +26 | +27 | # The inner `(...)` is parsed as parenthesized expression + | + + + | +27 | # The inner `(...)` is parsed as parenthesized expression +28 | with ((item as f)): ... + | ^^ Syntax Error: Expected ')', found 'as' +29 | +30 | with (item as f), x: ... + | + + + | +27 | # The inner `(...)` is parsed as parenthesized expression +28 | with ((item as f)): ... + | ^ Syntax Error: Expected ':', found ')' +29 | +30 | with (item as f), x: ... + | + + + | +27 | # The inner `(...)` is parsed as parenthesized expression +28 | with ((item as f)): ... + | ^ Syntax Error: Expected a statement +29 | +30 | with (item as f), x: ... + | + + + | +28 | with ((item as f)): ... +29 | +30 | with (item as f), x: ... + | ^ Syntax Error: Expected ':', found ',' +31 | with (item as f1) as f2: ... +32 | with (item1 as f, item2 := 0): ... + | + + + | +30 | with (item as f), x: ... +31 | with (item as f1) as f2: ... + | ^^ Syntax Error: Expected ':', found 'as' +32 | with (item1 as f, item2 := 0): ... + | + + + | +30 | with (item as f), x: ... +31 | with (item as f1) as f2: ... +32 | with (item1 as f, item2 := 0): ... + | ^^^^^^^^^^ Syntax Error: Unparenthesized named expression cannot be used here + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__empty_with_items.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__empty_with_items.py.snap new file mode 100644 index 0000000000..643131e041 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__empty_with_items.py.snap @@ -0,0 +1,69 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/with/empty_with_items.py +--- +## AST + +``` +Module( + ModModule { + range: 0..105, + body: [ + With( + StmtWith { + range: 88..98, + is_async: false, + items: [], + body: [ + Expr( + StmtExpr { + range: 95..98, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 95..98, + }, + ), + }, + ), + ], + }, + ), + Expr( + StmtExpr { + range: 100..105, + value: BinOp( + ExprBinOp { + range: 100..105, + left: Name( + ExprName { + range: 100..101, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 104..105, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +2 | # The parser should recover from this syntax error. +3 | +4 | with : ... + | ^ Syntax Error: Expected the start of an expression after `with` keyword +5 | +6 | x + y + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar.py.snap new file mode 100644 index 0000000000..c9ee426b17 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar.py.snap @@ -0,0 +1,75 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar.py +--- +## AST + +``` +Module( + ModModule { + range: 0..14, + body: [ + With( + StmtWith { + range: 0..14, + is_async: false, + items: [ + WithItem { + range: 6..6, + context_expr: Name( + ExprName { + range: 6..6, + id: "", + ctx: Invalid, + }, + ), + optional_vars: None, + }, + WithItem { + range: 9..14, + context_expr: BinOp( + ExprBinOp { + range: 9..14, + left: Name( + ExprName { + range: 9..10, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 13..14, + id: "y", + ctx: Load, + }, + ), + }, + ), + optional_vars: None, + }, + ], + body: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | with (: + | ^ Syntax Error: Expected an expression +2 | +3 | x + y + | + + + | +1 | with (: +2 | +3 | x + y + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar_eof.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar_eof.py.snap new file mode 100644 index 0000000000..64e5045ad0 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar_eof.py.snap @@ -0,0 +1,41 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar_eof.py +--- +## AST + +``` +Module( + ModModule { + range: 0..6, + body: [ + With( + StmtWith { + range: 0..6, + is_async: false, + items: [ + WithItem { + range: 6..6, + context_expr: Name( + ExprName { + range: 6..6, + id: "", + ctx: Invalid, + }, + ), + optional_vars: None, + }, + ], + body: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | with ( + | Syntax Error: unexpected EOF while parsing + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unparenthesized_with_items.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unparenthesized_with_items.py.snap new file mode 100644 index 0000000000..cd69d7291a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unparenthesized_with_items.py.snap @@ -0,0 +1,361 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/invalid/statements/with/unparenthesized_with_items.py +--- +## AST + +``` +Module( + ModModule { + range: 0..249, + body: [ + With( + StmtWith { + range: 86..102, + is_async: false, + items: [ + WithItem { + range: 91..95, + context_expr: Name( + ExprName { + range: 91..95, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Pass( + StmtPass { + range: 98..102, + }, + ), + ], + }, + ), + With( + StmtWith { + range: 103..124, + is_async: false, + items: [ + WithItem { + range: 108..117, + context_expr: Name( + ExprName { + range: 108..112, + id: "item", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 116..117, + id: "x", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Pass( + StmtPass { + range: 120..124, + }, + ), + ], + }, + ), + With( + StmtWith { + range: 125..141, + is_async: false, + items: [ + WithItem { + range: 130..135, + context_expr: Starred( + ExprStarred { + range: 130..135, + value: Name( + ExprName { + range: 131..135, + id: "item", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Pass( + StmtPass { + range: 137..141, + }, + ), + ], + }, + ), + With( + StmtWith { + range: 142..163, + is_async: false, + items: [ + WithItem { + range: 147..157, + context_expr: Starred( + ExprStarred { + range: 147..152, + value: Name( + ExprName { + range: 148..152, + id: "item", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 156..157, + id: "x", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Pass( + StmtPass { + range: 159..163, + }, + ), + ], + }, + ), + With( + StmtWith { + range: 164..193, + is_async: false, + items: [ + WithItem { + range: 169..175, + context_expr: Starred( + ExprStarred { + range: 169..175, + value: Name( + ExprName { + range: 170..175, + id: "item1", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 177..187, + context_expr: Name( + ExprName { + range: 177..182, + id: "item2", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 186..187, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Pass( + StmtPass { + range: 189..193, + }, + ), + ], + }, + ), + With( + StmtWith { + range: 194..223, + is_async: false, + items: [ + WithItem { + range: 199..209, + context_expr: Name( + ExprName { + range: 199..204, + id: "item1", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 208..209, + id: "f", + ctx: Store, + }, + ), + ), + }, + WithItem { + range: 211..217, + context_expr: Starred( + ExprStarred { + range: 211..217, + value: Name( + ExprName { + range: 212..217, + id: "item2", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Pass( + StmtPass { + range: 219..223, + }, + ), + ], + }, + ), + With( + StmtWith { + range: 224..249, + is_async: false, + items: [ + WithItem { + range: 229..233, + context_expr: Name( + ExprName { + range: 229..233, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 237..243, + context_expr: NumberLiteral( + ExprNumberLiteral { + range: 237..238, + value: Int( + 0, + ), + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 242..243, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Pass( + StmtPass { + range: 245..249, + }, + ), + ], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | # For parenthesized with items test cases, refer to `./ambiguous_lpar_with_items.py` +2 | +3 | with item,: pass + | ^ Syntax Error: Trailing comma not allowed +4 | with item as x,: pass +5 | with *item: pass + | + + + | +3 | with item,: pass +4 | with item as x,: pass + | ^ Syntax Error: Trailing comma not allowed +5 | with *item: pass +6 | with *item as x: pass + | + + + | +3 | with item,: pass +4 | with item as x,: pass +5 | with *item: pass + | ^^^^^ Syntax Error: Starred expression cannot be used here +6 | with *item as x: pass +7 | with *item1, item2 as f: pass + | + + + | +4 | with item as x,: pass +5 | with *item: pass +6 | with *item as x: pass + | ^^^^^ Syntax Error: Starred expression cannot be used here +7 | with *item1, item2 as f: pass +8 | with item1 as f, *item2: pass + | + + + | +5 | with *item: pass +6 | with *item as x: pass +7 | with *item1, item2 as f: pass + | ^^^^^^ Syntax Error: Starred expression cannot be used here +8 | with item1 as f, *item2: pass +9 | with item := 0 as f: pass + | + + + | +6 | with *item as x: pass +7 | with *item1, item2 as f: pass +8 | with item1 as f, *item2: pass + | ^^^^^^ Syntax Error: Starred expression cannot be used here +9 | with item := 0 as f: pass + | + + + | +7 | with *item1, item2 as f: pass +8 | with item1 as f, *item2: pass +9 | with item := 0 as f: pass + | ^^ Syntax Error: Expected ',', found ':=' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_invalid_order.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_invalid_order.py.snap new file mode 100644 index 0000000000..76f082556d --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_invalid_order.py.snap @@ -0,0 +1,83 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/try_stmt_invalid_order.py +--- +## AST + +``` +Module( + ModModule { + range: 0..47, + body: [ + Try( + StmtTry { + range: 0..31, + body: [ + Pass( + StmtPass { + range: 9..13, + }, + ), + ], + handlers: [], + orelse: [], + finalbody: [ + Pass( + StmtPass { + range: 27..31, + }, + ), + ], + is_star: false, + }, + ), + Pass( + StmtPass { + range: 42..46, + }, + ), + ], + }, +) +``` +## Errors + + | +3 | finally: +4 | pass +5 | else: + | ^^^^ Syntax Error: `else` block must come before `finally` block +6 | pass + | + + + | +3 | finally: +4 | pass +5 | else: + | ^ Syntax Error: Expected a statement +6 | pass + | + + + | +3 | finally: +4 | pass +5 | else: + | ^ Syntax Error: Expected a statement +6 | pass + | + + + | +4 | pass +5 | else: +6 | pass + | ^^^^ Syntax Error: Unexpected indentation + | + + + | +5 | else: +6 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_missing_except_finally.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_missing_except_finally.py.snap new file mode 100644 index 0000000000..7ed9614848 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_missing_except_finally.py.snap @@ -0,0 +1,69 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/try_stmt_missing_except_finally.py +--- +## AST + +``` +Module( + ModModule { + range: 0..43, + body: [ + Try( + StmtTry { + range: 0..13, + body: [ + Pass( + StmtPass { + range: 9..13, + }, + ), + ], + handlers: [], + orelse: [], + finalbody: [], + is_star: false, + }, + ), + Try( + StmtTry { + range: 14..42, + body: [ + Pass( + StmtPass { + range: 23..27, + }, + ), + ], + handlers: [], + orelse: [ + Pass( + StmtPass { + range: 38..42, + }, + ), + ], + finalbody: [], + is_star: false, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | try: +2 | pass +3 | try: + | ^^^ Syntax Error: Expected `except` or `finally` after `try` block +4 | pass +5 | else: + | + + + | +5 | else: +6 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_misspelled_except.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_misspelled_except.py.snap new file mode 100644 index 0000000000..7b73799637 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_misspelled_except.py.snap @@ -0,0 +1,272 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/try_stmt_misspelled_except.py +--- +## AST + +``` +Module( + ModModule { + range: 0..165, + body: [ + Try( + StmtTry { + range: 0..13, + body: [ + Pass( + StmtPass { + range: 9..13, + }, + ), + ], + handlers: [], + orelse: [], + finalbody: [], + is_star: false, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 14..20, + target: Name( + ExprName { + range: 14..19, + id: "exept", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 20..20, + id: "", + ctx: Invalid, + }, + ), + value: None, + simple: true, + }, + ), + Pass( + StmtPass { + range: 54..58, + }, + ), + Pass( + StmtPass { + range: 72..76, + }, + ), + Assign( + StmtAssign { + range: 77..82, + targets: [ + Name( + ExprName { + range: 77..78, + id: "a", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 81..82, + value: Int( + 1, + ), + }, + ), + }, + ), + Try( + StmtTry { + range: 83..113, + body: [ + Pass( + StmtPass { + range: 92..96, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 97..113, + type_: None, + name: None, + body: [ + Pass( + StmtPass { + range: 109..113, + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: false, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 114..120, + target: Name( + ExprName { + range: 114..119, + id: "exept", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 120..120, + id: "", + ctx: Invalid, + }, + ), + value: None, + simple: true, + }, + ), + Pass( + StmtPass { + range: 154..158, + }, + ), + Assign( + StmtAssign { + range: 159..164, + targets: [ + Name( + ExprName { + range: 159..160, + id: "b", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 163..164, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | try: +2 | pass +3 | exept: # spellchecker:disable-line + | ^^^^^ Syntax Error: Expected `except` or `finally` after `try` block +4 | pass +5 | finally: + | + + + | +1 | try: +2 | pass +3 | exept: # spellchecker:disable-line + | ^ Syntax Error: Expected an expression +4 | pass +5 | finally: +6 | pass + | + + + | +2 | pass +3 | exept: # spellchecker:disable-line +4 | pass + | ^^^^ Syntax Error: Unexpected indentation +5 | finally: +6 | pass + | + + + | +3 | exept: # spellchecker:disable-line +4 | pass +5 | finally: + | Syntax Error: Expected a statement +6 | pass +7 | a = 1 + | + + + | +3 | exept: # spellchecker:disable-line +4 | pass +5 | finally: + | ^ Syntax Error: Expected a statement +6 | pass +7 | a = 1 + | + + + | +3 | exept: # spellchecker:disable-line +4 | pass +5 | finally: + | ^ Syntax Error: Expected a statement +6 | pass +7 | a = 1 +8 | try: + | + + + | +4 | pass +5 | finally: +6 | pass + | ^^^^ Syntax Error: Unexpected indentation +7 | a = 1 +8 | try: + | + + + | +5 | finally: +6 | pass +7 | a = 1 + | Syntax Error: Expected a statement +8 | try: +9 | pass + | + + + | +10 | except: +11 | pass +12 | exept: # spellchecker:disable-line + | ^ Syntax Error: Expected an expression +13 | pass +14 | b = 1 + | + + + | +11 | pass +12 | exept: # spellchecker:disable-line +13 | pass + | ^^^^ Syntax Error: Unexpected indentation +14 | b = 1 + | + + + | +12 | exept: # spellchecker:disable-line +13 | pass +14 | b = 1 + | Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_incomplete_stmt.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_incomplete_stmt.py.snap new file mode 100644 index 0000000000..485b07c4d2 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_incomplete_stmt.py.snap @@ -0,0 +1,87 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/type_alias_incomplete_stmt.py +--- +## AST + +``` +Module( + ModModule { + range: 0..21, + body: [ + Expr( + StmtExpr { + range: 0..4, + value: Name( + ExprName { + range: 0..4, + id: "type", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5..9, + value: Name( + ExprName { + range: 5..9, + id: "type", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 10..11, + value: Name( + ExprName { + range: 10..11, + id: "x", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 12..20, + name: Name( + ExprName { + range: 17..18, + id: "x", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 20..20, + id: "", + ctx: Invalid, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | type +2 | type x + | ^ Syntax Error: Simple statements must be separated by newlines or semicolons +3 | type x = + | + + + | +1 | type +2 | type x +3 | type x = + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_invalid_value_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_invalid_value_expr.py.snap new file mode 100644 index 0000000000..35bdc09184 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_invalid_value_expr.py.snap @@ -0,0 +1,160 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/type_alias_invalid_value_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..67, + body: [ + TypeAlias( + StmtTypeAlias { + range: 0..11, + name: Name( + ExprName { + range: 5..6, + id: "x", + ctx: Store, + }, + ), + type_params: None, + value: Starred( + ExprStarred { + range: 9..11, + value: Name( + ExprName { + range: 10..11, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 12..28, + name: Name( + ExprName { + range: 17..18, + id: "x", + ctx: Store, + }, + ), + type_params: None, + value: Yield( + ExprYield { + range: 21..28, + value: Some( + Name( + ExprName { + range: 27..28, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 29..50, + name: Name( + ExprName { + range: 34..35, + id: "x", + ctx: Store, + }, + ), + type_params: None, + value: YieldFrom( + ExprYieldFrom { + range: 38..50, + value: Name( + ExprName { + range: 49..50, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 51..61, + name: Name( + ExprName { + range: 56..57, + id: "x", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 60..61, + id: "x", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 65..66, + value: NumberLiteral( + ExprNumberLiteral { + range: 65..66, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | type x = *y + | ^^ Syntax Error: Starred expression cannot be used here +2 | type x = yield y +3 | type x = yield from y + | + + + | +1 | type x = *y +2 | type x = yield y + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | type x = yield from y +4 | type x = x := 1 + | + + + | +1 | type x = *y +2 | type x = yield y +3 | type x = yield from y + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +4 | type x = x := 1 + | + + + | +2 | type x = yield y +3 | type x = yield from y +4 | type x = x := 1 + | ^^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_invalid_bound_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_invalid_bound_expr.py.snap new file mode 100644 index 0000000000..26f5f4a590 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_invalid_bound_expr.py.snap @@ -0,0 +1,253 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/type_param_invalid_bound_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..103, + body: [ + TypeAlias( + StmtTypeAlias { + range: 0..21, + name: Name( + ExprName { + range: 5..6, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 6..15, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 7..14, + name: Identifier { + id: "T", + range: 7..8, + }, + bound: Some( + Starred( + ExprStarred { + range: 10..14, + value: Name( + ExprName { + range: 11..14, + id: "int", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + ], + }, + ), + value: Name( + ExprName { + range: 18..21, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 22..46, + name: Name( + ExprName { + range: 27..28, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 28..40, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 29..39, + name: Identifier { + id: "T", + range: 29..30, + }, + bound: Some( + Yield( + ExprYield { + range: 32..39, + value: Some( + Name( + ExprName { + range: 38..39, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ), + }, + ), + ], + }, + ), + value: Name( + ExprName { + range: 43..46, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 47..76, + name: Name( + ExprName { + range: 52..53, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 53..70, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 54..69, + name: Identifier { + id: "T", + range: 54..55, + }, + bound: Some( + YieldFrom( + ExprYieldFrom { + range: 57..69, + value: Name( + ExprName { + range: 68..69, + id: "x", + ctx: Load, + }, + ), + }, + ), + ), + }, + ), + ], + }, + ), + value: Name( + ExprName { + range: 73..76, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 77..102, + name: Name( + ExprName { + range: 82..83, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 83..96, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 84..88, + name: Identifier { + id: "T", + range: 84..85, + }, + bound: Some( + Name( + ExprName { + range: 87..88, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + TypeVar( + TypeParamTypeVar { + range: 92..95, + name: Identifier { + id: "int", + range: 92..95, + }, + bound: None, + }, + ), + ], + }, + ), + value: Name( + ExprName { + range: 99..102, + id: "int", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | type X[T: *int] = int + | ^^^^ Syntax Error: Starred expression cannot be used here +2 | type X[T: yield x] = int +3 | type X[T: yield from x] = int + | + + + | +1 | type X[T: *int] = int +2 | type X[T: yield x] = int + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | type X[T: yield from x] = int +4 | type X[T: x := int] = int + | + + + | +1 | type X[T: *int] = int +2 | type X[T: yield x] = int +3 | type X[T: yield from x] = int + | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here +4 | type X[T: x := int] = int + | + + + | +2 | type X[T: yield x] = int +3 | type X[T: yield from x] = int +4 | type X[T: x := int] = int + | ^^ Syntax Error: Expected ',', found ':=' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_missing_bound.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_missing_bound.py.snap new file mode 100644 index 0000000000..3a7c95c538 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_missing_bound.py.snap @@ -0,0 +1,111 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/type_param_missing_bound.py +--- +## AST + +``` +Module( + ModModule { + range: 0..41, + body: [ + TypeAlias( + StmtTypeAlias { + range: 0..17, + name: Name( + ExprName { + range: 5..6, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 6..11, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 7..9, + name: Identifier { + id: "T", + range: 7..8, + }, + bound: None, + }, + ), + ], + }, + ), + value: Name( + ExprName { + range: 14..17, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 18..40, + name: Name( + ExprName { + range: 23..24, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 24..34, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 25..28, + name: Identifier { + id: "T1", + range: 25..27, + }, + bound: None, + }, + ), + TypeVar( + TypeParamTypeVar { + range: 31..33, + name: Identifier { + id: "T2", + range: 31..33, + }, + bound: None, + }, + ), + ], + }, + ), + value: Name( + ExprName { + range: 37..40, + id: "int", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | type X[T: ] = int + | ^ Syntax Error: Expected an expression +2 | type X[T1: , T2] = int + | + + + | +1 | type X[T: ] = int +2 | type X[T1: , T2] = int + | ^ Syntax Error: Expected an expression + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_bound.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_bound.py.snap new file mode 100644 index 0000000000..da9817f84c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_bound.py.snap @@ -0,0 +1,92 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/type_param_param_spec_bound.py +--- +## AST + +``` +Module( + ModModule { + range: 0..23, + body: [ + TypeAlias( + StmtTypeAlias { + range: 0..10, + name: Name( + ExprName { + range: 5..6, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 6..10, + type_params: [ + ParamSpec( + TypeParamParamSpec { + range: 7..10, + name: Identifier { + id: "T", + range: 9..10, + }, + }, + ), + ], + }, + ), + value: Name( + ExprName { + range: 10..10, + id: "", + ctx: Invalid, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 12..15, + value: Name( + ExprName { + range: 12..15, + id: "int", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 19..22, + value: Name( + ExprName { + range: 19..22, + id: "int", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | type X[**T: int] = int + | ^ Syntax Error: Expected ']', found ':' + | + + + | +1 | type X[**T: int] = int + | ^ Syntax Error: Expected a statement + | + + + | +1 | type X[**T: int] = int + | ^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_bound.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_bound.py.snap new file mode 100644 index 0000000000..49e65c0cea --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_bound.py.snap @@ -0,0 +1,92 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/type_param_type_var_tuple_bound.py +--- +## AST + +``` +Module( + ModModule { + range: 0..22, + body: [ + TypeAlias( + StmtTypeAlias { + range: 0..9, + name: Name( + ExprName { + range: 5..6, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 6..9, + type_params: [ + TypeVarTuple( + TypeParamTypeVarTuple { + range: 7..9, + name: Identifier { + id: "T", + range: 8..9, + }, + }, + ), + ], + }, + ), + value: Name( + ExprName { + range: 9..9, + id: "", + ctx: Invalid, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 11..14, + value: Name( + ExprName { + range: 11..14, + id: "int", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 18..21, + value: Name( + ExprName { + range: 18..21, + id: "int", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | type X[*T: int] = int + | ^ Syntax Error: Expected ']', found ':' + | + + + | +1 | type X[*T: int] = int + | ^ Syntax Error: Expected a statement + | + + + | +1 | type X[*T: int] = int + | ^ Syntax Error: Expected a statement + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unterminated_fstring_newline_recovery.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unterminated_fstring_newline_recovery.py.snap new file mode 100644 index 0000000000..06cf6d494b --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unterminated_fstring_newline_recovery.py.snap @@ -0,0 +1,385 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/unterminated_fstring_newline_recovery.py +--- +## AST + +``` +Module( + ModModule { + range: 0..67, + body: [ + Expr( + StmtExpr { + range: 0..7, + value: FString( + ExprFString { + range: 0..7, + value: FStringValue { + inner: Single( + FString( + FString { + range: 0..7, + elements: [], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 8..13, + value: BinOp( + ExprBinOp { + range: 8..13, + left: NumberLiteral( + ExprNumberLiteral { + range: 8..9, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 12..13, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 14..24, + value: FString( + ExprFString { + range: 14..24, + value: FStringValue { + inner: Single( + FString( + FString { + range: 14..24, + elements: [ + Literal( + FStringLiteralElement { + range: 16..22, + value: "hello ", + }, + ), + Expression( + FStringExpressionElement { + range: 22..24, + expression: Name( + ExprName { + range: 23..24, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 25..30, + value: BinOp( + ExprBinOp { + range: 25..30, + left: NumberLiteral( + ExprNumberLiteral { + range: 25..26, + value: Int( + 2, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 29..30, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 31..42, + value: FString( + ExprFString { + range: 31..42, + value: FStringValue { + inner: Single( + FString( + FString { + range: 31..42, + elements: [ + Literal( + FStringLiteralElement { + range: 33..39, + value: "hello ", + }, + ), + Expression( + FStringExpressionElement { + range: 39..42, + expression: Name( + ExprName { + range: 40..41, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 43..43, + elements: [], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 43..48, + value: BinOp( + ExprBinOp { + range: 43..48, + left: NumberLiteral( + ExprNumberLiteral { + range: 43..44, + value: Int( + 3, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 47..48, + value: Int( + 3, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 49..60, + value: FString( + ExprFString { + range: 49..60, + value: FStringValue { + inner: Single( + FString( + FString { + range: 49..60, + elements: [ + Literal( + FStringLiteralElement { + range: 51..57, + value: "hello ", + }, + ), + Expression( + FStringExpressionElement { + range: 57..60, + expression: Name( + ExprName { + range: 58..59, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 61..66, + value: BinOp( + ExprBinOp { + range: 61..66, + left: NumberLiteral( + ExprNumberLiteral { + range: 61..62, + value: Int( + 4, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 65..66, + value: Int( + 4, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` +## Errors + + | +1 | f"hello + | ^^^^^ Syntax Error: f-string: unterminated string +2 | 1 + 1 +3 | f"hello {x + | + + + | +1 | f"hello + | ^ Syntax Error: Expected FStringEnd, found newline +2 | 1 + 1 +3 | f"hello {x +4 | 2 + 2 + | + + + | +2 | 1 + 1 +3 | f"hello {x +4 | 2 + 2 + | ^ Syntax Error: f-string: expecting '}' +5 | f"hello {x: +6 | 3 + 3 + | + + + | +3 | f"hello {x +4 | 2 + 2 +5 | f"hello {x: + | ^^ Syntax Error: Simple statements must be separated by newlines or semicolons +6 | 3 + 3 +7 | f"hello {x} + | + + + | +4 | 2 + 2 +5 | f"hello {x: +6 | 3 + 3 + | ^ Syntax Error: Expected an f-string element or the end of the f-string +7 | f"hello {x} +8 | 4 + 4 + | + + + | +5 | f"hello {x: +6 | 3 + 3 +7 | f"hello {x} + | ^^ Syntax Error: Simple statements must be separated by newlines or semicolons +8 | 4 + 4 + | + + + | +5 | f"hello {x: +6 | 3 + 3 +7 | f"hello {x} + | Syntax Error: f-string: unterminated string +8 | 4 + 4 + | + + + | +6 | 3 + 3 +7 | f"hello {x} +8 | 4 + 4 + | ^ Syntax Error: Expected an f-string element or the end of the f-string + | + + + | +7 | f"hello {x} +8 | 4 + 4 + | + + + | +7 | f"hello {x} +8 | 4 + 4 + | + + + | +7 | f"hello {x} +8 | 4 + 4 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@while_stmt_invalid_test_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@while_stmt_invalid_test_expr.py.snap new file mode 100644 index 0000000000..f137f3aa87 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@while_stmt_invalid_test_expr.py.snap @@ -0,0 +1,191 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/while_stmt_invalid_test_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..70, + body: [ + While( + StmtWhile { + range: 0..13, + test: Starred( + ExprStarred { + range: 6..8, + value: Name( + ExprName { + range: 7..8, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 10..13, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 10..13, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + While( + StmtWhile { + range: 14..32, + test: Yield( + ExprYield { + range: 20..27, + value: Some( + Name( + ExprName { + range: 26..27, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 29..32, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 29..32, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + While( + StmtWhile { + range: 33..40, + test: Name( + ExprName { + range: 39..40, + id: "a", + ctx: Load, + }, + ), + body: [], + orelse: [], + }, + ), + AnnAssign( + StmtAnnAssign { + range: 42..48, + target: Name( + ExprName { + range: 42..43, + id: "b", + ctx: Store, + }, + ), + annotation: EllipsisLiteral( + ExprEllipsisLiteral { + range: 45..48, + }, + ), + value: None, + simple: true, + }, + ), + While( + StmtWhile { + range: 49..61, + test: Named( + ExprNamed { + range: 55..61, + target: Name( + ExprName { + range: 55..56, + id: "a", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 60..61, + value: Int( + 1, + ), + }, + ), + }, + ), + body: [], + orelse: [], + }, + ), + AnnAssign( + StmtAnnAssign { + range: 63..69, + target: Name( + ExprName { + range: 63..64, + id: "b", + ctx: Store, + }, + ), + annotation: EllipsisLiteral( + ExprEllipsisLiteral { + range: 66..69, + }, + ), + value: None, + simple: true, + }, + ), + ], + }, +) +``` +## Errors + + | +1 | while *x: ... + | ^^ Syntax Error: Starred expression cannot be used here +2 | while yield x: ... +3 | while a, b: ... + | + + + | +1 | while *x: ... +2 | while yield x: ... + | ^^^^^^^ Syntax Error: Yield expression cannot be used here +3 | while a, b: ... +4 | while a := 1, b: ... + | + + + | +1 | while *x: ... +2 | while yield x: ... +3 | while a, b: ... + | ^ Syntax Error: Expected ':', found ',' +4 | while a := 1, b: ... + | + + + | +2 | while yield x: ... +3 | while a, b: ... +4 | while a := 1, b: ... + | ^ Syntax Error: Expected ':', found ',' + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@while_stmt_missing_colon.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@while_stmt_missing_colon.py.snap new file mode 100644 index 0000000000..e02b4c349f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@while_stmt_missing_colon.py.snap @@ -0,0 +1,62 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/while_stmt_missing_colon.py +--- +## AST + +``` +Module( + ModModule { + range: 0..40, + body: [ + While( + StmtWhile { + range: 0..39, + test: Compare( + ExprCompare { + range: 12..18, + left: Name( + ExprName { + range: 12..13, + id: "a", + ctx: Load, + }, + ), + ops: [ + Lt, + ], + comparators: [ + NumberLiteral( + ExprNumberLiteral { + range: 16..18, + value: Int( + 30, + ), + }, + ), + ], + }, + ), + body: [ + Pass( + StmtPass { + range: 35..39, + }, + ), + ], + orelse: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | while ( +2 | a < 30 # comment +3 | ) + | ^ Syntax Error: Expected ':', found newline +4 | pass + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@while_stmt_missing_test.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@while_stmt_missing_test.py.snap new file mode 100644 index 0000000000..ae8c83e43e --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@while_stmt_missing_test.py.snap @@ -0,0 +1,93 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/while_stmt_missing_test.py +--- +## AST + +``` +Module( + ModModule { + range: 0..30, + body: [ + While( + StmtWhile { + range: 0..11, + test: Name( + ExprName { + range: 5..5, + id: "", + ctx: Invalid, + }, + ), + body: [ + Expr( + StmtExpr { + range: 8..11, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 8..11, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + While( + StmtWhile { + range: 12..29, + test: Name( + ExprName { + range: 17..17, + id: "", + ctx: Invalid, + }, + ), + body: [ + Assign( + StmtAssign { + range: 24..29, + targets: [ + Name( + ExprName { + range: 24..25, + id: "a", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 28..29, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + orelse: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | while : ... + | ^ Syntax Error: Expected an expression +2 | while : +3 | a = 1 + | + + + | +1 | while : ... +2 | while : + | ^ Syntax Error: Expected an expression +3 | a = 1 + | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@with_items_parenthesized_missing_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@with_items_parenthesized_missing_comma.py.snap new file mode 100644 index 0000000000..53bb021c7b --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@with_items_parenthesized_missing_comma.py.snap @@ -0,0 +1,333 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/err/with_items_parenthesized_missing_comma.py +--- +## AST + +``` +Module( + ModModule { + range: 0..160, + body: [ + With( + StmtWith { + range: 0..23, + is_async: false, + items: [ + WithItem { + range: 6..11, + context_expr: Name( + ExprName { + range: 6..11, + id: "item1", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 12..17, + context_expr: Name( + ExprName { + range: 12..17, + id: "item2", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 20..23, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 20..23, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 24..53, + is_async: false, + items: [ + WithItem { + range: 30..41, + context_expr: Name( + ExprName { + range: 30..35, + id: "item1", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 39..41, + id: "f1", + ctx: Store, + }, + ), + ), + }, + WithItem { + range: 42..47, + context_expr: Name( + ExprName { + range: 42..47, + id: "item2", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 50..53, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 50..53, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 54..91, + is_async: false, + items: [ + WithItem { + range: 60..65, + context_expr: Name( + ExprName { + range: 60..65, + id: "item1", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 67..72, + context_expr: Name( + ExprName { + range: 67..72, + id: "item2", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 73..78, + context_expr: Name( + ExprName { + range: 73..78, + id: "item3", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 80..85, + context_expr: Name( + ExprName { + range: 80..85, + id: "item4", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 88..91, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 88..91, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 92..135, + is_async: false, + items: [ + WithItem { + range: 98..103, + context_expr: Name( + ExprName { + range: 98..103, + id: "item1", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 105..116, + context_expr: Name( + ExprName { + range: 105..110, + id: "item2", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 114..116, + id: "f1", + ctx: Store, + }, + ), + ), + }, + WithItem { + range: 117..122, + context_expr: Name( + ExprName { + range: 117..122, + id: "item3", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 124..129, + context_expr: Name( + ExprName { + range: 124..129, + id: "item4", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 132..135, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 132..135, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 136..160, + is_async: false, + items: [ + WithItem { + range: 142..147, + context_expr: Name( + ExprName { + range: 142..147, + id: "item1", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 149..154, + context_expr: Name( + ExprName { + range: 149..154, + id: "item2", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 156..159, + context_expr: EllipsisLiteral( + ExprEllipsisLiteral { + range: 156..159, + }, + ), + optional_vars: None, + }, + ], + body: [], + }, + ), + ], + }, +) +``` +## Errors + + | +1 | with (item1 item2): ... + | ^^^^^ Syntax Error: Expected ',', found name +2 | with (item1 as f1 item2): ... +3 | with (item1, item2 item3, item4): ... + | + + + | +1 | with (item1 item2): ... +2 | with (item1 as f1 item2): ... + | ^^^^^ Syntax Error: Expected ',', found name +3 | with (item1, item2 item3, item4): ... +4 | with (item1, item2 as f1 item3, item4): ... + | + + + | +1 | with (item1 item2): ... +2 | with (item1 as f1 item2): ... +3 | with (item1, item2 item3, item4): ... + | ^^^^^ Syntax Error: Expected ',', found name +4 | with (item1, item2 as f1 item3, item4): ... +5 | with (item1, item2: ... + | + + + | +2 | with (item1 as f1 item2): ... +3 | with (item1, item2 item3, item4): ... +4 | with (item1, item2 as f1 item3, item4): ... + | ^^^^^ Syntax Error: Expected ',', found name +5 | with (item1, item2: ... + | + + + | +3 | with (item1, item2 item3, item4): ... +4 | with (item1, item2 as f1 item3, item4): ... +5 | with (item1, item2: ... + | ^ Syntax Error: Expected ',', found ':' + | + + + | +4 | with (item1, item2 as f1 item3, item4): ... +5 | with (item1, item2: ... + | diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@ann_assign_stmt_simple_target.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@ann_assign_stmt_simple_target.py.snap new file mode 100644 index 0000000000..540459aee8 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@ann_assign_stmt_simple_target.py.snap @@ -0,0 +1,123 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/ann_assign_stmt_simple_target.py +--- +## AST + +``` +Module( + ModModule { + range: 0..45, + body: [ + AnnAssign( + StmtAnnAssign { + range: 0..6, + target: Name( + ExprName { + range: 0..1, + id: "a", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 3..6, + id: "int", + ctx: Load, + }, + ), + value: None, + simple: true, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 17..25, + target: Name( + ExprName { + range: 18..19, + id: "a", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 22..25, + id: "int", + ctx: Load, + }, + ), + value: None, + simple: false, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 26..34, + target: Attribute( + ExprAttribute { + range: 26..29, + value: Name( + ExprName { + range: 26..27, + id: "a", + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 28..29, + }, + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 31..34, + id: "int", + ctx: Load, + }, + ), + value: None, + simple: false, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 35..44, + target: Subscript( + ExprSubscript { + range: 35..39, + value: Name( + ExprName { + range: 35..36, + id: "a", + ctx: Load, + }, + ), + slice: NumberLiteral( + ExprNumberLiteral { + range: 37..38, + value: Int( + 0, + ), + }, + ), + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 41..44, + id: "int", + ctx: Load, + }, + ), + value: None, + simple: false, + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@assign_targets_terminator.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@assign_targets_terminator.py.snap new file mode 100644 index 0000000000..9bfc041ffa --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@assign_targets_terminator.py.snap @@ -0,0 +1,143 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/assign_targets_terminator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..39, + body: [ + Assign( + StmtAssign { + range: 0..13, + targets: [ + Name( + ExprName { + range: 0..1, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 4..5, + id: "y", + ctx: Store, + }, + ), + Name( + ExprName { + range: 8..9, + id: "z", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 12..13, + value: Int( + 1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 15..19, + value: Tuple( + ExprTuple { + range: 15..19, + elts: [ + Name( + ExprName { + range: 15..16, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 18..19, + id: "b", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 20..33, + targets: [ + Name( + ExprName { + range: 20..21, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 24..25, + id: "y", + ctx: Store, + }, + ), + Name( + ExprName { + range: 28..29, + id: "z", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 32..33, + value: Int( + 1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 34..38, + value: Tuple( + ExprTuple { + range: 34..38, + elts: [ + Name( + ExprName { + range: 34..35, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 37..38, + id: "b", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@async_for_statement.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@async_for_statement.py.snap new file mode 100644 index 0000000000..3a09a04096 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@async_for_statement.py.snap @@ -0,0 +1,48 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/async_for_statement.py +--- +## AST + +``` +Module( + ModModule { + range: 0..30, + body: [ + For( + StmtFor { + range: 0..29, + is_async: true, + target: Name( + ExprName { + range: 10..16, + id: "target", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 20..24, + id: "iter", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 26..29, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 26..29, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@async_function_definition.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@async_function_definition.py.snap new file mode 100644 index 0000000000..0a0aab9974 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@async_function_definition.py.snap @@ -0,0 +1,48 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/async_function_definition.py +--- +## AST + +``` +Module( + ModModule { + range: 0..21, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..20, + is_async: true, + decorator_list: [], + name: Identifier { + id: "foo", + range: 10..13, + }, + type_params: None, + parameters: Parameters { + range: 13..15, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 17..20, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 17..20, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@async_with_statement.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@async_with_statement.py.snap new file mode 100644 index 0000000000..5d3ae7ebf4 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@async_with_statement.py.snap @@ -0,0 +1,46 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/async_with_statement.py +--- +## AST + +``` +Module( + ModModule { + range: 0..21, + body: [ + With( + StmtWith { + range: 0..20, + is_async: true, + items: [ + WithItem { + range: 11..15, + context_expr: Name( + ExprName { + range: 11..15, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 17..20, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 17..20, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@class_def_arguments.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@class_def_arguments.py.snap new file mode 100644 index 0000000000..d9745c2286 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@class_def_arguments.py.snap @@ -0,0 +1,69 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/class_def_arguments.py +--- +## AST + +``` +Module( + ModModule { + range: 0..32, + body: [ + ClassDef( + StmtClassDef { + range: 0..14, + decorator_list: [], + name: Identifier { + id: "Foo", + range: 6..9, + }, + type_params: None, + arguments: None, + body: [ + Expr( + StmtExpr { + range: 11..14, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 11..14, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 15..31, + decorator_list: [], + name: Identifier { + id: "Foo", + range: 21..24, + }, + type_params: None, + arguments: Some( + Arguments { + range: 24..26, + args: [], + keywords: [], + }, + ), + body: [ + Expr( + StmtExpr { + range: 28..31, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 28..31, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@decorator_async_function.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@decorator_async_function.py.snap new file mode 100644 index 0000000000..f4728ee987 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@decorator_async_function.py.snap @@ -0,0 +1,59 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/decorator_async_function.py +--- +## AST + +``` +Module( + ModModule { + range: 0..32, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..31, + is_async: true, + decorator_list: [ + Decorator { + range: 0..10, + expression: Name( + ExprName { + range: 1..10, + id: "decorator", + ctx: Load, + }, + ), + }, + ], + name: Identifier { + id: "foo", + range: 21..24, + }, + type_params: None, + parameters: Parameters { + range: 24..26, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 28..31, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 28..31, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@del_targets_terminator.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@del_targets_terminator.py.snap new file mode 100644 index 0000000000..2de88d6127 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@del_targets_terminator.py.snap @@ -0,0 +1,113 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/del_targets_terminator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..29, + body: [ + Delete( + StmtDelete { + range: 0..8, + targets: [ + Name( + ExprName { + range: 4..5, + id: "a", + ctx: Del, + }, + ), + Name( + ExprName { + range: 7..8, + id: "b", + ctx: Del, + }, + ), + ], + }, + ), + Expr( + StmtExpr { + range: 10..14, + value: Tuple( + ExprTuple { + range: 10..14, + elts: [ + Name( + ExprName { + range: 10..11, + id: "c", + ctx: Load, + }, + ), + Name( + ExprName { + range: 13..14, + id: "d", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Delete( + StmtDelete { + range: 15..23, + targets: [ + Name( + ExprName { + range: 19..20, + id: "a", + ctx: Del, + }, + ), + Name( + ExprName { + range: 22..23, + id: "b", + ctx: Del, + }, + ), + ], + }, + ), + Expr( + StmtExpr { + range: 24..28, + value: Tuple( + ExprTuple { + range: 24..28, + elts: [ + Name( + ExprName { + range: 24..25, + id: "c", + ctx: Load, + }, + ), + Name( + ExprName { + range: 27..28, + id: "d", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@dotted_name_normalized_spaces.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@dotted_name_normalized_spaces.py.snap new file mode 100644 index 0000000000..c404f5613c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@dotted_name_normalized_spaces.py.snap @@ -0,0 +1,45 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/dotted_name_normalized_spaces.py +--- +## AST + +``` +Module( + ModModule { + range: 0..32, + body: [ + Import( + StmtImport { + range: 0..12, + names: [ + Alias { + range: 7..12, + name: Identifier { + id: "a.b.c", + range: 7..12, + }, + asname: None, + }, + ], + }, + ), + Import( + StmtImport { + range: 13..31, + names: [ + Alias { + range: 20..31, + name: Identifier { + id: "a.b.c", + range: 20..31, + }, + asname: None, + }, + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__arguments.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__arguments.py.snap new file mode 100644 index 0000000000..0d4e1b3d35 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__arguments.py.snap @@ -0,0 +1,1725 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/arguments.py +--- +## AST + +``` +Module( + ModModule { + range: 0..805, + body: [ + Expr( + StmtExpr { + range: 102..108, + value: Call( + ExprCall { + range: 102..108, + func: Name( + ExprName { + range: 102..106, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 106..108, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 109..119, + value: Call( + ExprCall { + range: 109..119, + func: Name( + ExprName { + range: 109..113, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 113..119, + args: [ + Name( + ExprName { + range: 114..115, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 117..118, + id: "y", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 120..131, + value: Call( + ExprCall { + range: 120..131, + func: Name( + ExprName { + range: 120..124, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 124..131, + args: [ + Name( + ExprName { + range: 125..126, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 128..129, + id: "y", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 150..164, + value: Call( + ExprCall { + range: 150..164, + func: Name( + ExprName { + range: 150..154, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 154..164, + args: [], + keywords: [ + Keyword { + range: 155..158, + arg: Some( + Identifier { + id: "x", + range: 155..156, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 157..158, + value: Int( + 1, + ), + }, + ), + }, + Keyword { + range: 160..163, + arg: Some( + Identifier { + id: "y", + range: 160..161, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 162..163, + value: Int( + 2, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 165..173, + value: Call( + ExprCall { + range: 165..173, + func: Name( + ExprName { + range: 165..169, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 169..173, + args: [ + Starred( + ExprStarred { + range: 170..172, + value: Name( + ExprName { + range: 171..172, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 174..183, + value: Call( + ExprCall { + range: 174..183, + func: Name( + ExprName { + range: 174..178, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 178..183, + args: [], + keywords: [ + Keyword { + range: 179..182, + arg: None, + value: Name( + ExprName { + range: 181..182, + id: "x", + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 193..205, + value: Call( + ExprCall { + range: 193..205, + func: Name( + ExprName { + range: 193..197, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 197..205, + args: [ + Name( + ExprName { + range: 198..199, + id: "x", + ctx: Load, + }, + ), + ], + keywords: [ + Keyword { + range: 201..204, + arg: Some( + Identifier { + id: "y", + range: 201..202, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 203..204, + value: Int( + 1, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 206..217, + value: Call( + ExprCall { + range: 206..217, + func: Name( + ExprName { + range: 206..210, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 210..217, + args: [ + Name( + ExprName { + range: 211..212, + id: "x", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 214..216, + value: Name( + ExprName { + range: 215..216, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 218..230, + value: Call( + ExprCall { + range: 218..230, + func: Name( + ExprName { + range: 218..222, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 222..230, + args: [ + Name( + ExprName { + range: 223..224, + id: "x", + ctx: Load, + }, + ), + ], + keywords: [ + Keyword { + range: 226..229, + arg: None, + value: Name( + ExprName { + range: 228..229, + id: "y", + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 231..244, + value: Call( + ExprCall { + range: 231..244, + func: Name( + ExprName { + range: 231..235, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 235..244, + args: [ + Starred( + ExprStarred { + range: 241..243, + value: Name( + ExprName { + range: 242..243, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + keywords: [ + Keyword { + range: 236..239, + arg: Some( + Identifier { + id: "x", + range: 236..237, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 238..239, + value: Int( + 1, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 245..259, + value: Call( + ExprCall { + range: 245..259, + func: Name( + ExprName { + range: 245..249, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 249..259, + args: [], + keywords: [ + Keyword { + range: 250..253, + arg: Some( + Identifier { + id: "x", + range: 250..251, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 252..253, + value: Int( + 1, + ), + }, + ), + }, + Keyword { + range: 255..258, + arg: None, + value: Name( + ExprName { + range: 257..258, + id: "y", + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 260..273, + value: Call( + ExprCall { + range: 260..273, + func: Name( + ExprName { + range: 260..264, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 264..273, + args: [ + Starred( + ExprStarred { + range: 265..267, + value: Name( + ExprName { + range: 266..267, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + keywords: [ + Keyword { + range: 269..272, + arg: None, + value: Name( + ExprName { + range: 271..272, + id: "y", + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 274..288, + value: Call( + ExprCall { + range: 274..288, + func: Name( + ExprName { + range: 274..278, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 278..288, + args: [ + Starred( + ExprStarred { + range: 279..281, + value: Name( + ExprName { + range: 280..281, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 283..284, + id: "y", + ctx: Load, + }, + ), + Name( + ExprName { + range: 286..287, + id: "z", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 289..308, + value: Call( + ExprCall { + range: 289..308, + func: Name( + ExprName { + range: 289..293, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 293..308, + args: [], + keywords: [ + Keyword { + range: 294..297, + arg: None, + value: Name( + ExprName { + range: 296..297, + id: "x", + ctx: Load, + }, + ), + }, + Keyword { + range: 299..302, + arg: Some( + Identifier { + id: "y", + range: 299..300, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 301..302, + value: Int( + 1, + ), + }, + ), + }, + Keyword { + range: 304..307, + arg: Some( + Identifier { + id: "z", + range: 304..305, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 306..307, + value: Int( + 2, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 309..335, + value: Call( + ExprCall { + range: 309..335, + func: Name( + ExprName { + range: 309..313, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 313..335, + args: [ + Starred( + ExprStarred { + range: 314..317, + value: Name( + ExprName { + range: 315..317, + id: "x1", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 319..322, + value: Name( + ExprName { + range: 320..322, + id: "x2", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + keywords: [ + Keyword { + range: 324..328, + arg: None, + value: Name( + ExprName { + range: 326..328, + id: "y1", + ctx: Load, + }, + ), + }, + Keyword { + range: 330..334, + arg: None, + value: Name( + ExprName { + range: 332..334, + id: "y2", + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 336..355, + value: Call( + ExprCall { + range: 336..355, + func: Name( + ExprName { + range: 336..340, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 340..355, + args: [], + keywords: [ + Keyword { + range: 341..344, + arg: Some( + Identifier { + id: "x", + range: 341..342, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 343..344, + value: Int( + 1, + ), + }, + ), + }, + Keyword { + range: 346..349, + arg: None, + value: Name( + ExprName { + range: 348..349, + id: "y", + ctx: Load, + }, + ), + }, + Keyword { + range: 351..354, + arg: Some( + Identifier { + id: "z", + range: 351..352, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 353..354, + value: Int( + 1, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 378..402, + value: Call( + ExprCall { + range: 378..402, + func: Name( + ExprName { + range: 378..382, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 382..402, + args: [], + keywords: [ + Keyword { + range: 383..401, + arg: Some( + Identifier { + id: "x", + range: 383..384, + }, + ), + value: If( + ExprIf { + range: 385..401, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 390..394, + value: true, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 385..386, + value: Int( + 1, + ), + }, + ), + orelse: NumberLiteral( + ExprNumberLiteral { + range: 400..401, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 403..418, + value: Call( + ExprCall { + range: 403..418, + func: Name( + ExprName { + range: 403..407, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 407..418, + args: [], + keywords: [ + Keyword { + range: 408..417, + arg: Some( + Identifier { + id: "x", + range: 408..409, + }, + ), + value: Await( + ExprAwait { + range: 410..417, + value: Name( + ExprName { + range: 416..417, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 419..438, + value: Call( + ExprCall { + range: 419..438, + func: Name( + ExprName { + range: 419..423, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 423..438, + args: [], + keywords: [ + Keyword { + range: 424..437, + arg: Some( + Identifier { + id: "x", + range: 424..425, + }, + ), + value: Lambda( + ExprLambda { + range: 426..437, + parameters: Some( + Parameters { + range: 433..434, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 433..434, + parameter: Parameter { + range: 433..434, + name: Identifier { + id: "y", + range: 433..434, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 436..437, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 439..455, + value: Call( + ExprCall { + range: 439..455, + func: Name( + ExprName { + range: 439..443, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 443..455, + args: [], + keywords: [ + Keyword { + range: 444..454, + arg: Some( + Identifier { + id: "x", + range: 444..445, + }, + ), + value: Named( + ExprNamed { + range: 447..453, + target: Name( + ExprName { + range: 447..448, + id: "y", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 452..453, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 476..491, + value: Call( + ExprCall { + range: 476..491, + func: Name( + ExprName { + range: 476..480, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 480..491, + args: [ + Yield( + ExprYield { + range: 482..489, + value: Some( + Name( + ExprName { + range: 488..489, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 492..512, + value: Call( + ExprCall { + range: 492..512, + func: Name( + ExprName { + range: 492..496, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 496..512, + args: [ + YieldFrom( + ExprYieldFrom { + range: 498..510, + value: Name( + ExprName { + range: 509..510, + id: "x", + ctx: Load, + }, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 533..545, + value: Call( + ExprCall { + range: 533..545, + func: Name( + ExprName { + range: 533..537, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 537..545, + args: [ + Named( + ExprNamed { + range: 538..544, + target: Name( + ExprName { + range: 538..539, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 543..544, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 546..572, + value: Call( + ExprCall { + range: 546..572, + func: Name( + ExprName { + range: 546..550, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 550..572, + args: [ + Generator( + ExprGenerator { + range: 551..571, + elt: Named( + ExprNamed { + range: 551..557, + target: Name( + ExprName { + range: 551..552, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 556..557, + value: Int( + 1, + ), + }, + ), + }, + ), + generators: [ + Comprehension { + range: 558..571, + target: Name( + ExprName { + range: 562..563, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 567..571, + id: "iter", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: false, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 596..610, + value: Call( + ExprCall { + range: 596..610, + func: Name( + ExprName { + range: 596..600, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 600..610, + args: [ + Starred( + ExprStarred { + range: 601..609, + value: BoolOp( + ExprBoolOp { + range: 602..609, + op: And, + values: [ + Name( + ExprName { + range: 602..603, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 608..609, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 611..623, + value: Call( + ExprCall { + range: 611..623, + func: Name( + ExprName { + range: 611..615, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 615..623, + args: [ + Starred( + ExprStarred { + range: 616..622, + value: BinOp( + ExprBinOp { + range: 617..622, + left: Name( + ExprName { + range: 617..618, + id: "x", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 621..622, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 624..638, + value: Call( + ExprCall { + range: 624..638, + func: Name( + ExprName { + range: 624..628, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 628..638, + args: [ + Starred( + ExprStarred { + range: 629..637, + value: Await( + ExprAwait { + range: 630..637, + value: Name( + ExprName { + range: 636..637, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 639..657, + value: Call( + ExprCall { + range: 639..657, + func: Name( + ExprName { + range: 639..643, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 643..657, + args: [ + Starred( + ExprStarred { + range: 644..656, + value: Lambda( + ExprLambda { + range: 645..656, + parameters: Some( + Parameters { + range: 652..653, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 652..653, + parameter: Parameter { + range: 652..653, + name: Identifier { + id: "x", + range: 652..653, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 655..656, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 658..681, + value: Call( + ExprCall { + range: 658..681, + func: Name( + ExprName { + range: 658..662, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 662..681, + args: [ + Starred( + ExprStarred { + range: 663..680, + value: If( + ExprIf { + range: 664..680, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 669..673, + value: true, + }, + ), + body: Name( + ExprName { + range: 664..665, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 679..680, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 700..709, + value: Call( + ExprCall { + range: 700..709, + func: Name( + ExprName { + range: 700..704, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 704..709, + args: [], + keywords: [ + Keyword { + range: 705..708, + arg: None, + value: Name( + ExprName { + range: 707..708, + id: "x", + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 710..725, + value: Call( + ExprCall { + range: 710..725, + func: Name( + ExprName { + range: 710..714, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 714..725, + args: [], + keywords: [ + Keyword { + range: 715..724, + arg: None, + value: BoolOp( + ExprBoolOp { + range: 717..724, + op: And, + values: [ + Name( + ExprName { + range: 717..718, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 723..724, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 726..741, + value: Call( + ExprCall { + range: 726..741, + func: Name( + ExprName { + range: 726..730, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 730..741, + args: [], + keywords: [ + Keyword { + range: 731..740, + arg: None, + value: Await( + ExprAwait { + range: 733..740, + value: Name( + ExprName { + range: 739..740, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 742..766, + value: Call( + ExprCall { + range: 742..766, + func: Name( + ExprName { + range: 742..746, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 746..766, + args: [], + keywords: [ + Keyword { + range: 747..765, + arg: None, + value: If( + ExprIf { + range: 749..765, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 754..758, + value: true, + }, + ), + body: Name( + ExprName { + range: 749..750, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 764..765, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 767..784, + value: Call( + ExprCall { + range: 767..784, + func: Name( + ExprName { + range: 767..771, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 771..784, + args: [], + keywords: [ + Keyword { + range: 772..783, + arg: None, + value: Yield( + ExprYield { + range: 775..782, + value: Some( + Name( + ExprName { + range: 781..782, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 785..804, + value: Call( + ExprCall { + range: 785..804, + func: Name( + ExprName { + range: 785..789, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 789..804, + args: [], + keywords: [ + Keyword { + range: 790..803, + arg: None, + value: Lambda( + ExprLambda { + range: 792..803, + parameters: Some( + Parameters { + range: 799..800, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 799..800, + parameter: Parameter { + range: 799..800, + name: Identifier { + id: "x", + range: 799..800, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 802..803, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ], + }, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__attribute.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__attribute.py.snap new file mode 100644 index 0000000000..abf8605d69 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__attribute.py.snap @@ -0,0 +1,227 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/attribute.py +--- +## AST + +``` +Module( + ModModule { + range: 0..90, + body: [ + Expr( + StmtExpr { + range: 0..10, + value: Attribute( + ExprAttribute { + range: 0..10, + value: Name( + ExprName { + range: 0..5, + id: "value", + ctx: Load, + }, + ), + attr: Identifier { + id: "attr", + range: 6..10, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 11..23, + value: Call( + ExprCall { + range: 11..23, + func: Attribute( + ExprAttribute { + range: 11..21, + value: Name( + ExprName { + range: 11..16, + id: "value", + ctx: Load, + }, + ), + attr: Identifier { + id: "attr", + range: 17..21, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 21..23, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 24..36, + value: Attribute( + ExprAttribute { + range: 24..36, + value: Call( + ExprCall { + range: 24..31, + func: Name( + ExprName { + range: 24..29, + id: "value", + ctx: Load, + }, + ), + arguments: Arguments { + range: 29..31, + args: [], + keywords: [], + }, + }, + ), + attr: Identifier { + id: "attr", + range: 32..36, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 37..55, + value: Attribute( + ExprAttribute { + range: 37..55, + value: Call( + ExprCall { + range: 37..51, + func: Attribute( + ExprAttribute { + range: 37..49, + value: Call( + ExprCall { + range: 37..44, + func: Name( + ExprName { + range: 37..42, + id: "value", + ctx: Load, + }, + ), + arguments: Arguments { + range: 42..44, + args: [], + keywords: [], + }, + }, + ), + attr: Identifier { + id: "attr", + range: 45..49, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 49..51, + args: [], + keywords: [], + }, + }, + ), + attr: Identifier { + id: "foo", + range: 52..55, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 56..70, + value: Attribute( + ExprAttribute { + range: 56..70, + value: Attribute( + ExprAttribute { + range: 56..66, + value: Name( + ExprName { + range: 56..61, + id: "value", + ctx: Load, + }, + ), + attr: Identifier { + id: "attr", + range: 62..66, + }, + ctx: Load, + }, + ), + attr: Identifier { + id: "foo", + range: 67..70, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 71..89, + value: Attribute( + ExprAttribute { + range: 71..89, + value: Call( + ExprCall { + range: 71..85, + func: Attribute( + ExprAttribute { + range: 71..83, + value: Name( + ExprName { + range: 72..77, + id: "value", + ctx: Load, + }, + ), + attr: Identifier { + id: "attr", + range: 79..83, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 83..85, + args: [], + keywords: [], + }, + }, + ), + attr: Identifier { + id: "foo", + range: 86..89, + }, + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__await.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__await.py.snap new file mode 100644 index 0000000000..120bcda083 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__await.py.snap @@ -0,0 +1,512 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/await.py +--- +## AST + +``` +Module( + ModModule { + range: 0..211, + body: [ + Expr( + StmtExpr { + range: 0..7, + value: Await( + ExprAwait { + range: 0..7, + value: Name( + ExprName { + range: 6..7, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 8..19, + value: BinOp( + ExprBinOp { + range: 8..19, + left: Await( + ExprAwait { + range: 8..15, + value: Name( + ExprName { + range: 14..15, + id: "x", + ctx: Load, + }, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 18..19, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 20..33, + value: BoolOp( + ExprBoolOp { + range: 20..33, + op: And, + values: [ + Await( + ExprAwait { + range: 20..27, + value: Name( + ExprName { + range: 26..27, + id: "a", + ctx: Load, + }, + ), + }, + ), + Name( + ExprName { + range: 32..33, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 34..43, + value: Await( + ExprAwait { + range: 34..43, + value: Call( + ExprCall { + range: 40..43, + func: Name( + ExprName { + range: 40..41, + id: "f", + ctx: Load, + }, + ), + arguments: Arguments { + range: 41..43, + args: [], + keywords: [], + }, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 44..56, + value: Await( + ExprAwait { + range: 44..56, + value: List( + ExprList { + range: 50..56, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 51..52, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 54..55, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 57..69, + value: Await( + ExprAwait { + range: 57..69, + value: Set( + ExprSet { + range: 63..69, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 64..65, + value: Int( + 3, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 67..68, + value: Int( + 4, + ), + }, + ), + ], + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 70..82, + value: Await( + ExprAwait { + range: 70..82, + value: Dict( + ExprDict { + range: 76..82, + keys: [ + Some( + Name( + ExprName { + range: 77..78, + id: "i", + ctx: Load, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 80..81, + value: Int( + 5, + ), + }, + ), + ], + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 83..93, + value: Tuple( + ExprTuple { + range: 83..93, + elts: [ + Await( + ExprAwait { + range: 83..90, + value: NumberLiteral( + ExprNumberLiteral { + range: 89..90, + value: Int( + 7, + ), + }, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 92..93, + value: Int( + 8, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 94..107, + value: Await( + ExprAwait { + range: 94..107, + value: Tuple( + ExprTuple { + range: 100..107, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 101..102, + value: Int( + 9, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 104..106, + value: Int( + 10, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 108..120, + value: Compare( + ExprCompare { + range: 108..120, + left: Await( + ExprAwait { + range: 108..115, + value: NumberLiteral( + ExprNumberLiteral { + range: 114..115, + value: Int( + 1, + ), + }, + ), + }, + ), + ops: [ + Eq, + ], + comparators: [ + NumberLiteral( + ExprNumberLiteral { + range: 119..120, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 121..146, + value: If( + ExprIf { + range: 121..146, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 132..136, + value: true, + }, + ), + body: Await( + ExprAwait { + range: 121..128, + value: Name( + ExprName { + range: 127..128, + id: "x", + ctx: Load, + }, + ), + }, + ), + orelse: NoneLiteral( + ExprNoneLiteral { + range: 142..146, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 147..158, + value: Await( + ExprAwait { + range: 147..158, + value: Tuple( + ExprTuple { + range: 153..158, + elts: [ + Starred( + ExprStarred { + range: 154..156, + value: Name( + ExprName { + range: 155..156, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 159..178, + value: Await( + ExprAwait { + range: 159..178, + value: Lambda( + ExprLambda { + range: 166..177, + parameters: Some( + Parameters { + range: 173..174, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 173..174, + parameter: Parameter { + range: 173..174, + name: Identifier { + id: "x", + range: 173..174, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 176..177, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 179..192, + value: BinOp( + ExprBinOp { + range: 179..192, + left: Await( + ExprAwait { + range: 179..186, + value: Name( + ExprName { + range: 185..186, + id: "x", + ctx: Load, + }, + ), + }, + ), + op: Pow, + right: UnaryOp( + ExprUnaryOp { + range: 190..192, + op: USub, + operand: Name( + ExprName { + range: 191..192, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 193..211, + value: BinOp( + ExprBinOp { + range: 193..211, + left: Await( + ExprAwait { + range: 193..200, + value: Name( + ExprName { + range: 199..200, + id: "x", + ctx: Load, + }, + ), + }, + ), + op: Pow, + right: Await( + ExprAwait { + range: 204..211, + value: Name( + ExprName { + range: 210..211, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__bin_op.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__bin_op.py.snap new file mode 100644 index 0000000000..982687c7f1 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__bin_op.py.snap @@ -0,0 +1,1046 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/bin_op.py +--- +## AST + +``` +Module( + ModModule { + range: 0..397, + body: [ + Expr( + StmtExpr { + range: 9..14, + value: BinOp( + ExprBinOp { + range: 9..14, + left: NumberLiteral( + ExprNumberLiteral { + range: 9..10, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 13..14, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 15..20, + value: BinOp( + ExprBinOp { + range: 15..20, + left: NumberLiteral( + ExprNumberLiteral { + range: 15..16, + value: Int( + 1, + ), + }, + ), + op: Sub, + right: NumberLiteral( + ExprNumberLiteral { + range: 19..20, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 21..26, + value: BinOp( + ExprBinOp { + range: 21..26, + left: NumberLiteral( + ExprNumberLiteral { + range: 21..22, + value: Int( + 1, + ), + }, + ), + op: Mult, + right: NumberLiteral( + ExprNumberLiteral { + range: 25..26, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 27..32, + value: BinOp( + ExprBinOp { + range: 27..32, + left: NumberLiteral( + ExprNumberLiteral { + range: 27..28, + value: Int( + 1, + ), + }, + ), + op: Div, + right: NumberLiteral( + ExprNumberLiteral { + range: 31..32, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 33..39, + value: BinOp( + ExprBinOp { + range: 33..39, + left: NumberLiteral( + ExprNumberLiteral { + range: 33..34, + value: Int( + 1, + ), + }, + ), + op: FloorDiv, + right: NumberLiteral( + ExprNumberLiteral { + range: 38..39, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 40..45, + value: BinOp( + ExprBinOp { + range: 40..45, + left: NumberLiteral( + ExprNumberLiteral { + range: 40..41, + value: Int( + 1, + ), + }, + ), + op: Mod, + right: NumberLiteral( + ExprNumberLiteral { + range: 44..45, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 46..52, + value: BinOp( + ExprBinOp { + range: 46..52, + left: NumberLiteral( + ExprNumberLiteral { + range: 46..47, + value: Int( + 1, + ), + }, + ), + op: Pow, + right: NumberLiteral( + ExprNumberLiteral { + range: 51..52, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 53..58, + value: BinOp( + ExprBinOp { + range: 53..58, + left: NumberLiteral( + ExprNumberLiteral { + range: 53..54, + value: Int( + 1, + ), + }, + ), + op: BitOr, + right: NumberLiteral( + ExprNumberLiteral { + range: 57..58, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 59..64, + value: BinOp( + ExprBinOp { + range: 59..64, + left: NumberLiteral( + ExprNumberLiteral { + range: 59..60, + value: Int( + 1, + ), + }, + ), + op: BitXor, + right: NumberLiteral( + ExprNumberLiteral { + range: 63..64, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 65..70, + value: BinOp( + ExprBinOp { + range: 65..70, + left: NumberLiteral( + ExprNumberLiteral { + range: 65..66, + value: Int( + 1, + ), + }, + ), + op: BitAnd, + right: NumberLiteral( + ExprNumberLiteral { + range: 69..70, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 71..77, + value: BinOp( + ExprBinOp { + range: 71..77, + left: NumberLiteral( + ExprNumberLiteral { + range: 71..72, + value: Int( + 1, + ), + }, + ), + op: RShift, + right: NumberLiteral( + ExprNumberLiteral { + range: 76..77, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 78..84, + value: BinOp( + ExprBinOp { + range: 78..84, + left: NumberLiteral( + ExprNumberLiteral { + range: 78..79, + value: Int( + 1, + ), + }, + ), + op: LShift, + right: NumberLiteral( + ExprNumberLiteral { + range: 83..84, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 85..90, + value: BinOp( + ExprBinOp { + range: 85..90, + left: NumberLiteral( + ExprNumberLiteral { + range: 85..86, + value: Int( + 1, + ), + }, + ), + op: MatMult, + right: NumberLiteral( + ExprNumberLiteral { + range: 89..90, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 110..123, + value: BinOp( + ExprBinOp { + range: 110..123, + left: BinOp( + ExprBinOp { + range: 110..119, + left: BinOp( + ExprBinOp { + range: 110..115, + left: NumberLiteral( + ExprNumberLiteral { + range: 110..111, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 114..115, + value: Int( + 2, + ), + }, + ), + }, + ), + op: Sub, + right: NumberLiteral( + ExprNumberLiteral { + range: 118..119, + value: Int( + 3, + ), + }, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 122..123, + value: Int( + 4, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 124..146, + value: BinOp( + ExprBinOp { + range: 124..146, + left: BinOp( + ExprBinOp { + range: 124..142, + left: BinOp( + ExprBinOp { + range: 124..138, + left: BinOp( + ExprBinOp { + range: 124..133, + left: BinOp( + ExprBinOp { + range: 124..129, + left: NumberLiteral( + ExprNumberLiteral { + range: 124..125, + value: Int( + 1, + ), + }, + ), + op: Mult, + right: NumberLiteral( + ExprNumberLiteral { + range: 128..129, + value: Int( + 2, + ), + }, + ), + }, + ), + op: Div, + right: NumberLiteral( + ExprNumberLiteral { + range: 132..133, + value: Int( + 3, + ), + }, + ), + }, + ), + op: FloorDiv, + right: NumberLiteral( + ExprNumberLiteral { + range: 137..138, + value: Int( + 4, + ), + }, + ), + }, + ), + op: MatMult, + right: NumberLiteral( + ExprNumberLiteral { + range: 141..142, + value: Int( + 5, + ), + }, + ), + }, + ), + op: Mod, + right: NumberLiteral( + ExprNumberLiteral { + range: 145..146, + value: Int( + 6, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 147..168, + value: BinOp( + ExprBinOp { + range: 147..168, + left: BinOp( + ExprBinOp { + range: 147..163, + left: BinOp( + ExprBinOp { + range: 147..158, + left: BinOp( + ExprBinOp { + range: 147..153, + left: NumberLiteral( + ExprNumberLiteral { + range: 147..148, + value: Int( + 1, + ), + }, + ), + op: LShift, + right: NumberLiteral( + ExprNumberLiteral { + range: 152..153, + value: Int( + 2, + ), + }, + ), + }, + ), + op: RShift, + right: NumberLiteral( + ExprNumberLiteral { + range: 157..158, + value: Int( + 3, + ), + }, + ), + }, + ), + op: RShift, + right: NumberLiteral( + ExprNumberLiteral { + range: 162..163, + value: Int( + 4, + ), + }, + ), + }, + ), + op: LShift, + right: NumberLiteral( + ExprNumberLiteral { + range: 167..168, + value: Int( + 5, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 193..202, + value: BinOp( + ExprBinOp { + range: 193..202, + left: NumberLiteral( + ExprNumberLiteral { + range: 193..194, + value: Int( + 1, + ), + }, + ), + op: Add, + right: BinOp( + ExprBinOp { + range: 197..202, + left: NumberLiteral( + ExprNumberLiteral { + range: 197..198, + value: Int( + 2, + ), + }, + ), + op: Mult, + right: NumberLiteral( + ExprNumberLiteral { + range: 201..202, + value: Int( + 3, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 203..212, + value: BinOp( + ExprBinOp { + range: 203..212, + left: BinOp( + ExprBinOp { + range: 203..208, + left: NumberLiteral( + ExprNumberLiteral { + range: 203..204, + value: Int( + 1, + ), + }, + ), + op: Mult, + right: NumberLiteral( + ExprNumberLiteral { + range: 207..208, + value: Int( + 2, + ), + }, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 211..212, + value: Int( + 3, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 213..244, + value: BinOp( + ExprBinOp { + range: 213..244, + left: BinOp( + ExprBinOp { + range: 213..235, + left: BinOp( + ExprBinOp { + range: 213..231, + left: BinOp( + ExprBinOp { + range: 213..223, + left: BinOp( + ExprBinOp { + range: 213..219, + left: NumberLiteral( + ExprNumberLiteral { + range: 213..214, + value: Int( + 1, + ), + }, + ), + op: Pow, + right: NumberLiteral( + ExprNumberLiteral { + range: 218..219, + value: Int( + 2, + ), + }, + ), + }, + ), + op: Mult, + right: NumberLiteral( + ExprNumberLiteral { + range: 222..223, + value: Int( + 3, + ), + }, + ), + }, + ), + op: Sub, + right: BinOp( + ExprBinOp { + range: 226..231, + left: NumberLiteral( + ExprNumberLiteral { + range: 226..227, + value: Int( + 4, + ), + }, + ), + op: MatMult, + right: NumberLiteral( + ExprNumberLiteral { + range: 230..231, + value: Int( + 5, + ), + }, + ), + }, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 234..235, + value: Int( + 6, + ), + }, + ), + }, + ), + op: Sub, + right: BinOp( + ExprBinOp { + range: 238..244, + left: NumberLiteral( + ExprNumberLiteral { + range: 238..239, + value: Int( + 7, + ), + }, + ), + op: FloorDiv, + right: NumberLiteral( + ExprNumberLiteral { + range: 243..244, + value: Int( + 8, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 270..306, + value: BinOp( + ExprBinOp { + range: 270..306, + left: NumberLiteral( + ExprNumberLiteral { + range: 270..271, + value: Int( + 1, + ), + }, + ), + op: BitOr, + right: BinOp( + ExprBinOp { + range: 274..306, + left: BinOp( + ExprBinOp { + range: 274..279, + left: NumberLiteral( + ExprNumberLiteral { + range: 274..275, + value: Int( + 2, + ), + }, + ), + op: BitAnd, + right: NumberLiteral( + ExprNumberLiteral { + range: 278..279, + value: Int( + 3, + ), + }, + ), + }, + ), + op: BitXor, + right: BinOp( + ExprBinOp { + range: 282..306, + left: BinOp( + ExprBinOp { + range: 282..301, + left: BinOp( + ExprBinOp { + range: 282..291, + left: NumberLiteral( + ExprNumberLiteral { + range: 282..283, + value: Int( + 4, + ), + }, + ), + op: Add, + right: BinOp( + ExprBinOp { + range: 286..291, + left: NumberLiteral( + ExprNumberLiteral { + range: 286..287, + value: Int( + 5, + ), + }, + ), + op: MatMult, + right: NumberLiteral( + ExprNumberLiteral { + range: 290..291, + value: Int( + 6, + ), + }, + ), + }, + ), + }, + ), + op: LShift, + right: BinOp( + ExprBinOp { + range: 295..301, + left: NumberLiteral( + ExprNumberLiteral { + range: 295..296, + value: Int( + 7, + ), + }, + ), + op: FloorDiv, + right: NumberLiteral( + ExprNumberLiteral { + range: 300..301, + value: Int( + 8, + ), + }, + ), + }, + ), + }, + ), + op: RShift, + right: NumberLiteral( + ExprNumberLiteral { + range: 305..306, + value: Int( + 9, + ), + }, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 324..339, + value: BinOp( + ExprBinOp { + range: 324..339, + left: BinOp( + ExprBinOp { + range: 324..335, + left: NumberLiteral( + ExprNumberLiteral { + range: 324..325, + value: Int( + 1, + ), + }, + ), + op: Add, + right: BinOp( + ExprBinOp { + range: 329..334, + left: NumberLiteral( + ExprNumberLiteral { + range: 329..330, + value: Int( + 2, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 333..334, + value: Int( + 3, + ), + }, + ), + }, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 338..339, + value: Int( + 4, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 340..359, + value: BinOp( + ExprBinOp { + range: 340..359, + left: BinOp( + ExprBinOp { + range: 340..345, + left: NumberLiteral( + ExprNumberLiteral { + range: 340..341, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 344..345, + value: Int( + 2, + ), + }, + ), + }, + ), + op: Add, + right: BinOp( + ExprBinOp { + range: 349..358, + left: BinOp( + ExprBinOp { + range: 349..354, + left: NumberLiteral( + ExprNumberLiteral { + range: 349..350, + value: Int( + 3, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 353..354, + value: Int( + 4, + ), + }, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 357..358, + value: Int( + 5, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 390..396, + value: BinOp( + ExprBinOp { + range: 390..396, + left: Name( + ExprName { + range: 390..391, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: UnaryOp( + ExprUnaryOp { + range: 393..396, + op: UAdd, + operand: Name( + ExprName { + range: 395..396, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__bool_op.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__bool_op.py.snap new file mode 100644 index 0000000000..2cf78690b7 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__bool_op.py.snap @@ -0,0 +1,402 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/bool_op.py +--- +## AST + +``` +Module( + ModModule { + range: 0..142, + body: [ + Expr( + StmtExpr { + range: 0..7, + value: BoolOp( + ExprBoolOp { + range: 0..7, + op: And, + values: [ + Name( + ExprName { + range: 0..1, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 6..7, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 8..21, + value: BoolOp( + ExprBoolOp { + range: 8..21, + op: And, + values: [ + Name( + ExprName { + range: 8..9, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 14..15, + id: "b", + ctx: Load, + }, + ), + Name( + ExprName { + range: 20..21, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 22..28, + value: BoolOp( + ExprBoolOp { + range: 22..28, + op: Or, + values: [ + Name( + ExprName { + range: 22..23, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 27..28, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 29..40, + value: BoolOp( + ExprBoolOp { + range: 29..40, + op: Or, + values: [ + Name( + ExprName { + range: 29..30, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 34..35, + id: "b", + ctx: Load, + }, + ), + Name( + ExprName { + range: 39..40, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 41..53, + value: BoolOp( + ExprBoolOp { + range: 41..53, + op: Or, + values: [ + BoolOp( + ExprBoolOp { + range: 41..48, + op: And, + values: [ + Name( + ExprName { + range: 41..42, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 47..48, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + Name( + ExprName { + range: 52..53, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 54..88, + value: BoolOp( + ExprBoolOp { + range: 54..88, + op: Or, + values: [ + BoolOp( + ExprBoolOp { + range: 54..67, + op: And, + values: [ + Name( + ExprName { + range: 54..55, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 60..61, + id: "b", + ctx: Load, + }, + ), + Name( + ExprName { + range: 66..67, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + Name( + ExprName { + range: 71..72, + id: "d", + ctx: Load, + }, + ), + BoolOp( + ExprBoolOp { + range: 76..83, + op: And, + values: [ + Name( + ExprName { + range: 76..77, + id: "e", + ctx: Load, + }, + ), + Name( + ExprName { + range: 82..83, + id: "f", + ctx: Load, + }, + ), + ], + }, + ), + Name( + ExprName { + range: 87..88, + id: "g", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 89..105, + value: BoolOp( + ExprBoolOp { + range: 89..105, + op: Or, + values: [ + BoolOp( + ExprBoolOp { + range: 89..100, + op: And, + values: [ + Name( + ExprName { + range: 89..90, + id: "a", + ctx: Load, + }, + ), + UnaryOp( + ExprUnaryOp { + range: 95..100, + op: Not, + operand: Name( + ExprName { + range: 99..100, + id: "b", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + Name( + ExprName { + range: 104..105, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 106..124, + value: Yield( + ExprYield { + range: 106..124, + value: Some( + BoolOp( + ExprBoolOp { + range: 112..124, + op: Or, + values: [ + BoolOp( + ExprBoolOp { + range: 112..119, + op: And, + values: [ + Name( + ExprName { + range: 112..113, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 118..119, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + Name( + ExprName { + range: 123..124, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 125..141, + value: BoolOp( + ExprBoolOp { + range: 125..141, + op: Or, + values: [ + BoolOp( + ExprBoolOp { + range: 125..136, + op: And, + values: [ + UnaryOp( + ExprUnaryOp { + range: 125..130, + op: Not, + operand: Name( + ExprName { + range: 129..130, + id: "a", + ctx: Load, + }, + ), + }, + ), + Name( + ExprName { + range: 135..136, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + Name( + ExprName { + range: 140..141, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__call.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__call.py.snap new file mode 100644 index 0000000000..968d389285 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__call.py.snap @@ -0,0 +1,587 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/call.py +--- +## AST + +``` +Module( + ModModule { + range: 0..349, + body: [ + Expr( + StmtExpr { + range: 114..120, + value: Call( + ExprCall { + range: 114..120, + func: Name( + ExprName { + range: 114..118, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 118..120, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 121..132, + value: Call( + ExprCall { + range: 121..132, + func: Attribute( + ExprAttribute { + range: 121..130, + value: Name( + ExprName { + range: 121..125, + id: "attr", + ctx: Load, + }, + ), + attr: Identifier { + id: "expr", + range: 126..130, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 130..132, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 133..150, + value: Call( + ExprCall { + range: 133..150, + func: Subscript( + ExprSubscript { + range: 133..148, + value: Name( + ExprName { + range: 133..142, + id: "subscript", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 143..147, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 143..144, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 146..147, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + arguments: Arguments { + range: 148..150, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 151..162, + value: Call( + ExprCall { + range: 151..162, + func: Subscript( + ExprSubscript { + range: 151..160, + value: Name( + ExprName { + range: 151..156, + id: "slice", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 157..159, + lower: None, + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 158..159, + value: Int( + 1, + ), + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + arguments: Arguments { + range: 160..162, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 163..174, + value: Call( + ExprCall { + range: 163..174, + func: List( + ExprList { + range: 163..172, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 164..165, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 167..168, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 170..171, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + }, + ), + arguments: Arguments { + range: 172..174, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 175..186, + value: Call( + ExprCall { + range: 175..186, + func: Tuple( + ExprTuple { + range: 175..184, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 176..177, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 179..180, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 182..183, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + arguments: Arguments { + range: 184..186, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 187..206, + value: Call( + ExprCall { + range: 187..206, + func: Generator( + ExprGenerator { + range: 187..204, + elt: Name( + ExprName { + range: 188..189, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 190..203, + target: Name( + ExprName { + range: 194..195, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 199..203, + id: "iter", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + arguments: Arguments { + range: 204..206, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 207..218, + value: Call( + ExprCall { + range: 207..218, + func: Set( + ExprSet { + range: 207..216, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 208..209, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 211..212, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 214..215, + value: Int( + 3, + ), + }, + ), + ], + }, + ), + arguments: Arguments { + range: 216..218, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 219..233, + value: Call( + ExprCall { + range: 219..233, + func: Dict( + ExprDict { + range: 219..231, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 220..221, + value: Int( + 1, + ), + }, + ), + ), + Some( + NumberLiteral( + ExprNumberLiteral { + range: 226..227, + value: Int( + 3, + ), + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 223..224, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 229..230, + value: Int( + 4, + ), + }, + ), + ], + }, + ), + arguments: Arguments { + range: 231..233, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 234..245, + value: Call( + ExprCall { + range: 234..245, + func: Yield( + ExprYield { + range: 235..242, + value: Some( + Name( + ExprName { + range: 241..242, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + arguments: Arguments { + range: 243..245, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 306..312, + value: Call( + ExprCall { + range: 306..312, + func: BooleanLiteral( + ExprBooleanLiteral { + range: 306..310, + value: true, + }, + ), + arguments: Arguments { + range: 310..312, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 313..320, + value: Call( + ExprCall { + range: 313..320, + func: BooleanLiteral( + ExprBooleanLiteral { + range: 313..318, + value: false, + }, + ), + arguments: Arguments { + range: 318..320, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 321..327, + value: Call( + ExprCall { + range: 321..327, + func: NoneLiteral( + ExprNoneLiteral { + range: 321..325, + }, + ), + arguments: Arguments { + range: 325..327, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 328..338, + value: Call( + ExprCall { + range: 328..338, + func: StringLiteral( + ExprStringLiteral { + range: 328..336, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 328..336, + value: "string", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + arguments: Arguments { + range: 336..338, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 339..342, + value: Call( + ExprCall { + range: 339..342, + func: NumberLiteral( + ExprNumberLiteral { + range: 339..340, + value: Int( + 1, + ), + }, + ), + arguments: Arguments { + range: 340..342, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 343..348, + value: Call( + ExprCall { + range: 343..348, + func: NumberLiteral( + ExprNumberLiteral { + range: 343..346, + value: Float( + 1.0, + ), + }, + ), + arguments: Arguments { + range: 346..348, + args: [], + keywords: [], + }, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__compare.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__compare.py.snap new file mode 100644 index 0000000000..bd19b33575 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__compare.py.snap @@ -0,0 +1,697 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/compare.py +--- +## AST + +``` +Module( + ModModule { + range: 0..542, + body: [ + Expr( + StmtExpr { + range: 9..15, + value: Compare( + ExprCompare { + range: 9..15, + left: Name( + ExprName { + range: 9..10, + id: "a", + ctx: Load, + }, + ), + ops: [ + Eq, + ], + comparators: [ + Name( + ExprName { + range: 14..15, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 16..21, + value: Compare( + ExprCompare { + range: 16..21, + left: Name( + ExprName { + range: 16..17, + id: "b", + ctx: Load, + }, + ), + ops: [ + Lt, + ], + comparators: [ + Name( + ExprName { + range: 20..21, + id: "a", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 22..27, + value: Compare( + ExprCompare { + range: 22..27, + left: Name( + ExprName { + range: 22..23, + id: "b", + ctx: Load, + }, + ), + ops: [ + Gt, + ], + comparators: [ + Name( + ExprName { + range: 26..27, + id: "a", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 28..34, + value: Compare( + ExprCompare { + range: 28..34, + left: Name( + ExprName { + range: 28..29, + id: "a", + ctx: Load, + }, + ), + ops: [ + GtE, + ], + comparators: [ + Name( + ExprName { + range: 33..34, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 35..41, + value: Compare( + ExprCompare { + range: 35..41, + left: Name( + ExprName { + range: 35..36, + id: "a", + ctx: Load, + }, + ), + ops: [ + LtE, + ], + comparators: [ + Name( + ExprName { + range: 40..41, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 42..48, + value: Compare( + ExprCompare { + range: 42..48, + left: Name( + ExprName { + range: 42..43, + id: "a", + ctx: Load, + }, + ), + ops: [ + NotEq, + ], + comparators: [ + Name( + ExprName { + range: 47..48, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 49..55, + value: Compare( + ExprCompare { + range: 49..55, + left: Name( + ExprName { + range: 49..50, + id: "a", + ctx: Load, + }, + ), + ops: [ + Is, + ], + comparators: [ + Name( + ExprName { + range: 54..55, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 56..62, + value: Compare( + ExprCompare { + range: 56..62, + left: Name( + ExprName { + range: 56..57, + id: "a", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 61..62, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 63..73, + value: Compare( + ExprCompare { + range: 63..73, + left: Name( + ExprName { + range: 63..64, + id: "a", + ctx: Load, + }, + ), + ops: [ + NotIn, + ], + comparators: [ + Name( + ExprName { + range: 72..73, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 74..84, + value: Compare( + ExprCompare { + range: 74..84, + left: Name( + ExprName { + range: 74..75, + id: "a", + ctx: Load, + }, + ), + ops: [ + IsNot, + ], + comparators: [ + Name( + ExprName { + range: 83..84, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 110..156, + value: Compare( + ExprCompare { + range: 110..156, + left: Name( + ExprName { + range: 110..111, + id: "a", + ctx: Load, + }, + ), + ops: [ + NotIn, + IsNot, + NotIn, + NotIn, + IsNot, + ], + comparators: [ + Name( + ExprName { + range: 119..120, + id: "b", + ctx: Load, + }, + ), + Name( + ExprName { + range: 128..129, + id: "c", + ctx: Load, + }, + ), + Name( + ExprName { + range: 137..138, + id: "d", + ctx: Load, + }, + ), + Name( + ExprName { + range: 146..147, + id: "e", + ctx: Load, + }, + ), + Name( + ExprName { + range: 155..156, + id: "f", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 177..203, + value: Compare( + ExprCompare { + range: 177..203, + left: BinOp( + ExprBinOp { + range: 177..182, + left: Name( + ExprName { + range: 177..178, + id: "a", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 181..182, + id: "b", + ctx: Load, + }, + ), + }, + ), + ops: [ + Lt, + NotIn, + ], + comparators: [ + BinOp( + ExprBinOp { + range: 185..190, + left: Name( + ExprName { + range: 185..186, + id: "c", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 189..190, + id: "d", + ctx: Load, + }, + ), + }, + ), + BinOp( + ExprBinOp { + range: 198..203, + left: Name( + ExprName { + range: 198..199, + id: "e", + ctx: Load, + }, + ), + op: BitAnd, + right: Name( + ExprName { + range: 202..203, + id: "f", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 379..393, + value: UnaryOp( + ExprUnaryOp { + range: 379..393, + op: Not, + operand: Compare( + ExprCompare { + range: 383..393, + left: Name( + ExprName { + range: 383..384, + id: "x", + ctx: Load, + }, + ), + ops: [ + NotIn, + ], + comparators: [ + Name( + ExprName { + range: 392..393, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 395..416, + value: BoolOp( + ExprBoolOp { + range: 395..416, + op: Or, + values: [ + Name( + ExprName { + range: 395..396, + id: "x", + ctx: Load, + }, + ), + BoolOp( + ExprBoolOp { + range: 400..416, + op: And, + values: [ + Compare( + ExprCompare { + range: 400..410, + left: Name( + ExprName { + range: 400..401, + id: "y", + ctx: Load, + }, + ), + ops: [ + NotIn, + ], + comparators: [ + Name( + ExprName { + range: 409..410, + id: "z", + ctx: Load, + }, + ), + ], + }, + ), + Name( + ExprName { + range: 415..416, + id: "a", + ctx: Load, + }, + ), + ], + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 417..429, + value: Compare( + ExprCompare { + range: 417..429, + left: Name( + ExprName { + range: 417..418, + id: "x", + ctx: Load, + }, + ), + ops: [ + Eq, + ], + comparators: [ + Await( + ExprAwait { + range: 422..429, + value: Name( + ExprName { + range: 428..429, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 430..446, + value: Compare( + ExprCompare { + range: 430..446, + left: Name( + ExprName { + range: 430..431, + id: "x", + ctx: Load, + }, + ), + ops: [ + IsNot, + ], + comparators: [ + Await( + ExprAwait { + range: 439..446, + value: Name( + ExprName { + range: 445..446, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 489..541, + value: Compare( + ExprCompare { + range: 489..541, + left: Name( + ExprName { + range: 489..490, + id: "a", + ctx: Load, + }, + ), + ops: [ + Lt, + Eq, + Gt, + Is, + NotIn, + IsNot, + LtE, + GtE, + NotEq, + ], + comparators: [ + Name( + ExprName { + range: 493..494, + id: "b", + ctx: Load, + }, + ), + Name( + ExprName { + range: 498..499, + id: "c", + ctx: Load, + }, + ), + Name( + ExprName { + range: 502..503, + id: "d", + ctx: Load, + }, + ), + Name( + ExprName { + range: 507..508, + id: "e", + ctx: Load, + }, + ), + Name( + ExprName { + range: 516..517, + id: "f", + ctx: Load, + }, + ), + Name( + ExprName { + range: 525..526, + id: "g", + ctx: Load, + }, + ), + Name( + ExprName { + range: 530..531, + id: "h", + ctx: Load, + }, + ), + Name( + ExprName { + range: 535..536, + id: "i", + ctx: Load, + }, + ), + Name( + ExprName { + range: 540..541, + id: "j", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary.py.snap new file mode 100644 index 0000000000..55547247c8 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary.py.snap @@ -0,0 +1,1208 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/dictionary.py +--- +## AST + +``` +Module( + ModModule { + range: 0..622, + body: [ + Expr( + StmtExpr { + range: 9..11, + value: Dict( + ExprDict { + range: 9..11, + keys: [], + values: [], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 12..18, + value: Dict( + ExprDict { + range: 12..18, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 13..14, + value: Int( + 1, + ), + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 16..17, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 19..43, + value: Dict( + ExprDict { + range: 19..43, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 20..21, + value: Int( + 1, + ), + }, + ), + ), + Some( + Name( + ExprName { + range: 26..27, + id: "a", + ctx: Load, + }, + ), + ), + Some( + Name( + ExprName { + range: 32..33, + id: "b", + ctx: Load, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 23..24, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 29..30, + value: Int( + 1, + ), + }, + ), + StringLiteral( + ExprStringLiteral { + range: 35..42, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 35..42, + value: "hello", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 66..69, + value: Dict( + ExprDict { + range: 66..69, + keys: [], + values: [], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 70..100, + value: Dict( + ExprDict { + range: 70..100, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 76..77, + value: Int( + 1, + ), + }, + ), + ), + Some( + NumberLiteral( + ExprNumberLiteral { + range: 90..91, + value: Int( + 3, + ), + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 83..84, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 97..98, + value: Int( + 4, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 111..132, + value: Dict( + ExprDict { + range: 111..132, + keys: [ + Some( + Dict( + ExprDict { + range: 112..118, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 113..114, + value: Int( + 1, + ), + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 116..117, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + ), + ], + values: [ + Dict( + ExprDict { + range: 120..131, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 121..122, + value: Int( + 3, + ), + }, + ), + ), + ], + values: [ + Dict( + ExprDict { + range: 124..130, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 125..126, + value: Int( + 4, + ), + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 128..129, + value: Int( + 5, + ), + }, + ), + ], + }, + ), + ], + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 155..171, + value: Dict( + ExprDict { + range: 155..171, + keys: [ + Some( + Lambda( + ExprLambda { + range: 156..167, + parameters: Some( + Parameters { + range: 163..164, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 163..164, + parameter: Parameter { + range: 163..164, + name: Identifier { + id: "x", + range: 163..164, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 166..167, + id: "x", + ctx: Load, + }, + ), + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 169..170, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 172..202, + value: Dict( + ExprDict { + range: 172..202, + keys: [ + Some( + StringLiteral( + ExprStringLiteral { + range: 173..176, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 173..176, + value: "A", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + Some( + StringLiteral( + ExprStringLiteral { + range: 194..197, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 194..197, + value: "B", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + ], + values: [ + Lambda( + ExprLambda { + range: 178..192, + parameters: Some( + Parameters { + range: 185..186, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 185..186, + parameter: Parameter { + range: 185..186, + name: Identifier { + id: "p", + range: 185..186, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: NoneLiteral( + ExprNoneLiteral { + range: 188..192, + }, + ), + }, + ), + Name( + ExprName { + range: 199..200, + id: "C", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 224..237, + value: Dict( + ExprDict { + range: 224..237, + keys: [ + Some( + Named( + ExprNamed { + range: 226..232, + target: Name( + ExprName { + range: 226..227, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 231..232, + value: Int( + 1, + ), + }, + ), + }, + ), + ), + ], + values: [ + Name( + ExprName { + range: 235..236, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 238..258, + value: Dict( + ExprDict { + range: 238..258, + keys: [ + Some( + Named( + ExprNamed { + range: 240..246, + target: Name( + ExprName { + range: 240..241, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 245..246, + value: Int( + 1, + ), + }, + ), + }, + ), + ), + ], + values: [ + Named( + ExprNamed { + range: 250..256, + target: Name( + ExprName { + range: 250..251, + id: "y", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 255..256, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 284..289, + value: Dict( + ExprDict { + range: 284..289, + keys: [ + None, + ], + values: [ + Name( + ExprName { + range: 287..288, + id: "d", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 290..301, + value: Dict( + ExprDict { + range: 290..301, + keys: [ + Some( + Name( + ExprName { + range: 291..292, + id: "a", + ctx: Load, + }, + ), + ), + None, + ], + values: [ + Name( + ExprName { + range: 294..295, + id: "b", + ctx: Load, + }, + ), + Name( + ExprName { + range: 299..300, + id: "d", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 302..312, + value: Dict( + ExprDict { + range: 302..312, + keys: [ + None, + None, + ], + values: [ + Name( + ExprName { + range: 305..306, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 310..311, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 313..338, + value: Dict( + ExprDict { + range: 313..338, + keys: [ + Some( + StringLiteral( + ExprStringLiteral { + range: 314..317, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 314..317, + value: "a", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + None, + Some( + StringLiteral( + ExprStringLiteral { + range: 329..332, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 329..332, + value: "d", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + ], + values: [ + StringLiteral( + ExprStringLiteral { + range: 319..322, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 319..322, + value: "b", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + Name( + ExprName { + range: 326..327, + id: "c", + ctx: Load, + }, + ), + StringLiteral( + ExprStringLiteral { + range: 334..337, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 334..337, + value: "e", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 339..367, + value: Dict( + ExprDict { + range: 339..367, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 340..341, + value: Int( + 1, + ), + }, + ), + ), + None, + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 343..344, + value: Int( + 2, + ), + }, + ), + Dict( + ExprDict { + range: 348..366, + keys: [ + Some( + StringLiteral( + ExprStringLiteral { + range: 349..357, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 349..357, + value: "nested", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + ], + values: [ + StringLiteral( + ExprStringLiteral { + range: 359..365, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 359..365, + value: "dict", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 368..393, + value: Dict( + ExprDict { + range: 368..393, + keys: [ + Some( + BinOp( + ExprBinOp { + range: 369..374, + left: Name( + ExprName { + range: 369..370, + id: "x", + ctx: Load, + }, + ), + op: Mult, + right: NumberLiteral( + ExprNumberLiteral { + range: 373..374, + value: Int( + 1, + ), + }, + ), + }, + ), + ), + None, + ], + values: [ + BinOp( + ExprBinOp { + range: 376..382, + left: Name( + ExprName { + range: 376..377, + id: "y", + ctx: Load, + }, + ), + op: Pow, + right: NumberLiteral( + ExprNumberLiteral { + range: 381..382, + value: Int( + 2, + ), + }, + ), + }, + ), + Call( + ExprCall { + range: 386..392, + func: Name( + ExprName { + range: 386..390, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 390..392, + args: [], + keywords: [], + }, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 460..471, + value: Dict( + ExprDict { + range: 460..471, + keys: [ + None, + ], + values: [ + UnaryOp( + ExprUnaryOp { + range: 464..469, + op: Not, + operand: Name( + ExprName { + range: 468..469, + id: "x", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 494..515, + value: Dict( + ExprDict { + range: 494..515, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 495..496, + value: Int( + 1, + ), + }, + ), + ), + ], + values: [ + If( + ExprIf { + range: 498..514, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 503..507, + value: true, + }, + ), + body: Name( + ExprName { + range: 498..499, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 513..514, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 516..575, + value: DictComp( + ExprDictComp { + range: 516..575, + key: If( + ExprIf { + range: 517..533, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 522..526, + value: true, + }, + ), + body: Name( + ExprName { + range: 517..518, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 532..533, + id: "y", + ctx: Load, + }, + ), + }, + ), + value: Name( + ExprName { + range: 535..536, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 537..555, + target: Name( + ExprName { + range: 541..542, + id: "x", + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 546..555, + func: Name( + ExprName { + range: 546..551, + id: "range", + ctx: Load, + }, + ), + arguments: Arguments { + range: 551..555, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 552..554, + value: Int( + 10, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ifs: [], + is_async: false, + }, + Comprehension { + range: 556..574, + target: Name( + ExprName { + range: 560..561, + id: "y", + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 565..574, + func: Name( + ExprName { + range: 565..570, + id: "range", + ctx: Load, + }, + ), + arguments: Arguments { + range: 570..574, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 571..573, + value: Int( + 10, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 576..600, + value: Dict( + ExprDict { + range: 576..600, + keys: [ + Some( + Set( + ExprSet { + range: 577..583, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 578..579, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 581..582, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + ), + Some( + Name( + ExprName { + range: 588..589, + id: "x", + ctx: Load, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 585..586, + value: Int( + 3, + ), + }, + ), + Dict( + ExprDict { + range: 591..598, + keys: [ + Some( + NumberLiteral( + ExprNumberLiteral { + range: 592..593, + value: Int( + 1, + ), + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 595..596, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 601..621, + value: Dict( + ExprDict { + range: 601..621, + keys: [ + Some( + Name( + ExprName { + range: 603..604, + id: "x", + ctx: Load, + }, + ), + ), + Some( + Name( + ExprName { + range: 613..614, + id: "z", + ctx: Load, + }, + ), + ), + ], + values: [ + Name( + ExprName { + range: 608..609, + id: "y", + ctx: Load, + }, + ), + Name( + ExprName { + range: 618..619, + id: "a", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary_comprehension.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary_comprehension.py.snap new file mode 100644 index 0000000000..13565f213c --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary_comprehension.py.snap @@ -0,0 +1,999 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/dictionary_comprehension.py +--- +## AST + +``` +Module( + ModModule { + range: 0..589, + body: [ + Expr( + StmtExpr { + range: 0..22, + value: SetComp( + ExprSetComp { + range: 0..22, + elt: Name( + ExprName { + range: 1..2, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 3..21, + target: Name( + ExprName { + range: 7..8, + id: "y", + ctx: Store, + }, + ), + iter: Tuple( + ExprTuple { + range: 12..21, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 13..14, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 16..17, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 19..20, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 23..42, + value: DictComp( + ExprDictComp { + range: 23..42, + key: Name( + ExprName { + range: 24..26, + id: "x1", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 28..30, + id: "x2", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 31..41, + target: Name( + ExprName { + range: 35..36, + id: "y", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 40..41, + id: "z", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 43..73, + value: DictComp( + ExprDictComp { + range: 43..73, + key: BinOp( + ExprBinOp { + range: 44..49, + left: Name( + ExprName { + range: 44..45, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 48..49, + value: Int( + 1, + ), + }, + ), + }, + ), + value: StringLiteral( + ExprStringLiteral { + range: 51..54, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 51..54, + value: "x", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + generators: [ + Comprehension { + range: 55..72, + target: Name( + ExprName { + range: 59..60, + id: "i", + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 64..72, + func: Name( + ExprName { + range: 64..69, + id: "range", + ctx: Load, + }, + ), + arguments: Arguments { + range: 69..72, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 70..71, + value: Int( + 5, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 74..122, + value: DictComp( + ExprDictComp { + range: 74..122, + key: Name( + ExprName { + range: 75..76, + id: "b", + ctx: Load, + }, + ), + value: BinOp( + ExprBinOp { + range: 78..83, + left: Name( + ExprName { + range: 78..79, + id: "c", + ctx: Load, + }, + ), + op: Mult, + right: NumberLiteral( + ExprNumberLiteral { + range: 82..83, + value: Int( + 2, + ), + }, + ), + }, + ), + generators: [ + Comprehension { + range: 84..121, + target: Name( + ExprName { + range: 88..89, + id: "c", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 93..94, + id: "d", + ctx: Load, + }, + ), + ifs: [ + Compare( + ExprCompare { + range: 98..104, + left: Name( + ExprName { + range: 98..99, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 103..104, + id: "w", + ctx: Load, + }, + ), + ], + }, + ), + BoolOp( + ExprBoolOp { + range: 108..116, + op: And, + values: [ + Name( + ExprName { + range: 108..109, + id: "y", + ctx: Load, + }, + ), + Name( + ExprName { + range: 114..116, + id: "yy", + ctx: Load, + }, + ), + ], + }, + ), + Name( + ExprName { + range: 120..121, + id: "z", + ctx: Load, + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 123..176, + value: DictComp( + ExprDictComp { + range: 123..176, + key: Name( + ExprName { + range: 124..125, + id: "a", + ctx: Load, + }, + ), + value: BinOp( + ExprBinOp { + range: 127..133, + left: Name( + ExprName { + range: 127..128, + id: "a", + ctx: Load, + }, + ), + op: Pow, + right: NumberLiteral( + ExprNumberLiteral { + range: 132..133, + value: Int( + 2, + ), + }, + ), + }, + ), + generators: [ + Comprehension { + range: 134..155, + target: Name( + ExprName { + range: 138..139, + id: "b", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 143..144, + id: "c", + ctx: Load, + }, + ), + ifs: [ + BoolOp( + ExprBoolOp { + range: 148..155, + op: And, + values: [ + Name( + ExprName { + range: 148..149, + id: "d", + ctx: Load, + }, + ), + Name( + ExprName { + range: 154..155, + id: "e", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: false, + }, + Comprehension { + range: 156..175, + target: Name( + ExprName { + range: 160..161, + id: "f", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 165..166, + id: "j", + ctx: Load, + }, + ), + ifs: [ + Compare( + ExprCompare { + range: 170..175, + left: Name( + ExprName { + range: 170..171, + id: "k", + ctx: Load, + }, + ), + ops: [ + Gt, + ], + comparators: [ + Name( + ExprName { + range: 174..175, + id: "h", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 177..231, + value: DictComp( + ExprDictComp { + range: 177..231, + key: Name( + ExprName { + range: 178..179, + id: "a", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 181..182, + id: "b", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 183..204, + target: Name( + ExprName { + range: 187..188, + id: "b", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 192..193, + id: "c", + ctx: Load, + }, + ), + ifs: [ + BoolOp( + ExprBoolOp { + range: 197..204, + op: And, + values: [ + Name( + ExprName { + range: 197..198, + id: "d", + ctx: Load, + }, + ), + Name( + ExprName { + range: 203..204, + id: "e", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: false, + }, + Comprehension { + range: 205..230, + target: Name( + ExprName { + range: 215..216, + id: "f", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 220..221, + id: "j", + ctx: Load, + }, + ), + ifs: [ + Compare( + ExprCompare { + range: 225..230, + left: Name( + ExprName { + range: 225..226, + id: "k", + ctx: Load, + }, + ), + ops: [ + Gt, + ], + comparators: [ + Name( + ExprName { + range: 229..230, + id: "h", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: true, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 232..252, + value: DictComp( + ExprDictComp { + range: 232..252, + key: Name( + ExprName { + range: 233..234, + id: "a", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 236..237, + id: "a", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 238..251, + target: Tuple( + ExprTuple { + range: 242..246, + elts: [ + Name( + ExprName { + range: 242..243, + id: "b", + ctx: Store, + }, + ), + Name( + ExprName { + range: 245..246, + id: "c", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: false, + }, + ), + iter: Name( + ExprName { + range: 250..251, + id: "d", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 391..416, + value: DictComp( + ExprDictComp { + range: 391..416, + key: Name( + ExprName { + range: 392..393, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 395..396, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 397..415, + target: Name( + ExprName { + range: 401..402, + id: "x", + ctx: Store, + }, + ), + iter: Yield( + ExprYield { + range: 407..414, + value: Some( + Name( + ExprName { + range: 413..414, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 417..447, + value: DictComp( + ExprDictComp { + range: 417..447, + key: Name( + ExprName { + range: 418..419, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 421..422, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 423..446, + target: Name( + ExprName { + range: 427..428, + id: "x", + ctx: Store, + }, + ), + iter: YieldFrom( + ExprYieldFrom { + range: 433..445, + value: Name( + ExprName { + range: 444..445, + id: "y", + ctx: Load, + }, + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 448..477, + value: DictComp( + ExprDictComp { + range: 448..477, + key: Name( + ExprName { + range: 449..450, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 452..453, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 454..476, + target: Name( + ExprName { + range: 458..459, + id: "x", + ctx: Store, + }, + ), + iter: Lambda( + ExprLambda { + range: 464..475, + parameters: Some( + Parameters { + range: 471..472, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 471..472, + parameter: Parameter { + range: 471..472, + name: Identifier { + id: "y", + range: 471..472, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 474..475, + id: "y", + ctx: Load, + }, + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 478..511, + value: DictComp( + ExprDictComp { + range: 478..511, + key: Name( + ExprName { + range: 479..480, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 482..483, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 484..510, + target: Name( + ExprName { + range: 488..489, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 493..497, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Yield( + ExprYield { + range: 502..509, + value: Some( + Name( + ExprName { + range: 508..509, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 512..550, + value: DictComp( + ExprDictComp { + range: 512..550, + key: Name( + ExprName { + range: 513..514, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 516..517, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 518..549, + target: Name( + ExprName { + range: 522..523, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 527..531, + id: "data", + ctx: Load, + }, + ), + ifs: [ + YieldFrom( + ExprYieldFrom { + range: 536..548, + value: Name( + ExprName { + range: 547..548, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 551..588, + value: DictComp( + ExprDictComp { + range: 551..588, + key: Name( + ExprName { + range: 552..553, + id: "x", + ctx: Load, + }, + ), + value: Name( + ExprName { + range: 555..556, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 557..587, + target: Name( + ExprName { + range: 561..562, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 566..570, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Lambda( + ExprLambda { + range: 575..586, + parameters: Some( + Parameters { + range: 582..583, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 582..583, + parameter: Parameter { + range: 582..583, + name: Identifier { + id: "y", + range: 582..583, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 585..586, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__f_string.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__f_string.py.snap new file mode 100644 index 0000000000..4f94e70796 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__f_string.py.snap @@ -0,0 +1,2702 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/f_string.py +--- +## AST + +``` +Module( + ModModule { + range: 0..979, + body: [ + Expr( + StmtExpr { + range: 18..21, + value: FString( + ExprFString { + range: 18..21, + value: FStringValue { + inner: Single( + FString( + FString { + range: 18..21, + elements: [], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 22..25, + value: FString( + ExprFString { + range: 22..25, + value: FStringValue { + inner: Single( + FString( + FString { + range: 22..25, + elements: [], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 26..29, + value: FString( + ExprFString { + range: 26..29, + value: FStringValue { + inner: Single( + FString( + FString { + range: 26..29, + elements: [], + flags: FStringFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 30..37, + value: FString( + ExprFString { + range: 30..37, + value: FStringValue { + inner: Single( + FString( + FString { + range: 30..37, + elements: [], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: true, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 38..45, + value: FString( + ExprFString { + range: 38..45, + value: FStringValue { + inner: Single( + FString( + FString { + range: 38..45, + elements: [], + flags: FStringFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: true, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 47..56, + value: FString( + ExprFString { + range: 47..56, + value: FStringValue { + inner: Single( + FString( + FString { + range: 47..56, + elements: [ + Expression( + FStringExpressionElement { + range: 49..55, + expression: StringLiteral( + ExprStringLiteral { + range: 50..54, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 50..54, + value: " f", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 57..67, + value: FString( + ExprFString { + range: 57..67, + value: FStringValue { + inner: Single( + FString( + FString { + range: 57..67, + elements: [ + Expression( + FStringExpressionElement { + range: 59..66, + expression: Name( + ExprName { + range: 60..63, + id: "foo", + ctx: Load, + }, + ), + debug_text: None, + conversion: Str, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 68..75, + value: FString( + ExprFString { + range: 68..75, + value: FStringValue { + inner: Single( + FString( + FString { + range: 68..75, + elements: [ + Expression( + FStringExpressionElement { + range: 70..74, + expression: Tuple( + ExprTuple { + range: 71..73, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 71..72, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 76..86, + value: FString( + ExprFString { + range: 76..86, + value: FStringValue { + inner: Single( + FString( + FString { + range: 76..86, + elements: [ + Expression( + FStringExpressionElement { + range: 78..85, + expression: Compare( + ExprCompare { + range: 79..83, + left: NumberLiteral( + ExprNumberLiteral { + range: 79..80, + value: Int( + 3, + ), + }, + ), + ops: [ + NotEq, + ], + comparators: [ + NumberLiteral( + ExprNumberLiteral { + range: 82..83, + value: Int( + 4, + ), + }, + ), + ], + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 84..84, + elements: [], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 87..102, + value: FString( + ExprFString { + range: 87..102, + value: FStringValue { + inner: Single( + FString( + FString { + range: 87..102, + elements: [ + Expression( + FStringExpressionElement { + range: 89..101, + expression: NumberLiteral( + ExprNumberLiteral { + range: 90..91, + value: Int( + 3, + ), + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 92..100, + elements: [ + Expression( + FStringExpressionElement { + range: 92..97, + expression: StringLiteral( + ExprStringLiteral { + range: 93..96, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 93..96, + value: "}", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 97..100, + value: ">10", + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 103..118, + value: FString( + ExprFString { + range: 103..118, + value: FStringValue { + inner: Single( + FString( + FString { + range: 103..118, + elements: [ + Expression( + FStringExpressionElement { + range: 105..117, + expression: NumberLiteral( + ExprNumberLiteral { + range: 106..107, + value: Int( + 3, + ), + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 108..116, + elements: [ + Expression( + FStringExpressionElement { + range: 108..113, + expression: StringLiteral( + ExprStringLiteral { + range: 109..112, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 109..112, + value: "{", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 113..116, + value: ">10", + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 119..133, + value: FString( + ExprFString { + range: 119..133, + value: FStringValue { + inner: Single( + FString( + FString { + range: 119..133, + elements: [ + Expression( + FStringExpressionElement { + range: 121..132, + expression: Name( + ExprName { + range: 124..127, + id: "foo", + ctx: Load, + }, + ), + debug_text: Some( + DebugText { + leading: " ", + trailing: " = ", + }, + ), + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 134..154, + value: FString( + ExprFString { + range: 134..154, + value: FStringValue { + inner: Single( + FString( + FString { + range: 134..154, + elements: [ + Expression( + FStringExpressionElement { + range: 136..153, + expression: Name( + ExprName { + range: 139..142, + id: "foo", + ctx: Load, + }, + ), + debug_text: Some( + DebugText { + leading: " ", + trailing: " = ", + }, + ), + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 147..152, + elements: [ + Literal( + FStringLiteralElement { + range: 147..152, + value: ".3f ", + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 155..173, + value: FString( + ExprFString { + range: 155..173, + value: FStringValue { + inner: Single( + FString( + FString { + range: 155..173, + elements: [ + Expression( + FStringExpressionElement { + range: 157..172, + expression: Name( + ExprName { + range: 160..163, + id: "foo", + ctx: Load, + }, + ), + debug_text: Some( + DebugText { + leading: " ", + trailing: " = ", + }, + ), + conversion: Str, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 174..190, + value: FString( + ExprFString { + range: 174..190, + value: FStringValue { + inner: Single( + FString( + FString { + range: 174..190, + elements: [ + Expression( + FStringExpressionElement { + range: 176..189, + expression: Tuple( + ExprTuple { + range: 179..183, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 179..180, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 182..183, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + debug_text: Some( + DebugText { + leading: " ", + trailing: " = ", + }, + ), + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 191..217, + value: FString( + ExprFString { + range: 191..217, + value: FStringValue { + inner: Single( + FString( + FString { + range: 191..217, + elements: [ + Expression( + FStringExpressionElement { + range: 193..216, + expression: FString( + ExprFString { + range: 194..210, + value: FStringValue { + inner: Single( + FString( + FString { + range: 194..210, + elements: [ + Expression( + FStringExpressionElement { + range: 196..209, + expression: NumberLiteral( + ExprNumberLiteral { + range: 197..203, + value: Float( + 3.1415, + ), + }, + ), + debug_text: Some( + DebugText { + leading: "", + trailing: "=", + }, + ), + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 205..208, + elements: [ + Literal( + FStringLiteralElement { + range: 205..208, + value: ".1f", + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 211..215, + elements: [ + Literal( + FStringLiteralElement { + range: 211..215, + value: "*^20", + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 219..253, + value: Dict( + ExprDict { + range: 219..253, + keys: [ + Some( + FString( + ExprFString { + range: 220..248, + value: FStringValue { + inner: Concatenated( + [ + Literal( + StringLiteral { + range: 220..226, + value: "foo ", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 227..242, + elements: [ + Literal( + FStringLiteralElement { + range: 229..233, + value: "bar ", + }, + ), + Expression( + FStringExpressionElement { + range: 233..240, + expression: BinOp( + ExprBinOp { + range: 234..239, + left: Name( + ExprName { + range: 234..235, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 238..239, + id: "y", + ctx: Load, + }, + ), + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 240..241, + value: " ", + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 243..248, + value: "baz", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 250..252, + value: Int( + 10, + ), + }, + ), + ], + }, + ), + }, + ), + Match( + StmtMatch { + range: 254..345, + subject: Name( + ExprName { + range: 260..263, + id: "foo", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 269..293, + pattern: MatchValue( + PatternMatchValue { + range: 274..279, + value: StringLiteral( + ExprStringLiteral { + range: 274..279, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 274..279, + value: "one", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 289..293, + }, + ), + ], + }, + MatchCase { + range: 298..345, + pattern: MatchValue( + PatternMatchValue { + range: 303..331, + value: StringLiteral( + ExprStringLiteral { + range: 303..331, + value: StringLiteralValue { + inner: Concatenated( + ConcatenatedStringLiteral { + strings: [ + StringLiteral { + range: 303..316, + value: "implicitly ", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + StringLiteral { + range: 317..331, + value: "concatenated", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ], + value: "implicitly concatenated", + }, + ), + }, + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 341..345, + }, + ), + ], + }, + ], + }, + ), + Expr( + StmtExpr { + range: 347..364, + value: FString( + ExprFString { + range: 347..364, + value: FStringValue { + inner: Single( + FString( + FString { + range: 347..364, + elements: [ + Literal( + FStringLiteralElement { + range: 349..350, + value: "\\", + }, + ), + Expression( + FStringExpressionElement { + range: 350..355, + expression: Name( + ExprName { + range: 351..354, + id: "foo", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 355..356, + value: "\\", + }, + ), + Expression( + FStringExpressionElement { + range: 356..363, + expression: Name( + ExprName { + range: 357..360, + id: "bar", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 361..362, + elements: [ + Literal( + FStringLiteralElement { + range: 361..362, + value: "\\", + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 365..379, + value: FString( + ExprFString { + range: 365..379, + value: FStringValue { + inner: Single( + FString( + FString { + range: 365..379, + elements: [ + Literal( + FStringLiteralElement { + range: 367..378, + value: "\\{foo\\}", + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 380..420, + value: FString( + ExprFString { + range: 380..420, + value: FStringValue { + inner: Single( + FString( + FString { + range: 380..420, + elements: [ + Expression( + FStringExpressionElement { + range: 384..417, + expression: Name( + ExprName { + range: 390..393, + id: "foo", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 394..416, + elements: [ + Literal( + FStringLiteralElement { + range: 394..416, + value: "x\n y\n z\n", + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: true, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 421..439, + value: FString( + ExprFString { + range: 421..439, + value: FStringValue { + inner: Single( + FString( + FString { + range: 421..439, + elements: [ + Expression( + FStringExpressionElement { + range: 423..438, + expression: Name( + ExprName { + range: 428..431, + id: "foo", + ctx: Load, + }, + ), + debug_text: Some( + DebugText { + leading: " ( ", + trailing: " ) = ", + }, + ), + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 441..486, + value: FString( + ExprFString { + range: 441..486, + value: FStringValue { + inner: Single( + FString( + FString { + range: 441..486, + elements: [ + Literal( + FStringLiteralElement { + range: 443..450, + value: "normal ", + }, + ), + Expression( + FStringExpressionElement { + range: 450..455, + expression: Name( + ExprName { + range: 451..454, + id: "foo", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 455..468, + value: " {another} ", + }, + ), + Expression( + FStringExpressionElement { + range: 468..473, + expression: Name( + ExprName { + range: 469..472, + id: "bar", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 473..476, + value: " {", + }, + ), + Expression( + FStringExpressionElement { + range: 476..483, + expression: Name( + ExprName { + range: 477..482, + id: "three", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 483..485, + value: "}", + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 487..529, + value: FString( + ExprFString { + range: 487..529, + value: FStringValue { + inner: Single( + FString( + FString { + range: 487..529, + elements: [ + Literal( + FStringLiteralElement { + range: 489..496, + value: "normal ", + }, + ), + Expression( + FStringExpressionElement { + range: 496..503, + expression: Name( + ExprName { + range: 497..500, + id: "foo", + ctx: Load, + }, + ), + debug_text: None, + conversion: Ascii, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 503..504, + value: " ", + }, + ), + Expression( + FStringExpressionElement { + range: 504..511, + expression: Name( + ExprName { + range: 505..508, + id: "bar", + ctx: Load, + }, + ), + debug_text: None, + conversion: Str, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 511..512, + value: " ", + }, + ), + Expression( + FStringExpressionElement { + range: 512..519, + expression: Name( + ExprName { + range: 513..516, + id: "baz", + ctx: Load, + }, + ), + debug_text: None, + conversion: Repr, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 519..520, + value: " ", + }, + ), + Expression( + FStringExpressionElement { + range: 520..528, + expression: Name( + ExprName { + range: 521..527, + id: "foobar", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 530..549, + value: FString( + ExprFString { + range: 530..549, + value: FStringValue { + inner: Single( + FString( + FString { + range: 530..549, + elements: [ + Literal( + FStringLiteralElement { + range: 532..539, + value: "normal ", + }, + ), + Expression( + FStringExpressionElement { + range: 539..548, + expression: Name( + ExprName { + range: 540..541, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 542..547, + elements: [ + Literal( + FStringLiteralElement { + range: 542..547, + value: "y + 2", + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 550..568, + value: FString( + ExprFString { + range: 550..568, + value: FStringValue { + inner: Single( + FString( + FString { + range: 550..568, + elements: [ + Expression( + FStringExpressionElement { + range: 552..567, + expression: Name( + ExprName { + range: 553..554, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 555..566, + elements: [ + Expression( + FStringExpressionElement { + range: 555..566, + expression: Call( + ExprCall { + range: 556..565, + func: Attribute( + ExprAttribute { + range: 556..563, + value: Set( + ExprSet { + range: 556..559, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 557..558, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + attr: Identifier { + id: "pop", + range: 560..563, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 563..565, + args: [], + keywords: [], + }, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 569..588, + value: FString( + ExprFString { + range: 569..588, + value: FStringValue { + inner: Single( + FString( + FString { + range: 569..588, + elements: [ + Expression( + FStringExpressionElement { + range: 571..587, + expression: Lambda( + ExprLambda { + range: 573..585, + parameters: Some( + Parameters { + range: 580..581, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 580..581, + parameter: Parameter { + range: 580..581, + name: Identifier { + id: "x", + range: 580..581, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Set( + ExprSet { + range: 582..585, + elts: [ + Name( + ExprName { + range: 583..584, + id: "x", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 589..597, + value: FString( + ExprFString { + range: 589..597, + value: FStringValue { + inner: Single( + FString( + FString { + range: 589..597, + elements: [ + Expression( + FStringExpressionElement { + range: 591..596, + expression: Name( + ExprName { + range: 592..593, + id: "x", + ctx: Load, + }, + ), + debug_text: Some( + DebugText { + leading: "", + trailing: " =", + }, + ), + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 598..611, + value: FString( + ExprFString { + range: 598..611, + value: FStringValue { + inner: Single( + FString( + FString { + range: 598..611, + elements: [ + Expression( + FStringExpressionElement { + range: 600..610, + expression: Name( + ExprName { + range: 605..606, + id: "x", + ctx: Load, + }, + ), + debug_text: Some( + DebugText { + leading: " ", + trailing: " = ", + }, + ), + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 612..621, + value: FString( + ExprFString { + range: 612..621, + value: FStringValue { + inner: Single( + FString( + FString { + range: 612..621, + elements: [ + Expression( + FStringExpressionElement { + range: 614..620, + expression: Name( + ExprName { + range: 615..616, + id: "x", + ctx: Load, + }, + ), + debug_text: Some( + DebugText { + leading: "", + trailing: "=", + }, + ), + conversion: Ascii, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 622..636, + value: FString( + ExprFString { + range: 622..636, + value: FStringValue { + inner: Single( + FString( + FString { + range: 622..636, + elements: [ + Expression( + FStringExpressionElement { + range: 624..635, + expression: Name( + ExprName { + range: 625..626, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 627..634, + elements: [ + Literal( + FStringLiteralElement { + range: 627..634, + value: ".3f!r =", + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 637..653, + value: FString( + ExprFString { + range: 637..653, + value: FStringValue { + inner: Single( + FString( + FString { + range: 637..653, + elements: [ + Expression( + FStringExpressionElement { + range: 639..652, + expression: Name( + ExprName { + range: 640..641, + id: "x", + ctx: Load, + }, + ), + debug_text: Some( + DebugText { + leading: "", + trailing: " = ", + }, + ), + conversion: Repr, + format_spec: Some( + FStringFormatSpec { + range: 648..651, + elements: [ + Literal( + FStringLiteralElement { + range: 648..651, + value: ".3f", + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 654..667, + value: FString( + ExprFString { + range: 654..667, + value: FStringValue { + inner: Single( + FString( + FString { + range: 654..667, + elements: [ + Expression( + FStringExpressionElement { + range: 656..666, + expression: Name( + ExprName { + range: 657..658, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 659..665, + elements: [ + Literal( + FStringLiteralElement { + range: 659..665, + value: ".3f=!r", + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 668..682, + value: FString( + ExprFString { + range: 668..682, + value: FStringValue { + inner: Concatenated( + [ + Literal( + StringLiteral { + range: 668..675, + value: "hello", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 676..682, + elements: [ + Expression( + FStringExpressionElement { + range: 678..681, + expression: Name( + ExprName { + range: 679..680, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 683..696, + value: FString( + ExprFString { + range: 683..696, + value: FStringValue { + inner: Concatenated( + [ + FString( + FString { + range: 683..689, + elements: [ + Expression( + FStringExpressionElement { + range: 685..688, + expression: Name( + ExprName { + range: 686..687, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 690..696, + elements: [ + Expression( + FStringExpressionElement { + range: 692..695, + expression: Name( + ExprName { + range: 693..694, + id: "y", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 697..711, + value: FString( + ExprFString { + range: 697..711, + value: FStringValue { + inner: Concatenated( + [ + FString( + FString { + range: 697..703, + elements: [ + Expression( + FStringExpressionElement { + range: 699..702, + expression: Name( + ExprName { + range: 700..701, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 704..711, + value: "world", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 712..756, + value: FString( + ExprFString { + range: 712..756, + value: FStringValue { + inner: Single( + FString( + FString { + range: 712..756, + elements: [ + Literal( + FStringLiteralElement { + range: 714..739, + value: "Invalid args in command: ", + }, + ), + Expression( + FStringExpressionElement { + range: 739..755, + expression: Tuple( + ExprTuple { + range: 740..754, + elts: [ + Name( + ExprName { + range: 740..747, + id: "command", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 749..754, + value: Name( + ExprName { + range: 750..754, + id: "args", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 757..775, + value: FString( + ExprFString { + range: 757..775, + value: FStringValue { + inner: Concatenated( + [ + Literal( + StringLiteral { + range: 757..762, + value: "foo", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 763..769, + elements: [ + Expression( + FStringExpressionElement { + range: 765..768, + expression: Name( + ExprName { + range: 766..767, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 770..775, + value: "bar", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 776..825, + value: FString( + ExprFString { + range: 782..823, + value: FStringValue { + inner: Concatenated( + [ + FString( + FString { + range: 782..786, + elements: [ + Literal( + FStringLiteralElement { + range: 784..785, + value: "a", + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 791..795, + elements: [ + Literal( + FStringLiteralElement { + range: 793..794, + value: "b", + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 800..803, + value: "c", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 808..813, + elements: [ + Literal( + FStringLiteralElement { + range: 811..812, + value: "d", + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Raw { + uppercase_r: false, + }, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 818..823, + elements: [ + Literal( + FStringLiteralElement { + range: 821..822, + value: "e", + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Raw { + uppercase_r: false, + }, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 850..879, + value: FString( + ExprFString { + range: 850..879, + value: FStringValue { + inner: Concatenated( + [ + Literal( + StringLiteral { + range: 850..856, + value: "foo", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Unicode, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 857..865, + elements: [ + Expression( + FStringExpressionElement { + range: 859..864, + expression: Name( + ExprName { + range: 860..863, + id: "bar", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 866..871, + value: "baz", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 872..879, + value: " some", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 880..909, + value: FString( + ExprFString { + range: 880..909, + value: FStringValue { + inner: Concatenated( + [ + Literal( + StringLiteral { + range: 880..885, + value: "foo", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 886..894, + elements: [ + Expression( + FStringExpressionElement { + range: 888..893, + expression: Name( + ExprName { + range: 889..892, + id: "bar", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 895..901, + value: "baz", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Unicode, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 902..909, + value: " some", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 910..939, + value: FString( + ExprFString { + range: 910..939, + value: FStringValue { + inner: Concatenated( + [ + Literal( + StringLiteral { + range: 910..915, + value: "foo", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 916..924, + elements: [ + Expression( + FStringExpressionElement { + range: 918..923, + expression: Name( + ExprName { + range: 919..922, + id: "bar", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 925..930, + value: "baz", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 931..939, + value: " some", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Unicode, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 940..978, + value: FString( + ExprFString { + range: 940..978, + value: FStringValue { + inner: Concatenated( + [ + Literal( + StringLiteral { + range: 940..946, + value: "foo", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Unicode, + triple_quoted: false, + }, + }, + ), + FString( + FString { + range: 947..966, + elements: [ + Literal( + FStringLiteralElement { + range: 949..953, + value: "bar ", + }, + ), + Expression( + FStringExpressionElement { + range: 953..958, + expression: Name( + ExprName { + range: 954..957, + id: "baz", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 958..965, + value: " really", + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 967..973, + value: "bar", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Unicode, + triple_quoted: false, + }, + }, + ), + Literal( + StringLiteral { + range: 974..978, + value: "no", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + ], + ), + }, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__generator.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__generator.py.snap new file mode 100644 index 0000000000..784a012625 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__generator.py.snap @@ -0,0 +1,697 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/generator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..482, + body: [ + Expr( + StmtExpr { + range: 0..22, + value: Generator( + ExprGenerator { + range: 0..22, + elt: Name( + ExprName { + range: 1..2, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 3..21, + target: Name( + ExprName { + range: 7..13, + id: "target", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 17..21, + id: "iter", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 23..51, + value: Generator( + ExprGenerator { + range: 23..51, + elt: Name( + ExprName { + range: 24..25, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 26..50, + target: Name( + ExprName { + range: 36..42, + id: "target", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 46..50, + id: "iter", + ctx: Load, + }, + ), + ifs: [], + is_async: true, + }, + ], + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 52..100, + value: Generator( + ExprGenerator { + range: 52..100, + elt: Name( + ExprName { + range: 53..54, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 55..99, + target: Name( + ExprName { + range: 59..65, + id: "target", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 69..73, + id: "iter", + ctx: Load, + }, + ), + ifs: [ + Compare( + ExprCompare { + range: 77..83, + left: Name( + ExprName { + range: 77..78, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 82..83, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + BoolOp( + ExprBoolOp { + range: 87..94, + op: And, + values: [ + Name( + ExprName { + range: 87..88, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 93..94, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + Name( + ExprName { + range: 98..99, + id: "c", + ctx: Load, + }, + ), + ], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 101..166, + value: Generator( + ExprGenerator { + range: 101..166, + elt: Name( + ExprName { + range: 102..103, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 104..135, + target: Name( + ExprName { + range: 108..115, + id: "target1", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 119..124, + id: "iter1", + ctx: Load, + }, + ), + ifs: [ + BoolOp( + ExprBoolOp { + range: 128..135, + op: And, + values: [ + Name( + ExprName { + range: 128..129, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 134..135, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: false, + }, + Comprehension { + range: 136..165, + target: Name( + ExprName { + range: 140..147, + id: "target2", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 151..156, + id: "iter2", + ctx: Load, + }, + ), + ifs: [ + Compare( + ExprCompare { + range: 160..165, + left: Name( + ExprName { + range: 160..161, + id: "a", + ctx: Load, + }, + ), + ops: [ + Gt, + ], + comparators: [ + Name( + ExprName { + range: 164..165, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 167..238, + value: Generator( + ExprGenerator { + range: 167..238, + elt: Name( + ExprName { + range: 168..169, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 170..201, + target: Name( + ExprName { + range: 174..181, + id: "target1", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 185..190, + id: "iter1", + ctx: Load, + }, + ), + ifs: [ + BoolOp( + ExprBoolOp { + range: 194..201, + op: And, + values: [ + Name( + ExprName { + range: 194..195, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 200..201, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: false, + }, + Comprehension { + range: 202..237, + target: Name( + ExprName { + range: 212..219, + id: "target2", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 223..228, + id: "iter2", + ctx: Load, + }, + ), + ifs: [ + Compare( + ExprCompare { + range: 232..237, + left: Name( + ExprName { + range: 232..233, + id: "a", + ctx: Load, + }, + ), + ops: [ + Gt, + ], + comparators: [ + Name( + ExprName { + range: 236..237, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: true, + }, + ], + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 259..282, + value: Generator( + ExprGenerator { + range: 259..282, + elt: Named( + ExprNamed { + range: 260..270, + target: Name( + ExprName { + range: 260..261, + id: "x", + ctx: Store, + }, + ), + value: BinOp( + ExprBinOp { + range: 265..270, + left: Name( + ExprName { + range: 265..266, + id: "y", + ctx: Load, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 269..270, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + generators: [ + Comprehension { + range: 271..281, + target: Name( + ExprName { + range: 275..276, + id: "y", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 280..281, + id: "z", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 300..326, + value: Generator( + ExprGenerator { + range: 300..326, + elt: If( + ExprIf { + range: 301..314, + test: Name( + ExprName { + range: 306..307, + id: "y", + ctx: Load, + }, + ), + body: Name( + ExprName { + range: 301..302, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 313..314, + id: "y", + ctx: Load, + }, + ), + }, + ), + generators: [ + Comprehension { + range: 315..325, + target: Name( + ExprName { + range: 319..320, + id: "y", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 324..325, + id: "z", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 340..481, + value: Call( + ExprCall { + range: 340..481, + func: Attribute( + ExprAttribute { + range: 340..348, + value: StringLiteral( + ExprStringLiteral { + range: 340..343, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 340..343, + value: " ", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + attr: Identifier { + id: "join", + range: 344..348, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 348..481, + args: [ + Generator( + ExprGenerator { + range: 354..479, + elt: Name( + ExprName { + range: 354..357, + id: "sql", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 362..479, + target: Name( + ExprName { + range: 366..369, + id: "sql", + ctx: Store, + }, + ), + iter: Tuple( + ExprTuple { + range: 373..479, + elts: [ + If( + ExprIf { + range: 383..420, + test: Name( + ExprName { + range: 405..410, + id: "limit", + ctx: Load, + }, + ), + body: BinOp( + ExprBinOp { + range: 383..401, + left: StringLiteral( + ExprStringLiteral { + range: 383..393, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 383..393, + value: "LIMIT %d", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + op: Mod, + right: Name( + ExprName { + range: 396..401, + id: "limit", + ctx: Load, + }, + ), + }, + ), + orelse: NoneLiteral( + ExprNoneLiteral { + range: 416..420, + }, + ), + }, + ), + If( + ExprIf { + range: 430..472, + test: Name( + ExprName { + range: 456..462, + id: "offset", + ctx: Load, + }, + ), + body: BinOp( + ExprBinOp { + range: 431..451, + left: StringLiteral( + ExprStringLiteral { + range: 431..442, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 431..442, + value: "OFFSET %d", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + op: Mod, + right: Name( + ExprName { + range: 445..451, + id: "offset", + ctx: Load, + }, + ), + }, + ), + orelse: NoneLiteral( + ExprNoneLiteral { + range: 468..472, + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: false, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__if.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__if.py.snap new file mode 100644 index 0000000000..cb7c075732 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__if.py.snap @@ -0,0 +1,613 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/if.py +--- +## AST + +``` +Module( + ModModule { + range: 0..423, + body: [ + Expr( + StmtExpr { + range: 0..16, + value: If( + ExprIf { + range: 0..16, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 5..9, + value: true, + }, + ), + body: Name( + ExprName { + range: 0..1, + id: "a", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 15..16, + id: "b", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 17..35, + value: If( + ExprIf { + range: 17..35, + test: Name( + ExprName { + range: 24..25, + id: "x", + ctx: Load, + }, + ), + body: Call( + ExprCall { + range: 17..20, + func: Name( + ExprName { + range: 17..18, + id: "f", + ctx: Load, + }, + ), + arguments: Arguments { + range: 18..20, + args: [], + keywords: [], + }, + }, + ), + orelse: NoneLiteral( + ExprNoneLiteral { + range: 31..35, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 36..61, + value: If( + ExprIf { + range: 36..61, + test: Name( + ExprName { + range: 41..42, + id: "b", + ctx: Load, + }, + ), + body: Name( + ExprName { + range: 36..37, + id: "a", + ctx: Load, + }, + ), + orelse: If( + ExprIf { + range: 48..61, + test: Name( + ExprName { + range: 53..54, + id: "d", + ctx: Load, + }, + ), + body: Name( + ExprName { + range: 48..49, + id: "c", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 60..61, + id: "e", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 62..84, + value: If( + ExprIf { + range: 62..84, + test: Compare( + ExprCompare { + range: 71..76, + left: NumberLiteral( + ExprNumberLiteral { + range: 71..72, + value: Int( + 1, + ), + }, + ), + ops: [ + Lt, + ], + comparators: [ + NumberLiteral( + ExprNumberLiteral { + range: 75..76, + value: Int( + 0, + ), + }, + ), + ], + }, + ), + body: BinOp( + ExprBinOp { + range: 62..67, + left: NumberLiteral( + ExprNumberLiteral { + range: 62..63, + value: Int( + 1, + ), + }, + ), + op: Add, + right: Name( + ExprName { + range: 66..67, + id: "x", + ctx: Load, + }, + ), + }, + ), + orelse: UnaryOp( + ExprUnaryOp { + range: 82..84, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 83..84, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 85..108, + value: If( + ExprIf { + range: 85..108, + test: Name( + ExprName { + range: 96..97, + id: "x", + ctx: Load, + }, + ), + body: BoolOp( + ExprBoolOp { + range: 85..92, + op: And, + values: [ + Name( + ExprName { + range: 85..86, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 91..92, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + orelse: BooleanLiteral( + ExprBooleanLiteral { + range: 103..108, + value: false, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 109..127, + value: If( + ExprIf { + range: 109..127, + test: Name( + ExprName { + range: 119..120, + id: "y", + ctx: Load, + }, + ), + body: Compare( + ExprCompare { + range: 109..115, + left: Name( + ExprName { + range: 109..110, + id: "x", + ctx: Load, + }, + ), + ops: [ + LtE, + ], + comparators: [ + Name( + ExprName { + range: 114..115, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + orelse: Name( + ExprName { + range: 126..127, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 128..154, + value: If( + ExprIf { + range: 128..154, + test: BoolOp( + ExprBoolOp { + range: 136..143, + op: And, + values: [ + Name( + ExprName { + range: 136..137, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 142..143, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + body: BooleanLiteral( + ExprBooleanLiteral { + range: 128..132, + value: true, + }, + ), + orelse: BooleanLiteral( + ExprBooleanLiteral { + range: 149..154, + value: false, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 155..171, + value: Tuple( + ExprTuple { + range: 155..171, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 155..156, + value: Int( + 1, + ), + }, + ), + If( + ExprIf { + range: 158..171, + test: Name( + ExprName { + range: 163..164, + id: "a", + ctx: Load, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 158..159, + value: Int( + 1, + ), + }, + ), + orelse: Name( + ExprName { + range: 170..171, + id: "c", + ctx: Load, + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 214..240, + value: If( + ExprIf { + range: 214..240, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 219..223, + value: true, + }, + ), + body: Name( + ExprName { + range: 214..215, + id: "x", + ctx: Load, + }, + ), + orelse: Lambda( + ExprLambda { + range: 229..240, + parameters: Some( + Parameters { + range: 236..237, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 236..237, + parameter: Parameter { + range: 236..237, + name: Identifier { + id: "y", + range: 236..237, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 239..240, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 302..323, + value: If( + ExprIf { + range: 302..323, + test: Yield( + ExprYield { + range: 308..315, + value: Some( + Name( + ExprName { + range: 314..315, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + body: Name( + ExprName { + range: 302..303, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 322..323, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 324..350, + value: If( + ExprIf { + range: 324..350, + test: YieldFrom( + ExprYieldFrom { + range: 330..342, + value: Name( + ExprName { + range: 341..342, + id: "x", + ctx: Load, + }, + ), + }, + ), + body: Name( + ExprName { + range: 324..325, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 349..350, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 351..376, + value: If( + ExprIf { + range: 351..376, + test: Lambda( + ExprLambda { + range: 357..368, + parameters: Some( + Parameters { + range: 364..365, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 364..365, + parameter: Parameter { + range: 364..365, + name: Identifier { + id: "x", + range: 364..365, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 367..368, + id: "x", + ctx: Load, + }, + ), + }, + ), + body: Name( + ExprName { + range: 351..352, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 375..376, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 408..423, + value: If( + ExprIf { + range: 409..422, + test: Name( + ExprName { + range: 414..415, + id: "y", + ctx: Load, + }, + ), + body: Name( + ExprName { + range: 409..410, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 421..422, + id: "z", + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__lambda.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__lambda.py.snap new file mode 100644 index 0000000000..b0c41a886a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__lambda.py.snap @@ -0,0 +1,1521 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/lambda.py +--- +## AST + +``` +Module( + ModModule { + range: 0..530, + body: [ + Expr( + StmtExpr { + range: 0..9, + value: Lambda( + ExprLambda { + range: 0..9, + parameters: None, + body: Name( + ExprName { + range: 8..9, + id: "a", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 10..19, + value: Lambda( + ExprLambda { + range: 10..19, + parameters: None, + body: NumberLiteral( + ExprNumberLiteral { + range: 18..19, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 20..31, + value: Lambda( + ExprLambda { + range: 20..31, + parameters: Some( + Parameters { + range: 27..28, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 27..28, + parameter: Parameter { + range: 27..28, + name: Identifier { + id: "x", + range: 27..28, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 30..31, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 32..48, + value: Lambda( + ExprLambda { + range: 32..48, + parameters: Some( + Parameters { + range: 39..43, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 39..40, + parameter: Parameter { + range: 39..40, + name: Identifier { + id: "x", + range: 39..40, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 42..43, + parameter: Parameter { + range: 42..43, + name: Identifier { + id: "y", + range: 42..43, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: EllipsisLiteral( + ExprEllipsisLiteral { + range: 45..48, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 49..66, + value: Lambda( + ExprLambda { + range: 49..66, + parameters: Some( + Parameters { + range: 56..63, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 56..57, + parameter: Parameter { + range: 56..57, + name: Identifier { + id: "a", + range: 56..57, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 59..60, + parameter: Parameter { + range: 59..60, + name: Identifier { + id: "b", + range: 59..60, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 62..63, + parameter: Parameter { + range: 62..63, + name: Identifier { + id: "c", + range: 62..63, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 65..66, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 67..90, + value: Lambda( + ExprLambda { + range: 67..90, + parameters: Some( + Parameters { + range: 74..87, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 74..75, + parameter: Parameter { + range: 74..75, + name: Identifier { + id: "a", + range: 74..75, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 77..81, + parameter: Parameter { + range: 77..78, + name: Identifier { + id: "b", + range: 77..78, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 79..81, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 83..87, + parameter: Parameter { + range: 83..84, + name: Identifier { + id: "c", + range: 83..84, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 85..87, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 89..90, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 91..109, + value: Lambda( + ExprLambda { + range: 91..109, + parameters: Some( + Parameters { + range: 98..102, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 98..99, + parameter: Parameter { + range: 98..99, + name: Identifier { + id: "x", + range: 98..99, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 101..102, + parameter: Parameter { + range: 101..102, + name: Identifier { + id: "y", + range: 101..102, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: BinOp( + ExprBinOp { + range: 104..109, + left: Name( + ExprName { + range: 104..105, + id: "x", + ctx: Load, + }, + ), + op: Mult, + right: Name( + ExprName { + range: 108..109, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 110..130, + value: Lambda( + ExprLambda { + range: 110..130, + parameters: Some( + Parameters { + range: 117..123, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 117..118, + parameter: Parameter { + range: 117..118, + name: Identifier { + id: "y", + range: 117..118, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 120..123, + parameter: Parameter { + range: 120..121, + name: Identifier { + id: "z", + range: 120..121, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 122..123, + value: Int( + 1, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: BinOp( + ExprBinOp { + range: 125..130, + left: Name( + ExprName { + range: 125..126, + id: "z", + ctx: Load, + }, + ), + op: Mult, + right: Name( + ExprName { + range: 129..130, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 131..143, + value: Lambda( + ExprLambda { + range: 131..143, + parameters: Some( + Parameters { + range: 138..140, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 138..140, + name: Identifier { + id: "a", + range: 139..140, + }, + annotation: None, + }, + ), + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 142..143, + id: "a", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 144..166, + value: Lambda( + ExprLambda { + range: 144..166, + parameters: Some( + Parameters { + range: 151..161, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 151..153, + name: Identifier { + id: "a", + range: 152..153, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 155..156, + parameter: Parameter { + range: 155..156, + name: Identifier { + id: "z", + range: 155..156, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 158..161, + parameter: Parameter { + range: 158..159, + name: Identifier { + id: "x", + range: 158..159, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 160..161, + value: Int( + 0, + ), + }, + ), + ), + }, + ], + kwarg: None, + }, + ), + body: EllipsisLiteral( + ExprEllipsisLiteral { + range: 163..166, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 167..187, + value: Lambda( + ExprLambda { + range: 167..187, + parameters: Some( + Parameters { + range: 174..184, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 177..178, + parameter: Parameter { + range: 177..178, + name: Identifier { + id: "a", + range: 177..178, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 180..181, + parameter: Parameter { + range: 180..181, + name: Identifier { + id: "b", + range: 180..181, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 183..184, + parameter: Parameter { + range: 183..184, + name: Identifier { + id: "c", + range: 183..184, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 186..187, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 188..214, + value: Lambda( + ExprLambda { + range: 188..214, + parameters: Some( + Parameters { + range: 195..211, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 198..199, + parameter: Parameter { + range: 198..199, + name: Identifier { + id: "a", + range: 198..199, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 201..205, + parameter: Parameter { + range: 201..202, + name: Identifier { + id: "b", + range: 201..202, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 203..205, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 207..211, + parameter: Parameter { + range: 207..208, + name: Identifier { + id: "c", + range: 207..208, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 209..211, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 213..214, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 215..241, + value: Lambda( + ExprLambda { + range: 215..241, + parameters: Some( + Parameters { + range: 222..238, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 222..223, + parameter: Parameter { + range: 222..223, + name: Identifier { + id: "a", + range: 222..223, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 225..226, + parameter: Parameter { + range: 225..226, + name: Identifier { + id: "b", + range: 225..226, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 228..229, + parameter: Parameter { + range: 228..229, + name: Identifier { + id: "c", + range: 228..229, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 234..235, + parameter: Parameter { + range: 234..235, + name: Identifier { + id: "d", + range: 234..235, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 237..238, + parameter: Parameter { + range: 237..238, + name: Identifier { + id: "e", + range: 237..238, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 240..241, + value: Int( + 0, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 242..262, + value: Lambda( + ExprLambda { + range: 242..262, + parameters: Some( + Parameters { + range: 249..257, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: Some( + Parameter { + range: 249..257, + name: Identifier { + id: "kwargs", + range: 251..257, + }, + annotation: None, + }, + ), + }, + ), + body: Call( + ExprCall { + range: 259..262, + func: Name( + ExprName { + range: 259..260, + id: "f", + ctx: Load, + }, + ), + arguments: Arguments { + range: 260..262, + args: [], + keywords: [], + }, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 263..294, + value: Lambda( + ExprLambda { + range: 263..294, + parameters: Some( + Parameters { + range: 270..285, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 270..275, + name: Identifier { + id: "args", + range: 271..275, + }, + annotation: None, + }, + ), + kwonlyargs: [], + kwarg: Some( + Parameter { + range: 277..285, + name: Identifier { + id: "kwargs", + range: 279..285, + }, + annotation: None, + }, + ), + }, + ), + body: BinOp( + ExprBinOp { + range: 287..294, + left: Call( + ExprCall { + range: 287..290, + func: Name( + ExprName { + range: 287..288, + id: "f", + ctx: Load, + }, + ), + arguments: Arguments { + range: 288..290, + args: [], + keywords: [], + }, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 293..294, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 295..334, + value: Lambda( + ExprLambda { + range: 295..334, + parameters: Some( + Parameters { + range: 302..325, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 302..307, + name: Identifier { + id: "args", + range: 303..307, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 309..310, + parameter: Parameter { + range: 309..310, + name: Identifier { + id: "a", + range: 309..310, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 312..315, + parameter: Parameter { + range: 312..313, + name: Identifier { + id: "b", + range: 312..313, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 314..315, + value: Int( + 1, + ), + }, + ), + ), + }, + ], + kwarg: Some( + Parameter { + range: 317..325, + name: Identifier { + id: "kwargs", + range: 319..325, + }, + annotation: None, + }, + ), + }, + ), + body: BinOp( + ExprBinOp { + range: 327..334, + left: Call( + ExprCall { + range: 327..330, + func: Name( + ExprName { + range: 327..328, + id: "f", + ctx: Load, + }, + ), + arguments: Arguments { + range: 328..330, + args: [], + keywords: [], + }, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 333..334, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 335..351, + value: Lambda( + ExprLambda { + range: 335..351, + parameters: Some( + Parameters { + range: 342..346, + posonlyargs: [ + ParameterWithDefault { + range: 342..343, + parameter: Parameter { + range: 342..343, + name: Identifier { + id: "a", + range: 342..343, + }, + annotation: None, + }, + default: None, + }, + ], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: EllipsisLiteral( + ExprEllipsisLiteral { + range: 348..351, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 352..371, + value: Lambda( + ExprLambda { + range: 352..371, + parameters: Some( + Parameters { + range: 359..366, + posonlyargs: [ + ParameterWithDefault { + range: 359..360, + parameter: Parameter { + range: 359..360, + name: Identifier { + id: "a", + range: 359..360, + }, + annotation: None, + }, + default: None, + }, + ], + args: [ + ParameterWithDefault { + range: 365..366, + parameter: Parameter { + range: 365..366, + name: Identifier { + id: "b", + range: 365..366, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: EllipsisLiteral( + ExprEllipsisLiteral { + range: 368..371, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 372..391, + value: Lambda( + ExprLambda { + range: 372..391, + parameters: Some( + Parameters { + range: 379..386, + posonlyargs: [ + ParameterWithDefault { + range: 379..382, + parameter: Parameter { + range: 379..380, + name: Identifier { + id: "a", + range: 379..380, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 381..382, + value: Int( + 1, + ), + }, + ), + ), + }, + ], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: EllipsisLiteral( + ExprEllipsisLiteral { + range: 388..391, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 392..417, + value: Lambda( + ExprLambda { + range: 392..417, + parameters: Some( + Parameters { + range: 399..412, + posonlyargs: [ + ParameterWithDefault { + range: 399..400, + parameter: Parameter { + range: 399..400, + name: Identifier { + id: "a", + range: 399..400, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 402..403, + parameter: Parameter { + range: 402..403, + name: Identifier { + id: "b", + range: 402..403, + }, + annotation: None, + }, + default: None, + }, + ], + args: [], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 411..412, + parameter: Parameter { + range: 411..412, + name: Identifier { + id: "c", + range: 411..412, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + ), + body: EllipsisLiteral( + ExprEllipsisLiteral { + range: 414..417, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 418..440, + value: Lambda( + ExprLambda { + range: 418..440, + parameters: Some( + Parameters { + range: 425..435, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 425..429, + parameter: Parameter { + range: 425..427, + name: Identifier { + id: "kw", + range: 425..427, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 428..429, + value: Int( + 1, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 434..435, + parameter: Parameter { + range: 434..435, + name: Identifier { + id: "a", + range: 434..435, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + ), + body: EllipsisLiteral( + ExprEllipsisLiteral { + range: 437..440, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 441..467, + value: Lambda( + ExprLambda { + range: 441..467, + parameters: Some( + Parameters { + range: 448..464, + posonlyargs: [ + ParameterWithDefault { + range: 448..449, + parameter: Parameter { + range: 448..449, + name: Identifier { + id: "a", + range: 448..449, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 451..455, + parameter: Parameter { + range: 451..452, + name: Identifier { + id: "b", + range: 451..452, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 453..455, + value: Int( + 20, + ), + }, + ), + ), + }, + ], + args: [ + ParameterWithDefault { + range: 460..464, + parameter: Parameter { + range: 460..461, + name: Identifier { + id: "c", + range: 460..461, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 462..464, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 466..467, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 468..497, + value: Lambda( + ExprLambda { + range: 468..497, + parameters: Some( + Parameters { + range: 475..494, + posonlyargs: [ + ParameterWithDefault { + range: 475..476, + parameter: Parameter { + range: 475..476, + name: Identifier { + id: "a", + range: 475..476, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 478..479, + parameter: Parameter { + range: 478..479, + name: Identifier { + id: "b", + range: 478..479, + }, + annotation: None, + }, + default: None, + }, + ], + args: [ + ParameterWithDefault { + range: 484..485, + parameter: Parameter { + range: 484..485, + name: Identifier { + id: "c", + range: 484..485, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 490..491, + parameter: Parameter { + range: 490..491, + name: Identifier { + id: "d", + range: 490..491, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 493..494, + parameter: Parameter { + range: 493..494, + name: Identifier { + id: "e", + range: 493..494, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 496..497, + value: Int( + 0, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 498..530, + value: Lambda( + ExprLambda { + range: 498..530, + parameters: Some( + Parameters { + range: 505..527, + posonlyargs: [ + ParameterWithDefault { + range: 505..506, + parameter: Parameter { + range: 505..506, + name: Identifier { + id: "a", + range: 505..506, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 508..509, + parameter: Parameter { + range: 508..509, + name: Identifier { + id: "b", + range: 508..509, + }, + annotation: None, + }, + default: None, + }, + ], + args: [ + ParameterWithDefault { + range: 514..515, + parameter: Parameter { + range: 514..515, + name: Identifier { + id: "c", + range: 514..515, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: Some( + Parameter { + range: 517..519, + name: Identifier { + id: "d", + range: 518..519, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 521..522, + parameter: Parameter { + range: 521..522, + name: Identifier { + id: "e", + range: 521..522, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: Some( + Parameter { + range: 524..527, + name: Identifier { + id: "f", + range: 526..527, + }, + annotation: None, + }, + ), + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 529..530, + value: Int( + 0, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__list.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__list.py.snap new file mode 100644 index 0000000000..8d9b4f8292 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__list.py.snap @@ -0,0 +1,810 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/list.py +--- +## AST + +``` +Module( + ModModule { + range: 0..384, + body: [ + Expr( + StmtExpr { + range: 15..17, + value: List( + ExprList { + range: 15..17, + elts: [], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 18..21, + value: List( + ExprList { + range: 18..21, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 19..20, + value: Int( + 1, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 22..26, + value: List( + ExprList { + range: 22..26, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 23..24, + value: Int( + 1, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 27..36, + value: List( + ExprList { + range: 27..36, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 28..29, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 31..32, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 34..35, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 37..47, + value: List( + ExprList { + range: 37..47, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 38..39, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 41..42, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 44..45, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 75..78, + value: List( + ExprList { + range: 75..78, + elts: [], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 79..92, + value: List( + ExprList { + range: 79..92, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 89..90, + value: Int( + 1, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 93..114, + value: List( + ExprList { + range: 93..114, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 99..100, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 110..111, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 125..132, + value: List( + ExprList { + range: 125..132, + elts: [ + List( + ExprList { + range: 126..131, + elts: [ + List( + ExprList { + range: 127..130, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 128..129, + value: Int( + 1, + ), + }, + ), + ], + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 133..149, + value: List( + ExprList { + range: 133..149, + elts: [ + List( + ExprList { + range: 134..140, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 135..136, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 138..139, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + List( + ExprList { + range: 142..148, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 143..144, + value: Int( + 3, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 146..147, + value: Int( + 4, + ), + }, + ), + ], + ctx: Load, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 170..178, + value: List( + ExprList { + range: 170..178, + elts: [ + Named( + ExprNamed { + range: 171..177, + target: Name( + ExprName { + range: 171..172, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 176..177, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 179..188, + value: List( + ExprList { + range: 179..188, + elts: [ + Named( + ExprNamed { + range: 180..186, + target: Name( + ExprName { + range: 180..181, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 185..186, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 189..203, + value: List( + ExprList { + range: 189..203, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 190..191, + value: Int( + 1, + ), + }, + ), + Named( + ExprNamed { + range: 193..199, + target: Name( + ExprName { + range: 193..194, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 198..199, + value: Int( + 2, + ), + }, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 201..202, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 223..233, + value: List( + ExprList { + range: 223..233, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 224..225, + value: Int( + 1, + ), + }, + ), + Starred( + ExprStarred { + range: 227..229, + value: Name( + ExprName { + range: 228..229, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 231..232, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 234..248, + value: List( + ExprList { + range: 234..248, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 235..236, + value: Int( + 1, + ), + }, + ), + Starred( + ExprStarred { + range: 238..244, + value: BinOp( + ExprBinOp { + range: 239..244, + left: Name( + ExprName { + range: 239..240, + id: "x", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 243..244, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 246..247, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 271..334, + value: List( + ExprList { + range: 271..334, + elts: [ + BinOp( + ExprBinOp { + range: 272..277, + left: NumberLiteral( + ExprNumberLiteral { + range: 272..273, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 276..277, + value: Int( + 2, + ), + }, + ), + }, + ), + List( + ExprList { + range: 279..291, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 280..281, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 283..284, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 286..287, + value: Int( + 3, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 289..290, + value: Int( + 4, + ), + }, + ), + ], + ctx: Load, + }, + ), + Tuple( + ExprTuple { + range: 293..306, + elts: [ + Name( + ExprName { + range: 294..295, + id: "a", + ctx: Load, + }, + ), + BinOp( + ExprBinOp { + range: 297..302, + left: Name( + ExprName { + range: 297..298, + id: "b", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 301..302, + id: "c", + ctx: Load, + }, + ), + }, + ), + Name( + ExprName { + range: 304..305, + id: "d", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + Set( + ExprSet { + range: 308..317, + elts: [ + Name( + ExprName { + range: 309..310, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 312..313, + id: "b", + ctx: Load, + }, + ), + Name( + ExprName { + range: 315..316, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + Dict( + ExprDict { + range: 319..325, + keys: [ + Some( + Name( + ExprName { + range: 320..321, + id: "a", + ctx: Load, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 323..324, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + Named( + ExprNamed { + range: 327..333, + target: Name( + ExprName { + range: 327..328, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 332..333, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 335..383, + value: List( + ExprList { + range: 335..383, + elts: [ + Call( + ExprCall { + range: 336..382, + func: Name( + ExprName { + range: 336..341, + id: "call1", + ctx: Load, + }, + ), + arguments: Arguments { + range: 341..382, + args: [ + Generator( + ExprGenerator { + range: 342..381, + elt: Call( + ExprCall { + range: 342..361, + func: Name( + ExprName { + range: 342..347, + id: "call2", + ctx: Load, + }, + ), + arguments: Arguments { + range: 347..361, + args: [ + Call( + ExprCall { + range: 348..360, + func: Attribute( + ExprAttribute { + range: 348..358, + value: Name( + ExprName { + range: 348..353, + id: "value", + ctx: Load, + }, + ), + attr: Identifier { + id: "attr", + range: 354..358, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 358..360, + args: [], + keywords: [], + }, + }, + ), + ], + keywords: [], + }, + }, + ), + generators: [ + Comprehension { + range: 362..381, + target: Name( + ExprName { + range: 366..373, + id: "element", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 377..381, + id: "iter", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: false, + }, + ), + ], + keywords: [], + }, + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__list_comprehension.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__list_comprehension.py.snap new file mode 100644 index 0000000000..079ddce8ee --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__list_comprehension.py.snap @@ -0,0 +1,1290 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/list_comprehension.py +--- +## AST + +``` +Module( + ModModule { + range: 0..776, + body: [ + Assign( + StmtAssign { + range: 0..26, + targets: [ + Name( + ExprName { + range: 0..1, + id: "x", + ctx: Store, + }, + ), + ], + value: ListComp( + ExprListComp { + range: 4..26, + elt: Name( + ExprName { + range: 5..6, + id: "y", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 7..25, + target: Name( + ExprName { + range: 11..12, + id: "y", + ctx: Store, + }, + ), + iter: Tuple( + ExprTuple { + range: 16..25, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 17..18, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 20..21, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 23..24, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 28..49, + value: ListComp( + ExprListComp { + range: 28..49, + elt: Name( + ExprName { + range: 29..30, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 31..48, + target: Name( + ExprName { + range: 35..36, + id: "i", + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 40..48, + func: Name( + ExprName { + range: 40..45, + id: "range", + ctx: Load, + }, + ), + arguments: Arguments { + range: 45..48, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 46..47, + value: Int( + 5, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 50..91, + value: ListComp( + ExprListComp { + range: 50..91, + elt: Name( + ExprName { + range: 51..52, + id: "b", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 53..90, + target: Name( + ExprName { + range: 57..58, + id: "c", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 62..63, + id: "d", + ctx: Load, + }, + ), + ifs: [ + Compare( + ExprCompare { + range: 67..73, + left: Name( + ExprName { + range: 67..68, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 72..73, + id: "w", + ctx: Load, + }, + ), + ], + }, + ), + BoolOp( + ExprBoolOp { + range: 77..85, + op: And, + values: [ + Name( + ExprName { + range: 77..78, + id: "y", + ctx: Load, + }, + ), + Name( + ExprName { + range: 83..85, + id: "yy", + ctx: Load, + }, + ), + ], + }, + ), + Name( + ExprName { + range: 89..90, + id: "z", + ctx: Load, + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 92..137, + value: ListComp( + ExprListComp { + range: 92..137, + elt: Name( + ExprName { + range: 93..94, + id: "a", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 95..116, + target: Name( + ExprName { + range: 99..100, + id: "b", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 104..105, + id: "c", + ctx: Load, + }, + ), + ifs: [ + BoolOp( + ExprBoolOp { + range: 109..116, + op: And, + values: [ + Name( + ExprName { + range: 109..110, + id: "d", + ctx: Load, + }, + ), + Name( + ExprName { + range: 115..116, + id: "e", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: false, + }, + Comprehension { + range: 117..136, + target: Name( + ExprName { + range: 121..122, + id: "f", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 126..127, + id: "j", + ctx: Load, + }, + ), + ifs: [ + Compare( + ExprCompare { + range: 131..136, + left: Name( + ExprName { + range: 131..132, + id: "k", + ctx: Load, + }, + ), + ops: [ + Gt, + ], + comparators: [ + Name( + ExprName { + range: 135..136, + id: "h", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 138..189, + value: ListComp( + ExprListComp { + range: 138..189, + elt: Name( + ExprName { + range: 139..140, + id: "a", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 141..162, + target: Name( + ExprName { + range: 145..146, + id: "b", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 150..151, + id: "c", + ctx: Load, + }, + ), + ifs: [ + BoolOp( + ExprBoolOp { + range: 155..162, + op: And, + values: [ + Name( + ExprName { + range: 155..156, + id: "d", + ctx: Load, + }, + ), + Name( + ExprName { + range: 161..162, + id: "e", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: false, + }, + Comprehension { + range: 163..188, + target: Name( + ExprName { + range: 173..174, + id: "f", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 178..179, + id: "j", + ctx: Load, + }, + ), + ifs: [ + Compare( + ExprCompare { + range: 183..188, + left: Name( + ExprName { + range: 183..184, + id: "k", + ctx: Load, + }, + ), + ops: [ + Gt, + ], + comparators: [ + Name( + ExprName { + range: 187..188, + id: "h", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: true, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 190..209, + value: ListComp( + ExprListComp { + range: 190..209, + elt: NumberLiteral( + ExprNumberLiteral { + range: 191..192, + value: Int( + 1, + ), + }, + ), + generators: [ + Comprehension { + range: 193..208, + target: Name( + ExprName { + range: 197..198, + id: "i", + ctx: Store, + }, + ), + iter: Compare( + ExprCompare { + range: 202..208, + left: Name( + ExprName { + range: 202..203, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 207..208, + id: "a", + ctx: Load, + }, + ), + ], + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 210..227, + value: ListComp( + ExprListComp { + range: 210..227, + elt: Name( + ExprName { + range: 211..212, + id: "a", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 213..226, + target: Tuple( + ExprTuple { + range: 217..221, + elts: [ + Name( + ExprName { + range: 217..218, + id: "a", + ctx: Store, + }, + ), + Name( + ExprName { + range: 220..221, + id: "b", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: false, + }, + ), + iter: Name( + ExprName { + range: 225..226, + id: "G", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 228..257, + value: ListComp( + ExprListComp { + range: 228..257, + elt: Await( + ExprAwait { + range: 234..241, + value: Name( + ExprName { + range: 240..241, + id: "x", + ctx: Load, + }, + ), + }, + ), + generators: [ + Comprehension { + range: 242..255, + target: Tuple( + ExprTuple { + range: 246..250, + elts: [ + Name( + ExprName { + range: 246..247, + id: "a", + ctx: Store, + }, + ), + Name( + ExprName { + range: 249..250, + id: "b", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: false, + }, + ), + iter: Name( + ExprName { + range: 254..255, + id: "C", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 258..300, + value: ListComp( + ExprListComp { + range: 258..300, + elt: Name( + ExprName { + range: 259..260, + id: "i", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 261..299, + target: Name( + ExprName { + range: 265..266, + id: "i", + ctx: Store, + }, + ), + iter: Await( + ExprAwait { + range: 270..277, + value: Name( + ExprName { + range: 276..277, + id: "x", + ctx: Load, + }, + ), + }, + ), + ifs: [ + Compare( + ExprCompare { + range: 281..299, + left: Name( + ExprName { + range: 281..287, + id: "entity", + ctx: Load, + }, + ), + ops: [ + IsNot, + ], + comparators: [ + NoneLiteral( + ExprNoneLiteral { + range: 295..299, + }, + ), + ], + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 301..337, + value: ListComp( + ExprListComp { + range: 301..337, + elt: Name( + ExprName { + range: 302..303, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 304..336, + target: Name( + ExprName { + range: 308..309, + id: "x", + ctx: Store, + }, + ), + iter: If( + ExprIf { + range: 314..330, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 319..323, + value: true, + }, + ), + body: Name( + ExprName { + range: 314..315, + id: "l", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 329..330, + id: "L", + ctx: Load, + }, + ), + }, + ), + ifs: [ + Name( + ExprName { + range: 335..336, + id: "T", + ctx: Load, + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 338..380, + value: ListComp( + ExprListComp { + range: 338..380, + elt: Name( + ExprName { + range: 339..340, + id: "i", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 341..379, + target: Name( + ExprName { + range: 345..346, + id: "i", + ctx: Store, + }, + ), + iter: If( + ExprIf { + range: 351..373, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 362..366, + value: true, + }, + ), + body: Await( + ExprAwait { + range: 351..358, + value: Name( + ExprName { + range: 357..358, + id: "x", + ctx: Load, + }, + ), + }, + ), + orelse: Name( + ExprName { + range: 372..373, + id: "X", + ctx: Load, + }, + ), + }, + ), + ifs: [ + Name( + ExprName { + range: 378..379, + id: "F", + ctx: Load, + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 381..423, + value: ListComp( + ExprListComp { + range: 381..423, + elt: Name( + ExprName { + range: 382..383, + id: "i", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 384..422, + target: Name( + ExprName { + range: 388..389, + id: "i", + ctx: Store, + }, + ), + iter: Await( + ExprAwait { + range: 393..417, + value: If( + ExprIf { + range: 400..416, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 405..409, + value: true, + }, + ), + body: Name( + ExprName { + range: 400..401, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 415..416, + id: "X", + ctx: Load, + }, + ), + }, + ), + }, + ), + ifs: [ + Name( + ExprName { + range: 421..422, + id: "F", + ctx: Load, + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 424..457, + value: ListComp( + ExprListComp { + range: 424..457, + elt: Name( + ExprName { + range: 425..426, + id: "f", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 427..456, + target: Name( + ExprName { + range: 431..432, + id: "f", + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 436..456, + func: Name( + ExprName { + range: 436..437, + id: "c", + ctx: Load, + }, + ), + arguments: Arguments { + range: 437..456, + args: [ + If( + ExprIf { + range: 438..455, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 443..447, + value: true, + }, + ), + body: Name( + ExprName { + range: 438..439, + id: "x", + ctx: Load, + }, + ), + orelse: List( + ExprList { + range: 453..455, + elts: [], + ctx: Load, + }, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 596..618, + value: ListComp( + ExprListComp { + range: 596..618, + elt: Name( + ExprName { + range: 597..598, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 599..617, + target: Name( + ExprName { + range: 603..604, + id: "x", + ctx: Store, + }, + ), + iter: Yield( + ExprYield { + range: 609..616, + value: Some( + Name( + ExprName { + range: 615..616, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 619..646, + value: ListComp( + ExprListComp { + range: 619..646, + elt: Name( + ExprName { + range: 620..621, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 622..645, + target: Name( + ExprName { + range: 626..627, + id: "x", + ctx: Store, + }, + ), + iter: YieldFrom( + ExprYieldFrom { + range: 632..644, + value: Name( + ExprName { + range: 643..644, + id: "y", + ctx: Load, + }, + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 647..673, + value: ListComp( + ExprListComp { + range: 647..673, + elt: Name( + ExprName { + range: 648..649, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 650..672, + target: Name( + ExprName { + range: 654..655, + id: "x", + ctx: Store, + }, + ), + iter: Lambda( + ExprLambda { + range: 660..671, + parameters: Some( + Parameters { + range: 667..668, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 667..668, + parameter: Parameter { + range: 667..668, + name: Identifier { + id: "y", + range: 667..668, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 670..671, + id: "y", + ctx: Load, + }, + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 674..704, + value: ListComp( + ExprListComp { + range: 674..704, + elt: Name( + ExprName { + range: 675..676, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 677..703, + target: Name( + ExprName { + range: 681..682, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 686..690, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Yield( + ExprYield { + range: 695..702, + value: Some( + Name( + ExprName { + range: 701..702, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 705..740, + value: ListComp( + ExprListComp { + range: 705..740, + elt: Name( + ExprName { + range: 706..707, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 708..739, + target: Name( + ExprName { + range: 712..713, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 717..721, + id: "data", + ctx: Load, + }, + ), + ifs: [ + YieldFrom( + ExprYieldFrom { + range: 726..738, + value: Name( + ExprName { + range: 737..738, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 741..775, + value: ListComp( + ExprListComp { + range: 741..775, + elt: Name( + ExprName { + range: 742..743, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 744..774, + target: Name( + ExprName { + range: 748..749, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 753..757, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Lambda( + ExprLambda { + range: 762..773, + parameters: Some( + Parameters { + range: 769..770, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 769..770, + parameter: Parameter { + range: 769..770, + name: Identifier { + id: "y", + range: 769..770, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 772..773, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__name.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__name.py.snap new file mode 100644 index 0000000000..243594adfa --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__name.py.snap @@ -0,0 +1,123 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/name.py +--- +## AST + +``` +Module( + ModModule { + range: 0..76, + body: [ + Expr( + StmtExpr { + range: 0..1, + value: Name( + ExprName { + range: 0..1, + id: "_", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 2..5, + value: Name( + ExprName { + range: 3..4, + id: "_", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 6..8, + value: Name( + ExprName { + range: 6..8, + id: "__", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 9..17, + value: Name( + ExprName { + range: 9..17, + id: "__init__", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 18..22, + value: Name( + ExprName { + range: 18..22, + id: "name", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 23..29, + value: Name( + ExprName { + range: 24..28, + id: "name", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 60..65, + value: Name( + ExprName { + range: 60..65, + id: "match", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 66..70, + value: Name( + ExprName { + range: 66..70, + id: "case", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 71..75, + value: Name( + ExprName { + range: 71..75, + id: "type", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__named.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__named.py.snap new file mode 100644 index 0000000000..de7a542cf0 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__named.py.snap @@ -0,0 +1,316 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/named.py +--- +## AST + +``` +Module( + ModModule { + range: 0..157, + body: [ + Expr( + StmtExpr { + range: 0..11, + value: Named( + ExprNamed { + range: 1..10, + target: Name( + ExprName { + range: 1..5, + id: "name", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 9..10, + value: Int( + 0, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 12..29, + value: Named( + ExprNamed { + range: 13..28, + target: Name( + ExprName { + range: 13..17, + id: "name", + ctx: Store, + }, + ), + value: BinOp( + ExprBinOp { + range: 22..27, + left: Name( + ExprName { + range: 22..23, + id: "x", + ctx: Load, + }, + ), + op: Mult, + right: Name( + ExprName { + range: 26..27, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 30..45, + value: Named( + ExprNamed { + range: 31..44, + target: Name( + ExprName { + range: 31..35, + id: "name", + ctx: Store, + }, + ), + value: BinOp( + ExprBinOp { + range: 39..44, + left: NumberLiteral( + ExprNumberLiteral { + range: 39..40, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 43..44, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 46..63, + value: Named( + ExprNamed { + range: 47..62, + target: Name( + ExprName { + range: 47..51, + id: "name", + ctx: Store, + }, + ), + value: Tuple( + ExprTuple { + range: 55..62, + elts: [ + Starred( + ExprStarred { + range: 56..58, + value: Name( + ExprName { + range: 57..58, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 60..61, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 64..90, + value: Named( + ExprNamed { + range: 65..89, + target: Name( + ExprName { + range: 65..69, + id: "name", + ctx: Store, + }, + ), + value: If( + ExprIf { + range: 73..89, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 78..82, + value: true, + }, + ), + body: Name( + ExprName { + range: 73..74, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 88..89, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 91..112, + value: Named( + ExprNamed { + range: 92..111, + target: Name( + ExprName { + range: 92..96, + id: "name", + ctx: Store, + }, + ), + value: Lambda( + ExprLambda { + range: 100..111, + parameters: Some( + Parameters { + range: 107..108, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 107..108, + parameter: Parameter { + range: 107..108, + name: Identifier { + id: "x", + range: 107..108, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 110..111, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 113..132, + value: Named( + ExprNamed { + range: 114..131, + target: Name( + ExprName { + range: 114..118, + id: "name", + ctx: Store, + }, + ), + value: Yield( + ExprYield { + range: 123..130, + value: Some( + Name( + ExprName { + range: 129..130, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 133..157, + value: Named( + ExprNamed { + range: 134..156, + target: Name( + ExprName { + range: 134..138, + id: "name", + ctx: Store, + }, + ), + value: YieldFrom( + ExprYieldFrom { + range: 143..155, + value: Name( + ExprName { + range: 154..155, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__number_literal.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__number_literal.py.snap new file mode 100644 index 0000000000..52cb6df41a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__number_literal.py.snap @@ -0,0 +1,1028 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/number_literal.py +--- +## AST + +``` +Module( + ModModule { + range: 0..700, + body: [ + Assign( + StmtAssign { + range: 0..13, + targets: [ + Name( + ExprName { + range: 0..1, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 4..13, + value: Int( + 123456789, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 14..24, + targets: [ + Name( + ExprName { + range: 14..15, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 18..24, + value: Int( + 123456, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 25..31, + targets: [ + Name( + ExprName { + range: 25..26, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 29..31, + value: Float( + 0.1, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 32..38, + targets: [ + Name( + ExprName { + range: 32..33, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 36..38, + value: Float( + 1.0, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 39..47, + targets: [ + Name( + ExprName { + range: 39..40, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 43..47, + value: Float( + 10.0, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 48..56, + targets: [ + Name( + ExprName { + range: 48..49, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 52..56, + value: Float( + 0.1, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 57..73, + targets: [ + Name( + ExprName { + range: 57..58, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 61..73, + value: Float( + 1.00000001, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 74..97, + targets: [ + Name( + ExprName { + range: 74..75, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 78..97, + value: Float( + 123456789.12345679, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 98..131, + targets: [ + Name( + ExprName { + range: 98..99, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 102..131, + value: Float( + inf, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 132..155, + targets: [ + Name( + ExprName { + range: 132..133, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 136..155, + value: Float( + inf, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 156..170, + targets: [ + Name( + ExprName { + range: 156..157, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 160..170, + value: Complex { + real: 0.0, + imag: 123456789.0, + }, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 171..195, + targets: [ + Name( + ExprName { + range: 171..172, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 175..195, + value: Complex { + real: 0.0, + imag: 123456789.12345679, + }, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 196..207, + targets: [ + Name( + ExprName { + range: 196..197, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 200..207, + value: Int( + 727756, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 208..218, + targets: [ + Name( + ExprName { + range: 208..209, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 212..218, + value: Int( + 11, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 219..228, + targets: [ + Name( + ExprName { + range: 219..220, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 223..228, + value: Int( + 511, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 229..244, + targets: [ + Name( + ExprName { + range: 229..230, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 233..244, + value: Float( + 6e-9, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 245..254, + targets: [ + Name( + ExprName { + range: 245..246, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 249..254, + value: Int( + 10000, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 255..265, + targets: [ + Name( + ExprName { + range: 255..256, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 259..265, + value: Int( + 133333, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 286..298, + targets: [ + Name( + ExprName { + range: 286..287, + id: "x", + ctx: Store, + }, + ), + ], + value: Attribute( + ExprAttribute { + range: 290..298, + value: NumberLiteral( + ExprNumberLiteral { + range: 290..292, + value: Float( + 1.0, + ), + }, + ), + attr: Identifier { + id: "imag", + range: 294..298, + }, + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 299..312, + targets: [ + Name( + ExprName { + range: 299..300, + id: "x", + ctx: Store, + }, + ), + ], + value: Attribute( + ExprAttribute { + range: 303..312, + value: NumberLiteral( + ExprNumberLiteral { + range: 303..307, + value: Float( + 10.0, + ), + }, + ), + attr: Identifier { + id: "imag", + range: 308..312, + }, + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 313..326, + targets: [ + Name( + ExprName { + range: 313..314, + id: "x", + ctx: Store, + }, + ), + ], + value: Attribute( + ExprAttribute { + range: 317..326, + value: NumberLiteral( + ExprNumberLiteral { + range: 317..321, + value: Float( + 0.1, + ), + }, + ), + attr: Identifier { + id: "real", + range: 322..326, + }, + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 327..356, + targets: [ + Name( + ExprName { + range: 327..328, + id: "x", + ctx: Store, + }, + ), + ], + value: Call( + ExprCall { + range: 331..356, + func: Attribute( + ExprAttribute { + range: 331..354, + value: NumberLiteral( + ExprNumberLiteral { + range: 331..350, + value: Float( + 123456789.12345679, + ), + }, + ), + attr: Identifier { + id: "hex", + range: 351..354, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 354..356, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 357..396, + targets: [ + Name( + ExprName { + range: 357..358, + id: "x", + ctx: Store, + }, + ), + ], + value: Attribute( + ExprAttribute { + range: 361..396, + value: NumberLiteral( + ExprNumberLiteral { + range: 361..390, + value: Float( + inf, + ), + }, + ), + attr: Identifier { + id: "real", + range: 392..396, + }, + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 397..433, + targets: [ + Name( + ExprName { + range: 397..398, + id: "x", + ctx: Store, + }, + ), + ], + value: Call( + ExprCall { + range: 401..433, + func: Attribute( + ExprAttribute { + range: 401..431, + value: NumberLiteral( + ExprNumberLiteral { + range: 401..420, + value: Float( + inf, + ), + }, + ), + attr: Identifier { + id: "conjugate", + range: 422..431, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 431..433, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 434..453, + targets: [ + Name( + ExprName { + range: 434..435, + id: "x", + ctx: Store, + }, + ), + ], + value: Attribute( + ExprAttribute { + range: 438..453, + value: NumberLiteral( + ExprNumberLiteral { + range: 438..448, + value: Complex { + real: 0.0, + imag: 123456789.0, + }, + }, + ), + attr: Identifier { + id: "real", + range: 449..453, + }, + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 454..507, + targets: [ + Name( + ExprName { + range: 454..455, + id: "x", + ctx: Store, + }, + ), + ], + value: Call( + ExprCall { + range: 458..507, + func: Attribute( + ExprAttribute { + range: 458..486, + value: NumberLiteral( + ExprNumberLiteral { + range: 458..478, + value: Complex { + real: 0.0, + imag: 123456789.12345679, + }, + }, + ), + attr: Identifier { + id: "__add__", + range: 479..486, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 486..507, + args: [ + Call( + ExprCall { + range: 487..506, + func: Attribute( + ExprAttribute { + range: 487..504, + value: NumberLiteral( + ExprNumberLiteral { + range: 487..493, + value: Int( + 11, + ), + }, + ), + attr: Identifier { + id: "bit_length", + range: 494..504, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 504..506, + args: [], + keywords: [], + }, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 508..531, + targets: [ + Name( + ExprName { + range: 508..509, + id: "x", + ctx: Store, + }, + ), + ], + value: Call( + ExprCall { + range: 512..531, + func: Attribute( + ExprAttribute { + range: 512..529, + value: NumberLiteral( + ExprNumberLiteral { + range: 512..519, + value: Int( + 727756, + ), + }, + ), + attr: Identifier { + id: "conjugate", + range: 520..529, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 529..531, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 532..555, + targets: [ + Name( + ExprName { + range: 532..533, + id: "x", + ctx: Store, + }, + ), + ], + value: Call( + ExprCall { + range: 536..555, + func: Attribute( + ExprAttribute { + range: 536..553, + value: NumberLiteral( + ExprNumberLiteral { + range: 536..542, + value: Int( + 11, + ), + }, + ), + attr: Identifier { + id: "conjugate", + range: 544..553, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 553..555, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 556..571, + targets: [ + Name( + ExprName { + range: 556..557, + id: "x", + ctx: Store, + }, + ), + ], + value: Attribute( + ExprAttribute { + range: 560..571, + value: NumberLiteral( + ExprNumberLiteral { + range: 560..565, + value: Int( + 511, + ), + }, + ), + attr: Identifier { + id: "real", + range: 567..571, + }, + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 572..595, + targets: [ + Name( + ExprName { + range: 572..573, + id: "x", + ctx: Store, + }, + ), + ], + value: Call( + ExprCall { + range: 576..595, + func: Attribute( + ExprAttribute { + range: 576..593, + value: NumberLiteral( + ExprNumberLiteral { + range: 576..587, + value: Float( + 6e-9, + ), + }, + ), + attr: Identifier { + id: "hex", + range: 590..593, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 593..595, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 596..610, + targets: [ + Name( + ExprName { + range: 596..597, + id: "x", + ctx: Store, + }, + ), + ], + value: UnaryOp( + ExprUnaryOp { + range: 600..610, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 601..610, + value: Complex { + real: 0.0, + imag: 100.0, + }, + }, + ), + }, + ), + }, + ), + If( + StmtIf { + range: 612..632, + test: Attribute( + ExprAttribute { + range: 615..623, + value: NumberLiteral( + ExprNumberLiteral { + range: 615..617, + value: Int( + 10, + ), + }, + ), + attr: Identifier { + id: "real", + range: 619..623, + }, + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 629..632, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 629..632, + }, + ), + }, + ), + ], + elif_else_clauses: [], + }, + ), + Assign( + StmtAssign { + range: 677..688, + targets: [ + Name( + ExprName { + range: 677..678, + id: "y", + ctx: Store, + }, + ), + ], + value: Subscript( + ExprSubscript { + range: 681..688, + value: NumberLiteral( + ExprNumberLiteral { + range: 681..684, + value: Int( + 100, + ), + }, + ), + slice: Name( + ExprName { + range: 685..687, + id: "no", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 689..700, + targets: [ + Name( + ExprName { + range: 689..690, + id: "y", + ctx: Store, + }, + ), + ], + value: Call( + ExprCall { + range: 693..700, + func: NumberLiteral( + ExprNumberLiteral { + range: 693..696, + value: Int( + 100, + ), + }, + ), + arguments: Arguments { + range: 696..700, + args: [ + Name( + ExprName { + range: 697..699, + id: "no", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__parenthesized.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__parenthesized.py.snap new file mode 100644 index 0000000000..8ac5d39e1e --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__parenthesized.py.snap @@ -0,0 +1,234 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/parenthesized.py +--- +## AST + +``` +Module( + ModModule { + range: 0..92, + body: [ + Expr( + StmtExpr { + range: 0..6, + value: Name( + ExprName { + range: 1..5, + id: "expr", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 7..15, + value: Call( + ExprCall { + range: 7..15, + func: Name( + ExprName { + range: 8..12, + id: "expr", + ctx: Load, + }, + ), + arguments: Arguments { + range: 13..15, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 16..28, + value: Call( + ExprCall { + range: 16..28, + func: Call( + ExprCall { + range: 16..26, + func: Call( + ExprCall { + range: 16..24, + func: Name( + ExprName { + range: 17..21, + id: "expr", + ctx: Load, + }, + ), + arguments: Arguments { + range: 22..24, + args: [], + keywords: [], + }, + }, + ), + arguments: Arguments { + range: 24..26, + args: [], + keywords: [], + }, + }, + ), + arguments: Arguments { + range: 26..28, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 30..44, + value: BoolOp( + ExprBoolOp { + range: 31..43, + op: Or, + values: [ + BoolOp( + ExprBoolOp { + range: 31..38, + op: And, + values: [ + Name( + ExprName { + range: 31..32, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 37..38, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + Name( + ExprName { + range: 42..43, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 45..58, + value: Lambda( + ExprLambda { + range: 46..57, + parameters: Some( + Parameters { + range: 53..54, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 53..54, + parameter: Parameter { + range: 53..54, + name: Identifier { + id: "x", + range: 53..54, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 56..57, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 59..67, + value: Named( + ExprNamed { + range: 60..66, + target: Name( + ExprName { + range: 60..61, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 65..66, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 68..77, + value: Yield( + ExprYield { + range: 69..76, + value: Some( + Name( + ExprName { + range: 75..76, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 78..92, + value: YieldFrom( + ExprYieldFrom { + range: 79..91, + value: Name( + ExprName { + range: 90..91, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__set.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__set.py.snap new file mode 100644 index 0000000000..a607c403b1 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__set.py.snap @@ -0,0 +1,620 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/set.py +--- +## AST + +``` +Module( + ModModule { + range: 0..313, + body: [ + Expr( + StmtExpr { + range: 14..16, + value: Dict( + ExprDict { + range: 14..16, + keys: [], + values: [], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 17..20, + value: Set( + ExprSet { + range: 17..20, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 18..19, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 21..25, + value: Set( + ExprSet { + range: 21..25, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 22..23, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 26..35, + value: Set( + ExprSet { + range: 26..35, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 27..28, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 30..31, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 33..34, + value: Int( + 3, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 36..46, + value: Set( + ExprSet { + range: 36..46, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 37..38, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 40..41, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 43..44, + value: Int( + 3, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 74..77, + value: Dict( + ExprDict { + range: 74..77, + keys: [], + values: [], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 78..91, + value: Set( + ExprSet { + range: 78..91, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 88..89, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 92..113, + value: Set( + ExprSet { + range: 92..113, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 98..99, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 109..110, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 124..129, + value: Set( + ExprSet { + range: 124..129, + elts: [ + Set( + ExprSet { + range: 125..128, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 126..127, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 130..146, + value: Set( + ExprSet { + range: 130..146, + elts: [ + Set( + ExprSet { + range: 131..137, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 132..133, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 135..136, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + Set( + ExprSet { + range: 139..145, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 140..141, + value: Int( + 3, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 143..144, + value: Int( + 4, + ), + }, + ), + ], + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 167..175, + value: Set( + ExprSet { + range: 167..175, + elts: [ + Named( + ExprNamed { + range: 168..174, + target: Name( + ExprName { + range: 168..169, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 173..174, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 176..190, + value: Set( + ExprSet { + range: 176..190, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 177..178, + value: Int( + 1, + ), + }, + ), + Named( + ExprNamed { + range: 180..186, + target: Name( + ExprName { + range: 180..181, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 185..186, + value: Int( + 2, + ), + }, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 188..189, + value: Int( + 3, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 191..205, + value: Set( + ExprSet { + range: 191..205, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 192..193, + value: Int( + 1, + ), + }, + ), + Named( + ExprNamed { + range: 196..202, + target: Name( + ExprName { + range: 196..197, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 201..202, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 225..235, + value: Set( + ExprSet { + range: 225..235, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 226..227, + value: Int( + 1, + ), + }, + ), + Starred( + ExprStarred { + range: 229..231, + value: Name( + ExprName { + range: 230..231, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 233..234, + value: Int( + 3, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 236..250, + value: Set( + ExprSet { + range: 236..250, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 237..238, + value: Int( + 1, + ), + }, + ), + Starred( + ExprStarred { + range: 240..246, + value: BinOp( + ExprBinOp { + range: 241..246, + left: Name( + ExprName { + range: 241..242, + id: "x", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 245..246, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 248..249, + value: Int( + 3, + ), + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 273..312, + value: Set( + ExprSet { + range: 273..312, + elts: [ + BinOp( + ExprBinOp { + range: 274..279, + left: NumberLiteral( + ExprNumberLiteral { + range: 274..275, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 278..279, + value: Int( + 2, + ), + }, + ), + }, + ), + Tuple( + ExprTuple { + range: 281..287, + elts: [ + Name( + ExprName { + range: 282..283, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 285..286, + id: "b", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + Set( + ExprSet { + range: 289..298, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 290..291, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 293..294, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 296..297, + value: Int( + 3, + ), + }, + ), + ], + }, + ), + Dict( + ExprDict { + range: 300..311, + keys: [ + Some( + Name( + ExprName { + range: 301..302, + id: "a", + ctx: Load, + }, + ), + ), + None, + ], + values: [ + Name( + ExprName { + range: 304..305, + id: "b", + ctx: Load, + }, + ), + Name( + ExprName { + range: 309..310, + id: "d", + ctx: Load, + }, + ), + ], + }, + ), + ], + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__set_comprehension.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__set_comprehension.py.snap new file mode 100644 index 0000000000..22272a00a0 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__set_comprehension.py.snap @@ -0,0 +1,741 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/set_comprehension.py +--- +## AST + +``` +Module( + ModModule { + range: 0..492, + body: [ + Expr( + StmtExpr { + range: 0..15, + value: SetComp( + ExprSetComp { + range: 0..15, + elt: Name( + ExprName { + range: 1..2, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 3..14, + target: Name( + ExprName { + range: 7..8, + id: "i", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 12..14, + id: "ll", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 16..57, + value: SetComp( + ExprSetComp { + range: 16..57, + elt: Name( + ExprName { + range: 17..18, + id: "b", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 19..56, + target: Name( + ExprName { + range: 23..24, + id: "c", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 28..29, + id: "d", + ctx: Load, + }, + ), + ifs: [ + Compare( + ExprCompare { + range: 33..39, + left: Name( + ExprName { + range: 33..34, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 38..39, + id: "w", + ctx: Load, + }, + ), + ], + }, + ), + BoolOp( + ExprBoolOp { + range: 43..51, + op: And, + values: [ + Name( + ExprName { + range: 43..44, + id: "y", + ctx: Load, + }, + ), + Name( + ExprName { + range: 49..51, + id: "yy", + ctx: Load, + }, + ), + ], + }, + ), + Name( + ExprName { + range: 55..56, + id: "z", + ctx: Load, + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 58..103, + value: SetComp( + ExprSetComp { + range: 58..103, + elt: Name( + ExprName { + range: 59..60, + id: "a", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 61..82, + target: Name( + ExprName { + range: 65..66, + id: "b", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 70..71, + id: "c", + ctx: Load, + }, + ), + ifs: [ + BoolOp( + ExprBoolOp { + range: 75..82, + op: And, + values: [ + Name( + ExprName { + range: 75..76, + id: "d", + ctx: Load, + }, + ), + Name( + ExprName { + range: 81..82, + id: "e", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: false, + }, + Comprehension { + range: 83..102, + target: Name( + ExprName { + range: 87..88, + id: "f", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 92..93, + id: "j", + ctx: Load, + }, + ), + ifs: [ + Compare( + ExprCompare { + range: 97..102, + left: Name( + ExprName { + range: 97..98, + id: "k", + ctx: Load, + }, + ), + ops: [ + Gt, + ], + comparators: [ + Name( + ExprName { + range: 101..102, + id: "h", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 104..155, + value: SetComp( + ExprSetComp { + range: 104..155, + elt: Name( + ExprName { + range: 105..106, + id: "a", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 107..128, + target: Name( + ExprName { + range: 111..112, + id: "b", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 116..117, + id: "c", + ctx: Load, + }, + ), + ifs: [ + BoolOp( + ExprBoolOp { + range: 121..128, + op: And, + values: [ + Name( + ExprName { + range: 121..122, + id: "d", + ctx: Load, + }, + ), + Name( + ExprName { + range: 127..128, + id: "e", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: false, + }, + Comprehension { + range: 129..154, + target: Name( + ExprName { + range: 139..140, + id: "f", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 144..145, + id: "j", + ctx: Load, + }, + ), + ifs: [ + Compare( + ExprCompare { + range: 149..154, + left: Name( + ExprName { + range: 149..150, + id: "k", + ctx: Load, + }, + ), + ops: [ + Gt, + ], + comparators: [ + Name( + ExprName { + range: 153..154, + id: "h", + ctx: Load, + }, + ), + ], + }, + ), + ], + is_async: true, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 156..173, + value: SetComp( + ExprSetComp { + range: 156..173, + elt: Name( + ExprName { + range: 157..158, + id: "a", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 159..172, + target: Tuple( + ExprTuple { + range: 163..167, + elts: [ + Name( + ExprName { + range: 163..164, + id: "a", + ctx: Store, + }, + ), + Name( + ExprName { + range: 166..167, + id: "b", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: false, + }, + ), + iter: Name( + ExprName { + range: 171..172, + id: "G", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 312..334, + value: SetComp( + ExprSetComp { + range: 312..334, + elt: Name( + ExprName { + range: 313..314, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 315..333, + target: Name( + ExprName { + range: 319..320, + id: "x", + ctx: Store, + }, + ), + iter: Yield( + ExprYield { + range: 325..332, + value: Some( + Name( + ExprName { + range: 331..332, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 335..362, + value: SetComp( + ExprSetComp { + range: 335..362, + elt: Name( + ExprName { + range: 336..337, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 338..361, + target: Name( + ExprName { + range: 342..343, + id: "x", + ctx: Store, + }, + ), + iter: YieldFrom( + ExprYieldFrom { + range: 348..360, + value: Name( + ExprName { + range: 359..360, + id: "y", + ctx: Load, + }, + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 363..389, + value: SetComp( + ExprSetComp { + range: 363..389, + elt: Name( + ExprName { + range: 364..365, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 366..388, + target: Name( + ExprName { + range: 370..371, + id: "x", + ctx: Store, + }, + ), + iter: Lambda( + ExprLambda { + range: 376..387, + parameters: Some( + Parameters { + range: 383..384, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 383..384, + parameter: Parameter { + range: 383..384, + name: Identifier { + id: "y", + range: 383..384, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 386..387, + id: "y", + ctx: Load, + }, + ), + }, + ), + ifs: [], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 390..420, + value: SetComp( + ExprSetComp { + range: 390..420, + elt: Name( + ExprName { + range: 391..392, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 393..419, + target: Name( + ExprName { + range: 397..398, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 402..406, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Yield( + ExprYield { + range: 411..418, + value: Some( + Name( + ExprName { + range: 417..418, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 421..456, + value: SetComp( + ExprSetComp { + range: 421..456, + elt: Name( + ExprName { + range: 422..423, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 424..455, + target: Name( + ExprName { + range: 428..429, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 433..437, + id: "data", + ctx: Load, + }, + ), + ifs: [ + YieldFrom( + ExprYieldFrom { + range: 442..454, + value: Name( + ExprName { + range: 453..454, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 457..491, + value: SetComp( + ExprSetComp { + range: 457..491, + elt: Name( + ExprName { + range: 458..459, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 460..490, + target: Name( + ExprName { + range: 464..465, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 469..473, + id: "data", + ctx: Load, + }, + ), + ifs: [ + Lambda( + ExprLambda { + range: 478..489, + parameters: Some( + Parameters { + range: 485..486, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 485..486, + parameter: Parameter { + range: 485..486, + name: Identifier { + id: "y", + range: 485..486, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 488..489, + id: "y", + ctx: Load, + }, + ), + }, + ), + ], + is_async: false, + }, + ], + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__slice.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__slice.py.snap new file mode 100644 index 0000000000..dd3211144f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__slice.py.snap @@ -0,0 +1,655 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/slice.py +--- +## AST + +``` +Module( + ModModule { + range: 0..211, + body: [ + Expr( + StmtExpr { + range: 23..27, + value: Subscript( + ExprSubscript { + range: 23..27, + value: Name( + ExprName { + range: 23..24, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 25..26, + lower: None, + upper: None, + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 28..33, + value: Subscript( + ExprSubscript { + range: 28..33, + value: Name( + ExprName { + range: 28..29, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 30..32, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 30..31, + value: Int( + 1, + ), + }, + ), + ), + upper: None, + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 34..39, + value: Subscript( + ExprSubscript { + range: 34..39, + value: Name( + ExprName { + range: 34..35, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 36..38, + lower: None, + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 37..38, + value: Int( + 2, + ), + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 40..46, + value: Subscript( + ExprSubscript { + range: 40..46, + value: Name( + ExprName { + range: 40..41, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 42..45, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 42..43, + value: Int( + 1, + ), + }, + ), + ), + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 44..45, + value: Int( + 2, + ), + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 47..52, + value: Subscript( + ExprSubscript { + range: 47..52, + value: Name( + ExprName { + range: 47..48, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 49..51, + lower: None, + upper: None, + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 53..59, + value: Subscript( + ExprSubscript { + range: 53..59, + value: Name( + ExprName { + range: 53..54, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 55..58, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 55..56, + value: Int( + 1, + ), + }, + ), + ), + upper: None, + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 60..66, + value: Subscript( + ExprSubscript { + range: 60..66, + value: Name( + ExprName { + range: 60..61, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 62..65, + lower: None, + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 63..64, + value: Int( + 2, + ), + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 67..74, + value: Subscript( + ExprSubscript { + range: 67..74, + value: Name( + ExprName { + range: 67..68, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 69..73, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 69..70, + value: Int( + 1, + ), + }, + ), + ), + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 71..72, + value: Int( + 2, + ), + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 75..81, + value: Subscript( + ExprSubscript { + range: 75..81, + value: Name( + ExprName { + range: 75..76, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 77..80, + lower: None, + upper: None, + step: Some( + NumberLiteral( + ExprNumberLiteral { + range: 79..80, + value: Int( + 3, + ), + }, + ), + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 82..89, + value: Subscript( + ExprSubscript { + range: 82..89, + value: Name( + ExprName { + range: 82..83, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 84..88, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 84..85, + value: Int( + 1, + ), + }, + ), + ), + upper: None, + step: Some( + NumberLiteral( + ExprNumberLiteral { + range: 87..88, + value: Int( + 3, + ), + }, + ), + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 90..97, + value: Subscript( + ExprSubscript { + range: 90..97, + value: Name( + ExprName { + range: 90..91, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 92..96, + lower: None, + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 93..94, + value: Int( + 2, + ), + }, + ), + ), + step: Some( + NumberLiteral( + ExprNumberLiteral { + range: 95..96, + value: Int( + 3, + ), + }, + ), + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 98..106, + value: Subscript( + ExprSubscript { + range: 98..106, + value: Name( + ExprName { + range: 98..99, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 100..105, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 100..101, + value: Int( + 1, + ), + }, + ), + ), + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 102..103, + value: Int( + 2, + ), + }, + ), + ), + step: Some( + NumberLiteral( + ExprNumberLiteral { + range: 104..105, + value: Int( + 3, + ), + }, + ), + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 127..136, + value: Subscript( + ExprSubscript { + range: 127..136, + value: Name( + ExprName { + range: 127..128, + id: "x", + ctx: Load, + }, + ), + slice: Named( + ExprNamed { + range: 129..135, + target: Name( + ExprName { + range: 129..130, + id: "y", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 134..135, + value: Int( + 2, + ), + }, + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 137..149, + value: Subscript( + ExprSubscript { + range: 137..149, + value: Name( + ExprName { + range: 137..138, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 139..148, + lower: Some( + Named( + ExprNamed { + range: 140..146, + target: Name( + ExprName { + range: 140..141, + id: "y", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 145..146, + value: Int( + 2, + ), + }, + ), + }, + ), + ), + upper: None, + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 150..160, + value: Subscript( + ExprSubscript { + range: 150..160, + value: Name( + ExprName { + range: 150..151, + id: "x", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 152..159, + elts: [ + Named( + ExprNamed { + range: 152..158, + target: Name( + ExprName { + range: 152..153, + id: "y", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 157..158, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 202..210, + value: Subscript( + ExprSubscript { + range: 202..210, + value: Name( + ExprName { + range: 202..203, + id: "x", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 204..209, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 204..205, + value: Int( + 1, + ), + }, + ), + Slice( + ExprSlice { + range: 206..208, + lower: None, + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 207..208, + value: Int( + 2, + ), + }, + ), + ), + step: None, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__starred.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__starred.py.snap new file mode 100644 index 0000000000..2d9041f3a7 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__starred.py.snap @@ -0,0 +1,354 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/starred.py +--- +## AST + +``` +Module( + ModModule { + range: 0..172, + body: [ + Expr( + StmtExpr { + range: 0..2, + value: Starred( + ExprStarred { + range: 0..2, + value: Name( + ExprName { + range: 1..2, + id: "a", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 3..11, + value: Starred( + ExprStarred { + range: 3..11, + value: BinOp( + ExprBinOp { + range: 5..10, + left: Name( + ExprName { + range: 5..6, + id: "a", + ctx: Load, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 9..10, + value: Int( + 1, + ), + }, + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 12..19, + value: Starred( + ExprStarred { + range: 12..19, + value: Attribute( + ExprAttribute { + range: 13..19, + value: Name( + ExprName { + range: 13..14, + id: "x", + ctx: Load, + }, + ), + attr: Identifier { + id: "attr", + range: 15..19, + }, + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 21..57, + targets: [ + Name( + ExprName { + range: 21..32, + id: "array_slice", + ctx: Store, + }, + ), + ], + value: Subscript( + ExprSubscript { + range: 35..57, + value: Name( + ExprName { + range: 35..40, + id: "array", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 41..56, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 41..42, + value: Int( + 0, + ), + }, + ), + Starred( + ExprStarred { + range: 44..52, + value: Name( + ExprName { + range: 45..52, + id: "indexes", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + UnaryOp( + ExprUnaryOp { + range: 54..56, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 55..56, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 58..94, + targets: [ + Subscript( + ExprSubscript { + range: 58..80, + value: Name( + ExprName { + range: 58..63, + id: "array", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 64..79, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 64..65, + value: Int( + 0, + ), + }, + ), + Starred( + ExprStarred { + range: 67..75, + value: Name( + ExprName { + range: 68..75, + id: "indexes", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + UnaryOp( + ExprUnaryOp { + range: 77..79, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 78..79, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Store, + }, + ), + ], + value: Name( + ExprName { + range: 83..94, + id: "array_slice", + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 95..140, + value: Subscript( + ExprSubscript { + range: 95..140, + value: Name( + ExprName { + range: 95..100, + id: "array", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 101..139, + elts: [ + Starred( + ExprStarred { + range: 101..119, + value: Name( + ExprName { + range: 102..119, + id: "indexes_to_select", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 121..139, + value: Name( + ExprName { + range: 122..139, + id: "indexes_to_select", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 141..171, + value: Subscript( + ExprSubscript { + range: 141..171, + value: Name( + ExprName { + range: 141..146, + id: "array", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 147..170, + elts: [ + Slice( + ExprSlice { + range: 147..150, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 147..148, + value: Int( + 3, + ), + }, + ), + ), + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 149..150, + value: Int( + 5, + ), + }, + ), + ), + step: None, + }, + ), + Starred( + ExprStarred { + range: 152..170, + value: Name( + ExprName { + range: 153..170, + id: "indexes_to_select", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__string.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__string.py.snap new file mode 100644 index 0000000000..85db63784d --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__string.py.snap @@ -0,0 +1,315 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/string.py +--- +## AST + +``` +Module( + ModModule { + range: 0..163, + body: [ + Expr( + StmtExpr { + range: 0..13, + value: StringLiteral( + ExprStringLiteral { + range: 0..13, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 0..13, + value: "Hello World", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 14..20, + value: StringLiteral( + ExprStringLiteral { + range: 14..20, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 14..20, + value: "😎", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 21..32, + value: StringLiteral( + ExprStringLiteral { + range: 21..32, + value: StringLiteralValue { + inner: Concatenated( + ConcatenatedStringLiteral { + strings: [ + StringLiteral { + range: 21..26, + value: "Foo", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + StringLiteral { + range: 27..32, + value: "Bar", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ], + value: "FooBar", + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 33..60, + value: StringLiteral( + ExprStringLiteral { + range: 39..58, + value: StringLiteralValue { + inner: Concatenated( + ConcatenatedStringLiteral { + strings: [ + StringLiteral { + range: 39..42, + value: "A", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + StringLiteral { + range: 47..50, + value: "B", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + StringLiteral { + range: 55..58, + value: "C", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ], + value: "ABC", + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 61..79, + value: StringLiteral( + ExprStringLiteral { + range: 61..79, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 61..79, + value: "Olá, Mundo!", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: true, + }, + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 80..91, + value: StringLiteral( + ExprStringLiteral { + range: 80..91, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 80..91, + value: "ABCDE", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: true, + }, + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 92..121, + value: StringLiteral( + ExprStringLiteral { + range: 98..119, + value: StringLiteralValue { + inner: Concatenated( + ConcatenatedStringLiteral { + strings: [ + StringLiteral { + range: 98..106, + value: "aB", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: true, + }, + }, + StringLiteral { + range: 111..119, + value: "cD", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: true, + }, + }, + ], + value: "aBcD", + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 122..136, + value: BytesLiteral( + ExprBytesLiteral { + range: 122..136, + value: BytesLiteralValue { + inner: Single( + BytesLiteral { + range: 122..136, + value: [ + 104, + 101, + 108, + 108, + 111, + 32, + 119, + 111, + 114, + 108, + 100, + ], + flags: BytesLiteralFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 137..161, + value: BytesLiteral( + ExprBytesLiteral { + range: 137..161, + value: BytesLiteralValue { + inner: Concatenated( + [ + BytesLiteral { + range: 137..145, + value: [ + 98, + 121, + 116, + 101, + 115, + ], + flags: BytesLiteralFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + BytesLiteral { + range: 146..161, + value: [ + 99, + 111, + 110, + 99, + 97, + 116, + 101, + 110, + 97, + 116, + 101, + 100, + ], + flags: BytesLiteralFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ], + ), + }, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__subscript.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__subscript.py.snap new file mode 100644 index 0000000000..c7f4cca392 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__subscript.py.snap @@ -0,0 +1,783 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/subscript.py +--- +## AST + +``` +Module( + ModModule { + range: 0..266, + body: [ + Expr( + StmtExpr { + range: 0..10, + value: Subscript( + ExprSubscript { + range: 0..10, + value: Subscript( + ExprSubscript { + range: 0..7, + value: Name( + ExprName { + range: 0..4, + id: "data", + ctx: Load, + }, + ), + slice: NumberLiteral( + ExprNumberLiteral { + range: 5..6, + value: Int( + 0, + ), + }, + ), + ctx: Load, + }, + ), + slice: NumberLiteral( + ExprNumberLiteral { + range: 8..9, + value: Int( + 0, + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 11..21, + value: Subscript( + ExprSubscript { + range: 11..21, + value: Name( + ExprName { + range: 11..15, + id: "data", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 16..20, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 16..17, + value: Int( + 0, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 19..20, + value: Int( + 1, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 22..31, + value: Subscript( + ExprSubscript { + range: 22..31, + value: Name( + ExprName { + range: 22..26, + id: "data", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 27..30, + elts: [ + Slice( + ExprSlice { + range: 27..29, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 27..28, + value: Int( + 0, + ), + }, + ), + ), + upper: None, + step: None, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 32..43, + value: Subscript( + ExprSubscript { + range: 32..43, + value: Name( + ExprName { + range: 32..36, + id: "data", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 37..42, + elts: [ + Slice( + ExprSlice { + range: 37..39, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 37..38, + value: Int( + 0, + ), + }, + ), + ), + upper: None, + step: None, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 41..42, + value: Int( + 1, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 44..56, + value: Subscript( + ExprSubscript { + range: 44..56, + value: Name( + ExprName { + range: 44..48, + id: "data", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 49..55, + elts: [ + Slice( + ExprSlice { + range: 49..52, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 49..50, + value: Int( + 0, + ), + }, + ), + ), + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 51..52, + value: Int( + 1, + ), + }, + ), + ), + step: None, + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 54..55, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 57..80, + value: Subscript( + ExprSubscript { + range: 57..80, + value: Name( + ExprName { + range: 57..61, + id: "data", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 62..79, + elts: [ + Slice( + ExprSlice { + range: 62..67, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 62..63, + value: Int( + 0, + ), + }, + ), + ), + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 64..65, + value: Int( + 1, + ), + }, + ), + ), + step: Some( + NumberLiteral( + ExprNumberLiteral { + range: 66..67, + value: Int( + 2, + ), + }, + ), + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 69..70, + value: Int( + 3, + ), + }, + ), + Slice( + ExprSlice { + range: 72..79, + lower: Some( + Name( + ExprName { + range: 72..73, + id: "a", + ctx: Load, + }, + ), + ), + upper: Some( + BinOp( + ExprBinOp { + range: 74..79, + left: Name( + ExprName { + range: 74..75, + id: "b", + ctx: Load, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 78..79, + value: Int( + 1, + ), + }, + ), + }, + ), + ), + step: None, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 81..93, + value: Subscript( + ExprSubscript { + range: 81..93, + value: Name( + ExprName { + range: 81..85, + id: "data", + ctx: Load, + }, + ), + slice: Named( + ExprNamed { + range: 86..92, + target: Name( + ExprName { + range: 86..87, + id: "a", + ctx: Store, + }, + ), + value: Name( + ExprName { + range: 91..92, + id: "b", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 94..106, + value: Subscript( + ExprSubscript { + range: 94..106, + value: Name( + ExprName { + range: 94..98, + id: "data", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 99..105, + elts: [ + Slice( + ExprSlice { + range: 99..100, + lower: None, + upper: None, + step: None, + }, + ), + Slice( + ExprSlice { + range: 102..105, + lower: None, + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 103..105, + value: Int( + 11, + ), + }, + ), + ), + step: None, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 107..120, + value: Subscript( + ExprSubscript { + range: 107..120, + value: Name( + ExprName { + range: 107..111, + id: "data", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 112..119, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 112..113, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 115..116, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 118..119, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 121..132, + value: Subscript( + ExprSubscript { + range: 121..132, + value: Name( + ExprName { + range: 121..125, + id: "data", + ctx: Load, + }, + ), + slice: UnaryOp( + ExprUnaryOp { + range: 126..131, + op: Invert, + operand: Name( + ExprName { + range: 127..131, + id: "flag", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 133..148, + value: Subscript( + ExprSubscript { + range: 133..148, + value: Name( + ExprName { + range: 133..137, + id: "data", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 138..147, + lower: Some( + Named( + ExprNamed { + range: 139..145, + target: Name( + ExprName { + range: 139..140, + id: "a", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 144..145, + value: Int( + 0, + ), + }, + ), + }, + ), + ), + upper: None, + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 149..165, + value: Subscript( + ExprSubscript { + range: 149..165, + value: Name( + ExprName { + range: 149..153, + id: "data", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 154..164, + lower: Some( + Named( + ExprNamed { + range: 155..161, + target: Name( + ExprName { + range: 155..156, + id: "a", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 160..161, + value: Int( + 0, + ), + }, + ), + }, + ), + ), + upper: Some( + Name( + ExprName { + range: 163..164, + id: "y", + ctx: Load, + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 226..234, + value: Subscript( + ExprSubscript { + range: 226..234, + value: Name( + ExprName { + range: 226..230, + id: "data", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 231..233, + elts: [ + Starred( + ExprStarred { + range: 231..233, + value: Name( + ExprName { + range: 232..233, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 235..249, + value: Subscript( + ExprSubscript { + range: 235..249, + value: Name( + ExprName { + range: 235..239, + id: "data", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 240..248, + elts: [ + Starred( + ExprStarred { + range: 240..248, + value: BoolOp( + ExprBoolOp { + range: 241..248, + op: And, + values: [ + Name( + ExprName { + range: 241..242, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 247..248, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 250..265, + value: Subscript( + ExprSubscript { + range: 250..265, + value: Name( + ExprName { + range: 250..254, + id: "data", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 255..264, + elts: [ + Starred( + ExprStarred { + range: 255..264, + value: Named( + ExprNamed { + range: 257..263, + target: Name( + ExprName { + range: 257..258, + id: "x", + ctx: Store, + }, + ), + value: Name( + ExprName { + range: 262..263, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__tuple.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__tuple.py.snap new file mode 100644 index 0000000000..e425e62a83 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__tuple.py.snap @@ -0,0 +1,706 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/tuple.py +--- +## AST + +``` +Module( + ModModule { + range: 0..276, + body: [ + Expr( + StmtExpr { + range: 19..21, + value: Tuple( + ExprTuple { + range: 19..21, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 22..26, + value: Tuple( + ExprTuple { + range: 23..25, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 27..37, + value: Tuple( + ExprTuple { + range: 27..37, + elts: [ + Tuple( + ExprTuple { + range: 29..31, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + Tuple( + ExprTuple { + range: 34..36, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 38..42, + value: Tuple( + ExprTuple { + range: 38..42, + elts: [ + Name( + ExprName { + range: 39..40, + id: "a", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 43..49, + value: Tuple( + ExprTuple { + range: 43..49, + elts: [ + Name( + ExprName { + range: 44..45, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 47..48, + id: "b", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 50..57, + value: Tuple( + ExprTuple { + range: 50..57, + elts: [ + Name( + ExprName { + range: 51..52, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 54..55, + id: "b", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 58..66, + value: Tuple( + ExprTuple { + range: 59..65, + elts: [ + Name( + ExprName { + range: 60..61, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 63..64, + id: "b", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 90..92, + value: Tuple( + ExprTuple { + range: 90..92, + elts: [ + Name( + ExprName { + range: 90..91, + id: "a", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 93..97, + value: Tuple( + ExprTuple { + range: 93..97, + elts: [ + Name( + ExprName { + range: 93..94, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 96..97, + id: "b", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 98..103, + value: Tuple( + ExprTuple { + range: 98..103, + elts: [ + Name( + ExprName { + range: 98..99, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 101..102, + id: "b", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 126..129, + value: Tuple( + ExprTuple { + range: 126..129, + elts: [ + Starred( + ExprStarred { + range: 126..128, + value: Name( + ExprName { + range: 127..128, + id: "a", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 130..135, + value: Tuple( + ExprTuple { + range: 130..135, + elts: [ + Name( + ExprName { + range: 130..131, + id: "a", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 133..135, + value: Name( + ExprName { + range: 134..135, + id: "b", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 136..161, + value: Tuple( + ExprTuple { + range: 136..161, + elts: [ + Starred( + ExprStarred { + range: 136..142, + value: BinOp( + ExprBinOp { + range: 137..142, + left: Name( + ExprName { + range: 137..138, + id: "a", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 141..142, + id: "b", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 144..152, + value: Await( + ExprAwait { + range: 145..152, + value: Name( + ExprName { + range: 151..152, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Tuple( + ExprTuple { + range: 154..156, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + Starred( + ExprStarred { + range: 158..161, + value: Tuple( + ExprTuple { + range: 159..161, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 162..167, + value: Tuple( + ExprTuple { + range: 162..167, + elts: [ + Starred( + ExprStarred { + range: 163..165, + value: Name( + ExprName { + range: 164..165, + id: "a", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 168..175, + value: Tuple( + ExprTuple { + range: 168..175, + elts: [ + Name( + ExprName { + range: 169..170, + id: "a", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 172..174, + value: Name( + ExprName { + range: 173..174, + id: "b", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 176..203, + value: Tuple( + ExprTuple { + range: 176..203, + elts: [ + Starred( + ExprStarred { + range: 177..183, + value: BinOp( + ExprBinOp { + range: 178..183, + left: Name( + ExprName { + range: 178..179, + id: "a", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 182..183, + id: "b", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 185..193, + value: Await( + ExprAwait { + range: 186..193, + value: Name( + ExprName { + range: 192..193, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Tuple( + ExprTuple { + range: 195..197, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + Starred( + ExprStarred { + range: 199..202, + value: Tuple( + ExprTuple { + range: 200..202, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 224..233, + value: Tuple( + ExprTuple { + range: 224..233, + elts: [ + Named( + ExprNamed { + range: 225..231, + target: Name( + ExprName { + range: 225..226, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 230..231, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 234..245, + value: Tuple( + ExprTuple { + range: 234..245, + elts: [ + Name( + ExprName { + range: 235..236, + id: "x", + ctx: Load, + }, + ), + Named( + ExprNamed { + range: 238..244, + target: Name( + ExprName { + range: 238..239, + id: "y", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 243..244, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 246..260, + value: Tuple( + ExprTuple { + range: 246..260, + elts: [ + Name( + ExprName { + range: 247..248, + id: "x", + ctx: Load, + }, + ), + Named( + ExprNamed { + range: 250..256, + target: Name( + ExprName { + range: 250..251, + id: "y", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 255..256, + value: Int( + 2, + ), + }, + ), + }, + ), + Name( + ExprName { + range: 258..259, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 261..275, + value: Tuple( + ExprTuple { + range: 261..275, + elts: [ + Name( + ExprName { + range: 261..262, + id: "x", + ctx: Load, + }, + ), + Named( + ExprNamed { + range: 265..271, + target: Name( + ExprName { + range: 265..266, + id: "y", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 270..271, + value: Int( + 2, + ), + }, + ), + }, + ), + Name( + ExprName { + range: 274..275, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__unary_op.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__unary_op.py.snap new file mode 100644 index 0000000000..6ea9229422 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__unary_op.py.snap @@ -0,0 +1,506 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/unary_op.py +--- +## AST + +``` +Module( + ModModule { + range: 0..276, + body: [ + Expr( + StmtExpr { + range: 9..11, + value: UnaryOp( + ExprUnaryOp { + range: 9..11, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 10..11, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 12..14, + value: UnaryOp( + ExprUnaryOp { + range: 12..14, + op: UAdd, + operand: NumberLiteral( + ExprNumberLiteral { + range: 13..14, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 15..17, + value: UnaryOp( + ExprUnaryOp { + range: 15..17, + op: Invert, + operand: NumberLiteral( + ExprNumberLiteral { + range: 16..17, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 18..23, + value: UnaryOp( + ExprUnaryOp { + range: 18..23, + op: Not, + operand: Name( + ExprName { + range: 22..23, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 36..40, + value: UnaryOp( + ExprUnaryOp { + range: 36..40, + op: USub, + operand: UnaryOp( + ExprUnaryOp { + range: 37..40, + op: USub, + operand: UnaryOp( + ExprUnaryOp { + range: 38..40, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 39..40, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 41..45, + value: UnaryOp( + ExprUnaryOp { + range: 41..45, + op: USub, + operand: UnaryOp( + ExprUnaryOp { + range: 42..45, + op: UAdd, + operand: UnaryOp( + ExprUnaryOp { + range: 43..45, + op: Invert, + operand: NumberLiteral( + ExprNumberLiteral { + range: 44..45, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 46..53, + value: UnaryOp( + ExprUnaryOp { + range: 46..53, + op: Not, + operand: UnaryOp( + ExprUnaryOp { + range: 49..53, + op: USub, + operand: UnaryOp( + ExprUnaryOp { + range: 50..53, + op: UAdd, + operand: UnaryOp( + ExprUnaryOp { + range: 51..53, + op: Invert, + operand: NumberLiteral( + ExprNumberLiteral { + range: 52..53, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 54..63, + value: UnaryOp( + ExprUnaryOp { + range: 54..63, + op: Not, + operand: UnaryOp( + ExprUnaryOp { + range: 58..63, + op: Not, + operand: Name( + ExprName { + range: 62..63, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 84..93, + value: UnaryOp( + ExprUnaryOp { + range: 84..93, + op: USub, + operand: Await( + ExprAwait { + range: 86..93, + value: NumberLiteral( + ExprNumberLiteral { + range: 92..93, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 94..109, + value: UnaryOp( + ExprUnaryOp { + range: 94..109, + op: UAdd, + operand: BinOp( + ExprBinOp { + range: 96..109, + left: Await( + ExprAwait { + range: 96..103, + value: NumberLiteral( + ExprNumberLiteral { + range: 102..103, + value: Int( + 1, + ), + }, + ), + }, + ), + op: Pow, + right: UnaryOp( + ExprUnaryOp { + range: 107..109, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 108..109, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 110..117, + value: UnaryOp( + ExprUnaryOp { + range: 110..117, + op: Invert, + operand: Tuple( + ExprTuple { + range: 111..117, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 112..113, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 115..116, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 118..124, + value: BinOp( + ExprBinOp { + range: 118..124, + left: UnaryOp( + ExprUnaryOp { + range: 118..120, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 119..120, + value: Int( + 1, + ), + }, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 123..124, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 212..246, + value: BoolOp( + ExprBoolOp { + range: 212..246, + op: Or, + values: [ + BoolOp( + ExprBoolOp { + range: 212..223, + op: And, + values: [ + UnaryOp( + ExprUnaryOp { + range: 212..217, + op: Not, + operand: Name( + ExprName { + range: 216..217, + id: "a", + ctx: Load, + }, + ), + }, + ), + Name( + ExprName { + range: 222..223, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + BoolOp( + ExprBoolOp { + range: 227..246, + op: And, + values: [ + UnaryOp( + ExprUnaryOp { + range: 227..236, + op: Not, + operand: BinOp( + ExprBinOp { + range: 231..236, + left: Name( + ExprName { + range: 231..232, + id: "c", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 235..236, + id: "d", + ctx: Load, + }, + ), + }, + ), + }, + ), + UnaryOp( + ExprUnaryOp { + range: 241..246, + op: Not, + operand: Name( + ExprName { + range: 245..246, + id: "e", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + ], + }, + ), + }, + ), + Expr( + StmtExpr { + range: 247..259, + value: UnaryOp( + ExprUnaryOp { + range: 247..259, + op: Not, + operand: Named( + ExprNamed { + range: 252..258, + target: Name( + ExprName { + range: 252..253, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 257..258, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 260..275, + value: UnaryOp( + ExprUnaryOp { + range: 260..275, + op: Not, + operand: BinOp( + ExprBinOp { + range: 264..275, + left: Name( + ExprName { + range: 264..265, + id: "a", + ctx: Load, + }, + ), + op: BitOr, + right: UnaryOp( + ExprUnaryOp { + range: 269..274, + op: Not, + operand: Name( + ExprName { + range: 273..274, + id: "b", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__yield.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__yield.py.snap new file mode 100644 index 0000000000..d65f741b01 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__yield.py.snap @@ -0,0 +1,526 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/yield.py +--- +## AST + +``` +Module( + ModModule { + range: 0..188, + body: [ + Expr( + StmtExpr { + range: 0..5, + value: Yield( + ExprYield { + range: 0..5, + value: None, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 6..13, + value: Yield( + ExprYield { + range: 6..13, + value: Some( + Name( + ExprName { + range: 12..13, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 14..25, + value: Yield( + ExprYield { + range: 14..25, + value: Some( + BinOp( + ExprBinOp { + range: 20..25, + left: Name( + ExprName { + range: 20..21, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 24..25, + value: Int( + 1, + ), + }, + ), + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 26..39, + value: Yield( + ExprYield { + range: 26..39, + value: Some( + BoolOp( + ExprBoolOp { + range: 32..39, + op: And, + values: [ + Name( + ExprName { + range: 32..33, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 38..39, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 40..52, + value: Yield( + ExprYield { + range: 40..52, + value: Some( + Call( + ExprCall { + range: 46..52, + func: Name( + ExprName { + range: 46..50, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 50..52, + args: [], + keywords: [], + }, + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 53..65, + value: Yield( + ExprYield { + range: 53..65, + value: Some( + List( + ExprList { + range: 59..65, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 60..61, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 63..64, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 66..78, + value: Yield( + ExprYield { + range: 66..78, + value: Some( + Set( + ExprSet { + range: 72..78, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 73..74, + value: Int( + 3, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 76..77, + value: Int( + 4, + ), + }, + ), + ], + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 79..91, + value: Yield( + ExprYield { + range: 79..91, + value: Some( + Dict( + ExprDict { + range: 85..91, + keys: [ + Some( + Name( + ExprName { + range: 86..87, + id: "x", + ctx: Load, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 89..90, + value: Int( + 5, + ), + }, + ), + ], + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 92..102, + value: Yield( + ExprYield { + range: 92..102, + value: Some( + Tuple( + ExprTuple { + range: 98..102, + elts: [ + Name( + ExprName { + range: 98..99, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 101..102, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 103..115, + value: Yield( + ExprYield { + range: 103..115, + value: Some( + Tuple( + ExprTuple { + range: 109..115, + elts: [ + Name( + ExprName { + range: 110..111, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 113..114, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 116..128, + value: Yield( + ExprYield { + range: 116..128, + value: Some( + Compare( + ExprCompare { + range: 122..128, + left: Name( + ExprName { + range: 122..123, + id: "x", + ctx: Load, + }, + ), + ops: [ + Eq, + ], + comparators: [ + Name( + ExprName { + range: 127..128, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 129..143, + value: Yield( + ExprYield { + range: 129..143, + value: Some( + Named( + ExprNamed { + range: 136..142, + target: Name( + ExprName { + range: 136..137, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 141..142, + value: Int( + 1, + ), + }, + ), + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 144..152, + value: Yield( + ExprYield { + range: 144..152, + value: Some( + Starred( + ExprStarred { + range: 150..152, + value: Name( + ExprName { + range: 151..152, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 153..164, + value: Yield( + ExprYield { + range: 153..164, + value: Some( + Tuple( + ExprTuple { + range: 159..164, + elts: [ + Name( + ExprName { + range: 159..160, + id: "x", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 162..164, + value: Name( + ExprName { + range: 163..164, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 165..174, + value: Yield( + ExprYield { + range: 165..174, + value: Some( + Tuple( + ExprTuple { + range: 171..174, + elts: [ + Starred( + ExprStarred { + range: 171..173, + value: Name( + ExprName { + range: 172..173, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 175..187, + value: Yield( + ExprYield { + range: 175..187, + value: Some( + Starred( + ExprStarred { + range: 181..187, + value: BinOp( + ExprBinOp { + range: 182..187, + left: Name( + ExprName { + range: 182..183, + id: "x", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 186..187, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__yield_from.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__yield_from.py.snap new file mode 100644 index 0000000000..fe161c3851 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__yield_from.py.snap @@ -0,0 +1,374 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/expressions/yield_from.py +--- +## AST + +``` +Module( + ModModule { + range: 0..199, + body: [ + Expr( + StmtExpr { + range: 0..12, + value: YieldFrom( + ExprYieldFrom { + range: 0..12, + value: Name( + ExprName { + range: 11..12, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 13..29, + value: YieldFrom( + ExprYieldFrom { + range: 13..29, + value: BinOp( + ExprBinOp { + range: 24..29, + left: Name( + ExprName { + range: 24..25, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 28..29, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 30..48, + value: YieldFrom( + ExprYieldFrom { + range: 30..48, + value: BoolOp( + ExprBoolOp { + range: 41..48, + op: And, + values: [ + Name( + ExprName { + range: 41..42, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 47..48, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 49..66, + value: YieldFrom( + ExprYieldFrom { + range: 49..66, + value: Call( + ExprCall { + range: 60..66, + func: Name( + ExprName { + range: 60..64, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 64..66, + args: [], + keywords: [], + }, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 67..84, + value: YieldFrom( + ExprYieldFrom { + range: 67..84, + value: List( + ExprList { + range: 78..84, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 79..80, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 82..83, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 85..102, + value: YieldFrom( + ExprYieldFrom { + range: 85..102, + value: Set( + ExprSet { + range: 96..102, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 97..98, + value: Int( + 3, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 100..101, + value: Int( + 4, + ), + }, + ), + ], + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 103..120, + value: YieldFrom( + ExprYieldFrom { + range: 103..120, + value: Dict( + ExprDict { + range: 114..120, + keys: [ + Some( + Name( + ExprName { + range: 115..116, + id: "x", + ctx: Load, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 118..119, + value: Int( + 5, + ), + }, + ), + ], + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 121..138, + value: YieldFrom( + ExprYieldFrom { + range: 121..138, + value: Tuple( + ExprTuple { + range: 132..138, + elts: [ + Name( + ExprName { + range: 133..134, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 136..137, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 139..156, + value: YieldFrom( + ExprYieldFrom { + range: 139..156, + value: Compare( + ExprCompare { + range: 150..156, + left: Name( + ExprName { + range: 150..151, + id: "x", + ctx: Load, + }, + ), + ops: [ + Eq, + ], + comparators: [ + Name( + ExprName { + range: 155..156, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 157..176, + value: YieldFrom( + ExprYieldFrom { + range: 157..176, + value: Named( + ExprNamed { + range: 169..175, + target: Name( + ExprName { + range: 169..170, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 174..175, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 177..199, + value: YieldFrom( + ExprYieldFrom { + range: 177..199, + value: Tuple( + ExprTuple { + range: 188..199, + elts: [ + Name( + ExprName { + range: 189..190, + id: "x", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 192..198, + value: BinOp( + ExprBinOp { + range: 193..198, + left: Name( + ExprName { + range: 193..194, + id: "x", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 197..198, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@from_import_no_space.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@from_import_no_space.py.snap new file mode 100644 index 0000000000..2217e663dd --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@from_import_no_space.py.snap @@ -0,0 +1,53 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/from_import_no_space.py +--- +## AST + +``` +Module( + ModModule { + range: 0..30, + body: [ + ImportFrom( + StmtImportFrom { + range: 0..13, + module: None, + names: [ + Alias { + range: 12..13, + name: Identifier { + id: "x", + range: 12..13, + }, + asname: None, + }, + ], + level: Some( + 1, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 14..29, + module: None, + names: [ + Alias { + range: 28..29, + name: Identifier { + id: "x", + range: 28..29, + }, + asname: None, + }, + ], + level: Some( + 3, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@from_import_stmt_terminator.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@from_import_stmt_terminator.py.snap new file mode 100644 index 0000000000..8d0e410601 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@from_import_stmt_terminator.py.snap @@ -0,0 +1,227 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/from_import_stmt_terminator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..97, + body: [ + ImportFrom( + StmtImportFrom { + range: 0..20, + module: Some( + Identifier { + id: "a", + range: 5..6, + }, + ), + names: [ + Alias { + range: 15..16, + name: Identifier { + id: "b", + range: 15..16, + }, + asname: None, + }, + Alias { + range: 18..19, + name: Identifier { + id: "c", + range: 18..19, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 21..41, + module: Some( + Identifier { + id: "a", + range: 26..27, + }, + ), + names: [ + Alias { + range: 36..37, + name: Identifier { + id: "b", + range: 36..37, + }, + asname: None, + }, + Alias { + range: 39..40, + name: Identifier { + id: "c", + range: 39..40, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + Expr( + StmtExpr { + range: 43..47, + value: Tuple( + ExprTuple { + range: 43..47, + elts: [ + Name( + ExprName { + range: 43..44, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 46..47, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 48..66, + module: Some( + Identifier { + id: "a", + range: 53..54, + }, + ), + names: [ + Alias { + range: 62..63, + name: Identifier { + id: "b", + range: 62..63, + }, + asname: None, + }, + Alias { + range: 65..66, + name: Identifier { + id: "c", + range: 65..66, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + Expr( + StmtExpr { + range: 68..72, + value: Tuple( + ExprTuple { + range: 68..72, + elts: [ + Name( + ExprName { + range: 68..69, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 71..72, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 73..91, + module: Some( + Identifier { + id: "a", + range: 78..79, + }, + ), + names: [ + Alias { + range: 87..88, + name: Identifier { + id: "b", + range: 87..88, + }, + asname: None, + }, + Alias { + range: 90..91, + name: Identifier { + id: "c", + range: 90..91, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + Expr( + StmtExpr { + range: 92..96, + value: Tuple( + ExprTuple { + range: 92..96, + elts: [ + Name( + ExprName { + range: 92..93, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 95..96, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@fstring_format_spec_terminator.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@fstring_format_spec_terminator.py.snap new file mode 100644 index 0000000000..343825fcdb --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@fstring_format_spec_terminator.py.snap @@ -0,0 +1,138 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/fstring_format_spec_terminator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..43, + body: [ + Expr( + StmtExpr { + range: 0..19, + value: FString( + ExprFString { + range: 0..19, + value: FStringValue { + inner: Single( + FString( + FString { + range: 0..19, + elements: [ + Literal( + FStringLiteralElement { + range: 2..8, + value: "hello ", + }, + ), + Expression( + FStringExpressionElement { + range: 8..12, + expression: Name( + ExprName { + range: 9..10, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 11..11, + elements: [], + }, + ), + }, + ), + Literal( + FStringLiteralElement { + range: 12..18, + value: " world", + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 20..42, + value: FString( + ExprFString { + range: 20..42, + value: FStringValue { + inner: Single( + FString( + FString { + range: 20..42, + elements: [ + Literal( + FStringLiteralElement { + range: 22..28, + value: "hello ", + }, + ), + Expression( + FStringExpressionElement { + range: 28..35, + expression: Name( + ExprName { + range: 29..30, + id: "x", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 31..34, + elements: [ + Literal( + FStringLiteralElement { + range: 31..34, + value: ".3f", + }, + ), + ], + }, + ), + }, + ), + Literal( + FStringLiteralElement { + range: 35..41, + value: " world", + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@function_def_parameter_range.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@function_def_parameter_range.py.snap new file mode 100644 index 0000000000..c447efe4e7 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@function_def_parameter_range.py.snap @@ -0,0 +1,97 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/function_def_parameter_range.py +--- +## AST + +``` +Module( + ModModule { + range: 0..56, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..55, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..43, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 13..23, + parameter: Parameter { + range: 13..23, + name: Identifier { + id: "first", + range: 13..18, + }, + annotation: Some( + Name( + ExprName { + range: 20..23, + id: "int", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ParameterWithDefault { + range: 29..40, + parameter: Parameter { + range: 29..40, + name: Identifier { + id: "second", + range: 29..35, + }, + annotation: Some( + Name( + ExprName { + range: 37..40, + id: "int", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Name( + ExprName { + range: 47..50, + id: "int", + ctx: Load, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 52..55, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 52..55, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@function_def_parenthesized_return_types.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@function_def_parenthesized_return_types.py.snap new file mode 100644 index 0000000000..eb6c1f3cb1 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@function_def_parenthesized_return_types.py.snap @@ -0,0 +1,122 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/function_def_parenthesized_return_types.py +--- +## AST + +``` +Module( + ModModule { + range: 0..54, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..24, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..9, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Tuple( + ExprTuple { + range: 13..19, + elts: [ + Name( + ExprName { + range: 14..17, + id: "int", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 21..24, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 21..24, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 25..53, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 29..32, + }, + type_params: None, + parameters: Parameters { + range: 32..34, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Tuple( + ExprTuple { + range: 38..48, + elts: [ + Name( + ExprName { + range: 39..42, + id: "int", + ctx: Load, + }, + ), + Name( + ExprName { + range: 44..47, + id: "str", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 50..53, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 50..53, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@function_def_valid_return_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@function_def_valid_return_expr.py.snap new file mode 100644 index 0000000000..dce1c4cf13 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@function_def_valid_return_expr.py.snap @@ -0,0 +1,245 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/function_def_valid_return_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..125, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..27, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..9, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + BinOp( + ExprBinOp { + range: 13..22, + left: Name( + ExprName { + range: 13..16, + id: "int", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 19..22, + id: "str", + ctx: Load, + }, + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 24..27, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 24..27, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 28..57, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 32..35, + }, + type_params: None, + parameters: Parameters { + range: 35..37, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Lambda( + ExprLambda { + range: 41..52, + parameters: Some( + Parameters { + range: 48..49, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 48..49, + parameter: Parameter { + range: 48..49, + name: Identifier { + id: "x", + range: 48..49, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 51..52, + id: "x", + ctx: Load, + }, + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 54..57, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 54..57, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 58..85, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 62..65, + }, + type_params: None, + parameters: Parameters { + range: 65..67, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Yield( + ExprYield { + range: 72..79, + value: Some( + Name( + ExprName { + range: 78..79, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 82..85, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 82..85, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 86..124, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 90..93, + }, + type_params: None, + parameters: Parameters { + range: 93..95, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + If( + ExprIf { + range: 99..119, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 106..110, + value: true, + }, + ), + body: Name( + ExprName { + range: 99..102, + id: "int", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 116..119, + id: "str", + ctx: Load, + }, + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 121..124, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 121..124, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@global_stmt.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@global_stmt.py.snap new file mode 100644 index 0000000000..3231376754 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@global_stmt.py.snap @@ -0,0 +1,45 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/global_stmt.py +--- +## AST + +``` +Module( + ModModule { + range: 0..24, + body: [ + Global( + StmtGlobal { + range: 0..8, + names: [ + Identifier { + id: "x", + range: 7..8, + }, + ], + }, + ), + Global( + StmtGlobal { + range: 9..23, + names: [ + Identifier { + id: "x", + range: 16..17, + }, + Identifier { + id: "y", + range: 19..20, + }, + Identifier { + id: "z", + range: 22..23, + }, + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@import_stmt_terminator.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@import_stmt_terminator.py.snap new file mode 100644 index 0000000000..7cdade0b91 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@import_stmt_terminator.py.snap @@ -0,0 +1,112 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/import_stmt_terminator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..42, + body: [ + Import( + StmtImport { + range: 0..11, + names: [ + Alias { + range: 7..8, + name: Identifier { + id: "a", + range: 7..8, + }, + asname: None, + }, + Alias { + range: 10..11, + name: Identifier { + id: "b", + range: 10..11, + }, + asname: None, + }, + ], + }, + ), + Import( + StmtImport { + range: 13..24, + names: [ + Alias { + range: 20..21, + name: Identifier { + id: "c", + range: 20..21, + }, + asname: None, + }, + Alias { + range: 23..24, + name: Identifier { + id: "d", + range: 23..24, + }, + asname: None, + }, + ], + }, + ), + Import( + StmtImport { + range: 25..36, + names: [ + Alias { + range: 32..33, + name: Identifier { + id: "a", + range: 32..33, + }, + asname: None, + }, + Alias { + range: 35..36, + name: Identifier { + id: "b", + range: 35..36, + }, + asname: None, + }, + ], + }, + ), + Expr( + StmtExpr { + range: 37..41, + value: Tuple( + ExprTuple { + range: 37..41, + elts: [ + Name( + ExprName { + range: 37..38, + id: "c", + ctx: Load, + }, + ), + Name( + ExprName { + range: 40..41, + id: "d", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@lambda_with_no_parameters.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@lambda_with_no_parameters.py.snap new file mode 100644 index 0000000000..5b8eb039c3 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@lambda_with_no_parameters.py.snap @@ -0,0 +1,34 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/lambda_with_no_parameters.py +--- +## AST + +``` +Module( + ModModule { + range: 0..10, + body: [ + Expr( + StmtExpr { + range: 0..9, + value: Lambda( + ExprLambda { + range: 0..9, + parameters: None, + body: NumberLiteral( + ExprNumberLiteral { + range: 8..9, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@lambda_with_valid_body.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@lambda_with_valid_body.py.snap new file mode 100644 index 0000000000..d86b646422 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@lambda_with_valid_body.py.snap @@ -0,0 +1,348 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/lambda_with_valid_body.py +--- +## AST + +``` +Module( + ModModule { + range: 0..152, + body: [ + Expr( + StmtExpr { + range: 0..11, + value: Lambda( + ExprLambda { + range: 0..11, + parameters: Some( + Parameters { + range: 7..8, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 7..8, + parameter: Parameter { + range: 7..8, + name: Identifier { + id: "x", + range: 7..8, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 10..11, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 12..38, + value: Lambda( + ExprLambda { + range: 12..38, + parameters: Some( + Parameters { + range: 19..20, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 19..20, + parameter: Parameter { + range: 19..20, + name: Identifier { + id: "x", + range: 19..20, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: If( + ExprIf { + range: 22..38, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 27..31, + value: true, + }, + ), + body: Name( + ExprName { + range: 22..23, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 37..38, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 39..56, + value: Lambda( + ExprLambda { + range: 39..56, + parameters: Some( + Parameters { + range: 46..47, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 46..47, + parameter: Parameter { + range: 46..47, + name: Identifier { + id: "x", + range: 46..47, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Await( + ExprAwait { + range: 49..56, + value: Name( + ExprName { + range: 55..56, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 57..82, + value: Lambda( + ExprLambda { + range: 57..82, + parameters: Some( + Parameters { + range: 64..65, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 64..65, + parameter: Parameter { + range: 64..65, + name: Identifier { + id: "x", + range: 64..65, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Lambda( + ExprLambda { + range: 67..82, + parameters: Some( + Parameters { + range: 74..75, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 74..75, + parameter: Parameter { + range: 74..75, + name: Identifier { + id: "y", + range: 74..75, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: BinOp( + ExprBinOp { + range: 77..82, + left: Name( + ExprName { + range: 77..78, + id: "x", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 81..82, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 83..102, + value: Lambda( + ExprLambda { + range: 83..102, + parameters: Some( + Parameters { + range: 90..91, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 90..91, + parameter: Parameter { + range: 90..91, + name: Identifier { + id: "x", + range: 90..91, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Yield( + ExprYield { + range: 94..101, + value: Some( + Name( + ExprName { + range: 100..101, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 136..151, + value: Tuple( + ExprTuple { + range: 136..151, + elts: [ + Lambda( + ExprLambda { + range: 136..147, + parameters: Some( + Parameters { + range: 143..144, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 143..144, + parameter: Parameter { + range: 143..144, + name: Identifier { + id: "x", + range: 143..144, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 146..147, + id: "x", + ctx: Load, + }, + ), + }, + ), + Starred( + ExprStarred { + range: 149..151, + value: Name( + ExprName { + range: 150..151, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_as_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_as_pattern.py.snap new file mode 100644 index 0000000000..4fea0dcc18 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_as_pattern.py.snap @@ -0,0 +1,80 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/match_as_pattern.py +--- +## AST + +``` +Module( + ModModule { + range: 0..49, + body: [ + Match( + StmtMatch { + range: 0..48, + subject: Name( + ExprName { + range: 6..9, + id: "foo", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 15..32, + pattern: MatchAs( + PatternMatchAs { + range: 20..27, + pattern: None, + name: Some( + Identifier { + id: "foo_bar", + range: 20..27, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 29..32, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 29..32, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 37..48, + pattern: MatchAs( + PatternMatchAs { + range: 42..43, + pattern: None, + name: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 45..48, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 45..48, + }, + ), + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_parentheses_terminator.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_parentheses_terminator.py.snap new file mode 100644 index 0000000000..178abcfd53 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_parentheses_terminator.py.snap @@ -0,0 +1,123 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/match_sequence_pattern_parentheses_terminator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..57, + body: [ + Match( + StmtMatch { + range: 0..56, + subject: Name( + ExprName { + range: 6..13, + id: "subject", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 19..35, + pattern: MatchSequence( + PatternMatchSequence { + range: 24..30, + patterns: [ + MatchAs( + PatternMatchAs { + range: 25..26, + pattern: None, + name: Some( + Identifier { + id: "a", + range: 25..26, + }, + ), + }, + ), + MatchAs( + PatternMatchAs { + range: 28..29, + pattern: None, + name: Some( + Identifier { + id: "b", + range: 28..29, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 32..35, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 32..35, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 40..56, + pattern: MatchSequence( + PatternMatchSequence { + range: 45..51, + patterns: [ + MatchAs( + PatternMatchAs { + range: 46..47, + pattern: None, + name: Some( + Identifier { + id: "a", + range: 46..47, + }, + ), + }, + ), + MatchAs( + PatternMatchAs { + range: 49..50, + pattern: None, + name: Some( + Identifier { + id: "b", + range: 49..50, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 53..56, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 53..56, + }, + ), + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_terminator.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_terminator.py.snap new file mode 100644 index 0000000000..cf7c08be26 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_sequence_pattern_terminator.py.snap @@ -0,0 +1,195 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/match_sequence_pattern_terminator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..95, + body: [ + Match( + StmtMatch { + range: 0..94, + subject: Name( + ExprName { + range: 6..13, + id: "subject", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 19..30, + pattern: MatchAs( + PatternMatchAs { + range: 24..25, + pattern: None, + name: Some( + Identifier { + id: "a", + range: 24..25, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 27..30, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 27..30, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 35..51, + pattern: MatchAs( + PatternMatchAs { + range: 40..41, + pattern: None, + name: Some( + Identifier { + id: "a", + range: 40..41, + }, + ), + }, + ), + guard: Some( + Name( + ExprName { + range: 45..46, + id: "x", + ctx: Load, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 48..51, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 48..51, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 56..70, + pattern: MatchSequence( + PatternMatchSequence { + range: 61..65, + patterns: [ + MatchAs( + PatternMatchAs { + range: 61..62, + pattern: None, + name: Some( + Identifier { + id: "a", + range: 61..62, + }, + ), + }, + ), + MatchAs( + PatternMatchAs { + range: 64..65, + pattern: None, + name: Some( + Identifier { + id: "b", + range: 64..65, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 67..70, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 67..70, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 75..94, + pattern: MatchSequence( + PatternMatchSequence { + range: 80..84, + patterns: [ + MatchAs( + PatternMatchAs { + range: 80..81, + pattern: None, + name: Some( + Identifier { + id: "a", + range: 80..81, + }, + ), + }, + ), + MatchAs( + PatternMatchAs { + range: 83..84, + pattern: None, + name: Some( + Identifier { + id: "b", + range: 83..84, + }, + ), + }, + ), + ], + }, + ), + guard: Some( + Name( + ExprName { + range: 88..89, + id: "x", + ctx: Load, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 91..94, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 91..94, + }, + ), + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_subject_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_subject_expr.py.snap new file mode 100644 index 0000000000..8fa7c0e2b4 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_subject_expr.py.snap @@ -0,0 +1,229 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/match_stmt_subject_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..185, + body: [ + Match( + StmtMatch { + range: 0..29, + subject: Named( + ExprNamed { + range: 6..12, + target: Name( + ExprName { + range: 6..7, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 11..12, + value: Int( + 1, + ), + }, + ), + }, + ), + cases: [ + MatchCase { + range: 18..29, + pattern: MatchAs( + PatternMatchAs { + range: 23..24, + pattern: None, + name: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 26..29, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 26..29, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 30..61, + subject: Named( + ExprNamed { + range: 37..43, + target: Name( + ExprName { + range: 37..38, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 42..43, + value: Int( + 1, + ), + }, + ), + }, + ), + cases: [ + MatchCase { + range: 50..61, + pattern: MatchAs( + PatternMatchAs { + range: 55..56, + pattern: None, + name: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 58..61, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 58..61, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 121..153, + subject: Tuple( + ExprTuple { + range: 127..136, + elts: [ + Starred( + ExprStarred { + range: 127..133, + value: BinOp( + ExprBinOp { + range: 128..133, + left: Name( + ExprName { + range: 128..129, + id: "x", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 132..133, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 135..136, + id: "z", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + cases: [ + MatchCase { + range: 142..153, + pattern: MatchAs( + PatternMatchAs { + range: 147..148, + pattern: None, + name: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 150..153, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 150..153, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 154..184, + subject: Await( + ExprAwait { + range: 160..167, + value: Name( + ExprName { + range: 166..167, + id: "x", + ctx: Load, + }, + ), + }, + ), + cases: [ + MatchCase { + range: 173..184, + pattern: MatchAs( + PatternMatchAs { + range: 178..179, + pattern: None, + name: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 181..184, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 181..184, + }, + ), + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_valid_guard_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_valid_guard_expr.py.snap new file mode 100644 index 0000000000..0f30fcbe4d --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@match_stmt_valid_guard_expr.py.snap @@ -0,0 +1,281 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/match_stmt_valid_guard_expr.py +--- +## AST + +``` +Module( + ModModule { + range: 0..158, + body: [ + Match( + StmtMatch { + range: 0..34, + subject: Name( + ExprName { + range: 6..7, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 13..34, + pattern: MatchAs( + PatternMatchAs { + range: 18..19, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 18..19, + }, + ), + }, + ), + guard: Some( + Named( + ExprNamed { + range: 23..29, + target: Name( + ExprName { + range: 23..24, + id: "a", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 28..29, + value: Int( + 1, + ), + }, + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 31..34, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 31..34, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 35..79, + subject: Name( + ExprName { + range: 41..42, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 48..79, + pattern: MatchAs( + PatternMatchAs { + range: 53..54, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 53..54, + }, + ), + }, + ), + guard: Some( + If( + ExprIf { + range: 58..74, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 63..67, + value: true, + }, + ), + body: Name( + ExprName { + range: 58..59, + id: "a", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 73..74, + id: "b", + ctx: Load, + }, + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 76..79, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 76..79, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 80..119, + subject: Name( + ExprName { + range: 86..87, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 93..119, + pattern: MatchAs( + PatternMatchAs { + range: 98..99, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 98..99, + }, + ), + }, + ), + guard: Some( + Lambda( + ExprLambda { + range: 103..114, + parameters: Some( + Parameters { + range: 110..111, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 110..111, + parameter: Parameter { + range: 110..111, + name: Identifier { + id: "a", + range: 110..111, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 113..114, + id: "b", + ctx: Load, + }, + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 116..119, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 116..119, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 120..157, + subject: Name( + ExprName { + range: 126..127, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 133..157, + pattern: MatchAs( + PatternMatchAs { + range: 138..139, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 138..139, + }, + ), + }, + ), + guard: Some( + Yield( + ExprYield { + range: 144..151, + value: Some( + Name( + ExprName { + range: 150..151, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 154..157, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 154..157, + }, + ), + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@nonlocal_stmt.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@nonlocal_stmt.py.snap new file mode 100644 index 0000000000..279f806735 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@nonlocal_stmt.py.snap @@ -0,0 +1,45 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/nonlocal_stmt.py +--- +## AST + +``` +Module( + ModModule { + range: 0..28, + body: [ + Nonlocal( + StmtNonlocal { + range: 0..10, + names: [ + Identifier { + id: "x", + range: 9..10, + }, + ], + }, + ), + Nonlocal( + StmtNonlocal { + range: 11..27, + names: [ + Identifier { + id: "x", + range: 20..21, + }, + Identifier { + id: "y", + range: 23..24, + }, + Identifier { + id: "z", + range: 26..27, + }, + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@other__atom.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@other__atom.py.snap new file mode 100644 index 0000000000..292c50ca52 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@other__atom.py.snap @@ -0,0 +1,57 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/other/atom.py +--- +## AST + +``` +Module( + ModModule { + range: 0..73, + body: [ + Expr( + StmtExpr { + range: 0..3, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 0..3, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 4..8, + value: BooleanLiteral( + ExprBooleanLiteral { + range: 4..8, + value: true, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 9..14, + value: BooleanLiteral( + ExprBooleanLiteral { + range: 9..14, + value: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 15..19, + value: NoneLiteral( + ExprNoneLiteral { + range: 15..19, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@other__decorator.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@other__decorator.py.snap new file mode 100644 index 0000000000..84bf123453 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@other__decorator.py.snap @@ -0,0 +1,670 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/other/decorator.py +--- +## AST + +``` +Module( + ModModule { + range: 0..407, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..40, + is_async: false, + decorator_list: [ + Decorator { + range: 0..19, + expression: Name( + ExprName { + range: 1..19, + id: "function_decorator", + ctx: Load, + }, + ), + }, + ], + name: Identifier { + id: "test", + range: 24..28, + }, + type_params: None, + parameters: Parameters { + range: 28..30, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 36..40, + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 43..80, + decorator_list: [ + Decorator { + range: 43..59, + expression: Name( + ExprName { + range: 44..59, + id: "class_decorator", + ctx: Load, + }, + ), + }, + ], + name: Identifier { + id: "Test", + range: 66..70, + }, + type_params: None, + arguments: None, + body: [ + Pass( + StmtPass { + range: 76..80, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 83..106, + is_async: false, + decorator_list: [ + Decorator { + range: 83..93, + expression: Name( + ExprName { + range: 84..93, + id: "decorator", + ctx: Load, + }, + ), + }, + ], + name: Identifier { + id: "f", + range: 98..99, + }, + type_params: None, + parameters: Parameters { + range: 99..101, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 103..106, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 103..106, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 109..128, + is_async: false, + decorator_list: [ + Decorator { + range: 109..115, + expression: Attribute( + ExprAttribute { + range: 110..115, + value: Attribute( + ExprAttribute { + range: 110..113, + value: Name( + ExprName { + range: 110..111, + id: "a", + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 112..113, + }, + ctx: Load, + }, + ), + attr: Identifier { + id: "c", + range: 114..115, + }, + ctx: Load, + }, + ), + }, + ], + name: Identifier { + id: "f", + range: 120..121, + }, + type_params: None, + parameters: Parameters { + range: 121..123, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 125..128, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 125..128, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 131..153, + is_async: false, + decorator_list: [ + Decorator { + range: 131..133, + expression: Name( + ExprName { + range: 132..133, + id: "a", + ctx: Load, + }, + ), + }, + Decorator { + range: 134..140, + expression: Attribute( + ExprAttribute { + range: 135..140, + value: Attribute( + ExprAttribute { + range: 135..138, + value: Name( + ExprName { + range: 135..136, + id: "a", + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 137..138, + }, + ctx: Load, + }, + ), + attr: Identifier { + id: "c", + range: 139..140, + }, + ctx: Load, + }, + ), + }, + ], + name: Identifier { + id: "f", + range: 145..146, + }, + type_params: None, + parameters: Parameters { + range: 146..148, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 150..153, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 150..153, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 156..185, + decorator_list: [ + Decorator { + range: 156..158, + expression: Name( + ExprName { + range: 157..158, + id: "a", + ctx: Load, + }, + ), + }, + Decorator { + range: 159..165, + expression: BinOp( + ExprBinOp { + range: 160..165, + left: NumberLiteral( + ExprNumberLiteral { + range: 160..161, + value: Int( + 1, + ), + }, + ), + op: BitOr, + right: NumberLiteral( + ExprNumberLiteral { + range: 164..165, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + Decorator { + range: 166..172, + expression: Attribute( + ExprAttribute { + range: 167..172, + value: Attribute( + ExprAttribute { + range: 167..170, + value: Name( + ExprName { + range: 167..168, + id: "a", + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 169..170, + }, + ctx: Load, + }, + ), + attr: Identifier { + id: "c", + range: 171..172, + }, + ctx: Load, + }, + ), + }, + ], + name: Identifier { + id: "T", + range: 179..180, + }, + type_params: None, + arguments: None, + body: [ + Expr( + StmtExpr { + range: 182..185, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 182..185, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 188..269, + is_async: false, + decorator_list: [ + Decorator { + range: 188..195, + expression: Named( + ExprNamed { + range: 189..195, + target: Name( + ExprName { + range: 189..190, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 194..195, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + Decorator { + range: 196..213, + expression: If( + ExprIf { + range: 197..213, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 202..206, + value: true, + }, + ), + body: Name( + ExprName { + range: 197..198, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 212..213, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + Decorator { + range: 214..226, + expression: Lambda( + ExprLambda { + range: 215..226, + parameters: Some( + Parameters { + range: 222..223, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 222..223, + parameter: Parameter { + range: 222..223, + name: Identifier { + id: "x", + range: 222..223, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 225..226, + id: "x", + ctx: Load, + }, + ), + }, + ), + }, + Decorator { + range: 227..235, + expression: BoolOp( + ExprBoolOp { + range: 228..235, + op: And, + values: [ + Name( + ExprName { + range: 228..229, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 234..235, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + }, + Decorator { + range: 236..246, + expression: Yield( + ExprYield { + range: 238..245, + value: Some( + Name( + ExprName { + range: 244..245, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + }, + Decorator { + range: 247..256, + expression: Tuple( + ExprTuple { + range: 248..256, + elts: [ + Starred( + ExprStarred { + range: 249..251, + value: Name( + ExprName { + range: 250..251, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 253..255, + value: Name( + ExprName { + range: 254..255, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ], + name: Identifier { + id: "f", + range: 261..262, + }, + type_params: None, + parameters: Parameters { + range: 262..264, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 266..269, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 266..269, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 360..380, + is_async: false, + decorator_list: [ + Decorator { + range: 360..365, + expression: BinOp( + ExprBinOp { + range: 361..365, + left: Name( + ExprName { + range: 361..362, + id: "x", + ctx: Load, + }, + ), + op: MatMult, + right: Name( + ExprName { + range: 364..365, + id: "y", + ctx: Load, + }, + ), + }, + ), + }, + ], + name: Identifier { + id: "foo", + range: 370..373, + }, + type_params: None, + parameters: Parameters { + range: 373..375, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 377..380, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 377..380, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 383..407, + is_async: false, + decorator_list: [ + Decorator { + range: 383..385, + expression: Name( + ExprName { + range: 384..385, + id: "x", + ctx: Load, + }, + ), + }, + Decorator { + range: 388..390, + expression: Name( + ExprName { + range: 389..390, + id: "y", + ctx: Load, + }, + ), + }, + ], + name: Identifier { + id: "foo", + range: 397..400, + }, + type_params: None, + parameters: Parameters { + range: 400..402, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 404..407, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 404..407, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@param_with_annotation.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@param_with_annotation.py.snap new file mode 100644 index 0000000000..3790baafca --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@param_with_annotation.py.snap @@ -0,0 +1,278 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/param_with_annotation.py +--- +## AST + +``` +Module( + ModModule { + range: 0..113, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..22, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..17, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..16, + parameter: Parameter { + range: 8..16, + name: Identifier { + id: "arg", + range: 8..11, + }, + annotation: Some( + Name( + ExprName { + range: 13..16, + id: "int", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 19..22, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 19..22, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 23..53, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 27..30, + }, + type_params: None, + parameters: Parameters { + range: 30..48, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 31..47, + parameter: Parameter { + range: 31..47, + name: Identifier { + id: "arg", + range: 31..34, + }, + annotation: Some( + Lambda( + ExprLambda { + range: 36..47, + parameters: Some( + Parameters { + range: 43..44, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 43..44, + parameter: Parameter { + range: 43..44, + name: Identifier { + id: "x", + range: 43..44, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 46..47, + id: "x", + ctx: Load, + }, + ), + }, + ), + ), + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 50..53, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 50..53, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 54..82, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 58..61, + }, + type_params: None, + parameters: Parameters { + range: 61..77, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 62..76, + parameter: Parameter { + range: 62..76, + name: Identifier { + id: "arg", + range: 62..65, + }, + annotation: Some( + Yield( + ExprYield { + range: 68..75, + value: Some( + Name( + ExprName { + range: 74..75, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ), + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 79..82, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 79..82, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 83..112, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 87..90, + }, + type_params: None, + parameters: Parameters { + range: 90..107, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 91..106, + parameter: Parameter { + range: 91..106, + name: Identifier { + id: "arg", + range: 91..94, + }, + annotation: Some( + Named( + ExprNamed { + range: 97..105, + target: Name( + ExprName { + range: 97..98, + id: "x", + ctx: Store, + }, + ), + value: Name( + ExprName { + range: 102..105, + id: "int", + ctx: Load, + }, + ), + }, + ), + ), + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 109..112, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 109..112, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@param_with_default.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@param_with_default.py.snap new file mode 100644 index 0000000000..7064b7751d --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@param_with_default.py.snap @@ -0,0 +1,291 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/param_with_default.py +--- +## AST + +``` +Module( + ModModule { + range: 0..111, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..27, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..22, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..21, + parameter: Parameter { + range: 8..9, + name: Identifier { + id: "x", + range: 8..9, + }, + annotation: None, + }, + default: Some( + Lambda( + ExprLambda { + range: 10..21, + parameters: Some( + Parameters { + range: 17..18, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 17..18, + parameter: Parameter { + range: 17..18, + name: Identifier { + id: "y", + range: 17..18, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 20..21, + id: "y", + ctx: Load, + }, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 24..27, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 24..27, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 28..60, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 32..35, + }, + type_params: None, + parameters: Parameters { + range: 35..55, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 36..54, + parameter: Parameter { + range: 36..37, + name: Identifier { + id: "x", + range: 36..37, + }, + annotation: None, + }, + default: Some( + If( + ExprIf { + range: 38..54, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 43..47, + value: true, + }, + ), + body: NumberLiteral( + ExprNumberLiteral { + range: 38..39, + value: Int( + 1, + ), + }, + ), + orelse: NumberLiteral( + ExprNumberLiteral { + range: 53..54, + value: Int( + 2, + ), + }, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 57..60, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 57..60, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 61..84, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 65..68, + }, + type_params: None, + parameters: Parameters { + range: 68..79, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 69..78, + parameter: Parameter { + range: 69..70, + name: Identifier { + id: "x", + range: 69..70, + }, + annotation: None, + }, + default: Some( + Await( + ExprAwait { + range: 71..78, + value: Name( + ExprName { + range: 77..78, + id: "y", + ctx: Load, + }, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 81..84, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 81..84, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 85..110, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 89..92, + }, + type_params: None, + parameters: Parameters { + range: 92..105, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 93..104, + parameter: Parameter { + range: 93..94, + name: Identifier { + id: "x", + range: 93..94, + }, + annotation: None, + }, + default: Some( + Yield( + ExprYield { + range: 96..103, + value: Some( + Name( + ExprName { + range: 102..103, + id: "y", + ctx: Load, + }, + ), + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 107..110, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 107..110, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@param_with_star_annotation.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@param_with_star_annotation.py.snap new file mode 100644 index 0000000000..ca04a14fb0 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@param_with_star_annotation.py.snap @@ -0,0 +1,155 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/param_with_star_annotation.py +--- +## AST + +``` +Module( + ModModule { + range: 0..67, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..31, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..26, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 8..25, + name: Identifier { + id: "args", + range: 9..13, + }, + annotation: Some( + Starred( + ExprStarred { + range: 15..25, + value: BinOp( + ExprBinOp { + range: 16..25, + left: Name( + ExprName { + range: 16..19, + id: "int", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 22..25, + id: "str", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 28..31, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 28..31, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 32..66, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 36..39, + }, + type_params: None, + parameters: Parameters { + range: 39..61, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 40..60, + name: Identifier { + id: "args", + range: 41..45, + }, + annotation: Some( + Starred( + ExprStarred { + range: 47..60, + value: BoolOp( + ExprBoolOp { + range: 49..59, + op: Or, + values: [ + Name( + ExprName { + range: 49..52, + id: "int", + ctx: Load, + }, + ), + Name( + ExprName { + range: 56..59, + id: "str", + ctx: Load, + }, + ), + ], + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 63..66, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 63..66, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@params_non_default_after_star.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@params_non_default_after_star.py.snap new file mode 100644 index 0000000000..50612e8813 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@params_non_default_after_star.py.snap @@ -0,0 +1,226 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/params_non_default_after_star.py +--- +## AST + +``` +Module( + ModModule { + range: 0..72, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..33, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..28, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 8..12, + parameter: Parameter { + range: 8..9, + name: Identifier { + id: "a", + range: 8..9, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 10..12, + value: Int( + 10, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 17..18, + parameter: Parameter { + range: 17..18, + name: Identifier { + id: "b", + range: 17..18, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 20..24, + parameter: Parameter { + range: 20..21, + name: Identifier { + id: "c", + range: 20..21, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 22..24, + value: Int( + 11, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 26..27, + parameter: Parameter { + range: 26..27, + name: Identifier { + id: "d", + range: 26..27, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 30..33, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 30..33, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 34..71, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 38..41, + }, + type_params: None, + parameters: Parameters { + range: 41..66, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 42..46, + parameter: Parameter { + range: 42..43, + name: Identifier { + id: "a", + range: 42..43, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 44..46, + value: Int( + 10, + ), + }, + ), + ), + }, + ], + vararg: Some( + Parameter { + range: 48..53, + name: Identifier { + id: "args", + range: 49..53, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 55..56, + parameter: Parameter { + range: 55..56, + name: Identifier { + id: "b", + range: 55..56, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 58..62, + parameter: Parameter { + range: 58..59, + name: Identifier { + id: "c", + range: 58..59, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 60..62, + value: Int( + 11, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 64..65, + parameter: Parameter { + range: 64..65, + name: Identifier { + id: "d", + range: 64..65, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 68..71, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 68..71, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@params_seen_keyword_only_param_after_star.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@params_seen_keyword_only_param_after_star.py.snap new file mode 100644 index 0000000000..94fa821efa --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@params_seen_keyword_only_param_after_star.py.snap @@ -0,0 +1,134 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/params_seen_keyword_only_param_after_star.py +--- +## AST + +``` +Module( + ModModule { + range: 0..61, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..28, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 4..7, + }, + type_params: None, + parameters: Parameters { + range: 7..23, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 11..12, + parameter: Parameter { + range: 11..12, + name: Identifier { + id: "a", + range: 11..12, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: Some( + Parameter { + range: 14..22, + name: Identifier { + id: "kwargs", + range: 16..22, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 25..28, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 25..28, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 29..60, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 33..36, + }, + type_params: None, + parameters: Parameters { + range: 36..55, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 40..44, + parameter: Parameter { + range: 40..41, + name: Identifier { + id: "a", + range: 40..41, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 42..44, + value: Int( + 10, + ), + }, + ), + ), + }, + ], + kwarg: Some( + Parameter { + range: 46..54, + name: Identifier { + id: "kwargs", + range: 48..54, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 57..60, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 57..60, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@parenthesized_compare_expr_in_for.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@parenthesized_compare_expr_in_for.py.snap new file mode 100644 index 0000000000..d96d85bf19 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@parenthesized_compare_expr_in_for.py.snap @@ -0,0 +1,139 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/parenthesized_compare_expr_in_for.py +--- +## AST + +``` +Module( + ModModule { + range: 0..60, + body: [ + For( + StmtFor { + range: 0..28, + is_async: false, + target: Subscript( + ExprSubscript { + range: 4..15, + value: Compare( + ExprCompare { + range: 5..11, + left: Name( + ExprName { + range: 5..6, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 10..11, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + slice: NumberLiteral( + ExprNumberLiteral { + range: 13..14, + value: Int( + 0, + ), + }, + ), + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 19..23, + id: "iter", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 25..28, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 25..28, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 29..59, + is_async: false, + target: Attribute( + ExprAttribute { + range: 33..46, + value: Compare( + ExprCompare { + range: 34..40, + left: Name( + ExprName { + range: 34..35, + id: "x", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 39..40, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + attr: Identifier { + id: "attr", + range: 42..46, + }, + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 50..54, + id: "iter", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 56..59, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 56..59, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@simple_stmts_in_block.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@simple_stmts_in_block.py.snap new file mode 100644 index 0000000000..fcef98b46e --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@simple_stmts_in_block.py.snap @@ -0,0 +1,123 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/simple_stmts_in_block.py +--- +## AST + +``` +Module( + ModModule { + range: 0..84, + body: [ + If( + StmtIf { + range: 0..13, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 3..7, + value: true, + }, + ), + body: [ + Pass( + StmtPass { + range: 9..13, + }, + ), + ], + elif_else_clauses: [], + }, + ), + If( + StmtIf { + range: 14..27, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 17..21, + value: true, + }, + ), + body: [ + Pass( + StmtPass { + range: 23..27, + }, + ), + ], + elif_else_clauses: [], + }, + ), + If( + StmtIf { + range: 29..52, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 32..36, + value: true, + }, + ), + body: [ + Pass( + StmtPass { + range: 38..42, + }, + ), + Continue( + StmtContinue { + range: 44..52, + }, + ), + ], + elif_else_clauses: [], + }, + ), + If( + StmtIf { + range: 53..76, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 56..60, + value: true, + }, + ), + body: [ + Pass( + StmtPass { + range: 62..66, + }, + ), + Continue( + StmtContinue { + range: 68..76, + }, + ), + ], + elif_else_clauses: [], + }, + ), + Assign( + StmtAssign { + range: 78..83, + targets: [ + Name( + ExprName { + range: 78..79, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 82..83, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@simple_stmts_with_semicolons.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@simple_stmts_with_semicolons.py.snap new file mode 100644 index 0000000000..798e3e22fd --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@simple_stmts_with_semicolons.py.snap @@ -0,0 +1,92 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/inline/ok/simple_stmts_with_semicolons.py +--- +## AST + +``` +Module( + ModModule { + range: 0..51, + body: [ + Return( + StmtReturn { + range: 0..6, + value: None, + }, + ), + Import( + StmtImport { + range: 8..16, + names: [ + Alias { + range: 15..16, + name: Identifier { + id: "a", + range: 15..16, + }, + asname: None, + }, + ], + }, + ), + ImportFrom( + StmtImportFrom { + range: 18..33, + module: Some( + Identifier { + id: "x", + range: 23..24, + }, + ), + names: [ + Alias { + range: 32..33, + name: Identifier { + id: "y", + range: 32..33, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + Expr( + StmtExpr { + range: 35..36, + value: Name( + ExprName { + range: 35..36, + id: "z", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 38..50, + name: Name( + ExprName { + range: 43..44, + id: "T", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 47..50, + id: "int", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__ambiguous_lpar_with_items.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__ambiguous_lpar_with_items.py.snap new file mode 100644 index 0000000000..b17e20da0f --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__ambiguous_lpar_with_items.py.snap @@ -0,0 +1,4031 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/ambiguous_lpar_with_items.py +--- +## AST + +``` +Module( + ModModule { + range: 0..3620, + body: [ + With( + StmtWith { + range: 588..604, + is_async: false, + items: [ + WithItem { + range: 594..598, + context_expr: Name( + ExprName { + range: 594..598, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 601..604, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 601..604, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 605..622, + is_async: false, + items: [ + WithItem { + range: 611..615, + context_expr: Name( + ExprName { + range: 611..615, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 619..622, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 619..622, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 648..668, + is_async: false, + items: [ + WithItem { + range: 654..662, + context_expr: Name( + ExprName { + range: 656..660, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 665..668, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 665..668, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 669..693, + is_async: false, + items: [ + WithItem { + range: 675..680, + context_expr: Name( + ExprName { + range: 675..680, + id: "item1", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 682..687, + context_expr: Name( + ExprName { + range: 682..687, + id: "item2", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 690..693, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 690..693, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 694..719, + is_async: false, + items: [ + WithItem { + range: 700..705, + context_expr: Name( + ExprName { + range: 700..705, + id: "item1", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 707..712, + context_expr: Name( + ExprName { + range: 707..712, + id: "item2", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 716..719, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 716..719, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 745..794, + is_async: false, + items: [ + WithItem { + range: 751..758, + context_expr: Name( + ExprName { + range: 752..757, + id: "item1", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 760..767, + context_expr: Name( + ExprName { + range: 761..766, + id: "item2", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 769..779, + context_expr: Name( + ExprName { + range: 769..774, + id: "item3", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 778..779, + id: "f", + ctx: Store, + }, + ), + ), + }, + WithItem { + range: 781..788, + context_expr: Name( + ExprName { + range: 782..787, + id: "item4", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 791..794, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 791..794, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 795..828, + is_async: false, + items: [ + WithItem { + range: 801..815, + context_expr: Tuple( + ExprTuple { + range: 801..815, + elts: [ + Name( + ExprName { + range: 802..807, + id: "item1", + ctx: Load, + }, + ), + Name( + ExprName { + range: 809..814, + id: "item2", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + WithItem { + range: 817..822, + context_expr: Name( + ExprName { + range: 817..822, + id: "item3", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 825..828, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 825..828, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 829..852, + is_async: false, + items: [ + WithItem { + range: 835..846, + context_expr: Tuple( + ExprTuple { + range: 835..841, + elts: [ + Name( + ExprName { + range: 836..837, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 839..840, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 845..846, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 849..852, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 849..852, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 853..889, + is_async: false, + items: [ + WithItem { + range: 859..870, + context_expr: Name( + ExprName { + range: 859..864, + id: "item1", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 868..870, + id: "f1", + ctx: Store, + }, + ), + ), + }, + WithItem { + range: 872..883, + context_expr: Name( + ExprName { + range: 872..877, + id: "item2", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 881..883, + id: "f2", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 886..889, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 886..889, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 890..927, + is_async: false, + items: [ + WithItem { + range: 896..907, + context_expr: Name( + ExprName { + range: 896..901, + id: "item1", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 905..907, + id: "f1", + ctx: Store, + }, + ), + ), + }, + WithItem { + range: 909..920, + context_expr: Name( + ExprName { + range: 909..914, + id: "item2", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 918..920, + id: "f2", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 924..927, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 924..927, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 953..976, + is_async: false, + items: [ + WithItem { + range: 959..969, + context_expr: Compare( + ExprCompare { + range: 959..969, + left: Name( + ExprName { + range: 959..963, + id: "item", + ctx: Load, + }, + ), + ops: [ + Eq, + ], + comparators: [ + NumberLiteral( + ExprNumberLiteral { + range: 967..969, + value: Int( + 10, + ), + }, + ), + ], + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 973..976, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 973..976, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 977..1001, + is_async: false, + items: [ + WithItem { + range: 983..995, + context_expr: Named( + ExprNamed { + range: 984..994, + target: Name( + ExprName { + range: 984..988, + id: "item", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 992..994, + value: Int( + 10, + ), + }, + ), + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 998..1001, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 998..1001, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1002..1027, + is_async: false, + items: [ + WithItem { + range: 1008..1021, + context_expr: Tuple( + ExprTuple { + range: 1008..1021, + elts: [ + Named( + ExprNamed { + range: 1009..1019, + target: Name( + ExprName { + range: 1009..1013, + id: "item", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 1017..1019, + value: Int( + 10, + ), + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1024..1027, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1024..1027, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1028..1048, + is_async: false, + items: [ + WithItem { + range: 1034..1042, + context_expr: Tuple( + ExprTuple { + range: 1034..1042, + elts: [ + Starred( + ExprStarred { + range: 1035..1040, + value: Name( + ExprName { + range: 1036..1040, + id: "item", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1045..1048, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1045..1048, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1049..1081, + is_async: false, + items: [ + WithItem { + range: 1055..1068, + context_expr: Named( + ExprNamed { + range: 1056..1067, + target: Name( + ExprName { + range: 1056..1061, + id: "item1", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 1065..1067, + value: Int( + 10, + ), + }, + ), + }, + ), + optional_vars: None, + }, + WithItem { + range: 1070..1075, + context_expr: Name( + ExprName { + range: 1070..1075, + id: "item2", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1078..1081, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1078..1081, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1082..1119, + is_async: false, + items: [ + WithItem { + range: 1088..1098, + context_expr: Name( + ExprName { + range: 1088..1093, + id: "item1", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 1097..1098, + id: "f", + ctx: Store, + }, + ), + ), + }, + WithItem { + range: 1100..1113, + context_expr: Named( + ExprNamed { + range: 1101..1112, + target: Name( + ExprName { + range: 1101..1106, + id: "item2", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 1110..1112, + value: Int( + 10, + ), + }, + ), + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1116..1119, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1116..1119, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1120..1137, + is_async: false, + items: [ + WithItem { + range: 1126..1131, + context_expr: Call( + ExprCall { + range: 1126..1131, + func: Name( + ExprName { + range: 1126..1129, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1129..1131, + args: [], + keywords: [], + }, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1134..1137, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1134..1137, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1138..1156, + is_async: false, + items: [ + WithItem { + range: 1144..1149, + context_expr: Call( + ExprCall { + range: 1144..1149, + func: Name( + ExprName { + range: 1144..1147, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1147..1149, + args: [], + keywords: [], + }, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1153..1156, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1153..1156, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1157..1179, + is_async: false, + items: [ + WithItem { + range: 1163..1173, + context_expr: Call( + ExprCall { + range: 1163..1168, + func: Name( + ExprName { + range: 1163..1166, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1166..1168, + args: [], + keywords: [], + }, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 1172..1173, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 1176..1179, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1176..1179, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1180..1207, + is_async: false, + items: [ + WithItem { + range: 1186..1201, + context_expr: FString( + ExprFString { + range: 1186..1201, + value: FStringValue { + inner: Single( + FString( + FString { + range: 1186..1201, + elements: [ + Expression( + FStringExpressionElement { + range: 1188..1200, + expression: Name( + ExprName { + range: 1189..1193, + id: "item", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: Some( + FStringFormatSpec { + range: 1195..1199, + elements: [ + Literal( + FStringLiteralElement { + range: 1195..1199, + value: "= 42", + }, + ), + ], + }, + ), + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1204..1207, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1204..1207, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1208..1237, + is_async: false, + items: [ + WithItem { + range: 1214..1231, + context_expr: FString( + ExprFString { + range: 1214..1231, + value: FStringValue { + inner: Single( + FString( + FString { + range: 1214..1231, + elements: [ + Expression( + FStringExpressionElement { + range: 1216..1230, + expression: Named( + ExprNamed { + range: 1218..1228, + target: Name( + ExprName { + range: 1218..1222, + id: "item", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 1226..1228, + value: Int( + 42, + ), + }, + ), + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1234..1237, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1234..1237, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1238..1278, + is_async: false, + items: [ + WithItem { + range: 1244..1266, + context_expr: Generator( + ExprGenerator { + range: 1244..1266, + elt: Name( + ExprName { + range: 1245..1246, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 1247..1265, + target: Name( + ExprName { + range: 1251..1252, + id: "x", + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 1256..1265, + func: Name( + ExprName { + range: 1256..1261, + id: "range", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1261..1265, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 1262..1264, + value: Int( + 10, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + optional_vars: None, + }, + WithItem { + range: 1268..1272, + context_expr: Name( + ExprName { + range: 1268..1272, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1275..1278, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1275..1278, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1279..1319, + is_async: false, + items: [ + WithItem { + range: 1285..1289, + context_expr: Name( + ExprName { + range: 1285..1289, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 1291..1313, + context_expr: Generator( + ExprGenerator { + range: 1291..1313, + elt: Name( + ExprName { + range: 1292..1293, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 1294..1312, + target: Name( + ExprName { + range: 1298..1299, + id: "x", + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 1303..1312, + func: Name( + ExprName { + range: 1303..1308, + id: "range", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1308..1312, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 1309..1311, + value: Int( + 10, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1316..1319, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1316..1319, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1320..1366, + is_async: false, + items: [ + WithItem { + range: 1326..1330, + context_expr: Name( + ExprName { + range: 1326..1330, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 1332..1354, + context_expr: Generator( + ExprGenerator { + range: 1332..1354, + elt: Name( + ExprName { + range: 1333..1334, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 1335..1353, + target: Name( + ExprName { + range: 1339..1340, + id: "x", + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 1344..1353, + func: Name( + ExprName { + range: 1344..1349, + id: "range", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1349..1353, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 1350..1352, + value: Int( + 10, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + optional_vars: None, + }, + WithItem { + range: 1356..1360, + context_expr: Name( + ExprName { + range: 1356..1360, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1363..1366, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1363..1366, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1367..1388, + is_async: false, + items: [ + WithItem { + range: 1373..1382, + context_expr: Subscript( + ExprSubscript { + range: 1373..1382, + value: Name( + ExprName { + range: 1373..1377, + id: "data", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 1378..1381, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1378..1379, + value: Int( + 1, + ), + }, + ), + ), + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1380..1381, + value: Int( + 2, + ), + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1385..1388, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1385..1388, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1389..1415, + is_async: false, + items: [ + WithItem { + range: 1395..1409, + context_expr: Subscript( + ExprSubscript { + range: 1395..1404, + value: Name( + ExprName { + range: 1395..1399, + id: "data", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 1400..1403, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1400..1401, + value: Int( + 1, + ), + }, + ), + ), + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1402..1403, + value: Int( + 2, + ), + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 1408..1409, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 1412..1415, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1412..1415, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1416..1450, + is_async: false, + items: [ + WithItem { + range: 1422..1444, + context_expr: Generator( + ExprGenerator { + range: 1422..1439, + elt: Name( + ExprName { + range: 1423..1424, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 1425..1438, + target: Name( + ExprName { + range: 1429..1430, + id: "x", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 1434..1438, + id: "iter", + ctx: Load, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 1443..1444, + id: "y", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 1447..1450, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1447..1450, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1663..1684, + is_async: false, + items: [ + WithItem { + range: 1668..1679, + context_expr: Name( + ExprName { + range: 1669..1673, + id: "item", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 1678..1679, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 1681..1684, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1681..1684, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1685..1707, + is_async: false, + items: [ + WithItem { + range: 1690..1702, + context_expr: Named( + ExprNamed { + range: 1691..1701, + target: Name( + ExprName { + range: 1691..1695, + id: "item", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 1699..1701, + value: Int( + 10, + ), + }, + ), + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1704..1707, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1704..1707, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1708..1735, + is_async: false, + items: [ + WithItem { + range: 1713..1730, + context_expr: Named( + ExprNamed { + range: 1714..1724, + target: Name( + ExprName { + range: 1714..1718, + id: "item", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 1722..1724, + value: Int( + 10, + ), + }, + ), + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 1729..1730, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 1732..1735, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1732..1735, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1736..1762, + is_async: false, + items: [ + WithItem { + range: 1741..1757, + context_expr: Named( + ExprNamed { + range: 1744..1753, + target: Name( + ExprName { + range: 1744..1748, + id: "item", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 1752..1753, + value: Int( + 1, + ), + }, + ), + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1759..1762, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1759..1762, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1763..1793, + is_async: false, + items: [ + WithItem { + range: 1768..1781, + context_expr: Named( + ExprNamed { + range: 1769..1780, + target: Name( + ExprName { + range: 1769..1774, + id: "item1", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 1778..1780, + value: Int( + 42, + ), + }, + ), + }, + ), + optional_vars: None, + }, + WithItem { + range: 1783..1788, + context_expr: Name( + ExprName { + range: 1783..1788, + id: "item2", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1790..1793, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1790..1793, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1794..1828, + is_async: false, + items: [ + WithItem { + range: 1799..1823, + context_expr: Call( + ExprCall { + range: 1799..1823, + func: Attribute( + ExprAttribute { + range: 1799..1821, + value: BinOp( + ExprBinOp { + range: 1800..1815, + left: Name( + ExprName { + range: 1800..1804, + id: "root", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 1807..1815, + id: "filename", + ctx: Load, + }, + ), + }, + ), + attr: Identifier { + id: "read", + range: 1817..1821, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 1821..1823, + args: [], + keywords: [], + }, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1825..1828, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1825..1828, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1851..1890, + is_async: false, + items: [ + WithItem { + range: 1856..1885, + context_expr: Call( + ExprCall { + range: 1856..1880, + func: Attribute( + ExprAttribute { + range: 1856..1878, + value: BinOp( + ExprBinOp { + range: 1857..1872, + left: Name( + ExprName { + range: 1857..1861, + id: "root", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 1864..1872, + id: "filename", + ctx: Load, + }, + ), + }, + ), + attr: Identifier { + id: "read", + range: 1874..1878, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 1878..1880, + args: [], + keywords: [], + }, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 1884..1885, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 1887..1890, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1887..1890, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1913..1930, + is_async: false, + items: [ + WithItem { + range: 1918..1925, + context_expr: Call( + ExprCall { + range: 1918..1925, + func: Name( + ExprName { + range: 1919..1922, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1923..1925, + args: [], + keywords: [], + }, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 1927..1930, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1927..1930, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1953..1975, + is_async: false, + items: [ + WithItem { + range: 1958..1970, + context_expr: Call( + ExprCall { + range: 1958..1965, + func: Name( + ExprName { + range: 1959..1962, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1963..1965, + args: [], + keywords: [], + }, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 1969..1970, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 1972..1975, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1972..1975, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 1998..2020, + is_async: false, + items: [ + WithItem { + range: 2003..2015, + context_expr: Call( + ExprCall { + range: 2004..2009, + func: Name( + ExprName { + range: 2004..2007, + id: "foo", + ctx: Load, + }, + ), + arguments: Arguments { + range: 2007..2009, + args: [], + keywords: [], + }, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 2014..2015, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 2017..2020, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2017..2020, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2021..2047, + is_async: false, + items: [ + WithItem { + range: 2026..2042, + context_expr: Subscript( + ExprSubscript { + range: 2027..2036, + value: Name( + ExprName { + range: 2027..2031, + id: "data", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 2032..2035, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 2032..2033, + value: Int( + 1, + ), + }, + ), + ), + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 2034..2035, + value: Int( + 2, + ), + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 2041..2042, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 2044..2047, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2044..2047, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2048..2070, + is_async: false, + items: [ + WithItem { + range: 2053..2065, + context_expr: Subscript( + ExprSubscript { + range: 2053..2065, + value: Tuple( + ExprTuple { + range: 2053..2062, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 2054..2055, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 2057..2058, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 2060..2061, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + slice: NumberLiteral( + ExprNumberLiteral { + range: 2063..2064, + value: Int( + 0, + ), + }, + ), + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 2067..2070, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2067..2070, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2093..2120, + is_async: false, + items: [ + WithItem { + range: 2098..2115, + context_expr: Subscript( + ExprSubscript { + range: 2098..2110, + value: Tuple( + ExprTuple { + range: 2098..2107, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 2099..2100, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 2102..2103, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 2105..2106, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + slice: NumberLiteral( + ExprNumberLiteral { + range: 2108..2109, + value: Int( + 0, + ), + }, + ), + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 2114..2115, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 2117..2120, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2117..2120, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2143..2169, + is_async: false, + items: [ + WithItem { + range: 2148..2155, + context_expr: Name( + ExprName { + range: 2149..2154, + id: "item1", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 2157..2164, + context_expr: Name( + ExprName { + range: 2158..2163, + id: "item2", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 2166..2169, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2166..2169, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2170..2210, + is_async: false, + items: [ + WithItem { + range: 2175..2189, + context_expr: Call( + ExprCall { + range: 2176..2188, + func: Name( + ExprName { + range: 2176..2180, + id: "open", + ctx: Load, + }, + ), + arguments: Arguments { + range: 2180..2188, + args: [ + StringLiteral( + ExprStringLiteral { + range: 2181..2187, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 2181..2187, + value: "a.py", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + keywords: [], + }, + }, + ), + optional_vars: None, + }, + WithItem { + range: 2191..2205, + context_expr: Call( + ExprCall { + range: 2192..2204, + func: Name( + ExprName { + range: 2192..2196, + id: "open", + ctx: Load, + }, + ), + arguments: Arguments { + range: 2196..2204, + args: [ + StringLiteral( + ExprStringLiteral { + range: 2197..2203, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 2197..2203, + value: "b.py", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + keywords: [], + }, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 2207..2210, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2207..2210, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2211..2230, + is_async: false, + items: [ + WithItem { + range: 2216..2225, + context_expr: Yield( + ExprYield { + range: 2217..2224, + value: Some( + Name( + ExprName { + range: 2223..2224, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 2227..2230, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2227..2230, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2231..2252, + is_async: false, + items: [ + WithItem { + range: 2237..2246, + context_expr: Yield( + ExprYield { + range: 2238..2245, + value: Some( + Name( + ExprName { + range: 2244..2245, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 2249..2252, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2249..2252, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2253..2277, + is_async: false, + items: [ + WithItem { + range: 2258..2272, + context_expr: YieldFrom( + ExprYieldFrom { + range: 2259..2271, + value: Name( + ExprName { + range: 2270..2271, + id: "x", + ctx: Load, + }, + ), + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 2274..2277, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2274..2277, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2278..2304, + is_async: false, + items: [ + WithItem { + range: 2284..2298, + context_expr: YieldFrom( + ExprYieldFrom { + range: 2285..2297, + value: Name( + ExprName { + range: 2296..2297, + id: "x", + ctx: Load, + }, + ), + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 2301..2304, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2301..2304, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2305..2329, + is_async: false, + items: [ + WithItem { + range: 2310..2324, + context_expr: Yield( + ExprYield { + range: 2311..2318, + value: Some( + Name( + ExprName { + range: 2317..2318, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 2323..2324, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 2326..2329, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2326..2329, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2330..2355, + is_async: false, + items: [ + WithItem { + range: 2335..2350, + context_expr: Yield( + ExprYield { + range: 2336..2344, + value: Some( + Tuple( + ExprTuple { + range: 2342..2344, + elts: [ + Name( + ExprName { + range: 2342..2343, + id: "x", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 2349..2350, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 2352..2355, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2352..2355, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2741..2753, + is_async: false, + items: [ + WithItem { + range: 2746..2748, + context_expr: Tuple( + ExprTuple { + range: 2746..2748, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 2750..2753, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2750..2753, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2754..2771, + is_async: false, + items: [ + WithItem { + range: 2759..2766, + context_expr: Tuple( + ExprTuple { + range: 2759..2761, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 2765..2766, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 2768..2771, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2768..2771, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2772..2795, + is_async: false, + items: [ + WithItem { + range: 2777..2790, + context_expr: Tuple( + ExprTuple { + range: 2777..2790, + elts: [ + Named( + ExprNamed { + range: 2778..2788, + target: Name( + ExprName { + range: 2778..2782, + id: "item", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 2786..2788, + value: Int( + 42, + ), + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 2792..2795, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2792..2795, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2796..2820, + is_async: false, + items: [ + WithItem { + range: 2801..2815, + context_expr: Tuple( + ExprTuple { + range: 2801..2815, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 2802..2803, + value: Int( + 1, + ), + }, + ), + Named( + ExprNamed { + range: 2805..2814, + target: Name( + ExprName { + range: 2805..2809, + id: "item", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 2813..2814, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 2817..2820, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2817..2820, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2821..2851, + is_async: false, + items: [ + WithItem { + range: 2826..2846, + context_expr: Tuple( + ExprTuple { + range: 2826..2846, + elts: [ + Named( + ExprNamed { + range: 2827..2838, + target: Name( + ExprName { + range: 2827..2832, + id: "item1", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 2836..2838, + value: Int( + 10, + ), + }, + ), + }, + ), + Name( + ExprName { + range: 2840..2845, + id: "item2", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 2848..2851, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2848..2851, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2852..2893, + is_async: false, + items: [ + WithItem { + range: 2857..2888, + context_expr: Tuple( + ExprTuple { + range: 2857..2883, + elts: [ + Name( + ExprName { + range: 2858..2863, + id: "item1", + ctx: Load, + }, + ), + Named( + ExprNamed { + range: 2865..2875, + target: Name( + ExprName { + range: 2865..2870, + id: "item2", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 2874..2875, + value: Int( + 2, + ), + }, + ), + }, + ), + Name( + ExprName { + range: 2877..2882, + id: "item3", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 2887..2888, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 2890..2893, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2890..2893, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2894..2916, + is_async: false, + items: [ + WithItem { + range: 2899..2911, + context_expr: Tuple( + ExprTuple { + range: 2899..2906, + elts: [ + Name( + ExprName { + range: 2900..2904, + id: "item", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 2910..2911, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 2913..2916, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2913..2916, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2917..2935, + is_async: false, + items: [ + WithItem { + range: 2922..2930, + context_expr: Tuple( + ExprTuple { + range: 2922..2930, + elts: [ + Starred( + ExprStarred { + range: 2923..2928, + value: Name( + ExprName { + range: 2924..2928, + id: "item", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 2932..2935, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2932..2935, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2936..2959, + is_async: false, + items: [ + WithItem { + range: 2941..2954, + context_expr: Tuple( + ExprTuple { + range: 2941..2949, + elts: [ + Starred( + ExprStarred { + range: 2942..2947, + value: Name( + ExprName { + range: 2943..2947, + id: "item", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 2953..2954, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 2956..2959, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2956..2959, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2960..2989, + is_async: false, + items: [ + WithItem { + range: 2965..2984, + context_expr: Tuple( + ExprTuple { + range: 2965..2979, + elts: [ + Name( + ExprName { + range: 2966..2971, + id: "item1", + ctx: Load, + }, + ), + Name( + ExprName { + range: 2973..2978, + id: "item2", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 2983..2984, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 2986..2989, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2986..2989, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 2990..3020, + is_async: false, + items: [ + WithItem { + range: 2995..3015, + context_expr: Tuple( + ExprTuple { + range: 2995..3010, + elts: [ + Name( + ExprName { + range: 2996..3001, + id: "item1", + ctx: Load, + }, + ), + Name( + ExprName { + range: 3003..3008, + id: "item2", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 3014..3015, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 3017..3020, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3017..3020, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 3021..3052, + is_async: false, + items: [ + WithItem { + range: 3026..3040, + context_expr: Tuple( + ExprTuple { + range: 3026..3040, + elts: [ + Name( + ExprName { + range: 3027..3032, + id: "item1", + ctx: Load, + }, + ), + Name( + ExprName { + range: 3034..3039, + id: "item2", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + WithItem { + range: 3042..3047, + context_expr: Name( + ExprName { + range: 3042..3047, + id: "item3", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 3049..3052, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3049..3052, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 3053..3091, + is_async: false, + items: [ + WithItem { + range: 3058..3086, + context_expr: Tuple( + ExprTuple { + range: 3058..3081, + elts: [ + Tuple( + ExprTuple { + range: 3059..3073, + elts: [ + Name( + ExprName { + range: 3060..3065, + id: "item1", + ctx: Load, + }, + ), + Name( + ExprName { + range: 3067..3072, + id: "item2", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + Name( + ExprName { + range: 3075..3080, + id: "item3", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 3085..3086, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 3088..3091, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3088..3091, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 3092..3138, + is_async: false, + items: [ + WithItem { + range: 3097..3105, + context_expr: Tuple( + ExprTuple { + range: 3097..3105, + elts: [ + Name( + ExprName { + range: 3098..3103, + id: "item1", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + WithItem { + range: 3107..3112, + context_expr: Name( + ExprName { + range: 3107..3112, + id: "item2", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 3114..3133, + context_expr: Tuple( + ExprTuple { + range: 3114..3128, + elts: [ + Name( + ExprName { + range: 3115..3120, + id: "item3", + ctx: Load, + }, + ), + Name( + ExprName { + range: 3122..3127, + id: "item4", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 3132..3133, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 3135..3138, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3135..3138, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 3139..3182, + is_async: false, + items: [ + WithItem { + range: 3144..3164, + context_expr: Tuple( + ExprTuple { + range: 3144..3158, + elts: [ + Name( + ExprName { + range: 3145..3150, + id: "item1", + ctx: Load, + }, + ), + Name( + ExprName { + range: 3152..3157, + id: "item2", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 3162..3164, + id: "f1", + ctx: Store, + }, + ), + ), + }, + WithItem { + range: 3166..3177, + context_expr: Name( + ExprName { + range: 3166..3171, + id: "item3", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 3175..3177, + id: "f2", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 3179..3182, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3179..3182, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 3183..3208, + is_async: false, + items: [ + WithItem { + range: 3188..3203, + context_expr: Tuple( + ExprTuple { + range: 3188..3203, + elts: [ + Name( + ExprName { + range: 3189..3194, + id: "item1", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 3196..3202, + value: Name( + ExprName { + range: 3197..3202, + id: "item2", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 3205..3208, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3205..3208, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 3209..3239, + is_async: false, + items: [ + WithItem { + range: 3214..3234, + context_expr: Tuple( + ExprTuple { + range: 3214..3229, + elts: [ + Name( + ExprName { + range: 3215..3220, + id: "item1", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 3222..3228, + value: Name( + ExprName { + range: 3223..3228, + id: "item2", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 3233..3234, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 3236..3239, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3236..3239, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 3240..3271, + is_async: false, + items: [ + WithItem { + range: 3245..3266, + context_expr: Tuple( + ExprTuple { + range: 3245..3266, + elts: [ + Named( + ExprNamed { + range: 3246..3257, + target: Name( + ExprName { + range: 3246..3251, + id: "item1", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 3255..3257, + value: Int( + 10, + ), + }, + ), + }, + ), + Starred( + ExprStarred { + range: 3259..3265, + value: Name( + ExprName { + range: 3260..3265, + id: "item2", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 3268..3271, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3268..3271, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 3272..3305, + is_async: false, + items: [ + WithItem { + range: 3277..3300, + context_expr: Tuple( + ExprTuple { + range: 3277..3300, + elts: [ + Named( + ExprNamed { + range: 3279..3290, + target: Name( + ExprName { + range: 3279..3284, + id: "item1", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 3288..3290, + value: Int( + 10, + ), + }, + ), + }, + ), + Starred( + ExprStarred { + range: 3293..3299, + value: Name( + ExprName { + range: 3294..3299, + id: "item2", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 3302..3305, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3302..3305, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 3510..3542, + is_async: false, + items: [ + WithItem { + range: 3515..3537, + context_expr: Generator( + ExprGenerator { + range: 3515..3537, + elt: Name( + ExprName { + range: 3516..3517, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 3518..3536, + target: Name( + ExprName { + range: 3522..3523, + id: "x", + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 3527..3536, + func: Name( + ExprName { + range: 3527..3532, + id: "range", + ctx: Load, + }, + ), + arguments: Arguments { + range: 3532..3536, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 3533..3535, + value: Int( + 10, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 3539..3542, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3539..3542, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 3543..3581, + is_async: false, + items: [ + WithItem { + range: 3548..3576, + context_expr: Generator( + ExprGenerator { + range: 3548..3576, + elt: Name( + ExprName { + range: 3549..3550, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 3551..3575, + target: Name( + ExprName { + range: 3561..3562, + id: "x", + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 3566..3575, + func: Name( + ExprName { + range: 3566..3571, + id: "range", + ctx: Load, + }, + ), + arguments: Arguments { + range: 3571..3575, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 3572..3574, + value: Int( + 10, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ifs: [], + is_async: true, + }, + ], + parenthesized: true, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 3578..3581, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3578..3581, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 3582..3620, + is_async: false, + items: [ + WithItem { + range: 3587..3609, + context_expr: Generator( + ExprGenerator { + range: 3587..3609, + elt: Name( + ExprName { + range: 3588..3589, + id: "x", + ctx: Load, + }, + ), + generators: [ + Comprehension { + range: 3590..3608, + target: Name( + ExprName { + range: 3594..3595, + id: "x", + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 3599..3608, + func: Name( + ExprName { + range: 3599..3604, + id: "range", + ctx: Load, + }, + ), + arguments: Arguments { + range: 3604..3608, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 3605..3607, + value: Int( + 10, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ifs: [], + is_async: false, + }, + ], + parenthesized: true, + }, + ), + optional_vars: None, + }, + WithItem { + range: 3611..3615, + context_expr: Name( + ExprName { + range: 3611..3615, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 3617..3620, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3617..3620, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__annotated_assignment.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__annotated_assignment.py.snap new file mode 100644 index 0000000000..e8e067797d --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__annotated_assignment.py.snap @@ -0,0 +1,273 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/annotated_assignment.py +--- +## AST + +``` +Module( + ModModule { + range: 0..103, + body: [ + AnnAssign( + StmtAnnAssign { + range: 0..6, + target: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 3..6, + id: "int", + ctx: Load, + }, + ), + value: None, + simple: true, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 7..17, + target: Name( + ExprName { + range: 7..8, + id: "x", + ctx: Store, + }, + ), + annotation: Name( + ExprName { + range: 10..13, + id: "int", + ctx: Load, + }, + ), + value: Some( + NumberLiteral( + ExprNumberLiteral { + range: 16..17, + value: Int( + 1, + ), + }, + ), + ), + simple: true, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 18..28, + target: Name( + ExprName { + range: 19..20, + id: "x", + ctx: Store, + }, + ), + annotation: BinOp( + ExprBinOp { + range: 23..28, + left: NumberLiteral( + ExprNumberLiteral { + range: 23..24, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 27..28, + value: Int( + 2, + ), + }, + ), + }, + ), + value: None, + simple: false, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 29..55, + target: Name( + ExprName { + range: 29..30, + id: "x", + ctx: Store, + }, + ), + annotation: BinOp( + ExprBinOp { + range: 32..48, + left: Subscript( + ExprSubscript { + range: 32..42, + value: Name( + ExprName { + range: 32..37, + id: "tuple", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 38..41, + id: "int", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 45..48, + id: "int", + ctx: Load, + }, + ), + }, + ), + value: Some( + Tuple( + ExprTuple { + range: 51..55, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 52..53, + value: Int( + 1, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ), + simple: true, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 56..83, + target: Name( + ExprName { + range: 56..57, + id: "x", + ctx: Store, + }, + ), + annotation: If( + ExprIf { + range: 59..79, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 66..70, + value: true, + }, + ), + body: Name( + ExprName { + range: 59..62, + id: "int", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 76..79, + id: "str", + ctx: Load, + }, + ), + }, + ), + value: Some( + NumberLiteral( + ExprNumberLiteral { + range: 82..83, + value: Int( + 1, + ), + }, + ), + ), + simple: true, + }, + ), + AnnAssign( + StmtAnnAssign { + range: 84..102, + target: Name( + ExprName { + range: 84..85, + id: "x", + ctx: Store, + }, + ), + annotation: Lambda( + ExprLambda { + range: 87..98, + parameters: Some( + Parameters { + range: 94..95, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 94..95, + parameter: Parameter { + range: 94..95, + name: Identifier { + id: "x", + range: 94..95, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 97..98, + id: "y", + ctx: Load, + }, + ), + }, + ), + value: Some( + NumberLiteral( + ExprNumberLiteral { + range: 101..102, + value: Int( + 1, + ), + }, + ), + ), + simple: true, + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assert.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assert.py.snap new file mode 100644 index 0000000000..28fa1f9488 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assert.py.snap @@ -0,0 +1,334 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/assert.py +--- +## AST + +``` +Module( + ModModule { + range: 0..186, + body: [ + Assert( + StmtAssert { + range: 0..12, + test: Compare( + ExprCompare { + range: 7..12, + left: NumberLiteral( + ExprNumberLiteral { + range: 7..8, + value: Int( + 1, + ), + }, + ), + ops: [ + Lt, + ], + comparators: [ + NumberLiteral( + ExprNumberLiteral { + range: 11..12, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + msg: None, + }, + ), + Assert( + StmtAssert { + range: 13..26, + test: Call( + ExprCall { + range: 20..26, + func: Name( + ExprName { + range: 20..24, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 24..26, + args: [], + keywords: [], + }, + }, + ), + msg: None, + }, + ), + Assert( + StmtAssert { + range: 27..41, + test: BoolOp( + ExprBoolOp { + range: 34..41, + op: And, + values: [ + Name( + ExprName { + range: 34..35, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 40..41, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + msg: None, + }, + ), + Assert( + StmtAssert { + range: 42..60, + test: Lambda( + ExprLambda { + range: 49..60, + parameters: Some( + Parameters { + range: 56..57, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 56..57, + parameter: Parameter { + range: 56..57, + name: Identifier { + id: "x", + range: 56..57, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 59..60, + id: "y", + ctx: Load, + }, + ), + }, + ), + msg: None, + }, + ), + Assert( + StmtAssert { + range: 61..75, + test: Await( + ExprAwait { + range: 68..75, + value: Name( + ExprName { + range: 74..75, + id: "x", + ctx: Load, + }, + ), + }, + ), + msg: None, + }, + ), + Assert( + StmtAssert { + range: 76..99, + test: If( + ExprIf { + range: 83..99, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 88..92, + value: true, + }, + ), + body: Name( + ExprName { + range: 83..84, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 98..99, + id: "y", + ctx: Load, + }, + ), + }, + ), + msg: None, + }, + ), + Assert( + StmtAssert { + range: 101..118, + test: Name( + ExprName { + range: 108..109, + id: "x", + ctx: Load, + }, + ), + msg: Some( + StringLiteral( + ExprStringLiteral { + range: 111..118, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 111..118, + value: "error", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + }, + ), + Assert( + StmtAssert { + range: 119..140, + test: Name( + ExprName { + range: 126..127, + id: "x", + ctx: Load, + }, + ), + msg: Some( + Lambda( + ExprLambda { + range: 129..140, + parameters: Some( + Parameters { + range: 136..137, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 136..137, + parameter: Parameter { + range: 136..137, + name: Identifier { + id: "x", + range: 136..137, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 139..140, + id: "y", + ctx: Load, + }, + ), + }, + ), + ), + }, + ), + Assert( + StmtAssert { + range: 141..158, + test: Name( + ExprName { + range: 148..149, + id: "x", + ctx: Load, + }, + ), + msg: Some( + Await( + ExprAwait { + range: 151..158, + value: Name( + ExprName { + range: 157..158, + id: "x", + ctx: Load, + }, + ), + }, + ), + ), + }, + ), + Assert( + StmtAssert { + range: 159..185, + test: Name( + ExprName { + range: 166..167, + id: "x", + ctx: Load, + }, + ), + msg: Some( + If( + ExprIf { + range: 169..185, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 174..178, + value: true, + }, + ), + body: Name( + ExprName { + range: 169..170, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 184..185, + id: "y", + ctx: Load, + }, + ), + }, + ), + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assignment.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assignment.py.snap new file mode 100644 index 0000000000..fc6bd9d7b8 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assignment.py.snap @@ -0,0 +1,954 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/assignment.py +--- +## AST + +``` +Module( + ModModule { + range: 0..734, + body: [ + Assign( + StmtAssign { + range: 0..13, + targets: [ + Name( + ExprName { + range: 0..1, + id: "x", + ctx: Store, + }, + ), + ], + value: Tuple( + ExprTuple { + range: 4..13, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 5..6, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 8..9, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 11..12, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 15..33, + targets: [ + Tuple( + ExprTuple { + range: 15..21, + elts: [ + Name( + ExprName { + range: 16..17, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 19..20, + id: "y", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: true, + }, + ), + ], + value: Tuple( + ExprTuple { + range: 24..33, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 25..26, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 28..29, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 31..32, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 35..53, + targets: [ + List( + ExprList { + range: 35..41, + elts: [ + Name( + ExprName { + range: 36..37, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 39..40, + id: "y", + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + ], + value: Tuple( + ExprTuple { + range: 44..53, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 45..46, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 48..49, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 51..52, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 55..70, + targets: [ + Attribute( + ExprAttribute { + range: 55..58, + value: Name( + ExprName { + range: 55..56, + id: "x", + ctx: Load, + }, + ), + attr: Identifier { + id: "y", + range: 57..58, + }, + ctx: Store, + }, + ), + ], + value: Tuple( + ExprTuple { + range: 61..70, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 62..63, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 65..66, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 68..69, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 72..88, + targets: [ + Subscript( + ExprSubscript { + range: 72..76, + value: Name( + ExprName { + range: 72..73, + id: "x", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 74..75, + id: "y", + ctx: Load, + }, + ), + ctx: Store, + }, + ), + ], + value: Tuple( + ExprTuple { + range: 79..88, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 80..81, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 83..84, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 86..87, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 90..109, + targets: [ + Tuple( + ExprTuple { + range: 90..97, + elts: [ + Name( + ExprName { + range: 91..92, + id: "x", + ctx: Store, + }, + ), + Starred( + ExprStarred { + range: 94..96, + value: Name( + ExprName { + range: 95..96, + id: "y", + ctx: Store, + }, + ), + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: true, + }, + ), + ], + value: Tuple( + ExprTuple { + range: 100..109, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 101..102, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 104..105, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 107..108, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 259..268, + targets: [ + Starred( + ExprStarred { + range: 259..263, + value: Name( + ExprName { + range: 260..263, + id: "foo", + ctx: Store, + }, + ), + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 266..268, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 270..291, + targets: [ + List( + ExprList { + range: 270..279, + elts: [ + Name( + ExprName { + range: 271..272, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 274..275, + id: "y", + ctx: Store, + }, + ), + Name( + ExprName { + range: 277..278, + id: "z", + ctx: Store, + }, + ), + ], + ctx: Store, + }, + ), + ], + value: List( + ExprList { + range: 282..291, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 283..284, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 286..287, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 289..290, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 293..314, + targets: [ + Tuple( + ExprTuple { + range: 293..302, + elts: [ + Name( + ExprName { + range: 294..295, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 297..298, + id: "y", + ctx: Store, + }, + ), + Name( + ExprName { + range: 300..301, + id: "z", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: true, + }, + ), + ], + value: Tuple( + ExprTuple { + range: 305..314, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 306..307, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 309..310, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 312..313, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 315..324, + targets: [ + Subscript( + ExprSubscript { + range: 315..319, + value: Name( + ExprName { + range: 315..316, + id: "x", + ctx: Load, + }, + ), + slice: NumberLiteral( + ExprNumberLiteral { + range: 317..318, + value: Int( + 0, + ), + }, + ), + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 322..324, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 421..430, + targets: [ + Subscript( + ExprSubscript { + range: 421..425, + value: NumberLiteral( + ExprNumberLiteral { + range: 421..422, + value: Int( + 5, + ), + }, + ), + slice: NumberLiteral( + ExprNumberLiteral { + range: 423..424, + value: Int( + 0, + ), + }, + ), + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 428..430, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 431..444, + targets: [ + Subscript( + ExprSubscript { + range: 431..437, + value: Name( + ExprName { + range: 431..432, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 433..436, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 433..434, + value: Int( + 1, + ), + }, + ), + ), + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 435..436, + value: Int( + 2, + ), + }, + ), + ), + step: None, + }, + ), + ctx: Store, + }, + ), + ], + value: List( + ExprList { + range: 440..444, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 441..443, + value: Int( + 42, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 540..553, + targets: [ + Subscript( + ExprSubscript { + range: 540..546, + value: NumberLiteral( + ExprNumberLiteral { + range: 540..541, + value: Int( + 5, + ), + }, + ), + slice: Slice( + ExprSlice { + range: 542..545, + lower: Some( + NumberLiteral( + ExprNumberLiteral { + range: 542..543, + value: Int( + 1, + ), + }, + ), + ), + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 544..545, + value: Int( + 2, + ), + }, + ), + ), + step: None, + }, + ), + ctx: Store, + }, + ), + ], + value: List( + ExprList { + range: 549..553, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 550..552, + value: Int( + 42, + ), + }, + ), + ], + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 555..567, + targets: [ + Attribute( + ExprAttribute { + range: 555..562, + value: Name( + ExprName { + range: 555..558, + id: "foo", + ctx: Load, + }, + ), + attr: Identifier { + id: "bar", + range: 559..562, + }, + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 565..567, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 669..681, + targets: [ + Attribute( + ExprAttribute { + range: 669..676, + value: StringLiteral( + ExprStringLiteral { + range: 669..674, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 669..674, + value: "foo", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + attr: Identifier { + id: "y", + range: 675..676, + }, + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 679..681, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 683..691, + targets: [ + Name( + ExprName { + range: 683..686, + id: "foo", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 689..691, + value: Int( + 42, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 693..703, + targets: [ + List( + ExprList { + range: 693..695, + elts: [], + ctx: Store, + }, + ), + ], + value: Starred( + ExprStarred { + range: 698..703, + value: Name( + ExprName { + range: 699..703, + id: "data", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 704..714, + targets: [ + Tuple( + ExprTuple { + range: 704..706, + elts: [], + ctx: Store, + parenthesized: true, + }, + ), + ], + value: Starred( + ExprStarred { + range: 709..714, + value: Name( + ExprName { + range: 710..714, + id: "data", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 715..724, + targets: [ + Tuple( + ExprTuple { + range: 715..719, + elts: [ + Name( + ExprName { + range: 715..716, + id: "a", + ctx: Store, + }, + ), + Name( + ExprName { + range: 718..719, + id: "b", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: false, + }, + ), + ], + value: Name( + ExprName { + range: 722..724, + id: "ab", + ctx: Load, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 725..734, + targets: [ + Name( + ExprName { + range: 725..726, + id: "a", + ctx: Store, + }, + ), + Name( + ExprName { + range: 729..730, + id: "b", + ctx: Store, + }, + ), + ], + value: Name( + ExprName { + range: 733..734, + id: "c", + ctx: Load, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__augmented_assignment.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__augmented_assignment.py.snap new file mode 100644 index 0000000000..1e995986d3 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__augmented_assignment.py.snap @@ -0,0 +1,484 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/augmented_assignment.py +--- +## AST + +``` +Module( + ModModule { + range: 0..212, + body: [ + AugAssign( + StmtAugAssign { + range: 0..6, + target: Name( + ExprName { + range: 0..1, + id: "x", + ctx: Store, + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 5..6, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 7..23, + target: Attribute( + ExprAttribute { + range: 7..10, + value: Name( + ExprName { + range: 7..8, + id: "x", + ctx: Load, + }, + ), + attr: Identifier { + id: "y", + range: 9..10, + }, + ctx: Store, + }, + ), + op: Add, + value: Tuple( + ExprTuple { + range: 14..23, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 15..16, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 18..19, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 21..22, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 24..41, + target: Subscript( + ExprSubscript { + range: 24..28, + value: Name( + ExprName { + range: 24..25, + id: "x", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 26..27, + id: "y", + ctx: Load, + }, + ), + ctx: Store, + }, + ), + op: Add, + value: Tuple( + ExprTuple { + range: 32..41, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 33..34, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 36..37, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 39..40, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 86..92, + target: Name( + ExprName { + range: 86..87, + id: "x", + ctx: Store, + }, + ), + op: Add, + value: NumberLiteral( + ExprNumberLiteral { + range: 91..92, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 93..99, + target: Name( + ExprName { + range: 93..94, + id: "x", + ctx: Store, + }, + ), + op: Sub, + value: NumberLiteral( + ExprNumberLiteral { + range: 98..99, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 100..106, + target: Name( + ExprName { + range: 100..101, + id: "x", + ctx: Store, + }, + ), + op: Mult, + value: NumberLiteral( + ExprNumberLiteral { + range: 105..106, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 107..113, + target: Name( + ExprName { + range: 107..108, + id: "x", + ctx: Store, + }, + ), + op: Div, + value: NumberLiteral( + ExprNumberLiteral { + range: 112..113, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 114..121, + target: Name( + ExprName { + range: 114..115, + id: "x", + ctx: Store, + }, + ), + op: FloorDiv, + value: NumberLiteral( + ExprNumberLiteral { + range: 120..121, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 122..128, + target: Name( + ExprName { + range: 122..123, + id: "x", + ctx: Store, + }, + ), + op: Mod, + value: NumberLiteral( + ExprNumberLiteral { + range: 127..128, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 129..136, + target: Name( + ExprName { + range: 129..130, + id: "x", + ctx: Store, + }, + ), + op: Pow, + value: NumberLiteral( + ExprNumberLiteral { + range: 135..136, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 137..143, + target: Name( + ExprName { + range: 137..138, + id: "x", + ctx: Store, + }, + ), + op: BitAnd, + value: NumberLiteral( + ExprNumberLiteral { + range: 142..143, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 144..150, + target: Name( + ExprName { + range: 144..145, + id: "x", + ctx: Store, + }, + ), + op: BitOr, + value: NumberLiteral( + ExprNumberLiteral { + range: 149..150, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 151..157, + target: Name( + ExprName { + range: 151..152, + id: "x", + ctx: Store, + }, + ), + op: BitXor, + value: NumberLiteral( + ExprNumberLiteral { + range: 156..157, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 158..165, + target: Name( + ExprName { + range: 158..159, + id: "x", + ctx: Store, + }, + ), + op: LShift, + value: NumberLiteral( + ExprNumberLiteral { + range: 164..165, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 166..173, + target: Name( + ExprName { + range: 166..167, + id: "x", + ctx: Store, + }, + ), + op: RShift, + value: NumberLiteral( + ExprNumberLiteral { + range: 172..173, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 174..180, + target: Name( + ExprName { + range: 174..175, + id: "x", + ctx: Store, + }, + ), + op: MatMult, + value: NumberLiteral( + ExprNumberLiteral { + range: 179..180, + value: Int( + 1, + ), + }, + ), + }, + ), + AugAssign( + StmtAugAssign { + range: 190..212, + target: Name( + ExprName { + range: 190..191, + id: "a", + ctx: Store, + }, + ), + op: FloorDiv, + value: BinOp( + ExprBinOp { + range: 196..212, + left: BinOp( + ExprBinOp { + range: 197..202, + left: Name( + ExprName { + range: 197..198, + id: "a", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 201..202, + id: "b", + ctx: Load, + }, + ), + }, + ), + op: Sub, + right: BinOp( + ExprBinOp { + range: 206..212, + left: Name( + ExprName { + range: 206..207, + id: "c", + ctx: Load, + }, + ), + op: Pow, + right: NumberLiteral( + ExprNumberLiteral { + range: 211..212, + value: Int( + 2, + ), + }, + ), + }, + ), + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__class.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__class.py.snap new file mode 100644 index 0000000000..98ebc2cf77 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__class.py.snap @@ -0,0 +1,844 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/class.py +--- +## AST + +``` +Module( + ModModule { + range: 0..681, + body: [ + ClassDef( + StmtClassDef { + range: 0..19, + decorator_list: [], + name: Identifier { + id: "Test", + range: 6..10, + }, + type_params: None, + arguments: None, + body: [ + Expr( + StmtExpr { + range: 16..19, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 16..19, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 22..80, + decorator_list: [], + name: Identifier { + id: "Test", + range: 28..32, + }, + type_params: None, + arguments: Some( + Arguments { + range: 32..34, + args: [], + keywords: [], + }, + ), + body: [ + FunctionDef( + StmtFunctionDef { + range: 44..80, + is_async: false, + decorator_list: [], + name: Identifier { + id: "__init__", + range: 48..56, + }, + type_params: None, + parameters: Parameters { + range: 56..62, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 57..61, + parameter: Parameter { + range: 57..61, + name: Identifier { + id: "self", + range: 57..61, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 76..80, + }, + ), + ], + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 83..116, + decorator_list: [], + name: Identifier { + id: "Test", + range: 89..93, + }, + type_params: None, + arguments: Some( + Arguments { + range: 93..107, + args: [ + Starred( + ExprStarred { + range: 99..101, + value: Name( + ExprName { + range: 100..101, + id: "A", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + keywords: [ + Keyword { + range: 94..97, + arg: Some( + Identifier { + id: "a", + range: 94..95, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 96..97, + value: Int( + 1, + ), + }, + ), + }, + Keyword { + range: 103..106, + arg: None, + value: Name( + ExprName { + range: 105..106, + id: "k", + ctx: Load, + }, + ), + }, + ], + }, + ), + body: [ + Expr( + StmtExpr { + range: 113..116, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 113..116, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 119..168, + decorator_list: [], + name: Identifier { + id: "Test", + range: 125..129, + }, + type_params: None, + arguments: None, + body: [ + FunctionDef( + StmtFunctionDef { + range: 135..168, + is_async: false, + decorator_list: [], + name: Identifier { + id: "method", + range: 139..145, + }, + type_params: None, + parameters: Parameters { + range: 145..147, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Assign( + StmtAssign { + range: 157..168, + targets: [ + Tuple( + ExprTuple { + range: 157..161, + elts: [ + Name( + ExprName { + range: 157..158, + id: "a", + ctx: Store, + }, + ), + Name( + ExprName { + range: 160..161, + id: "b", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: false, + }, + ), + ], + value: Name( + ExprName { + range: 164..168, + id: "data", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 171..289, + decorator_list: [], + name: Identifier { + id: "Test", + range: 177..181, + }, + type_params: None, + arguments: Some( + Arguments { + range: 181..187, + args: [ + Name( + ExprName { + range: 182..183, + id: "A", + ctx: Load, + }, + ), + Name( + ExprName { + range: 185..186, + id: "B", + ctx: Load, + }, + ), + ], + keywords: [], + }, + ), + body: [ + FunctionDef( + StmtFunctionDef { + range: 193..225, + is_async: false, + decorator_list: [], + name: Identifier { + id: "__init__", + range: 197..205, + }, + type_params: None, + parameters: Parameters { + range: 205..211, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 206..210, + parameter: Parameter { + range: 206..210, + name: Identifier { + id: "self", + range: 206..210, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 221..225, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 231..289, + is_async: false, + decorator_list: [], + name: Identifier { + id: "method_with_default", + range: 235..254, + }, + type_params: None, + parameters: Parameters { + range: 254..275, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 255..259, + parameter: Parameter { + range: 255..259, + name: Identifier { + id: "self", + range: 255..259, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 261..274, + parameter: Parameter { + range: 261..264, + name: Identifier { + id: "arg", + range: 261..264, + }, + annotation: None, + }, + default: Some( + StringLiteral( + ExprStringLiteral { + range: 265..274, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 265..274, + value: "default", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 285..289, + }, + ), + ], + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 331..351, + decorator_list: [], + name: Identifier { + id: "Test", + range: 337..341, + }, + type_params: Some( + TypeParams { + range: 341..344, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 342..343, + name: Identifier { + id: "T", + range: 342..343, + }, + bound: None, + }, + ), + ], + }, + ), + arguments: Some( + Arguments { + range: 344..346, + args: [], + keywords: [], + }, + ), + body: [ + Expr( + StmtExpr { + range: 348..351, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 348..351, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 374..399, + decorator_list: [], + name: Identifier { + id: "Test", + range: 380..384, + }, + type_params: Some( + TypeParams { + range: 384..392, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 385..391, + name: Identifier { + id: "T", + range: 385..386, + }, + bound: Some( + Name( + ExprName { + range: 388..391, + id: "str", + ctx: Load, + }, + ), + ), + }, + ), + ], + }, + ), + arguments: Some( + Arguments { + range: 392..394, + args: [], + keywords: [], + }, + ), + body: [ + Expr( + StmtExpr { + range: 396..399, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 396..399, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 428..462, + decorator_list: [], + name: Identifier { + id: "Test", + range: 434..438, + }, + type_params: Some( + TypeParams { + range: 438..455, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 439..454, + name: Identifier { + id: "T", + range: 439..440, + }, + bound: Some( + Tuple( + ExprTuple { + range: 442..454, + elts: [ + Name( + ExprName { + range: 443..446, + id: "str", + ctx: Load, + }, + ), + Name( + ExprName { + range: 448..453, + id: "bytes", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ), + }, + ), + ], + }, + ), + arguments: Some( + Arguments { + range: 455..457, + args: [], + keywords: [], + }, + ), + body: [ + Expr( + StmtExpr { + range: 459..462, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 459..462, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 483..506, + decorator_list: [], + name: Identifier { + id: "Test", + range: 489..493, + }, + type_params: Some( + TypeParams { + range: 493..499, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 494..495, + name: Identifier { + id: "T", + range: 494..495, + }, + bound: None, + }, + ), + TypeVar( + TypeParamTypeVar { + range: 497..498, + name: Identifier { + id: "U", + range: 497..498, + }, + bound: None, + }, + ), + ], + }, + ), + arguments: Some( + Arguments { + range: 499..501, + args: [], + keywords: [], + }, + ), + body: [ + Expr( + StmtExpr { + range: 503..506, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 503..506, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 525..549, + decorator_list: [], + name: Identifier { + id: "Test", + range: 531..535, + }, + type_params: Some( + TypeParams { + range: 535..542, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 536..537, + name: Identifier { + id: "T", + range: 536..537, + }, + bound: None, + }, + ), + TypeVar( + TypeParamTypeVar { + range: 539..540, + name: Identifier { + id: "U", + range: 539..540, + }, + bound: None, + }, + ), + ], + }, + ), + arguments: Some( + Arguments { + range: 542..544, + args: [], + keywords: [], + }, + ), + body: [ + Expr( + StmtExpr { + range: 546..549, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 546..549, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 566..588, + decorator_list: [], + name: Identifier { + id: "Test", + range: 572..576, + }, + type_params: Some( + TypeParams { + range: 576..581, + type_params: [ + TypeVarTuple( + TypeParamTypeVarTuple { + range: 577..580, + name: Identifier { + id: "Ts", + range: 578..580, + }, + }, + ), + ], + }, + ), + arguments: Some( + Arguments { + range: 581..583, + args: [], + keywords: [], + }, + ), + body: [ + Expr( + StmtExpr { + range: 585..588, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 585..588, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 602..624, + decorator_list: [], + name: Identifier { + id: "Test", + range: 608..612, + }, + type_params: Some( + TypeParams { + range: 612..617, + type_params: [ + ParamSpec( + TypeParamParamSpec { + range: 613..616, + name: Identifier { + id: "P", + range: 615..616, + }, + }, + ), + ], + }, + ), + arguments: Some( + Arguments { + range: 617..619, + args: [], + keywords: [], + }, + ), + body: [ + Expr( + StmtExpr { + range: 621..624, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 621..624, + }, + ), + }, + ), + ], + }, + ), + ClassDef( + StmtClassDef { + range: 640..680, + decorator_list: [], + name: Identifier { + id: "Test", + range: 646..650, + }, + type_params: Some( + TypeParams { + range: 650..670, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 651..652, + name: Identifier { + id: "X", + range: 651..652, + }, + bound: None, + }, + ), + TypeVar( + TypeParamTypeVar { + range: 654..660, + name: Identifier { + id: "Y", + range: 654..655, + }, + bound: Some( + Name( + ExprName { + range: 657..660, + id: "str", + ctx: Load, + }, + ), + ), + }, + ), + TypeVarTuple( + TypeParamTypeVarTuple { + range: 662..664, + name: Identifier { + id: "U", + range: 663..664, + }, + }, + ), + ParamSpec( + TypeParamParamSpec { + range: 666..669, + name: Identifier { + id: "P", + range: 668..669, + }, + }, + ), + ], + }, + ), + arguments: Some( + Arguments { + range: 670..672, + args: [], + keywords: [], + }, + ), + body: [ + Pass( + StmtPass { + range: 676..680, + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__delete.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__delete.py.snap new file mode 100644 index 0000000000..68494f4681 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__delete.py.snap @@ -0,0 +1,299 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/delete.py +--- +## AST + +``` +Module( + ModModule { + range: 0..122, + body: [ + Delete( + StmtDelete { + range: 0..5, + targets: [ + Name( + ExprName { + range: 4..5, + id: "x", + ctx: Del, + }, + ), + ], + }, + ), + Delete( + StmtDelete { + range: 6..13, + targets: [ + Name( + ExprName { + range: 11..12, + id: "x", + ctx: Del, + }, + ), + ], + }, + ), + Delete( + StmtDelete { + range: 14..23, + targets: [ + Name( + ExprName { + range: 18..19, + id: "a", + ctx: Del, + }, + ), + Name( + ExprName { + range: 21..22, + id: "b", + ctx: Del, + }, + ), + ], + }, + ), + Delete( + StmtDelete { + range: 24..40, + targets: [ + Name( + ExprName { + range: 28..29, + id: "a", + ctx: Del, + }, + ), + Tuple( + ExprTuple { + range: 31..37, + elts: [ + Name( + ExprName { + range: 32..33, + id: "b", + ctx: Del, + }, + ), + Name( + ExprName { + range: 35..36, + id: "c", + ctx: Del, + }, + ), + ], + ctx: Del, + parenthesized: true, + }, + ), + Name( + ExprName { + range: 39..40, + id: "d", + ctx: Del, + }, + ), + ], + }, + ), + Delete( + StmtDelete { + range: 41..51, + targets: [ + List( + ExprList { + range: 45..51, + elts: [ + Name( + ExprName { + range: 46..47, + id: "a", + ctx: Del, + }, + ), + Name( + ExprName { + range: 49..50, + id: "b", + ctx: Del, + }, + ), + ], + ctx: Del, + }, + ), + ], + }, + ), + Delete( + StmtDelete { + range: 52..70, + targets: [ + List( + ExprList { + range: 56..70, + elts: [ + Name( + ExprName { + range: 57..58, + id: "a", + ctx: Del, + }, + ), + List( + ExprList { + range: 60..66, + elts: [ + Name( + ExprName { + range: 61..62, + id: "b", + ctx: Del, + }, + ), + Name( + ExprName { + range: 64..65, + id: "c", + ctx: Del, + }, + ), + ], + ctx: Del, + }, + ), + Name( + ExprName { + range: 68..69, + id: "d", + ctx: Del, + }, + ), + ], + ctx: Del, + }, + ), + ], + }, + ), + Delete( + StmtDelete { + range: 71..78, + targets: [ + Attribute( + ExprAttribute { + range: 75..78, + value: Name( + ExprName { + range: 75..76, + id: "x", + ctx: Load, + }, + ), + attr: Identifier { + id: "y", + range: 77..78, + }, + ctx: Del, + }, + ), + ], + }, + ), + Delete( + StmtDelete { + range: 79..87, + targets: [ + Subscript( + ExprSubscript { + range: 83..87, + value: Name( + ExprName { + range: 83..84, + id: "x", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 85..86, + id: "y", + ctx: Load, + }, + ), + ctx: Del, + }, + ), + ], + }, + ), + Delete( + StmtDelete { + range: 88..121, + targets: [ + Tuple( + ExprTuple { + range: 92..121, + elts: [ + Name( + ExprName { + range: 98..99, + id: "x", + ctx: Del, + }, + ), + Attribute( + ExprAttribute { + range: 105..108, + value: Name( + ExprName { + range: 105..106, + id: "x", + ctx: Load, + }, + ), + attr: Identifier { + id: "y", + range: 107..108, + }, + ctx: Del, + }, + ), + Subscript( + ExprSubscript { + range: 114..118, + value: Name( + ExprName { + range: 114..115, + id: "x", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 116..117, + id: "y", + ctx: Load, + }, + ), + ctx: Del, + }, + ), + ], + ctx: Del, + parenthesized: true, + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__for.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__for.py.snap new file mode 100644 index 0000000000..2eaca10f37 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__for.py.snap @@ -0,0 +1,833 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/for.py +--- +## AST + +``` +Module( + ModModule { + range: 0..660, + body: [ + For( + StmtFor { + range: 0..28, + is_async: false, + target: Name( + ExprName { + range: 4..10, + id: "target", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 14..18, + id: "iter", + ctx: Load, + }, + ), + body: [ + Pass( + StmtPass { + range: 24..28, + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 30..63, + is_async: false, + target: Name( + ExprName { + range: 34..40, + id: "target", + ctx: Store, + }, + ), + iter: Tuple( + ExprTuple { + range: 44..53, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 45..46, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 48..49, + value: Int( + 2, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 51..52, + value: Int( + 3, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + body: [ + Pass( + StmtPass { + range: 59..63, + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 65..100, + is_async: false, + target: Attribute( + ExprAttribute { + range: 69..80, + value: Name( + ExprName { + range: 69..75, + id: "target", + ctx: Load, + }, + ), + attr: Identifier { + id: "attr", + range: 76..80, + }, + ctx: Store, + }, + ), + iter: Call( + ExprCall { + range: 84..90, + func: Name( + ExprName { + range: 84..88, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 88..90, + args: [], + keywords: [], + }, + }, + ), + body: [ + Pass( + StmtPass { + range: 96..100, + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 102..135, + is_async: false, + target: Subscript( + ExprSubscript { + range: 106..115, + value: Name( + ExprName { + range: 106..112, + id: "target", + ctx: Load, + }, + ), + slice: NumberLiteral( + ExprNumberLiteral { + range: 113..114, + value: Int( + 0, + ), + }, + ), + ctx: Store, + }, + ), + iter: Attribute( + ExprAttribute { + range: 119..125, + value: Name( + ExprName { + range: 119..120, + id: "x", + ctx: Load, + }, + ), + attr: Identifier { + id: "attr", + range: 121..125, + }, + ctx: Load, + }, + ), + body: [ + Pass( + StmtPass { + range: 131..135, + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 137..167, + is_async: false, + target: Name( + ExprName { + range: 141..147, + id: "target", + ctx: Store, + }, + ), + iter: Compare( + ExprCompare { + range: 151..157, + left: Name( + ExprName { + range: 151..152, + id: "x", + ctx: Load, + }, + ), + ops: [ + LtE, + ], + comparators: [ + Name( + ExprName { + range: 156..157, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + body: [ + Pass( + StmtPass { + range: 163..167, + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 169..200, + is_async: false, + target: Name( + ExprName { + range: 173..179, + id: "target", + ctx: Store, + }, + ), + iter: BoolOp( + ExprBoolOp { + range: 183..190, + op: And, + values: [ + Name( + ExprName { + range: 183..184, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 189..190, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + body: [ + Pass( + StmtPass { + range: 196..200, + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 202..232, + is_async: false, + target: Tuple( + ExprTuple { + range: 206..214, + elts: [ + Name( + ExprName { + range: 206..207, + id: "a", + ctx: Store, + }, + ), + Name( + ExprName { + range: 209..210, + id: "b", + ctx: Store, + }, + ), + Name( + ExprName { + range: 212..213, + id: "c", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: false, + }, + ), + iter: Name( + ExprName { + range: 218..222, + id: "iter", + ctx: Load, + }, + ), + body: [ + Pass( + StmtPass { + range: 228..232, + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 234..262, + is_async: false, + target: Tuple( + ExprTuple { + range: 238..244, + elts: [ + Name( + ExprName { + range: 239..240, + id: "a", + ctx: Store, + }, + ), + Name( + ExprName { + range: 242..243, + id: "b", + ctx: Store, + }, + ), + ], + ctx: Store, + parenthesized: true, + }, + ), + iter: Name( + ExprName { + range: 248..252, + id: "iter", + ctx: Load, + }, + ), + body: [ + Pass( + StmtPass { + range: 258..262, + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 264..295, + is_async: false, + target: Name( + ExprName { + range: 268..274, + id: "target", + ctx: Store, + }, + ), + iter: Starred( + ExprStarred { + range: 278..285, + value: Attribute( + ExprAttribute { + range: 279..285, + value: Name( + ExprName { + range: 279..280, + id: "x", + ctx: Load, + }, + ), + attr: Identifier { + id: "attr", + range: 281..285, + }, + ctx: Load, + }, + ), + ctx: Load, + }, + ), + body: [ + Pass( + StmtPass { + range: 291..295, + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 297..327, + is_async: false, + target: Name( + ExprName { + range: 301..307, + id: "target", + ctx: Store, + }, + ), + iter: List( + ExprList { + range: 311..317, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 312..313, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 315..316, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + }, + ), + body: [ + Pass( + StmtPass { + range: 323..327, + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 329..377, + is_async: false, + target: Starred( + ExprStarred { + range: 333..340, + value: Name( + ExprName { + range: 334..340, + id: "target", + ctx: Store, + }, + ), + ctx: Store, + }, + ), + iter: Tuple( + ExprTuple { + range: 344..352, + elts: [ + Name( + ExprName { + range: 344..345, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 347..348, + id: "b", + ctx: Load, + }, + ), + Name( + ExprName { + range: 350..351, + id: "c", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + body: [ + Pass( + StmtPass { + range: 358..362, + }, + ), + ], + orelse: [ + Pass( + StmtPass { + range: 373..377, + }, + ), + ], + }, + ), + For( + StmtFor { + range: 379..404, + is_async: false, + target: Name( + ExprName { + range: 383..389, + id: "target", + ctx: Store, + }, + ), + iter: Starred( + ExprStarred { + range: 393..399, + value: BinOp( + ExprBinOp { + range: 394..399, + left: Name( + ExprName { + range: 394..395, + id: "x", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 398..399, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 401..404, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 401..404, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 405..432, + is_async: false, + target: Name( + ExprName { + range: 409..415, + id: "target", + ctx: Store, + }, + ), + iter: Starred( + ExprStarred { + range: 419..427, + value: Await( + ExprAwait { + range: 420..427, + value: Name( + ExprName { + range: 426..427, + id: "x", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 429..432, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 429..432, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 433..459, + is_async: false, + target: Name( + ExprName { + range: 437..443, + id: "target", + ctx: Store, + }, + ), + iter: Await( + ExprAwait { + range: 447..454, + value: Name( + ExprName { + range: 453..454, + id: "x", + ctx: Load, + }, + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 456..459, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 456..459, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 460..490, + is_async: false, + target: Name( + ExprName { + range: 464..470, + id: "target", + ctx: Store, + }, + ), + iter: Lambda( + ExprLambda { + range: 474..485, + parameters: Some( + Parameters { + range: 481..482, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 481..482, + parameter: Parameter { + range: 481..482, + name: Identifier { + id: "x", + range: 481..482, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 484..485, + id: "x", + ctx: Load, + }, + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 487..490, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 487..490, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + For( + StmtFor { + range: 491..526, + is_async: false, + target: Name( + ExprName { + range: 495..501, + id: "target", + ctx: Store, + }, + ), + iter: If( + ExprIf { + range: 505..521, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 510..514, + value: true, + }, + ), + body: Name( + ExprName { + range: 505..506, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 520..521, + id: "y", + ctx: Load, + }, + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 523..526, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 523..526, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + If( + StmtIf { + range: 528..659, + test: Name( + ExprName { + range: 531..532, + id: "x", + ctx: Load, + }, + ), + body: [ + For( + StmtFor { + range: 538..570, + is_async: false, + target: Name( + ExprName { + range: 542..548, + id: "target", + ctx: Store, + }, + ), + iter: Name( + ExprName { + range: 552..556, + id: "iter", + ctx: Load, + }, + ), + body: [ + Pass( + StmtPass { + range: 566..570, + }, + ), + ], + orelse: [], + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 645..659, + test: None, + body: [ + Pass( + StmtPass { + range: 655..659, + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__from_import.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__from_import.py.snap new file mode 100644 index 0000000000..b5994ad9cd --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__from_import.py.snap @@ -0,0 +1,255 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/from_import.py +--- +## AST + +``` +Module( + ModModule { + range: 0..259, + body: [ + ImportFrom( + StmtImportFrom { + range: 0..15, + module: Some( + Identifier { + id: "a", + range: 5..6, + }, + ), + names: [ + Alias { + range: 14..15, + name: Identifier { + id: "b", + range: 14..15, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 27..42, + module: None, + names: [ + Alias { + range: 41..42, + name: Identifier { + id: "a", + range: 41..42, + }, + asname: None, + }, + ], + level: Some( + 1, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 43..85, + module: Some( + Identifier { + id: "foo.bar", + range: 48..55, + }, + ), + names: [ + Alias { + range: 63..71, + name: Identifier { + id: "baz", + range: 63..66, + }, + asname: Some( + Identifier { + id: "b", + range: 70..71, + }, + ), + }, + Alias { + range: 73..85, + name: Identifier { + id: "FooBar", + range: 73..79, + }, + asname: Some( + Identifier { + id: "fb", + range: 83..85, + }, + ), + }, + ], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 86..102, + module: Some( + Identifier { + id: "a", + range: 92..93, + }, + ), + names: [ + Alias { + range: 101..102, + name: Identifier { + id: "b", + range: 101..102, + }, + asname: None, + }, + ], + level: Some( + 1, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 103..120, + module: None, + names: [ + Alias { + range: 119..120, + name: Identifier { + id: "c", + range: 119..120, + }, + asname: None, + }, + ], + level: Some( + 3, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 121..161, + module: None, + names: [ + Alias { + range: 160..161, + name: Identifier { + id: "d", + range: 160..161, + }, + asname: None, + }, + ], + level: Some( + 26, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 162..207, + module: Some( + Identifier { + id: "a.b.c", + range: 193..198, + }, + ), + names: [ + Alias { + range: 206..207, + name: Identifier { + id: "d", + range: 206..207, + }, + asname: None, + }, + ], + level: Some( + 26, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 208..242, + module: Some( + Identifier { + id: "module", + range: 213..219, + }, + ), + names: [ + Alias { + range: 228..229, + name: Identifier { + id: "a", + range: 228..229, + }, + asname: None, + }, + Alias { + range: 231..237, + name: Identifier { + id: "b", + range: 231..232, + }, + asname: Some( + Identifier { + id: "B", + range: 236..237, + }, + ), + }, + Alias { + range: 239..240, + name: Identifier { + id: "c", + range: 239..240, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + ImportFrom( + StmtImportFrom { + range: 243..258, + module: Some( + Identifier { + id: "a", + range: 248..249, + }, + ), + names: [ + Alias { + range: 257..258, + name: Identifier { + id: "*", + range: 257..258, + }, + asname: None, + }, + ], + level: Some( + 0, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__function.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__function.py.snap new file mode 100644 index 0000000000..3e436931fa --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__function.py.snap @@ -0,0 +1,3232 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/function.py +--- +## AST + +``` +Module( + ModModule { + range: 0..2399, + body: [ + FunctionDef( + StmtFunctionDef { + range: 0..29, + is_async: false, + decorator_list: [], + name: Identifier { + id: "no_parameters", + range: 4..17, + }, + type_params: None, + parameters: Parameters { + range: 17..19, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 25..29, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 32..76, + is_async: false, + decorator_list: [], + name: Identifier { + id: "positional_parameters", + range: 36..57, + }, + type_params: None, + parameters: Parameters { + range: 57..66, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 58..59, + parameter: Parameter { + range: 58..59, + name: Identifier { + id: "a", + range: 58..59, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 61..62, + parameter: Parameter { + range: 61..62, + name: Identifier { + id: "b", + range: 61..62, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 64..65, + parameter: Parameter { + range: 64..65, + name: Identifier { + id: "c", + range: 64..65, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 72..76, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 79..149, + is_async: false, + decorator_list: [], + name: Identifier { + id: "positional_parameters_with_default_values", + range: 83..124, + }, + type_params: None, + parameters: Parameters { + range: 124..139, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 125..126, + parameter: Parameter { + range: 125..126, + name: Identifier { + id: "a", + range: 125..126, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 128..132, + parameter: Parameter { + range: 128..129, + name: Identifier { + id: "b", + range: 128..129, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 130..132, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 134..138, + parameter: Parameter { + range: 134..135, + name: Identifier { + id: "c", + range: 134..135, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 136..138, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 145..149, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 152..226, + is_async: false, + decorator_list: [], + name: Identifier { + id: "positional_parameters_with_default_values2", + range: 156..198, + }, + type_params: None, + parameters: Parameters { + range: 198..216, + posonlyargs: [ + ParameterWithDefault { + range: 199..200, + parameter: Parameter { + range: 199..200, + name: Identifier { + id: "a", + range: 199..200, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 202..206, + parameter: Parameter { + range: 202..203, + name: Identifier { + id: "b", + range: 202..203, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 204..206, + value: Int( + 20, + ), + }, + ), + ), + }, + ], + args: [ + ParameterWithDefault { + range: 211..215, + parameter: Parameter { + range: 211..212, + name: Identifier { + id: "c", + range: 211..212, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 213..215, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 222..226, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 229..296, + is_async: false, + decorator_list: [], + name: Identifier { + id: "positional_only_and_positional_parameters", + range: 233..274, + }, + type_params: None, + parameters: Parameters { + range: 274..286, + posonlyargs: [ + ParameterWithDefault { + range: 275..276, + parameter: Parameter { + range: 275..276, + name: Identifier { + id: "a", + range: 275..276, + }, + annotation: None, + }, + default: None, + }, + ], + args: [ + ParameterWithDefault { + range: 281..282, + parameter: Parameter { + range: 281..282, + name: Identifier { + id: "b", + range: 281..282, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 284..285, + parameter: Parameter { + range: 284..285, + name: Identifier { + id: "c", + range: 284..285, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 292..296, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 299..393, + is_async: false, + decorator_list: [], + name: Identifier { + id: "pos_args_with_defaults_and_varargs_and_kwargs", + range: 303..348, + }, + type_params: None, + parameters: Parameters { + range: 348..383, + posonlyargs: [ + ParameterWithDefault { + range: 349..350, + parameter: Parameter { + range: 349..350, + name: Identifier { + id: "a", + range: 349..350, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 352..356, + parameter: Parameter { + range: 352..353, + name: Identifier { + id: "b", + range: 352..353, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 354..356, + value: Int( + 20, + ), + }, + ), + ), + }, + ], + args: [ + ParameterWithDefault { + range: 361..365, + parameter: Parameter { + range: 361..362, + name: Identifier { + id: "c", + range: 361..362, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 363..365, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + vararg: Some( + Parameter { + range: 367..372, + name: Identifier { + id: "args", + range: 368..372, + }, + annotation: None, + }, + ), + kwonlyargs: [], + kwarg: Some( + Parameter { + range: 374..382, + name: Identifier { + id: "kwargs", + range: 376..382, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 389..393, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 396..445, + is_async: false, + decorator_list: [], + name: Identifier { + id: "keyword_only_parameters", + range: 400..423, + }, + type_params: None, + parameters: Parameters { + range: 423..435, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 427..428, + parameter: Parameter { + range: 427..428, + name: Identifier { + id: "a", + range: 427..428, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 430..431, + parameter: Parameter { + range: 430..431, + name: Identifier { + id: "b", + range: 430..431, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 433..434, + parameter: Parameter { + range: 433..434, + name: Identifier { + id: "c", + range: 433..434, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 441..445, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 448..517, + is_async: false, + decorator_list: [], + name: Identifier { + id: "keyword_only_parameters_with_defaults", + range: 452..489, + }, + type_params: None, + parameters: Parameters { + range: 489..507, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 493..494, + parameter: Parameter { + range: 493..494, + name: Identifier { + id: "a", + range: 493..494, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 496..500, + parameter: Parameter { + range: 496..497, + name: Identifier { + id: "b", + range: 496..497, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 498..500, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 502..506, + parameter: Parameter { + range: 502..503, + name: Identifier { + id: "c", + range: 502..503, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 504..506, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 513..517, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 520..594, + is_async: false, + decorator_list: [], + name: Identifier { + id: "kw_only_args_with_defaults_and_varargs", + range: 524..562, + }, + type_params: None, + parameters: Parameters { + range: 562..584, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 563..568, + name: Identifier { + id: "args", + range: 564..568, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 570..571, + parameter: Parameter { + range: 570..571, + name: Identifier { + id: "a", + range: 570..571, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 573..577, + parameter: Parameter { + range: 573..574, + name: Identifier { + id: "b", + range: 573..574, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 575..577, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 579..583, + parameter: Parameter { + range: 579..580, + name: Identifier { + id: "c", + range: 579..580, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 581..583, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 590..594, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 597..676, + is_async: false, + decorator_list: [], + name: Identifier { + id: "kw_only_args_with_defaults_and_kwargs", + range: 601..638, + }, + type_params: None, + parameters: Parameters { + range: 638..666, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 642..643, + parameter: Parameter { + range: 642..643, + name: Identifier { + id: "a", + range: 642..643, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 645..649, + parameter: Parameter { + range: 645..646, + name: Identifier { + id: "b", + range: 645..646, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 647..649, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 651..655, + parameter: Parameter { + range: 651..652, + name: Identifier { + id: "c", + range: 651..652, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 653..655, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + kwarg: Some( + Parameter { + range: 657..665, + name: Identifier { + id: "kwargs", + range: 659..665, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 672..676, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 679..774, + is_async: false, + decorator_list: [], + name: Identifier { + id: "kw_only_args_with_defaults_and_varargs_and_kwargs", + range: 683..732, + }, + type_params: None, + parameters: Parameters { + range: 732..764, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 733..738, + name: Identifier { + id: "args", + range: 734..738, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 740..741, + parameter: Parameter { + range: 740..741, + name: Identifier { + id: "a", + range: 740..741, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 743..747, + parameter: Parameter { + range: 743..744, + name: Identifier { + id: "b", + range: 743..744, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 745..747, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 749..753, + parameter: Parameter { + range: 749..750, + name: Identifier { + id: "c", + range: 749..750, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 751..753, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + kwarg: Some( + Parameter { + range: 755..763, + name: Identifier { + id: "kwargs", + range: 757..763, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 770..774, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 777..835, + is_async: false, + decorator_list: [], + name: Identifier { + id: "pos_and_kw_only_args", + range: 781..801, + }, + type_params: None, + parameters: Parameters { + range: 801..825, + posonlyargs: [ + ParameterWithDefault { + range: 802..803, + parameter: Parameter { + range: 802..803, + name: Identifier { + id: "a", + range: 802..803, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 805..806, + parameter: Parameter { + range: 805..806, + name: Identifier { + id: "b", + range: 805..806, + }, + annotation: None, + }, + default: None, + }, + ], + args: [ + ParameterWithDefault { + range: 811..812, + parameter: Parameter { + range: 811..812, + name: Identifier { + id: "c", + range: 811..812, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 817..818, + parameter: Parameter { + range: 817..818, + name: Identifier { + id: "d", + range: 817..818, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 820..821, + parameter: Parameter { + range: 820..821, + name: Identifier { + id: "e", + range: 820..821, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 823..824, + parameter: Parameter { + range: 823..824, + name: Identifier { + id: "f", + range: 823..824, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 831..835, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 838..916, + is_async: false, + decorator_list: [], + name: Identifier { + id: "pos_and_kw_only_args_with_defaults", + range: 842..876, + }, + type_params: None, + parameters: Parameters { + range: 876..906, + posonlyargs: [ + ParameterWithDefault { + range: 877..878, + parameter: Parameter { + range: 877..878, + name: Identifier { + id: "a", + range: 877..878, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 880..881, + parameter: Parameter { + range: 880..881, + name: Identifier { + id: "b", + range: 880..881, + }, + annotation: None, + }, + default: None, + }, + ], + args: [ + ParameterWithDefault { + range: 886..887, + parameter: Parameter { + range: 886..887, + name: Identifier { + id: "c", + range: 886..887, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 892..893, + parameter: Parameter { + range: 892..893, + name: Identifier { + id: "d", + range: 892..893, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 895..899, + parameter: Parameter { + range: 895..896, + name: Identifier { + id: "e", + range: 895..896, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 897..899, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 901..905, + parameter: Parameter { + range: 901..902, + name: Identifier { + id: "f", + range: 901..902, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 903..905, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 912..916, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 919..1013, + is_async: false, + decorator_list: [], + name: Identifier { + id: "pos_and_kw_only_args_with_defaults_and_varargs", + range: 923..969, + }, + type_params: None, + parameters: Parameters { + range: 969..1003, + posonlyargs: [ + ParameterWithDefault { + range: 970..971, + parameter: Parameter { + range: 970..971, + name: Identifier { + id: "a", + range: 970..971, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 973..974, + parameter: Parameter { + range: 973..974, + name: Identifier { + id: "b", + range: 973..974, + }, + annotation: None, + }, + default: None, + }, + ], + args: [ + ParameterWithDefault { + range: 979..980, + parameter: Parameter { + range: 979..980, + name: Identifier { + id: "c", + range: 979..980, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: Some( + Parameter { + range: 982..987, + name: Identifier { + id: "args", + range: 983..987, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 989..990, + parameter: Parameter { + range: 989..990, + name: Identifier { + id: "d", + range: 989..990, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 992..996, + parameter: Parameter { + range: 992..993, + name: Identifier { + id: "e", + range: 992..993, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 994..996, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 998..1002, + parameter: Parameter { + range: 998..999, + name: Identifier { + id: "f", + range: 998..999, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1000..1002, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 1009..1013, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 1016..1121, + is_async: false, + decorator_list: [], + name: Identifier { + id: "pos_and_kw_only_args_with_defaults_and_kwargs", + range: 1020..1065, + }, + type_params: None, + parameters: Parameters { + range: 1065..1111, + posonlyargs: [ + ParameterWithDefault { + range: 1071..1072, + parameter: Parameter { + range: 1071..1072, + name: Identifier { + id: "a", + range: 1071..1072, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1074..1075, + parameter: Parameter { + range: 1074..1075, + name: Identifier { + id: "b", + range: 1074..1075, + }, + annotation: None, + }, + default: None, + }, + ], + args: [ + ParameterWithDefault { + range: 1080..1081, + parameter: Parameter { + range: 1080..1081, + name: Identifier { + id: "c", + range: 1080..1081, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 1086..1087, + parameter: Parameter { + range: 1086..1087, + name: Identifier { + id: "d", + range: 1086..1087, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1089..1093, + parameter: Parameter { + range: 1089..1090, + name: Identifier { + id: "e", + range: 1089..1090, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1091..1093, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 1095..1099, + parameter: Parameter { + range: 1095..1096, + name: Identifier { + id: "f", + range: 1095..1096, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1097..1099, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + kwarg: Some( + Parameter { + range: 1101..1109, + name: Identifier { + id: "kwargs", + range: 1103..1109, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 1117..1121, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 1124..1245, + is_async: false, + decorator_list: [], + name: Identifier { + id: "pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs", + range: 1128..1185, + }, + type_params: None, + parameters: Parameters { + range: 1185..1235, + posonlyargs: [ + ParameterWithDefault { + range: 1191..1192, + parameter: Parameter { + range: 1191..1192, + name: Identifier { + id: "a", + range: 1191..1192, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1194..1195, + parameter: Parameter { + range: 1194..1195, + name: Identifier { + id: "b", + range: 1194..1195, + }, + annotation: None, + }, + default: None, + }, + ], + args: [ + ParameterWithDefault { + range: 1200..1201, + parameter: Parameter { + range: 1200..1201, + name: Identifier { + id: "c", + range: 1200..1201, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: Some( + Parameter { + range: 1203..1208, + name: Identifier { + id: "args", + range: 1204..1208, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 1210..1211, + parameter: Parameter { + range: 1210..1211, + name: Identifier { + id: "d", + range: 1210..1211, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1213..1217, + parameter: Parameter { + range: 1213..1214, + name: Identifier { + id: "e", + range: 1213..1214, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1215..1217, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 1219..1223, + parameter: Parameter { + range: 1219..1220, + name: Identifier { + id: "f", + range: 1219..1220, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1221..1223, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + kwarg: Some( + Parameter { + range: 1225..1233, + name: Identifier { + id: "kwargs", + range: 1227..1233, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 1241..1245, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 1248..1316, + is_async: false, + decorator_list: [], + name: Identifier { + id: "positional_and_keyword_parameters", + range: 1252..1285, + }, + type_params: None, + parameters: Parameters { + range: 1285..1306, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 1286..1287, + parameter: Parameter { + range: 1286..1287, + name: Identifier { + id: "a", + range: 1286..1287, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1289..1290, + parameter: Parameter { + range: 1289..1290, + name: Identifier { + id: "b", + range: 1289..1290, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1292..1293, + parameter: Parameter { + range: 1292..1293, + name: Identifier { + id: "c", + range: 1292..1293, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 1298..1299, + parameter: Parameter { + range: 1298..1299, + name: Identifier { + id: "d", + range: 1298..1299, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1301..1302, + parameter: Parameter { + range: 1301..1302, + name: Identifier { + id: "e", + range: 1301..1302, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1304..1305, + parameter: Parameter { + range: 1304..1305, + name: Identifier { + id: "f", + range: 1304..1305, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 1312..1316, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 1319..1407, + is_async: false, + decorator_list: [], + name: Identifier { + id: "positional_and_keyword_parameters_with_defaults", + range: 1323..1370, + }, + type_params: None, + parameters: Parameters { + range: 1370..1397, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 1371..1372, + parameter: Parameter { + range: 1371..1372, + name: Identifier { + id: "a", + range: 1371..1372, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1374..1375, + parameter: Parameter { + range: 1374..1375, + name: Identifier { + id: "b", + range: 1374..1375, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1377..1378, + parameter: Parameter { + range: 1377..1378, + name: Identifier { + id: "c", + range: 1377..1378, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 1383..1384, + parameter: Parameter { + range: 1383..1384, + name: Identifier { + id: "d", + range: 1383..1384, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1386..1390, + parameter: Parameter { + range: 1386..1387, + name: Identifier { + id: "e", + range: 1386..1387, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1388..1390, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 1392..1396, + parameter: Parameter { + range: 1392..1393, + name: Identifier { + id: "f", + range: 1392..1393, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1394..1396, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 1403..1407, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 1410..1520, + is_async: false, + decorator_list: [], + name: Identifier { + id: "positional_and_keyword_parameters_with_defaults_and_varargs", + range: 1414..1473, + }, + type_params: None, + parameters: Parameters { + range: 1473..1510, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 1479..1480, + parameter: Parameter { + range: 1479..1480, + name: Identifier { + id: "a", + range: 1479..1480, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1482..1483, + parameter: Parameter { + range: 1482..1483, + name: Identifier { + id: "b", + range: 1482..1483, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1485..1486, + parameter: Parameter { + range: 1485..1486, + name: Identifier { + id: "c", + range: 1485..1486, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: Some( + Parameter { + range: 1488..1493, + name: Identifier { + id: "args", + range: 1489..1493, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 1495..1496, + parameter: Parameter { + range: 1495..1496, + name: Identifier { + id: "d", + range: 1495..1496, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1498..1502, + parameter: Parameter { + range: 1498..1499, + name: Identifier { + id: "e", + range: 1498..1499, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1500..1502, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 1504..1508, + parameter: Parameter { + range: 1504..1505, + name: Identifier { + id: "f", + range: 1504..1505, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1506..1508, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 1516..1520, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 1523..1654, + is_async: false, + decorator_list: [], + name: Identifier { + id: "positional_and_keyword_parameters_with_defaults_and_varargs_and_kwargs", + range: 1527..1597, + }, + type_params: None, + parameters: Parameters { + range: 1597..1644, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 1603..1604, + parameter: Parameter { + range: 1603..1604, + name: Identifier { + id: "a", + range: 1603..1604, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1606..1607, + parameter: Parameter { + range: 1606..1607, + name: Identifier { + id: "b", + range: 1606..1607, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1609..1610, + parameter: Parameter { + range: 1609..1610, + name: Identifier { + id: "c", + range: 1609..1610, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: Some( + Parameter { + range: 1612..1617, + name: Identifier { + id: "args", + range: 1613..1617, + }, + annotation: None, + }, + ), + kwonlyargs: [ + ParameterWithDefault { + range: 1619..1620, + parameter: Parameter { + range: 1619..1620, + name: Identifier { + id: "d", + range: 1619..1620, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 1622..1626, + parameter: Parameter { + range: 1622..1623, + name: Identifier { + id: "e", + range: 1622..1623, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1624..1626, + value: Int( + 20, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 1628..1632, + parameter: Parameter { + range: 1628..1629, + name: Identifier { + id: "f", + range: 1628..1629, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1630..1632, + value: Int( + 30, + ), + }, + ), + ), + }, + ], + kwarg: Some( + Parameter { + range: 1634..1642, + name: Identifier { + id: "kwargs", + range: 1636..1642, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 1650..1654, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 1703..1735, + is_async: false, + decorator_list: [], + name: Identifier { + id: "func", + range: 1707..1711, + }, + type_params: Some( + TypeParams { + range: 1711..1714, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 1712..1713, + name: Identifier { + id: "T", + range: 1712..1713, + }, + bound: None, + }, + ), + ], + }, + ), + parameters: Parameters { + range: 1714..1720, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 1715..1719, + parameter: Parameter { + range: 1715..1719, + name: Identifier { + id: "a", + range: 1715..1716, + }, + annotation: Some( + Name( + ExprName { + range: 1718..1719, + id: "T", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Name( + ExprName { + range: 1724..1725, + id: "T", + ctx: Load, + }, + ), + ), + body: [ + Pass( + StmtPass { + range: 1731..1735, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 1738..1775, + is_async: false, + decorator_list: [], + name: Identifier { + id: "func", + range: 1742..1746, + }, + type_params: Some( + TypeParams { + range: 1746..1754, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 1747..1753, + name: Identifier { + id: "T", + range: 1747..1748, + }, + bound: Some( + Name( + ExprName { + range: 1750..1753, + id: "str", + ctx: Load, + }, + ), + ), + }, + ), + ], + }, + ), + parameters: Parameters { + range: 1754..1760, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 1755..1759, + parameter: Parameter { + range: 1755..1759, + name: Identifier { + id: "a", + range: 1755..1756, + }, + annotation: Some( + Name( + ExprName { + range: 1758..1759, + id: "T", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Name( + ExprName { + range: 1764..1765, + id: "T", + ctx: Load, + }, + ), + ), + body: [ + Pass( + StmtPass { + range: 1771..1775, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 1778..1824, + is_async: false, + decorator_list: [], + name: Identifier { + id: "func", + range: 1782..1786, + }, + type_params: Some( + TypeParams { + range: 1786..1803, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 1787..1802, + name: Identifier { + id: "T", + range: 1787..1788, + }, + bound: Some( + Tuple( + ExprTuple { + range: 1790..1802, + elts: [ + Name( + ExprName { + range: 1791..1794, + id: "str", + ctx: Load, + }, + ), + Name( + ExprName { + range: 1796..1801, + id: "bytes", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ), + }, + ), + ], + }, + ), + parameters: Parameters { + range: 1803..1809, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 1804..1808, + parameter: Parameter { + range: 1804..1808, + name: Identifier { + id: "a", + range: 1804..1805, + }, + annotation: Some( + Name( + ExprName { + range: 1807..1808, + id: "T", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Name( + ExprName { + range: 1813..1814, + id: "T", + ctx: Load, + }, + ), + ), + body: [ + Pass( + StmtPass { + range: 1820..1824, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 1827..1873, + is_async: false, + decorator_list: [], + name: Identifier { + id: "func", + range: 1831..1835, + }, + type_params: Some( + TypeParams { + range: 1835..1840, + type_params: [ + TypeVarTuple( + TypeParamTypeVarTuple { + range: 1836..1839, + name: Identifier { + id: "Ts", + range: 1837..1839, + }, + }, + ), + ], + }, + ), + parameters: Parameters { + range: 1840..1849, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 1841..1848, + name: Identifier { + id: "a", + range: 1842..1843, + }, + annotation: Some( + Starred( + ExprStarred { + range: 1845..1848, + value: Name( + ExprName { + range: 1846..1848, + id: "Ts", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Subscript( + ExprSubscript { + range: 1853..1863, + value: Name( + ExprName { + range: 1853..1858, + id: "Tuple", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 1859..1862, + elts: [ + Starred( + ExprStarred { + range: 1859..1862, + value: Name( + ExprName { + range: 1860..1862, + id: "Ts", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + ), + body: [ + Pass( + StmtPass { + range: 1869..1873, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 1876..1934, + is_async: false, + decorator_list: [], + name: Identifier { + id: "func", + range: 1880..1884, + }, + type_params: Some( + TypeParams { + range: 1884..1889, + type_params: [ + ParamSpec( + TypeParamParamSpec { + range: 1885..1888, + name: Identifier { + id: "P", + range: 1887..1888, + }, + }, + ), + ], + }, + ), + parameters: Parameters { + range: 1889..1924, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 1890..1903, + name: Identifier { + id: "args", + range: 1891..1895, + }, + annotation: Some( + Attribute( + ExprAttribute { + range: 1897..1903, + value: Name( + ExprName { + range: 1897..1898, + id: "P", + ctx: Load, + }, + ), + attr: Identifier { + id: "args", + range: 1899..1903, + }, + ctx: Load, + }, + ), + ), + }, + ), + kwonlyargs: [], + kwarg: Some( + Parameter { + range: 1905..1923, + name: Identifier { + id: "kwargs", + range: 1907..1913, + }, + annotation: Some( + Attribute( + ExprAttribute { + range: 1915..1923, + value: Name( + ExprName { + range: 1915..1916, + id: "P", + ctx: Load, + }, + ), + attr: Identifier { + id: "kwargs", + range: 1917..1923, + }, + ctx: Load, + }, + ), + ), + }, + ), + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 1930..1934, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 1937..1978, + is_async: false, + decorator_list: [], + name: Identifier { + id: "func", + range: 1941..1945, + }, + type_params: Some( + TypeParams { + range: 1945..1966, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 1946..1947, + name: Identifier { + id: "T", + range: 1946..1947, + }, + bound: None, + }, + ), + TypeVar( + TypeParamTypeVar { + range: 1949..1955, + name: Identifier { + id: "U", + range: 1949..1950, + }, + bound: Some( + Name( + ExprName { + range: 1952..1955, + id: "str", + ctx: Load, + }, + ), + ), + }, + ), + TypeVarTuple( + TypeParamTypeVarTuple { + range: 1957..1960, + name: Identifier { + id: "Ts", + range: 1958..1960, + }, + }, + ), + ParamSpec( + TypeParamParamSpec { + range: 1962..1965, + name: Identifier { + id: "P", + range: 1964..1965, + }, + }, + ), + ], + }, + ), + parameters: Parameters { + range: 1966..1968, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 1974..1978, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 1981..2000, + is_async: false, + decorator_list: [], + name: Identifier { + id: "ellipsis", + range: 1985..1993, + }, + type_params: None, + parameters: Parameters { + range: 1993..1995, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Expr( + StmtExpr { + range: 1997..2000, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 1997..2000, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 2003..2064, + is_async: false, + decorator_list: [], + name: Identifier { + id: "multiple_statements", + range: 2007..2026, + }, + type_params: None, + parameters: Parameters { + range: 2026..2028, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: Some( + Name( + ExprName { + range: 2032..2035, + id: "int", + ctx: Load, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 2041..2047, + value: Call( + ExprCall { + range: 2041..2047, + func: Name( + ExprName { + range: 2041..2045, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 2045..2047, + args: [], + keywords: [], + }, + }, + ), + }, + ), + Pass( + StmtPass { + range: 2052..2056, + }, + ), + Expr( + StmtExpr { + range: 2061..2064, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 2061..2064, + }, + ), + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 2067..2091, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 2071..2074, + }, + type_params: None, + parameters: Parameters { + range: 2074..2081, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 2075..2080, + name: Identifier { + id: "args", + range: 2076..2080, + }, + annotation: None, + }, + ), + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 2087..2091, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 2094..2121, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 2098..2101, + }, + type_params: None, + parameters: Parameters { + range: 2101..2111, + posonlyargs: [], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: Some( + Parameter { + range: 2102..2110, + name: Identifier { + id: "kwargs", + range: 2104..2110, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 2117..2121, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 2124..2158, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 2128..2131, + }, + type_params: None, + parameters: Parameters { + range: 2131..2148, + posonlyargs: [], + args: [], + vararg: Some( + Parameter { + range: 2132..2137, + name: Identifier { + id: "args", + range: 2133..2137, + }, + annotation: None, + }, + ), + kwonlyargs: [], + kwarg: Some( + Parameter { + range: 2139..2147, + name: Identifier { + id: "kwargs", + range: 2141..2147, + }, + annotation: None, + }, + ), + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 2154..2158, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 2161..2184, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 2165..2168, + }, + type_params: None, + parameters: Parameters { + range: 2168..2174, + posonlyargs: [ + ParameterWithDefault { + range: 2169..2170, + parameter: Parameter { + range: 2169..2170, + name: Identifier { + id: "a", + range: 2169..2170, + }, + annotation: None, + }, + default: None, + }, + ], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 2180..2184, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 2187..2213, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 2191..2194, + }, + type_params: None, + parameters: Parameters { + range: 2194..2203, + posonlyargs: [ + ParameterWithDefault { + range: 2195..2196, + parameter: Parameter { + range: 2195..2196, + name: Identifier { + id: "a", + range: 2195..2196, + }, + annotation: None, + }, + default: None, + }, + ], + args: [ + ParameterWithDefault { + range: 2201..2202, + parameter: Parameter { + range: 2201..2202, + name: Identifier { + id: "b", + range: 2201..2202, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 2209..2213, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 2216..2242, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 2220..2223, + }, + type_params: None, + parameters: Parameters { + range: 2223..2232, + posonlyargs: [ + ParameterWithDefault { + range: 2224..2227, + parameter: Parameter { + range: 2224..2225, + name: Identifier { + id: "a", + range: 2224..2225, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 2226..2227, + value: Int( + 1, + ), + }, + ), + ), + }, + ], + args: [], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 2238..2242, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 2245..2277, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 2249..2252, + }, + type_params: None, + parameters: Parameters { + range: 2252..2267, + posonlyargs: [ + ParameterWithDefault { + range: 2253..2254, + parameter: Parameter { + range: 2253..2254, + name: Identifier { + id: "a", + range: 2253..2254, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 2256..2257, + parameter: Parameter { + range: 2256..2257, + name: Identifier { + id: "b", + range: 2256..2257, + }, + annotation: None, + }, + default: None, + }, + ], + args: [], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 2265..2266, + parameter: Parameter { + range: 2265..2266, + name: Identifier { + id: "c", + range: 2265..2266, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 2273..2277, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 2280..2309, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 2284..2287, + }, + type_params: None, + parameters: Parameters { + range: 2287..2299, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 2288..2292, + parameter: Parameter { + range: 2288..2290, + name: Identifier { + id: "kw", + range: 2288..2290, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 2291..2292, + value: Int( + 1, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [ + ParameterWithDefault { + range: 2297..2298, + parameter: Parameter { + range: 2297..2298, + name: Identifier { + id: "a", + range: 2297..2298, + }, + annotation: None, + }, + default: None, + }, + ], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 2305..2309, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 2312..2357, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 2316..2319, + }, + type_params: None, + parameters: Parameters { + range: 2319..2347, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 2320..2326, + parameter: Parameter { + range: 2320..2326, + name: Identifier { + id: "x", + range: 2320..2321, + }, + annotation: Some( + Name( + ExprName { + range: 2323..2326, + id: "int", + ctx: Load, + }, + ), + ), + }, + default: None, + }, + ParameterWithDefault { + range: 2328..2336, + parameter: Parameter { + range: 2328..2336, + name: Identifier { + id: "y", + range: 2328..2329, + }, + annotation: Some( + StringLiteral( + ExprStringLiteral { + range: 2331..2336, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 2331..2336, + value: "str", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + }, + default: None, + }, + ParameterWithDefault { + range: 2338..2346, + parameter: Parameter { + range: 2338..2346, + name: Identifier { + id: "z", + range: 2338..2339, + }, + annotation: Some( + BinOp( + ExprBinOp { + range: 2341..2346, + left: NumberLiteral( + ExprNumberLiteral { + range: 2341..2342, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 2345..2346, + value: Int( + 2, + ), + }, + ), + }, + ), + ), + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 2353..2357, + }, + ), + ], + }, + ), + FunctionDef( + StmtFunctionDef { + range: 2360..2398, + is_async: false, + decorator_list: [], + name: Identifier { + id: "foo", + range: 2364..2367, + }, + type_params: None, + parameters: Parameters { + range: 2367..2388, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 2368..2372, + parameter: Parameter { + range: 2368..2372, + name: Identifier { + id: "self", + range: 2368..2372, + }, + annotation: None, + }, + default: None, + }, + ParameterWithDefault { + range: 2374..2377, + parameter: Parameter { + range: 2374..2375, + name: Identifier { + id: "a", + range: 2374..2375, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 2376..2377, + value: Int( + 1, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 2379..2382, + parameter: Parameter { + range: 2379..2380, + name: Identifier { + id: "b", + range: 2379..2380, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 2381..2382, + value: Int( + 2, + ), + }, + ), + ), + }, + ParameterWithDefault { + range: 2384..2387, + parameter: Parameter { + range: 2384..2385, + name: Identifier { + id: "c", + range: 2384..2385, + }, + annotation: None, + }, + default: Some( + NumberLiteral( + ExprNumberLiteral { + range: 2386..2387, + value: Int( + 3, + ), + }, + ), + ), + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + returns: None, + body: [ + Pass( + StmtPass { + range: 2394..2398, + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__if.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__if.py.snap new file mode 100644 index 0000000000..f0c41f6ce0 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__if.py.snap @@ -0,0 +1,673 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/if.py +--- +## AST + +``` +Module( + ModModule { + range: 0..375, + body: [ + If( + StmtIf { + range: 0..28, + test: NumberLiteral( + ExprNumberLiteral { + range: 3..4, + value: Int( + 1, + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 6..8, + value: NumberLiteral( + ExprNumberLiteral { + range: 6..8, + value: Int( + 10, + ), + }, + ), + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 9..19, + test: Some( + NumberLiteral( + ExprNumberLiteral { + range: 14..15, + value: Int( + 2, + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 17..19, + value: NumberLiteral( + ExprNumberLiteral { + range: 17..19, + value: Int( + 20, + ), + }, + ), + }, + ), + ], + }, + ElifElseClause { + range: 20..28, + test: None, + body: [ + Expr( + StmtExpr { + range: 26..28, + value: NumberLiteral( + ExprNumberLiteral { + range: 26..28, + value: Int( + 30, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + If( + StmtIf { + range: 30..52, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 33..37, + value: true, + }, + ), + body: [ + Expr( + StmtExpr { + range: 43..44, + value: NumberLiteral( + ExprNumberLiteral { + range: 43..44, + value: Int( + 1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 49..52, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 49..52, + }, + ), + }, + ), + ], + elif_else_clauses: [], + }, + ), + If( + StmtIf { + range: 53..85, + test: Compare( + ExprCompare { + range: 56..61, + left: Name( + ExprName { + range: 56..57, + id: "x", + ctx: Load, + }, + ), + ops: [ + Lt, + ], + comparators: [ + NumberLiteral( + ExprNumberLiteral { + range: 60..61, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + body: [ + Expr( + StmtExpr { + range: 67..70, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 67..70, + }, + ), + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 71..85, + test: None, + body: [ + Pass( + StmtPass { + range: 81..85, + }, + ), + ], + }, + ], + }, + ), + If( + StmtIf { + range: 87..117, + test: Name( + ExprName { + range: 90..91, + id: "a", + ctx: Load, + }, + ), + body: [ + Pass( + StmtPass { + range: 97..101, + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 102..117, + test: Some( + Name( + ExprName { + range: 107..108, + id: "b", + ctx: Load, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 114..117, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 114..117, + }, + ), + }, + ), + ], + }, + ], + }, + ), + If( + StmtIf { + range: 119..203, + test: BoolOp( + ExprBoolOp { + range: 122..129, + op: And, + values: [ + Name( + ExprName { + range: 122..123, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 128..129, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + body: [ + Expr( + StmtExpr { + range: 135..138, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 135..138, + }, + ), + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 139..157, + test: Some( + BooleanLiteral( + ExprBooleanLiteral { + range: 144..148, + value: true, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 154..157, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 154..157, + }, + ), + }, + ), + ], + }, + ElifElseClause { + range: 158..173, + test: Some( + Name( + ExprName { + range: 163..164, + id: "c", + ctx: Load, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 170..173, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 170..173, + }, + ), + }, + ), + ], + }, + ElifElseClause { + range: 174..189, + test: Some( + Name( + ExprName { + range: 179..180, + id: "d", + ctx: Load, + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 186..189, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 186..189, + }, + ), + }, + ), + ], + }, + ElifElseClause { + range: 190..203, + test: None, + body: [ + Expr( + StmtExpr { + range: 200..203, + value: Call( + ExprCall { + range: 200..203, + func: Name( + ExprName { + range: 200..201, + id: "f", + ctx: Load, + }, + ), + arguments: Arguments { + range: 201..203, + args: [], + keywords: [], + }, + }, + ), + }, + ), + ], + }, + ], + }, + ), + If( + StmtIf { + range: 229..260, + test: Named( + ExprNamed { + range: 232..238, + target: Name( + ExprName { + range: 232..233, + id: "a", + ctx: Store, + }, + ), + value: Name( + ExprName { + range: 237..238, + id: "b", + ctx: Load, + }, + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 240..243, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 240..243, + }, + ), + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 244..260, + test: Some( + Named( + ExprNamed { + range: 249..255, + target: Name( + ExprName { + range: 249..250, + id: "a", + ctx: Store, + }, + ), + value: Name( + ExprName { + range: 254..255, + id: "b", + ctx: Load, + }, + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 257..260, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 257..260, + }, + ), + }, + ), + ], + }, + ], + }, + ), + If( + StmtIf { + range: 261..302, + test: Lambda( + ExprLambda { + range: 264..275, + parameters: Some( + Parameters { + range: 271..272, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 271..272, + parameter: Parameter { + range: 271..272, + name: Identifier { + id: "x", + range: 271..272, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 274..275, + id: "x", + ctx: Load, + }, + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 277..280, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 277..280, + }, + ), + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 281..302, + test: Some( + Lambda( + ExprLambda { + range: 286..297, + parameters: Some( + Parameters { + range: 293..294, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 293..294, + parameter: Parameter { + range: 293..294, + name: Identifier { + id: "x", + range: 293..294, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 296..297, + id: "x", + ctx: Load, + }, + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 299..302, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 299..302, + }, + ), + }, + ), + ], + }, + ], + }, + ), + If( + StmtIf { + range: 303..336, + test: Await( + ExprAwait { + range: 306..313, + value: Name( + ExprName { + range: 312..313, + id: "x", + ctx: Load, + }, + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 315..318, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 315..318, + }, + ), + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 319..336, + test: Some( + Await( + ExprAwait { + range: 324..331, + value: Name( + ExprName { + range: 330..331, + id: "x", + ctx: Load, + }, + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 333..336, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 333..336, + }, + ), + }, + ), + ], + }, + ], + }, + ), + If( + StmtIf { + range: 337..374, + test: Yield( + ExprYield { + range: 341..348, + value: Some( + Name( + ExprName { + range: 347..348, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 351..354, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 351..354, + }, + ), + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 355..374, + test: Some( + Yield( + ExprYield { + range: 361..368, + value: Some( + Name( + ExprName { + range: 367..368, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 371..374, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 371..374, + }, + ), + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__import.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__import.py.snap new file mode 100644 index 0000000000..1a201d6f12 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__import.py.snap @@ -0,0 +1,129 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/import.py +--- +## AST + +``` +Module( + ModModule { + range: 0..92, + body: [ + Import( + StmtImport { + range: 0..8, + names: [ + Alias { + range: 7..8, + name: Identifier { + id: "a", + range: 7..8, + }, + asname: None, + }, + ], + }, + ), + Import( + StmtImport { + range: 9..21, + names: [ + Alias { + range: 16..21, + name: Identifier { + id: "a.b.c", + range: 16..21, + }, + asname: None, + }, + ], + }, + ), + Import( + StmtImport { + range: 22..39, + names: [ + Alias { + range: 29..39, + name: Identifier { + id: "a.b.c", + range: 29..34, + }, + asname: Some( + Identifier { + id: "d", + range: 38..39, + }, + ), + }, + ], + }, + ), + Import( + StmtImport { + range: 40..54, + names: [ + Alias { + range: 47..48, + name: Identifier { + id: "a", + range: 47..48, + }, + asname: None, + }, + Alias { + range: 50..51, + name: Identifier { + id: "b", + range: 50..51, + }, + asname: None, + }, + Alias { + range: 53..54, + name: Identifier { + id: "c", + range: 53..54, + }, + asname: None, + }, + ], + }, + ), + Import( + StmtImport { + range: 55..91, + names: [ + Alias { + range: 62..74, + name: Identifier { + id: "foo.bar", + range: 62..69, + }, + asname: Some( + Identifier { + id: "a", + range: 73..74, + }, + ), + }, + Alias { + range: 76..91, + name: Identifier { + id: "a.b.c.d", + range: 76..83, + }, + asname: Some( + Identifier { + id: "abcd", + range: 87..91, + }, + ), + }, + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__match.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__match.py.snap new file mode 100644 index 0000000000..1b25503682 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__match.py.snap @@ -0,0 +1,7716 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/match.py +--- +## AST + +``` +Module( + ModModule { + range: 0..5743, + body: [ + Match( + StmtMatch { + range: 67..103, + subject: Name( + ExprName { + range: 73..74, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 80..103, + pattern: MatchValue( + PatternMatchValue { + range: 85..88, + value: UnaryOp( + ExprUnaryOp { + range: 85..88, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 86..88, + value: Complex { + real: 0.0, + imag: 0.0, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 98..103, + targets: [ + Name( + ExprName { + range: 98..99, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 102..103, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 126..167, + subject: Name( + ExprName { + range: 132..133, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 139..167, + pattern: MatchClass( + PatternMatchClass { + range: 144..152, + cls: Name( + ExprName { + range: 144..149, + id: "bytes", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 149..152, + patterns: [ + MatchAs( + PatternMatchAs { + range: 150..151, + pattern: None, + name: Some( + Identifier { + id: "z", + range: 150..151, + }, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 162..167, + targets: [ + Name( + ExprName { + range: 162..163, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 166..167, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 190..260, + subject: Name( + ExprName { + range: 196..197, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 203..229, + pattern: MatchValue( + PatternMatchValue { + range: 208..209, + value: NumberLiteral( + ExprNumberLiteral { + range: 208..209, + value: Int( + 0, + ), + }, + ), + }, + ), + guard: Some( + NumberLiteral( + ExprNumberLiteral { + range: 213..214, + value: Int( + 0, + ), + }, + ), + ), + body: [ + Assign( + StmtAssign { + range: 224..229, + targets: [ + Name( + ExprName { + range: 224..225, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 228..229, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + MatchCase { + range: 234..260, + pattern: MatchValue( + PatternMatchValue { + range: 239..240, + value: NumberLiteral( + ExprNumberLiteral { + range: 239..240, + value: Int( + 0, + ), + }, + ), + }, + ), + guard: Some( + NumberLiteral( + ExprNumberLiteral { + range: 244..245, + value: Int( + 1, + ), + }, + ), + ), + body: [ + Assign( + StmtAssign { + range: 255..260, + targets: [ + Name( + ExprName { + range: 255..256, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 259..260, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 283..332, + subject: NumberLiteral( + ExprNumberLiteral { + range: 289..290, + value: Int( + 3, + ), + }, + ), + cases: [ + MatchCase { + range: 296..332, + pattern: MatchOr( + PatternMatchOr { + range: 301..314, + patterns: [ + MatchValue( + PatternMatchValue { + range: 301..302, + value: NumberLiteral( + ExprNumberLiteral { + range: 301..302, + value: Int( + 0, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 305..306, + value: NumberLiteral( + ExprNumberLiteral { + range: 305..306, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 309..310, + value: NumberLiteral( + ExprNumberLiteral { + range: 309..310, + value: Int( + 2, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 313..314, + value: NumberLiteral( + ExprNumberLiteral { + range: 313..314, + value: Int( + 3, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 324..332, + targets: [ + Name( + ExprName { + range: 324..325, + id: "x", + ctx: Store, + }, + ), + ], + value: BooleanLiteral( + ExprBooleanLiteral { + range: 328..332, + value: true, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 355..403, + subject: Name( + ExprName { + range: 361..362, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 368..403, + pattern: MatchOr( + PatternMatchOr { + range: 373..388, + patterns: [ + MatchSequence( + PatternMatchSequence { + range: 373..379, + patterns: [ + MatchValue( + PatternMatchValue { + range: 374..375, + value: NumberLiteral( + ExprNumberLiteral { + range: 374..375, + value: Int( + 0, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 377..378, + value: NumberLiteral( + ExprNumberLiteral { + range: 377..378, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + ), + MatchSequence( + PatternMatchSequence { + range: 382..388, + patterns: [ + MatchValue( + PatternMatchValue { + range: 383..384, + value: NumberLiteral( + ExprNumberLiteral { + range: 383..384, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 386..387, + value: NumberLiteral( + ExprNumberLiteral { + range: 386..387, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 398..403, + targets: [ + Name( + ExprName { + range: 398..399, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 402..403, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 445..523, + subject: Name( + ExprName { + range: 451..452, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 458..489, + pattern: MatchSequence( + PatternMatchSequence { + range: 463..467, + patterns: [ + MatchStar( + PatternMatchStar { + range: 464..466, + name: None, + }, + ), + ], + }, + ), + guard: None, + body: [ + Return( + StmtReturn { + range: 477..489, + value: Some( + StringLiteral( + ExprStringLiteral { + range: 484..489, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 484..489, + value: "seq", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + }, + ), + ], + }, + MatchCase { + range: 494..523, + pattern: MatchMapping( + PatternMatchMapping { + range: 499..501, + keys: [], + patterns: [], + rest: None, + }, + ), + guard: None, + body: [ + Return( + StmtReturn { + range: 511..523, + value: Some( + StringLiteral( + ExprStringLiteral { + range: 518..523, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 518..523, + value: "map", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 546..714, + subject: Name( + ExprName { + range: 552..553, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 559..594, + pattern: MatchMapping( + PatternMatchMapping { + range: 564..579, + keys: [ + NumberLiteral( + ExprNumberLiteral { + range: 565..566, + value: Int( + 0, + ), + }, + ), + ], + patterns: [ + MatchSequence( + PatternMatchSequence { + range: 568..578, + patterns: [ + MatchValue( + PatternMatchValue { + range: 569..570, + value: NumberLiteral( + ExprNumberLiteral { + range: 569..570, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 572..573, + value: NumberLiteral( + ExprNumberLiteral { + range: 572..573, + value: Int( + 2, + ), + }, + ), + }, + ), + MatchMapping( + PatternMatchMapping { + range: 575..577, + keys: [], + patterns: [], + rest: None, + }, + ), + ], + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 589..594, + targets: [ + Name( + ExprName { + range: 589..590, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 593..594, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + MatchCase { + range: 599..687, + pattern: MatchOr( + PatternMatchOr { + range: 604..672, + patterns: [ + MatchMapping( + PatternMatchMapping { + range: 604..626, + keys: [ + NumberLiteral( + ExprNumberLiteral { + range: 605..606, + value: Int( + 0, + ), + }, + ), + ], + patterns: [ + MatchOr( + PatternMatchOr { + range: 608..625, + patterns: [ + MatchSequence( + PatternMatchSequence { + range: 608..618, + patterns: [ + MatchValue( + PatternMatchValue { + range: 609..610, + value: NumberLiteral( + ExprNumberLiteral { + range: 609..610, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 612..613, + value: NumberLiteral( + ExprNumberLiteral { + range: 612..613, + value: Int( + 2, + ), + }, + ), + }, + ), + MatchMapping( + PatternMatchMapping { + range: 615..617, + keys: [], + patterns: [], + rest: None, + }, + ), + ], + }, + ), + MatchSingleton( + PatternMatchSingleton { + range: 621..625, + value: True, + }, + ), + ], + }, + ), + ], + rest: None, + }, + ), + MatchMapping( + PatternMatchMapping { + range: 629..638, + keys: [ + NumberLiteral( + ExprNumberLiteral { + range: 630..631, + value: Int( + 1, + ), + }, + ), + ], + patterns: [ + MatchSequence( + PatternMatchSequence { + range: 633..637, + patterns: [ + MatchSequence( + PatternMatchSequence { + range: 634..636, + patterns: [], + }, + ), + ], + }, + ), + ], + rest: None, + }, + ), + MatchMapping( + PatternMatchMapping { + range: 641..656, + keys: [ + NumberLiteral( + ExprNumberLiteral { + range: 642..643, + value: Int( + 0, + ), + }, + ), + ], + patterns: [ + MatchSequence( + PatternMatchSequence { + range: 645..655, + patterns: [ + MatchValue( + PatternMatchValue { + range: 646..647, + value: NumberLiteral( + ExprNumberLiteral { + range: 646..647, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 649..650, + value: NumberLiteral( + ExprNumberLiteral { + range: 649..650, + value: Int( + 2, + ), + }, + ), + }, + ), + MatchMapping( + PatternMatchMapping { + range: 652..654, + keys: [], + patterns: [], + rest: None, + }, + ), + ], + }, + ), + ], + rest: None, + }, + ), + MatchSequence( + PatternMatchSequence { + range: 659..661, + patterns: [], + }, + ), + MatchValue( + PatternMatchValue { + range: 664..667, + value: StringLiteral( + ExprStringLiteral { + range: 664..667, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 664..667, + value: "X", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + MatchMapping( + PatternMatchMapping { + range: 670..672, + keys: [], + patterns: [], + rest: None, + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 682..687, + targets: [ + Name( + ExprName { + range: 682..683, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 686..687, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + MatchCase { + range: 692..714, + pattern: MatchSequence( + PatternMatchSequence { + range: 697..699, + patterns: [], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 709..714, + targets: [ + Name( + ExprName { + range: 709..710, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 713..714, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 737..782, + subject: Name( + ExprName { + range: 743..744, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 750..782, + pattern: MatchValue( + PatternMatchValue { + range: 755..767, + value: BinOp( + ExprBinOp { + range: 755..767, + left: NumberLiteral( + ExprNumberLiteral { + range: 755..759, + value: Float( + 0.25, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 762..767, + value: Complex { + real: 0.0, + imag: 1.75, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 777..782, + targets: [ + Name( + ExprName { + range: 777..778, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 781..782, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 805..841, + subject: Name( + ExprName { + range: 811..812, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 818..841, + pattern: MatchValue( + PatternMatchValue { + range: 823..826, + value: UnaryOp( + ExprUnaryOp { + range: 823..826, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 824..826, + value: Complex { + real: 0.0, + imag: 0.0, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 836..841, + targets: [ + Name( + ExprName { + range: 836..837, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 840..841, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 864..913, + subject: NumberLiteral( + ExprNumberLiteral { + range: 870..871, + value: Int( + 4, + ), + }, + ), + cases: [ + MatchCase { + range: 877..913, + pattern: MatchOr( + PatternMatchOr { + range: 882..895, + patterns: [ + MatchValue( + PatternMatchValue { + range: 882..883, + value: NumberLiteral( + ExprNumberLiteral { + range: 882..883, + value: Int( + 0, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 886..887, + value: NumberLiteral( + ExprNumberLiteral { + range: 886..887, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 890..891, + value: NumberLiteral( + ExprNumberLiteral { + range: 890..891, + value: Int( + 2, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 894..895, + value: NumberLiteral( + ExprNumberLiteral { + range: 894..895, + value: Int( + 3, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 905..913, + targets: [ + Name( + ExprName { + range: 905..906, + id: "x", + ctx: Store, + }, + ), + ], + value: BooleanLiteral( + ExprBooleanLiteral { + range: 909..913, + value: true, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 936..975, + subject: Name( + ExprName { + range: 942..943, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 949..975, + pattern: MatchValue( + PatternMatchValue { + range: 954..955, + value: NumberLiteral( + ExprNumberLiteral { + range: 954..955, + value: Int( + 0, + ), + }, + ), + }, + ), + guard: Some( + Name( + ExprName { + range: 959..960, + id: "x", + ctx: Load, + }, + ), + ), + body: [ + Assign( + StmtAssign { + range: 970..975, + targets: [ + Name( + ExprName { + range: 970..971, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 974..975, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 998..1098, + subject: Name( + ExprName { + range: 1004..1005, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 1011..1037, + pattern: MatchMapping( + PatternMatchMapping { + range: 1016..1022, + keys: [ + NumberLiteral( + ExprNumberLiteral { + range: 1017..1018, + value: Int( + 1, + ), + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 1020..1021, + value: NumberLiteral( + ExprNumberLiteral { + range: 1020..1021, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1032..1037, + targets: [ + Name( + ExprName { + range: 1032..1033, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1036..1037, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + MatchCase { + range: 1042..1068, + pattern: MatchMapping( + PatternMatchMapping { + range: 1047..1053, + keys: [ + NumberLiteral( + ExprNumberLiteral { + range: 1048..1049, + value: Int( + 0, + ), + }, + ), + ], + patterns: [ + MatchValue( + PatternMatchValue { + range: 1051..1052, + value: NumberLiteral( + ExprNumberLiteral { + range: 1051..1052, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1063..1068, + targets: [ + Name( + ExprName { + range: 1063..1064, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1067..1068, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + MatchCase { + range: 1073..1098, + pattern: MatchMapping( + PatternMatchMapping { + range: 1078..1083, + keys: [], + patterns: [], + rest: Some( + Identifier { + id: "z", + range: 1081..1082, + }, + ), + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1093..1098, + targets: [ + Name( + ExprName { + range: 1093..1094, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1097..1098, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 1121..1162, + subject: Call( + ExprCall { + range: 1127..1132, + func: Name( + ExprName { + range: 1127..1130, + id: "Seq", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1130..1132, + args: [], + keywords: [], + }, + }, + ), + cases: [ + MatchCase { + range: 1138..1162, + pattern: MatchSequence( + PatternMatchSequence { + range: 1143..1147, + patterns: [ + MatchStar( + PatternMatchStar { + range: 1144..1146, + name: None, + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1157..1162, + targets: [ + Name( + ExprName { + range: 1157..1158, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1161..1162, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 1185..1245, + subject: Name( + ExprName { + range: 1191..1192, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 1198..1219, + pattern: MatchValue( + PatternMatchValue { + range: 1203..1204, + value: NumberLiteral( + ExprNumberLiteral { + range: 1203..1204, + value: Int( + 1, + ), + }, + ), + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1214..1219, + targets: [ + Name( + ExprName { + range: 1214..1215, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1218..1219, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + MatchCase { + range: 1224..1245, + pattern: MatchValue( + PatternMatchValue { + range: 1229..1230, + value: NumberLiteral( + ExprNumberLiteral { + range: 1229..1230, + value: Int( + 1, + ), + }, + ), + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1240..1245, + targets: [ + Name( + ExprName { + range: 1240..1241, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1244..1245, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 1268..1315, + subject: Name( + ExprName { + range: 1274..1275, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 1281..1315, + pattern: MatchMapping( + PatternMatchMapping { + range: 1286..1298, + keys: [ + StringLiteral( + ExprStringLiteral { + range: 1287..1292, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 1287..1292, + value: "foo", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + patterns: [ + MatchAs( + PatternMatchAs { + range: 1294..1297, + pattern: None, + name: Some( + Identifier { + id: "bar", + range: 1294..1297, + }, + ), + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1308..1315, + targets: [ + Name( + ExprName { + range: 1308..1309, + id: "y", + ctx: Store, + }, + ), + ], + value: Name( + ExprName { + range: 1312..1315, + id: "bar", + ctx: Load, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 1338..1392, + subject: Tuple( + ExprTuple { + range: 1344..1353, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 1345..1346, + value: Int( + 0, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 1348..1349, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 1351..1352, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + cases: [ + MatchCase { + range: 1359..1392, + pattern: MatchSequence( + PatternMatchSequence { + range: 1364..1377, + patterns: [ + MatchValue( + PatternMatchValue { + range: 1365..1366, + value: NumberLiteral( + ExprNumberLiteral { + range: 1365..1366, + value: Int( + 0, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 1368..1369, + value: NumberLiteral( + ExprNumberLiteral { + range: 1368..1369, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchStar( + PatternMatchStar { + range: 1371..1373, + name: Some( + Identifier { + id: "x", + range: 1372..1373, + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 1375..1376, + value: NumberLiteral( + ExprNumberLiteral { + range: 1375..1376, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1387..1392, + targets: [ + Name( + ExprName { + range: 1387..1388, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1391..1392, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 1415..1529, + subject: Name( + ExprName { + range: 1421..1422, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 1428..1451, + pattern: MatchSequence( + PatternMatchSequence { + range: 1433..1436, + patterns: [ + MatchValue( + PatternMatchValue { + range: 1434..1435, + value: NumberLiteral( + ExprNumberLiteral { + range: 1434..1435, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1446..1451, + targets: [ + Name( + ExprName { + range: 1446..1447, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1450..1451, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + MatchCase { + range: 1456..1498, + pattern: MatchSequence( + PatternMatchSequence { + range: 1461..1467, + patterns: [ + MatchValue( + PatternMatchValue { + range: 1462..1463, + value: NumberLiteral( + ExprNumberLiteral { + range: 1462..1463, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 1465..1466, + value: NumberLiteral( + ExprNumberLiteral { + range: 1465..1466, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ), + guard: Some( + Named( + ExprNamed { + range: 1472..1482, + target: Name( + ExprName { + range: 1472..1473, + id: "x", + ctx: Store, + }, + ), + value: Subscript( + ExprSubscript { + range: 1477..1482, + value: Name( + ExprName { + range: 1477..1478, + id: "x", + ctx: Load, + }, + ), + slice: Slice( + ExprSlice { + range: 1479..1481, + lower: None, + upper: Some( + NumberLiteral( + ExprNumberLiteral { + range: 1480..1481, + value: Int( + 0, + ), + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + ), + body: [ + Assign( + StmtAssign { + range: 1493..1498, + targets: [ + Name( + ExprName { + range: 1493..1494, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1497..1498, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + MatchCase { + range: 1503..1529, + pattern: MatchSequence( + PatternMatchSequence { + range: 1508..1514, + patterns: [ + MatchValue( + PatternMatchValue { + range: 1509..1510, + value: NumberLiteral( + ExprNumberLiteral { + range: 1509..1510, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 1512..1513, + value: NumberLiteral( + ExprNumberLiteral { + range: 1512..1513, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1524..1529, + targets: [ + Name( + ExprName { + range: 1524..1525, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1528..1529, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 1552..1595, + subject: Name( + ExprName { + range: 1558..1559, + id: "w", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 1565..1595, + pattern: MatchSequence( + PatternMatchSequence { + range: 1570..1580, + patterns: [ + MatchAs( + PatternMatchAs { + range: 1571..1572, + pattern: None, + name: Some( + Identifier { + id: "x", + range: 1571..1572, + }, + ), + }, + ), + MatchAs( + PatternMatchAs { + range: 1574..1575, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 1574..1575, + }, + ), + }, + ), + MatchStar( + PatternMatchStar { + range: 1577..1579, + name: None, + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1590..1595, + targets: [ + Name( + ExprName { + range: 1590..1591, + id: "z", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1594..1595, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 1618..1664, + subject: Name( + ExprName { + range: 1624..1625, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 1631..1664, + pattern: MatchValue( + PatternMatchValue { + range: 1636..1649, + value: BinOp( + ExprBinOp { + range: 1636..1649, + left: UnaryOp( + ExprUnaryOp { + range: 1636..1641, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 1637..1641, + value: Float( + 0.25, + ), + }, + ), + }, + ), + op: Sub, + right: NumberLiteral( + ExprNumberLiteral { + range: 1644..1649, + value: Complex { + real: 0.0, + imag: 1.75, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1659..1664, + targets: [ + Name( + ExprName { + range: 1659..1660, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1663..1664, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 1687..1726, + subject: Tuple( + ExprTuple { + range: 1693..1697, + elts: [ + Name( + ExprName { + range: 1694..1695, + id: "x", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + cases: [ + MatchCase { + range: 1703..1726, + pattern: MatchSequence( + PatternMatchSequence { + range: 1708..1711, + patterns: [ + MatchAs( + PatternMatchAs { + range: 1709..1710, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 1709..1710, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1721..1726, + targets: [ + Name( + ExprName { + range: 1721..1722, + id: "z", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1725..1726, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 1749..1789, + subject: Name( + ExprName { + range: 1755..1756, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 1762..1789, + pattern: MatchValue( + PatternMatchValue { + range: 1767..1774, + value: Attribute( + ExprAttribute { + range: 1767..1774, + value: Attribute( + ExprAttribute { + range: 1767..1772, + value: Attribute( + ExprAttribute { + range: 1767..1770, + value: Name( + ExprName { + range: 1767..1768, + id: "A", + ctx: Load, + }, + ), + attr: Identifier { + id: "B", + range: 1769..1770, + }, + ctx: Load, + }, + ), + attr: Identifier { + id: "C", + range: 1771..1772, + }, + ctx: Load, + }, + ), + attr: Identifier { + id: "D", + range: 1773..1774, + }, + ctx: Load, + }, + ), + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1784..1789, + targets: [ + Name( + ExprName { + range: 1784..1785, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1788..1789, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 1812..1849, + subject: Name( + ExprName { + range: 1818..1819, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 1825..1849, + pattern: MatchSingleton( + PatternMatchSingleton { + range: 1830..1834, + value: None, + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1844..1849, + targets: [ + Name( + ExprName { + range: 1844..1845, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1848..1849, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 1872..1906, + subject: Name( + ExprName { + range: 1878..1879, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 1885..1906, + pattern: MatchValue( + PatternMatchValue { + range: 1890..1891, + value: NumberLiteral( + ExprNumberLiteral { + range: 1890..1891, + value: Int( + 0, + ), + }, + ), + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1901..1906, + targets: [ + Name( + ExprName { + range: 1901..1902, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1905..1906, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 1929..1967, + subject: Name( + ExprName { + range: 1935..1936, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 1942..1967, + pattern: MatchSingleton( + PatternMatchSingleton { + range: 1947..1952, + value: False, + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 1962..1967, + targets: [ + Name( + ExprName { + range: 1962..1963, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1966..1967, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 1990..2081, + subject: Name( + ExprName { + range: 1996..1997, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 2003..2025, + pattern: MatchSequence( + PatternMatchSequence { + range: 2008..2010, + patterns: [], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 2020..2025, + targets: [ + Name( + ExprName { + range: 2020..2021, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2024..2025, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + MatchCase { + range: 2030..2054, + pattern: MatchSequence( + PatternMatchSequence { + range: 2035..2039, + patterns: [ + MatchValue( + PatternMatchValue { + range: 2036..2038, + value: StringLiteral( + ExprStringLiteral { + range: 2036..2038, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 2036..2038, + value: "", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 2049..2054, + targets: [ + Name( + ExprName { + range: 2049..2050, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2053..2054, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + MatchCase { + range: 2059..2081, + pattern: MatchValue( + PatternMatchValue { + range: 2064..2066, + value: StringLiteral( + ExprStringLiteral { + range: 2064..2066, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 2064..2066, + value: "", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 2076..2081, + targets: [ + Name( + ExprName { + range: 2076..2077, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2080..2081, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 2104..2138, + subject: Name( + ExprName { + range: 2110..2111, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 2117..2138, + pattern: MatchAs( + PatternMatchAs { + range: 2122..2123, + pattern: None, + name: Some( + Identifier { + id: "z", + range: 2122..2123, + }, + ), + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 2133..2138, + targets: [ + Name( + ExprName { + range: 2133..2134, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2137..2138, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 2161..2207, + subject: Name( + ExprName { + range: 2167..2168, + id: "w", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 2174..2207, + pattern: MatchSequence( + PatternMatchSequence { + range: 2179..2192, + patterns: [ + MatchAs( + PatternMatchAs { + range: 2180..2181, + pattern: None, + name: Some( + Identifier { + id: "x", + range: 2180..2181, + }, + ), + }, + ), + MatchAs( + PatternMatchAs { + range: 2183..2184, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 2183..2184, + }, + ), + }, + ), + MatchStar( + PatternMatchStar { + range: 2186..2191, + name: Some( + Identifier { + id: "rest", + range: 2187..2191, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 2202..2207, + targets: [ + Name( + ExprName { + range: 2202..2203, + id: "z", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2206..2207, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 2230..2307, + subject: Name( + ExprName { + range: 2236..2237, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 2243..2307, + pattern: MatchOr( + PatternMatchOr { + range: 2248..2278, + patterns: [ + MatchAs( + PatternMatchAs { + range: 2249..2255, + pattern: Some( + MatchValue( + PatternMatchValue { + range: 2249..2250, + value: NumberLiteral( + ExprNumberLiteral { + range: 2249..2250, + value: Int( + 0, + ), + }, + ), + }, + ), + ), + name: Some( + Identifier { + id: "z", + range: 2254..2255, + }, + ), + }, + ), + MatchAs( + PatternMatchAs { + range: 2260..2266, + pattern: Some( + MatchValue( + PatternMatchValue { + range: 2260..2261, + value: NumberLiteral( + ExprNumberLiteral { + range: 2260..2261, + value: Int( + 1, + ), + }, + ), + }, + ), + ), + name: Some( + Identifier { + id: "z", + range: 2265..2266, + }, + ), + }, + ), + MatchAs( + PatternMatchAs { + range: 2271..2277, + pattern: Some( + MatchValue( + PatternMatchValue { + range: 2271..2272, + value: NumberLiteral( + ExprNumberLiteral { + range: 2271..2272, + value: Int( + 2, + ), + }, + ), + }, + ), + ), + name: Some( + Identifier { + id: "z", + range: 2276..2277, + }, + ), + }, + ), + ], + }, + ), + guard: Some( + Compare( + ExprCompare { + range: 2282..2292, + left: Name( + ExprName { + range: 2282..2283, + id: "z", + ctx: Load, + }, + ), + ops: [ + Eq, + ], + comparators: [ + BinOp( + ExprBinOp { + range: 2287..2292, + left: Name( + ExprName { + range: 2287..2288, + id: "x", + ctx: Load, + }, + ), + op: Mod, + right: NumberLiteral( + ExprNumberLiteral { + range: 2291..2292, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ), + ), + body: [ + Assign( + StmtAssign { + range: 2302..2307, + targets: [ + Name( + ExprName { + range: 2302..2303, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2306..2307, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 2330..2499, + subject: Name( + ExprName { + range: 2336..2337, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 2343..2378, + pattern: MatchMapping( + PatternMatchMapping { + range: 2348..2363, + keys: [ + NumberLiteral( + ExprNumberLiteral { + range: 2349..2350, + value: Int( + 0, + ), + }, + ), + ], + patterns: [ + MatchSequence( + PatternMatchSequence { + range: 2352..2362, + patterns: [ + MatchValue( + PatternMatchValue { + range: 2353..2354, + value: NumberLiteral( + ExprNumberLiteral { + range: 2353..2354, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 2356..2357, + value: NumberLiteral( + ExprNumberLiteral { + range: 2356..2357, + value: Int( + 2, + ), + }, + ), + }, + ), + MatchMapping( + PatternMatchMapping { + range: 2359..2361, + keys: [], + patterns: [], + rest: None, + }, + ), + ], + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 2373..2378, + targets: [ + Name( + ExprName { + range: 2373..2374, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2377..2378, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + MatchCase { + range: 2383..2472, + pattern: MatchOr( + PatternMatchOr { + range: 2388..2457, + patterns: [ + MatchMapping( + PatternMatchMapping { + range: 2388..2411, + keys: [ + NumberLiteral( + ExprNumberLiteral { + range: 2389..2390, + value: Int( + 0, + ), + }, + ), + ], + patterns: [ + MatchOr( + PatternMatchOr { + range: 2392..2410, + patterns: [ + MatchSequence( + PatternMatchSequence { + range: 2392..2402, + patterns: [ + MatchValue( + PatternMatchValue { + range: 2393..2394, + value: NumberLiteral( + ExprNumberLiteral { + range: 2393..2394, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 2396..2397, + value: NumberLiteral( + ExprNumberLiteral { + range: 2396..2397, + value: Int( + 2, + ), + }, + ), + }, + ), + MatchMapping( + PatternMatchMapping { + range: 2399..2401, + keys: [], + patterns: [], + rest: None, + }, + ), + ], + }, + ), + MatchSingleton( + PatternMatchSingleton { + range: 2405..2410, + value: False, + }, + ), + ], + }, + ), + ], + rest: None, + }, + ), + MatchMapping( + PatternMatchMapping { + range: 2414..2423, + keys: [ + NumberLiteral( + ExprNumberLiteral { + range: 2415..2416, + value: Int( + 1, + ), + }, + ), + ], + patterns: [ + MatchSequence( + PatternMatchSequence { + range: 2418..2422, + patterns: [ + MatchSequence( + PatternMatchSequence { + range: 2419..2421, + patterns: [], + }, + ), + ], + }, + ), + ], + rest: None, + }, + ), + MatchMapping( + PatternMatchMapping { + range: 2426..2441, + keys: [ + NumberLiteral( + ExprNumberLiteral { + range: 2427..2428, + value: Int( + 0, + ), + }, + ), + ], + patterns: [ + MatchSequence( + PatternMatchSequence { + range: 2430..2440, + patterns: [ + MatchValue( + PatternMatchValue { + range: 2431..2432, + value: NumberLiteral( + ExprNumberLiteral { + range: 2431..2432, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 2434..2435, + value: NumberLiteral( + ExprNumberLiteral { + range: 2434..2435, + value: Int( + 2, + ), + }, + ), + }, + ), + MatchMapping( + PatternMatchMapping { + range: 2437..2439, + keys: [], + patterns: [], + rest: None, + }, + ), + ], + }, + ), + ], + rest: None, + }, + ), + MatchSequence( + PatternMatchSequence { + range: 2444..2446, + patterns: [], + }, + ), + MatchValue( + PatternMatchValue { + range: 2449..2452, + value: StringLiteral( + ExprStringLiteral { + range: 2449..2452, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 2449..2452, + value: "X", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + MatchMapping( + PatternMatchMapping { + range: 2455..2457, + keys: [], + patterns: [], + rest: None, + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 2467..2472, + targets: [ + Name( + ExprName { + range: 2467..2468, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2471..2472, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + MatchCase { + range: 2477..2499, + pattern: MatchSequence( + PatternMatchSequence { + range: 2482..2484, + patterns: [], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 2494..2499, + targets: [ + Name( + ExprName { + range: 2494..2495, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2498..2499, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 2522..2568, + subject: Tuple( + ExprTuple { + range: 2528..2537, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 2529..2530, + value: Int( + 0, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 2532..2533, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 2535..2536, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + cases: [ + MatchCase { + range: 2543..2568, + pattern: MatchSequence( + PatternMatchSequence { + range: 2548..2553, + patterns: [ + MatchValue( + PatternMatchValue { + range: 2548..2549, + value: NumberLiteral( + ExprNumberLiteral { + range: 2548..2549, + value: Int( + 0, + ), + }, + ), + }, + ), + MatchStar( + PatternMatchStar { + range: 2551..2553, + name: Some( + Identifier { + id: "x", + range: 2552..2553, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 2563..2568, + targets: [ + Name( + ExprName { + range: 2563..2564, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2567..2568, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 2591..2638, + subject: Tuple( + ExprTuple { + range: 2597..2606, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 2598..2599, + value: Int( + 0, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 2601..2602, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 2604..2605, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + cases: [ + MatchCase { + range: 2612..2638, + pattern: MatchSequence( + PatternMatchSequence { + range: 2617..2623, + patterns: [ + MatchStar( + PatternMatchStar { + range: 2617..2619, + name: Some( + Identifier { + id: "x", + range: 2618..2619, + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 2621..2622, + value: NumberLiteral( + ExprNumberLiteral { + range: 2621..2622, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 2633..2638, + targets: [ + Name( + ExprName { + range: 2633..2634, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2637..2638, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 2661..2697, + subject: Tuple( + ExprTuple { + range: 2667..2669, + elts: [ + Name( + ExprName { + range: 2667..2668, + id: "x", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + cases: [ + MatchCase { + range: 2675..2697, + pattern: MatchSequence( + PatternMatchSequence { + range: 2680..2682, + patterns: [ + MatchAs( + PatternMatchAs { + range: 2680..2681, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 2680..2681, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 2692..2697, + targets: [ + Name( + ExprName { + range: 2692..2693, + id: "z", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2696..2697, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 2720..2760, + subject: Tuple( + ExprTuple { + range: 2726..2730, + elts: [ + Name( + ExprName { + range: 2726..2727, + id: "w", + ctx: Load, + }, + ), + Name( + ExprName { + range: 2729..2730, + id: "x", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + cases: [ + MatchCase { + range: 2736..2760, + pattern: MatchSequence( + PatternMatchSequence { + range: 2741..2745, + patterns: [ + MatchAs( + PatternMatchAs { + range: 2741..2742, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 2741..2742, + }, + ), + }, + ), + MatchAs( + PatternMatchAs { + range: 2744..2745, + pattern: None, + name: Some( + Identifier { + id: "z", + range: 2744..2745, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 2755..2760, + targets: [ + Name( + ExprName { + range: 2755..2756, + id: "v", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2759..2760, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 2783..2829, + subject: Tuple( + ExprTuple { + range: 2789..2796, + elts: [ + Named( + ExprNamed { + range: 2789..2795, + target: Name( + ExprName { + range: 2789..2790, + id: "w", + ctx: Store, + }, + ), + value: Name( + ExprName { + range: 2794..2795, + id: "x", + ctx: Load, + }, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + cases: [ + MatchCase { + range: 2802..2829, + pattern: MatchSequence( + PatternMatchSequence { + range: 2807..2814, + patterns: [ + MatchAs( + PatternMatchAs { + range: 2807..2813, + pattern: Some( + MatchAs( + PatternMatchAs { + range: 2807..2808, + pattern: None, + name: Some( + Identifier { + id: "y", + range: 2807..2808, + }, + ), + }, + ), + ), + name: Some( + Identifier { + id: "v", + range: 2812..2813, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 2824..2829, + targets: [ + Name( + ExprName { + range: 2824..2825, + id: "z", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 2828..2829, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 2831..2952, + subject: Name( + ExprName { + range: 2837..2838, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 2927..2952, + pattern: MatchValue( + PatternMatchValue { + range: 2932..2938, + value: FString( + ExprFString { + range: 2932..2938, + value: FStringValue { + inner: Single( + FString( + FString { + range: 2932..2938, + elements: [ + Expression( + FStringExpressionElement { + range: 2934..2937, + expression: Name( + ExprName { + range: 2935..2936, + id: "y", + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 2948..2952, + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 2953..3025, + subject: Dict( + ExprDict { + range: 2959..2970, + keys: [ + Some( + StringLiteral( + ExprStringLiteral { + range: 2960..2966, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 2960..2966, + value: "test", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + ], + values: [ + NumberLiteral( + ExprNumberLiteral { + range: 2968..2969, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + cases: [ + MatchCase { + range: 2976..3025, + pattern: MatchMapping( + PatternMatchMapping { + range: 2981..3004, + keys: [], + patterns: [], + rest: Some( + Identifier { + id: "rest", + range: 2993..2997, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3014..3025, + value: Call( + ExprCall { + range: 3014..3025, + func: Name( + ExprName { + range: 3014..3019, + id: "print", + ctx: Load, + }, + ), + arguments: Arguments { + range: 3019..3025, + args: [ + Name( + ExprName { + range: 3020..3024, + id: "rest", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 3026..3129, + subject: Dict( + ExprDict { + range: 3032..3049, + keys: [ + Some( + StringLiteral( + ExprStringLiteral { + range: 3033..3040, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 3033..3040, + value: "label", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + ], + values: [ + StringLiteral( + ExprStringLiteral { + range: 3042..3048, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 3042..3048, + value: "test", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + }, + ), + cases: [ + MatchCase { + range: 3055..3129, + pattern: MatchMapping( + PatternMatchMapping { + range: 3060..3107, + keys: [ + StringLiteral( + ExprStringLiteral { + range: 3070..3077, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 3070..3077, + value: "label", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + patterns: [ + MatchAs( + PatternMatchAs { + range: 3079..3100, + pattern: Some( + MatchOr( + PatternMatchOr { + range: 3079..3091, + patterns: [ + MatchClass( + PatternMatchClass { + range: 3079..3084, + cls: Name( + ExprName { + range: 3079..3082, + id: "str", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 3082..3084, + patterns: [], + keywords: [], + }, + }, + ), + MatchSingleton( + PatternMatchSingleton { + range: 3087..3091, + value: None, + }, + ), + ], + }, + ), + ), + name: Some( + Identifier { + id: "label", + range: 3095..3100, + }, + ), + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3117..3129, + value: Call( + ExprCall { + range: 3117..3129, + func: Name( + ExprName { + range: 3117..3122, + id: "print", + ctx: Load, + }, + ), + arguments: Arguments { + range: 3122..3129, + args: [ + Name( + ExprName { + range: 3123..3128, + id: "label", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 3130..3170, + subject: Name( + ExprName { + range: 3136..3137, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 3143..3170, + pattern: MatchSequence( + PatternMatchSequence { + range: 3148..3155, + patterns: [ + MatchValue( + PatternMatchValue { + range: 3149..3150, + value: NumberLiteral( + ExprNumberLiteral { + range: 3149..3150, + value: Int( + 0, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 3152..3153, + value: NumberLiteral( + ExprNumberLiteral { + range: 3152..3153, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 3165..3170, + targets: [ + Name( + ExprName { + range: 3165..3166, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 3169..3170, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 3171..3211, + subject: Name( + ExprName { + range: 3177..3178, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 3184..3211, + pattern: MatchSequence( + PatternMatchSequence { + range: 3189..3196, + patterns: [ + MatchValue( + PatternMatchValue { + range: 3190..3191, + value: NumberLiteral( + ExprNumberLiteral { + range: 3190..3191, + value: Int( + 0, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 3193..3194, + value: NumberLiteral( + ExprNumberLiteral { + range: 3193..3194, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 3206..3211, + targets: [ + Name( + ExprName { + range: 3206..3207, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 3210..3211, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 3212..3249, + subject: Name( + ExprName { + range: 3218..3219, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 3225..3249, + pattern: MatchSequence( + PatternMatchSequence { + range: 3230..3234, + patterns: [ + MatchValue( + PatternMatchValue { + range: 3231..3232, + value: NumberLiteral( + ExprNumberLiteral { + range: 3231..3232, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Assign( + StmtAssign { + range: 3244..3249, + targets: [ + Name( + ExprName { + range: 3244..3245, + id: "y", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 3248..3249, + value: Int( + 0, + ), + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 3250..3284, + subject: Tuple( + ExprTuple { + range: 3256..3258, + elts: [ + Name( + ExprName { + range: 3256..3257, + id: "x", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + cases: [ + MatchCase { + range: 3264..3284, + pattern: MatchAs( + PatternMatchAs { + range: 3269..3270, + pattern: None, + name: Some( + Identifier { + id: "z", + range: 3269..3270, + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 3280..3284, + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 3285..3321, + subject: Tuple( + ExprTuple { + range: 3291..3295, + elts: [ + Name( + ExprName { + range: 3291..3292, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 3294..3295, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + cases: [ + MatchCase { + range: 3301..3321, + pattern: MatchAs( + PatternMatchAs { + range: 3306..3307, + pattern: None, + name: Some( + Identifier { + id: "z", + range: 3306..3307, + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 3317..3321, + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 3322..3359, + subject: Tuple( + ExprTuple { + range: 3328..3333, + elts: [ + Name( + ExprName { + range: 3328..3329, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 3331..3332, + id: "y", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + cases: [ + MatchCase { + range: 3339..3359, + pattern: MatchAs( + PatternMatchAs { + range: 3344..3345, + pattern: None, + name: Some( + Identifier { + id: "z", + range: 3344..3345, + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 3355..3359, + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 3385..3475, + subject: Name( + ExprName { + range: 3391..3392, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 3398..3420, + pattern: MatchSingleton( + PatternMatchSingleton { + range: 3403..3407, + value: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3417..3420, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3417..3420, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3425..3447, + pattern: MatchSingleton( + PatternMatchSingleton { + range: 3430..3434, + value: True, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3444..3447, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3444..3447, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3452..3475, + pattern: MatchSingleton( + PatternMatchSingleton { + range: 3457..3462, + value: False, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3472..3475, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3472..3475, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 3497..3821, + subject: Name( + ExprName { + range: 3503..3504, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 3510..3531, + pattern: MatchValue( + PatternMatchValue { + range: 3515..3518, + value: Attribute( + ExprAttribute { + range: 3515..3518, + value: Name( + ExprName { + range: 3515..3516, + id: "a", + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 3517..3518, + }, + ctx: Load, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3528..3531, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3528..3531, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3536..3559, + pattern: MatchValue( + PatternMatchValue { + range: 3541..3546, + value: Attribute( + ExprAttribute { + range: 3541..3546, + value: Attribute( + ExprAttribute { + range: 3541..3544, + value: Name( + ExprName { + range: 3541..3542, + id: "a", + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 3543..3544, + }, + ctx: Load, + }, + ), + attr: Identifier { + id: "c", + range: 3545..3546, + }, + ctx: Load, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3556..3559, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3556..3559, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3564..3584, + pattern: MatchValue( + PatternMatchValue { + range: 3569..3571, + value: StringLiteral( + ExprStringLiteral { + range: 3569..3571, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 3569..3571, + value: "", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3581..3584, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3581..3584, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3589..3610, + pattern: MatchValue( + PatternMatchValue { + range: 3594..3597, + value: BytesLiteral( + ExprBytesLiteral { + range: 3594..3597, + value: BytesLiteralValue { + inner: Single( + BytesLiteral { + range: 3594..3597, + value: [], + flags: BytesLiteralFlags { + quote_style: Single, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3607..3610, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3607..3610, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3615..3634, + pattern: MatchValue( + PatternMatchValue { + range: 3620..3621, + value: NumberLiteral( + ExprNumberLiteral { + range: 3620..3621, + value: Int( + 1, + ), + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3631..3634, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3631..3634, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3639..3660, + pattern: MatchValue( + PatternMatchValue { + range: 3644..3647, + value: NumberLiteral( + ExprNumberLiteral { + range: 3644..3647, + value: Float( + 1.0, + ), + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3657..3660, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3657..3660, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3665..3687, + pattern: MatchValue( + PatternMatchValue { + range: 3670..3674, + value: NumberLiteral( + ExprNumberLiteral { + range: 3670..3674, + value: Complex { + real: 0.0, + imag: 1.0, + }, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3684..3687, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3684..3687, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3692..3716, + pattern: MatchValue( + PatternMatchValue { + range: 3697..3703, + value: BinOp( + ExprBinOp { + range: 3697..3703, + left: NumberLiteral( + ExprNumberLiteral { + range: 3697..3698, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 3701..3703, + value: Complex { + real: 0.0, + imag: 1.0, + }, + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3713..3716, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3713..3716, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3721..3741, + pattern: MatchValue( + PatternMatchValue { + range: 3726..3728, + value: UnaryOp( + ExprUnaryOp { + range: 3726..3728, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 3727..3728, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3738..3741, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3738..3741, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3746..3767, + pattern: MatchValue( + PatternMatchValue { + range: 3751..3754, + value: UnaryOp( + ExprUnaryOp { + range: 3751..3754, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 3752..3754, + value: Float( + 1.0, + ), + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3764..3767, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3764..3767, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3772..3795, + pattern: MatchValue( + PatternMatchValue { + range: 3777..3782, + value: UnaryOp( + ExprUnaryOp { + range: 3777..3782, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 3778..3782, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3792..3795, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3792..3795, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3800..3821, + pattern: MatchValue( + PatternMatchValue { + range: 3806..3807, + value: NumberLiteral( + ExprNumberLiteral { + range: 3806..3807, + value: Int( + 1, + ), + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3818..3821, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3818..3821, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 3840..3927, + subject: Name( + ExprName { + range: 3846..3847, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 3853..3876, + pattern: MatchOr( + PatternMatchOr { + range: 3858..3863, + patterns: [ + MatchValue( + PatternMatchValue { + range: 3858..3859, + value: NumberLiteral( + ExprNumberLiteral { + range: 3858..3859, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 3862..3863, + value: NumberLiteral( + ExprNumberLiteral { + range: 3862..3863, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3873..3876, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3873..3876, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3881..3927, + pattern: MatchOr( + PatternMatchOr { + range: 3886..3914, + patterns: [ + MatchValue( + PatternMatchValue { + range: 3886..3888, + value: StringLiteral( + ExprStringLiteral { + range: 3886..3888, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 3886..3888, + value: "", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 3891..3894, + value: NumberLiteral( + ExprNumberLiteral { + range: 3891..3894, + value: Float( + 1.1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 3897..3899, + value: UnaryOp( + ExprUnaryOp { + range: 3897..3899, + op: USub, + operand: NumberLiteral( + ExprNumberLiteral { + range: 3898..3899, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 3902..3908, + value: BinOp( + ExprBinOp { + range: 3902..3908, + left: NumberLiteral( + ExprNumberLiteral { + range: 3902..3903, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 3906..3908, + value: Complex { + real: 0.0, + imag: 1.0, + }, + }, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 3911..3914, + value: Attribute( + ExprAttribute { + range: 3911..3914, + value: Name( + ExprName { + range: 3911..3912, + id: "a", + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 3913..3914, + }, + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3924..3927, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3924..3927, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 3946..4163, + subject: Name( + ExprName { + range: 3952..3953, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 3959..3978, + pattern: MatchAs( + PatternMatchAs { + range: 3964..3965, + pattern: None, + name: Some( + Identifier { + id: "a", + range: 3964..3965, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 3975..3978, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 3975..3978, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 3983..4007, + pattern: MatchAs( + PatternMatchAs { + range: 3988..3994, + pattern: Some( + MatchAs( + PatternMatchAs { + range: 3988..3989, + pattern: None, + name: Some( + Identifier { + id: "a", + range: 3988..3989, + }, + ), + }, + ), + ), + name: Some( + Identifier { + id: "b", + range: 3993..3994, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4004..4007, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4004..4007, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4012..4042, + pattern: MatchAs( + PatternMatchAs { + range: 4017..4029, + pattern: Some( + MatchOr( + PatternMatchOr { + range: 4017..4022, + patterns: [ + MatchValue( + PatternMatchValue { + range: 4017..4018, + value: NumberLiteral( + ExprNumberLiteral { + range: 4017..4018, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4021..4022, + value: NumberLiteral( + ExprNumberLiteral { + range: 4021..4022, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ), + ), + name: Some( + Identifier { + id: "two", + range: 4026..4029, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4039..4042, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4039..4042, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4047..4078, + pattern: MatchAs( + PatternMatchAs { + range: 4052..4065, + pattern: Some( + MatchValue( + PatternMatchValue { + range: 4052..4058, + value: BinOp( + ExprBinOp { + range: 4052..4058, + left: NumberLiteral( + ExprNumberLiteral { + range: 4052..4053, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 4056..4058, + value: Complex { + real: 0.0, + imag: 3.0, + }, + }, + ), + }, + ), + }, + ), + ), + name: Some( + Identifier { + id: "sum", + range: 4062..4065, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4075..4078, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4075..4078, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4083..4110, + pattern: MatchAs( + PatternMatchAs { + range: 4088..4097, + pattern: Some( + MatchValue( + PatternMatchValue { + range: 4088..4091, + value: Attribute( + ExprAttribute { + range: 4088..4091, + value: Name( + ExprName { + range: 4088..4089, + id: "a", + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 4090..4091, + }, + ctx: Load, + }, + ), + }, + ), + ), + name: Some( + Identifier { + id: "ab", + range: 4095..4097, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4107..4110, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4107..4110, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4115..4134, + pattern: MatchAs( + PatternMatchAs { + range: 4120..4121, + pattern: None, + name: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4131..4134, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4131..4134, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4139..4163, + pattern: MatchAs( + PatternMatchAs { + range: 4144..4150, + pattern: Some( + MatchAs( + PatternMatchAs { + range: 4144..4145, + pattern: None, + name: None, + }, + ), + ), + name: Some( + Identifier { + id: "x", + range: 4149..4150, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4160..4163, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4160..4163, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 4188..4439, + subject: Name( + ExprName { + range: 4194..4195, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 4201..4226, + pattern: MatchSequence( + PatternMatchSequence { + range: 4206..4213, + patterns: [ + MatchValue( + PatternMatchValue { + range: 4206..4207, + value: NumberLiteral( + ExprNumberLiteral { + range: 4206..4207, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4209..4210, + value: NumberLiteral( + ExprNumberLiteral { + range: 4209..4210, + value: Int( + 2, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4212..4213, + value: NumberLiteral( + ExprNumberLiteral { + range: 4212..4213, + value: Int( + 3, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4223..4226, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4223..4226, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4231..4259, + pattern: MatchSequence( + PatternMatchSequence { + range: 4236..4246, + patterns: [ + MatchValue( + PatternMatchValue { + range: 4237..4238, + value: NumberLiteral( + ExprNumberLiteral { + range: 4237..4238, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4240..4241, + value: NumberLiteral( + ExprNumberLiteral { + range: 4240..4241, + value: Int( + 2, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4243..4244, + value: NumberLiteral( + ExprNumberLiteral { + range: 4243..4244, + value: Int( + 3, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4256..4259, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4256..4259, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4264..4304, + pattern: MatchSequence( + PatternMatchSequence { + range: 4269..4291, + patterns: [ + MatchValue( + PatternMatchValue { + range: 4270..4276, + value: BinOp( + ExprBinOp { + range: 4270..4276, + left: NumberLiteral( + ExprNumberLiteral { + range: 4270..4271, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 4274..4276, + value: Complex { + real: 0.0, + imag: 2.0, + }, + }, + ), + }, + ), + }, + ), + MatchAs( + PatternMatchAs { + range: 4278..4279, + pattern: None, + name: Some( + Identifier { + id: "a", + range: 4278..4279, + }, + ), + }, + ), + MatchSingleton( + PatternMatchSingleton { + range: 4281..4285, + value: None, + }, + ), + MatchValue( + PatternMatchValue { + range: 4287..4290, + value: Attribute( + ExprAttribute { + range: 4287..4290, + value: Name( + ExprName { + range: 4287..4288, + id: "a", + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 4289..4290, + }, + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4301..4304, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4301..4304, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4309..4343, + pattern: MatchAs( + PatternMatchAs { + range: 4314..4330, + pattern: Some( + MatchSequence( + PatternMatchSequence { + range: 4314..4325, + patterns: [ + MatchAs( + PatternMatchAs { + range: 4315..4321, + pattern: Some( + MatchValue( + PatternMatchValue { + range: 4315..4316, + value: NumberLiteral( + ExprNumberLiteral { + range: 4315..4316, + value: Int( + 1, + ), + }, + ), + }, + ), + ), + name: Some( + Identifier { + id: "X", + range: 4320..4321, + }, + ), + }, + ), + MatchAs( + PatternMatchAs { + range: 4323..4324, + pattern: None, + name: Some( + Identifier { + id: "b", + range: 4323..4324, + }, + ), + }, + ), + ], + }, + ), + ), + name: Some( + Identifier { + id: "S", + range: 4329..4330, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4340..4343, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4340..4343, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4348..4380, + pattern: MatchSequence( + PatternMatchSequence { + range: 4353..4367, + patterns: [ + MatchValue( + PatternMatchValue { + range: 4354..4355, + value: NumberLiteral( + ExprNumberLiteral { + range: 4354..4355, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4357..4358, + value: NumberLiteral( + ExprNumberLiteral { + range: 4357..4358, + value: Int( + 2, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4360..4366, + value: BinOp( + ExprBinOp { + range: 4360..4366, + left: NumberLiteral( + ExprNumberLiteral { + range: 4360..4361, + value: Int( + 3, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 4364..4366, + value: Complex { + real: 0.0, + imag: 1.0, + }, + }, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4377..4380, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4377..4380, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4385..4413, + pattern: MatchSequence( + PatternMatchSequence { + range: 4390..4400, + patterns: [ + MatchSequence( + PatternMatchSequence { + range: 4391..4396, + patterns: [ + MatchValue( + PatternMatchValue { + range: 4392..4393, + value: NumberLiteral( + ExprNumberLiteral { + range: 4392..4393, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4394..4395, + value: NumberLiteral( + ExprNumberLiteral { + range: 4394..4395, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ), + MatchValue( + PatternMatchValue { + range: 4398..4399, + value: NumberLiteral( + ExprNumberLiteral { + range: 4398..4399, + value: Int( + 3, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4410..4413, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4410..4413, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4418..4439, + pattern: MatchSequence( + PatternMatchSequence { + range: 4423..4426, + patterns: [ + MatchValue( + PatternMatchValue { + range: 4424..4425, + value: NumberLiteral( + ExprNumberLiteral { + range: 4424..4425, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4436..4439, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4436..4439, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 4460..4589, + subject: Name( + ExprName { + range: 4466..4467, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 4473..4494, + pattern: MatchSequence( + PatternMatchSequence { + range: 4478..4481, + patterns: [ + MatchStar( + PatternMatchStar { + range: 4478..4480, + name: Some( + Identifier { + id: "a", + range: 4479..4480, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4491..4494, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4491..4494, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4499..4520, + pattern: MatchSequence( + PatternMatchSequence { + range: 4504..4507, + patterns: [ + MatchStar( + PatternMatchStar { + range: 4504..4506, + name: None, + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4517..4520, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4517..4520, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4525..4556, + pattern: MatchSequence( + PatternMatchSequence { + range: 4530..4543, + patterns: [ + MatchValue( + PatternMatchValue { + range: 4531..4532, + value: NumberLiteral( + ExprNumberLiteral { + range: 4531..4532, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4534..4535, + value: NumberLiteral( + ExprNumberLiteral { + range: 4534..4535, + value: Int( + 2, + ), + }, + ), + }, + ), + MatchStar( + PatternMatchStar { + range: 4537..4542, + name: Some( + Identifier { + id: "rest", + range: 4538..4542, + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4553..4556, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4553..4556, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4561..4589, + pattern: MatchSequence( + PatternMatchSequence { + range: 4566..4576, + patterns: [ + MatchStar( + PatternMatchStar { + range: 4567..4569, + name: None, + }, + ), + MatchValue( + PatternMatchValue { + range: 4571..4572, + value: NumberLiteral( + ExprNumberLiteral { + range: 4571..4572, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4574..4575, + value: NumberLiteral( + ExprNumberLiteral { + range: 4574..4575, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4586..4589, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4586..4589, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 4611..4883, + subject: Name( + ExprName { + range: 4617..4618, + id: "x", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 4624..4649, + pattern: MatchClass( + PatternMatchClass { + range: 4629..4636, + cls: Name( + ExprName { + range: 4629..4634, + id: "Point", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 4634..4636, + patterns: [], + keywords: [], + }, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4646..4649, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4646..4649, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4654..4683, + pattern: MatchClass( + PatternMatchClass { + range: 4659..4670, + cls: Attribute( + ExprAttribute { + range: 4659..4668, + value: Attribute( + ExprAttribute { + range: 4659..4662, + value: Name( + ExprName { + range: 4659..4660, + id: "a", + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 4661..4662, + }, + ctx: Load, + }, + ), + attr: Identifier { + id: "Point", + range: 4663..4668, + }, + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 4668..4670, + patterns: [], + keywords: [], + }, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4680..4683, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4680..4683, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4688..4718, + pattern: MatchClass( + PatternMatchClass { + range: 4693..4705, + cls: Name( + ExprName { + range: 4693..4700, + id: "Point2D", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 4700..4705, + patterns: [], + keywords: [ + PatternKeyword { + range: 4701..4704, + attr: Identifier { + id: "x", + range: 4701..4702, + }, + pattern: MatchValue( + PatternMatchValue { + range: 4703..4704, + value: NumberLiteral( + ExprNumberLiteral { + range: 4703..4704, + value: Int( + 0, + ), + }, + ), + }, + ), + }, + ], + }, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4715..4718, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4715..4718, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4723..4759, + pattern: MatchClass( + PatternMatchClass { + range: 4728..4746, + cls: Name( + ExprName { + range: 4728..4735, + id: "Point2D", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 4735..4746, + patterns: [], + keywords: [ + PatternKeyword { + range: 4736..4739, + attr: Identifier { + id: "x", + range: 4736..4737, + }, + pattern: MatchValue( + PatternMatchValue { + range: 4738..4739, + value: NumberLiteral( + ExprNumberLiteral { + range: 4738..4739, + value: Int( + 0, + ), + }, + ), + }, + ), + }, + PatternKeyword { + range: 4741..4744, + attr: Identifier { + id: "y", + range: 4741..4742, + }, + pattern: MatchValue( + PatternMatchValue { + range: 4743..4744, + value: NumberLiteral( + ExprNumberLiteral { + range: 4743..4744, + value: Int( + 0, + ), + }, + ), + }, + ), + }, + ], + }, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4756..4759, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4756..4759, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4764..4795, + pattern: MatchClass( + PatternMatchClass { + range: 4769..4782, + cls: Name( + ExprName { + range: 4769..4776, + id: "Point2D", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 4776..4782, + patterns: [ + MatchValue( + PatternMatchValue { + range: 4777..4778, + value: NumberLiteral( + ExprNumberLiteral { + range: 4777..4778, + value: Int( + 0, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4780..4781, + value: NumberLiteral( + ExprNumberLiteral { + range: 4780..4781, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4792..4795, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4792..4795, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4800..4838, + pattern: MatchClass( + PatternMatchClass { + range: 4805..4825, + cls: Name( + ExprName { + range: 4805..4812, + id: "Point2D", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 4812..4825, + patterns: [ + MatchSequence( + PatternMatchSequence { + range: 4813..4819, + patterns: [ + MatchValue( + PatternMatchValue { + range: 4814..4815, + value: NumberLiteral( + ExprNumberLiteral { + range: 4814..4815, + value: Int( + 0, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4817..4818, + value: NumberLiteral( + ExprNumberLiteral { + range: 4817..4818, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + ), + ], + keywords: [ + PatternKeyword { + range: 4821..4824, + attr: Identifier { + id: "y", + range: 4821..4822, + }, + pattern: MatchValue( + PatternMatchValue { + range: 4823..4824, + value: NumberLiteral( + ExprNumberLiteral { + range: 4823..4824, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ], + }, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4835..4838, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4835..4838, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4843..4883, + pattern: MatchClass( + PatternMatchClass { + range: 4848..4870, + cls: Name( + ExprName { + range: 4848..4855, + id: "Point2D", + ctx: Load, + }, + ), + arguments: PatternArguments { + range: 4855..4870, + patterns: [], + keywords: [ + PatternKeyword { + range: 4856..4864, + attr: Identifier { + id: "x", + range: 4856..4857, + }, + pattern: MatchSequence( + PatternMatchSequence { + range: 4858..4864, + patterns: [ + MatchValue( + PatternMatchValue { + range: 4859..4860, + value: NumberLiteral( + ExprNumberLiteral { + range: 4859..4860, + value: Int( + 0, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4862..4863, + value: NumberLiteral( + ExprNumberLiteral { + range: 4862..4863, + value: Int( + 1, + ), + }, + ), + }, + ), + ], + }, + ), + }, + PatternKeyword { + range: 4866..4869, + attr: Identifier { + id: "y", + range: 4866..4867, + }, + pattern: MatchValue( + PatternMatchValue { + range: 4868..4869, + value: NumberLiteral( + ExprNumberLiteral { + range: 4868..4869, + value: Int( + 1, + ), + }, + ), + }, + ), + }, + ], + }, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4880..4883, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4880..4883, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 4907..5001, + subject: Named( + ExprNamed { + range: 4913..4919, + target: Name( + ExprName { + range: 4913..4914, + id: "x", + ctx: Store, + }, + ), + value: Name( + ExprName { + range: 4918..4919, + id: "b", + ctx: Load, + }, + ), + }, + ), + cases: [ + MatchCase { + range: 4925..4949, + pattern: MatchMapping( + PatternMatchMapping { + range: 4930..4936, + keys: [ + NumberLiteral( + ExprNumberLiteral { + range: 4931..4932, + value: Int( + 1, + ), + }, + ), + ], + patterns: [ + MatchAs( + PatternMatchAs { + range: 4934..4935, + pattern: None, + name: None, + }, + ), + ], + rest: None, + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4946..4949, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4946..4949, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 4954..5001, + pattern: MatchMapping( + PatternMatchMapping { + range: 4959..4988, + keys: [ + StringLiteral( + ExprStringLiteral { + range: 4960..4962, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 4960..4962, + value: "", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + NoneLiteral( + ExprNoneLiteral { + range: 4967..4971, + }, + ), + ], + patterns: [ + MatchAs( + PatternMatchAs { + range: 4964..4965, + pattern: None, + name: Some( + Identifier { + id: "a", + range: 4964..4965, + }, + ), + }, + ), + MatchSequence( + PatternMatchSequence { + range: 4973..4979, + patterns: [ + MatchValue( + PatternMatchValue { + range: 4974..4975, + value: NumberLiteral( + ExprNumberLiteral { + range: 4974..4975, + value: Int( + 1, + ), + }, + ), + }, + ), + MatchValue( + PatternMatchValue { + range: 4977..4978, + value: NumberLiteral( + ExprNumberLiteral { + range: 4977..4978, + value: Int( + 2, + ), + }, + ), + }, + ), + ], + }, + ), + ], + rest: Some( + Identifier { + id: "rest", + range: 4983..4987, + }, + ), + }, + ), + guard: None, + body: [ + Expr( + StmtExpr { + range: 4998..5001, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 4998..5001, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Match( + StmtMatch { + range: 5019..5079, + subject: Name( + ExprName { + range: 5025..5026, + id: "y", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 5032..5053, + pattern: MatchAs( + PatternMatchAs { + range: 5037..5038, + pattern: None, + name: Some( + Identifier { + id: "a", + range: 5037..5038, + }, + ), + }, + ), + guard: Some( + Named( + ExprNamed { + range: 5042..5048, + target: Name( + ExprName { + range: 5042..5043, + id: "b", + ctx: Store, + }, + ), + value: Name( + ExprName { + range: 5047..5048, + id: "c", + ctx: Load, + }, + ), + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 5050..5053, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 5050..5053, + }, + ), + }, + ), + ], + }, + MatchCase { + range: 5058..5079, + pattern: MatchAs( + PatternMatchAs { + range: 5063..5064, + pattern: None, + name: Some( + Identifier { + id: "e", + range: 5063..5064, + }, + ), + }, + ), + guard: Some( + Compare( + ExprCompare { + range: 5069..5074, + left: NumberLiteral( + ExprNumberLiteral { + range: 5069..5070, + value: Int( + 1, + ), + }, + ), + ops: [ + Lt, + ], + comparators: [ + NumberLiteral( + ExprNumberLiteral { + range: 5073..5074, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + ), + body: [ + Expr( + StmtExpr { + range: 5076..5079, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 5076..5079, + }, + ), + }, + ), + ], + }, + ], + }, + ), + Expr( + StmtExpr { + range: 5108..5123, + value: Tuple( + ExprTuple { + range: 5108..5123, + elts: [ + BinOp( + ExprBinOp { + range: 5108..5120, + left: BinOp( + ExprBinOp { + range: 5108..5116, + left: Name( + ExprName { + range: 5108..5113, + id: "match", + ctx: Load, + }, + ), + op: Mult, + right: Name( + ExprName { + range: 5115..5116, + id: "a", + ctx: Load, + }, + ), + }, + ), + op: Add, + right: Name( + ExprName { + range: 5119..5120, + id: "b", + ctx: Load, + }, + ), + }, + ), + Name( + ExprName { + range: 5122..5123, + id: "c", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5149..5166, + value: Tuple( + ExprTuple { + range: 5149..5166, + elts: [ + BinOp( + ExprBinOp { + range: 5149..5163, + left: Name( + ExprName { + range: 5149..5154, + id: "match", + ctx: Load, + }, + ), + op: Mult, + right: BinOp( + ExprBinOp { + range: 5157..5162, + left: Name( + ExprName { + range: 5157..5158, + id: "a", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 5161..5162, + id: "b", + ctx: Load, + }, + ), + }, + ), + }, + ), + Name( + ExprName { + range: 5165..5166, + id: "c", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5192..5209, + value: Call( + ExprCall { + range: 5192..5209, + func: Name( + ExprName { + range: 5192..5197, + id: "match", + ctx: Load, + }, + ), + arguments: Arguments { + range: 5198..5209, + args: [ + Starred( + ExprStarred { + range: 5199..5205, + value: BinOp( + ExprBinOp { + range: 5200..5205, + left: Name( + ExprName { + range: 5200..5201, + id: "a", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 5204..5205, + id: "b", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 5207..5208, + id: "c", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5236..5252, + value: BinOp( + ExprBinOp { + range: 5236..5252, + left: BinOp( + ExprBinOp { + range: 5236..5248, + left: Name( + ExprName { + range: 5236..5241, + id: "match", + ctx: Load, + }, + ), + op: Sub, + right: BinOp( + ExprBinOp { + range: 5243..5248, + left: Name( + ExprName { + range: 5243..5244, + id: "a", + ctx: Load, + }, + ), + op: Mult, + right: Name( + ExprName { + range: 5247..5248, + id: "b", + ctx: Load, + }, + ), + }, + ), + }, + ), + op: Add, + right: Name( + ExprName { + range: 5251..5252, + id: "c", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5279..5297, + value: BinOp( + ExprBinOp { + range: 5279..5297, + left: BinOp( + ExprBinOp { + range: 5279..5293, + left: Name( + ExprName { + range: 5279..5284, + id: "match", + ctx: Load, + }, + ), + op: Sub, + right: BinOp( + ExprBinOp { + range: 5287..5292, + left: Name( + ExprName { + range: 5287..5288, + id: "a", + ctx: Load, + }, + ), + op: Mult, + right: Name( + ExprName { + range: 5291..5292, + id: "b", + ctx: Load, + }, + ), + }, + ), + }, + ), + op: Add, + right: Name( + ExprName { + range: 5296..5297, + id: "c", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5324..5342, + value: BinOp( + ExprBinOp { + range: 5324..5342, + left: BinOp( + ExprBinOp { + range: 5324..5338, + left: Call( + ExprCall { + range: 5324..5334, + func: Name( + ExprName { + range: 5324..5329, + id: "match", + ctx: Load, + }, + ), + arguments: Arguments { + range: 5330..5334, + args: [ + UnaryOp( + ExprUnaryOp { + range: 5331..5333, + op: USub, + operand: Name( + ExprName { + range: 5332..5333, + id: "a", + ctx: Load, + }, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + op: Mult, + right: Name( + ExprName { + range: 5337..5338, + id: "b", + ctx: Load, + }, + ), + }, + ), + op: Add, + right: Name( + ExprName { + range: 5341..5342, + id: "c", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5370..5380, + value: Attribute( + ExprAttribute { + range: 5370..5380, + value: Call( + ExprCall { + range: 5370..5378, + func: Name( + ExprName { + range: 5370..5375, + id: "match", + ctx: Load, + }, + ), + arguments: Arguments { + range: 5376..5378, + args: [], + keywords: [], + }, + }, + ), + attr: Identifier { + id: "a", + range: 5379..5380, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5397..5409, + value: Attribute( + ExprAttribute { + range: 5397..5409, + value: Call( + ExprCall { + range: 5397..5407, + func: Name( + ExprName { + range: 5397..5402, + id: "match", + ctx: Load, + }, + ), + arguments: Arguments { + range: 5403..5407, + args: [ + Tuple( + ExprTuple { + range: 5404..5406, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + ], + keywords: [], + }, + }, + ), + attr: Identifier { + id: "a", + range: 5408..5409, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5428..5441, + value: Attribute( + ExprAttribute { + range: 5428..5441, + value: Call( + ExprCall { + range: 5428..5439, + func: Name( + ExprName { + range: 5428..5433, + id: "match", + ctx: Load, + }, + ), + arguments: Arguments { + range: 5434..5439, + args: [ + Tuple( + ExprTuple { + range: 5435..5437, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + ], + keywords: [], + }, + }, + ), + attr: Identifier { + id: "a", + range: 5440..5441, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5460..5471, + value: Attribute( + ExprAttribute { + range: 5460..5471, + value: Subscript( + ExprSubscript { + range: 5460..5469, + value: Name( + ExprName { + range: 5460..5465, + id: "match", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 5467..5468, + id: "a", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 5470..5471, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5489..5501, + value: Attribute( + ExprAttribute { + range: 5489..5501, + value: Subscript( + ExprSubscript { + range: 5489..5499, + value: Name( + ExprName { + range: 5489..5494, + id: "match", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 5496..5498, + elts: [ + Name( + ExprName { + range: 5496..5497, + id: "a", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 5500..5501, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5542..5556, + value: Attribute( + ExprAttribute { + range: 5542..5556, + value: Subscript( + ExprSubscript { + range: 5542..5554, + value: Name( + ExprName { + range: 5542..5547, + id: "match", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 5549..5553, + elts: [ + Name( + ExprName { + range: 5550..5551, + id: "a", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 5555..5556, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5577..5594, + value: Subscript( + ExprSubscript { + range: 5577..5594, + value: Call( + ExprCall { + range: 5577..5584, + func: Name( + ExprName { + range: 5577..5582, + id: "match", + ctx: Load, + }, + ), + arguments: Arguments { + range: 5582..5584, + args: [], + keywords: [], + }, + }, + ), + slice: Slice( + ExprSlice { + range: 5585..5593, + lower: Some( + Name( + ExprName { + range: 5585..5586, + id: "a", + ctx: Load, + }, + ), + ), + upper: Some( + Name( + ExprName { + range: 5592..5593, + id: "b", + ctx: Load, + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + If( + StmtIf { + range: 5614..5633, + test: Named( + ExprNamed { + range: 5617..5627, + target: Name( + ExprName { + range: 5617..5622, + id: "match", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 5626..5627, + value: Int( + 1, + ), + }, + ), + }, + ), + body: [ + Pass( + StmtPass { + range: 5629..5633, + }, + ), + ], + elif_else_clauses: [], + }, + ), + Match( + StmtMatch { + range: 5634..5688, + subject: Name( + ExprName { + range: 5640..5645, + id: "match", + ctx: Load, + }, + ), + cases: [ + MatchCase { + range: 5651..5663, + pattern: MatchValue( + PatternMatchValue { + range: 5656..5657, + value: NumberLiteral( + ExprNumberLiteral { + range: 5656..5657, + value: Int( + 1, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 5659..5663, + }, + ), + ], + }, + MatchCase { + range: 5668..5688, + pattern: MatchValue( + PatternMatchValue { + range: 5673..5674, + value: NumberLiteral( + ExprNumberLiteral { + range: 5673..5674, + value: Int( + 2, + ), + }, + ), + }, + ), + guard: None, + body: [ + Pass( + StmtPass { + range: 5684..5688, + }, + ), + ], + }, + ], + }, + ), + Assign( + StmtAssign { + range: 5689..5725, + targets: [ + Name( + ExprName { + range: 5689..5694, + id: "match", + ctx: Store, + }, + ), + ], + value: Lambda( + ExprLambda { + range: 5697..5725, + parameters: Some( + Parameters { + range: 5704..5709, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 5704..5709, + parameter: Parameter { + range: 5704..5709, + name: Identifier { + id: "query", + range: 5704..5709, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Compare( + ExprCompare { + range: 5711..5725, + left: Name( + ExprName { + range: 5711..5716, + id: "query", + ctx: Load, + }, + ), + ops: [ + Eq, + ], + comparators: [ + Name( + ExprName { + range: 5720..5725, + id: "event", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 5726..5742, + value: Call( + ExprCall { + range: 5726..5742, + func: Name( + ExprName { + range: 5726..5731, + id: "print", + ctx: Load, + }, + ), + arguments: Arguments { + range: 5731..5742, + args: [ + Call( + ExprCall { + range: 5732..5741, + func: Name( + ExprName { + range: 5732..5737, + id: "match", + ctx: Load, + }, + ), + arguments: Arguments { + range: 5737..5741, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 5738..5740, + value: Int( + 12, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__raise.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__raise.py.snap new file mode 100644 index 0000000000..ec27a9479a --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__raise.py.snap @@ -0,0 +1,490 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/raise.py +--- +## AST + +``` +Module( + ModModule { + range: 0..289, + body: [ + Raise( + StmtRaise { + range: 8..13, + exc: None, + cause: None, + }, + ), + Raise( + StmtRaise { + range: 14..21, + exc: Some( + Name( + ExprName { + range: 20..21, + id: "a", + ctx: Load, + }, + ), + ), + cause: None, + }, + ), + Raise( + StmtRaise { + range: 22..34, + exc: Some( + Tuple( + ExprTuple { + range: 28..34, + elts: [ + Name( + ExprName { + range: 29..30, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 32..33, + id: "b", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ), + cause: None, + }, + ), + Raise( + StmtRaise { + range: 35..46, + exc: Some( + Compare( + ExprCompare { + range: 41..46, + left: NumberLiteral( + ExprNumberLiteral { + range: 41..42, + value: Int( + 1, + ), + }, + ), + ops: [ + Lt, + ], + comparators: [ + NumberLiteral( + ExprNumberLiteral { + range: 45..46, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + ), + cause: None, + }, + ), + Raise( + StmtRaise { + range: 47..60, + exc: Some( + BoolOp( + ExprBoolOp { + range: 53..60, + op: And, + values: [ + Name( + ExprName { + range: 53..54, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 59..60, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + ), + cause: None, + }, + ), + Raise( + StmtRaise { + range: 61..78, + exc: Some( + Lambda( + ExprLambda { + range: 67..78, + parameters: Some( + Parameters { + range: 74..75, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 74..75, + parameter: Parameter { + range: 74..75, + name: Identifier { + id: "x", + range: 74..75, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 77..78, + id: "y", + ctx: Load, + }, + ), + }, + ), + ), + cause: None, + }, + ), + Raise( + StmtRaise { + range: 79..92, + exc: Some( + Await( + ExprAwait { + range: 85..92, + value: Name( + ExprName { + range: 91..92, + id: "x", + ctx: Load, + }, + ), + }, + ), + ), + cause: None, + }, + ), + Raise( + StmtRaise { + range: 93..115, + exc: Some( + If( + ExprIf { + range: 99..115, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 104..108, + value: true, + }, + ), + body: Name( + ExprName { + range: 99..100, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 114..115, + id: "y", + ctx: Load, + }, + ), + }, + ), + ), + cause: None, + }, + ), + Raise( + StmtRaise { + range: 138..152, + exc: Some( + Name( + ExprName { + range: 144..145, + id: "x", + ctx: Load, + }, + ), + ), + cause: Some( + Name( + ExprName { + range: 151..152, + id: "a", + ctx: Load, + }, + ), + ), + }, + ), + Raise( + StmtRaise { + range: 153..172, + exc: Some( + Name( + ExprName { + range: 159..160, + id: "x", + ctx: Load, + }, + ), + ), + cause: Some( + Tuple( + ExprTuple { + range: 166..172, + elts: [ + Name( + ExprName { + range: 167..168, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 170..171, + id: "b", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ), + }, + ), + Raise( + StmtRaise { + range: 173..191, + exc: Some( + Name( + ExprName { + range: 179..180, + id: "x", + ctx: Load, + }, + ), + ), + cause: Some( + Compare( + ExprCompare { + range: 186..191, + left: NumberLiteral( + ExprNumberLiteral { + range: 186..187, + value: Int( + 1, + ), + }, + ), + ops: [ + Lt, + ], + comparators: [ + NumberLiteral( + ExprNumberLiteral { + range: 190..191, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + ), + }, + ), + Raise( + StmtRaise { + range: 192..212, + exc: Some( + Name( + ExprName { + range: 198..199, + id: "x", + ctx: Load, + }, + ), + ), + cause: Some( + BoolOp( + ExprBoolOp { + range: 205..212, + op: And, + values: [ + Name( + ExprName { + range: 205..206, + id: "a", + ctx: Load, + }, + ), + Name( + ExprName { + range: 211..212, + id: "b", + ctx: Load, + }, + ), + ], + }, + ), + ), + }, + ), + Raise( + StmtRaise { + range: 213..237, + exc: Some( + Name( + ExprName { + range: 219..220, + id: "x", + ctx: Load, + }, + ), + ), + cause: Some( + Lambda( + ExprLambda { + range: 226..237, + parameters: Some( + Parameters { + range: 233..234, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 233..234, + parameter: Parameter { + range: 233..234, + name: Identifier { + id: "x", + range: 233..234, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 236..237, + id: "y", + ctx: Load, + }, + ), + }, + ), + ), + }, + ), + Raise( + StmtRaise { + range: 238..258, + exc: Some( + Name( + ExprName { + range: 244..245, + id: "x", + ctx: Load, + }, + ), + ), + cause: Some( + Await( + ExprAwait { + range: 251..258, + value: Name( + ExprName { + range: 257..258, + id: "x", + ctx: Load, + }, + ), + }, + ), + ), + }, + ), + Raise( + StmtRaise { + range: 259..288, + exc: Some( + Name( + ExprName { + range: 265..266, + id: "x", + ctx: Load, + }, + ), + ), + cause: Some( + If( + ExprIf { + range: 272..288, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 277..281, + value: true, + }, + ), + body: Name( + ExprName { + range: 272..273, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 287..288, + id: "y", + ctx: Load, + }, + ), + }, + ), + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__return.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__return.py.snap new file mode 100644 index 0000000000..056479e918 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__return.py.snap @@ -0,0 +1,382 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/return.py +--- +## AST + +``` +Module( + ModModule { + range: 0..191, + body: [ + Return( + StmtReturn { + range: 0..6, + value: None, + }, + ), + Return( + StmtReturn { + range: 7..15, + value: Some( + Name( + ExprName { + range: 14..15, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 16..25, + value: Some( + Starred( + ExprStarred { + range: 23..25, + value: Name( + ExprName { + range: 24..25, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 26..39, + value: Some( + Starred( + ExprStarred { + range: 33..39, + value: BinOp( + ExprBinOp { + range: 34..39, + left: Name( + ExprName { + range: 34..35, + id: "x", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 38..39, + id: "y", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 40..53, + value: Some( + Tuple( + ExprTuple { + range: 47..53, + elts: [ + Starred( + ExprStarred { + range: 47..49, + value: Name( + ExprName { + range: 48..49, + id: "x", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 51..53, + value: Name( + ExprName { + range: 52..53, + id: "y", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 54..69, + value: Some( + Named( + ExprNamed { + range: 62..68, + target: Name( + ExprName { + range: 62..63, + id: "x", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 67..68, + value: Int( + 1, + ), + }, + ), + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 70..81, + value: Some( + NoneLiteral( + ExprNoneLiteral { + range: 77..81, + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 82..96, + value: Some( + BoolOp( + ExprBoolOp { + range: 89..96, + op: And, + values: [ + Name( + ExprName { + range: 89..90, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 95..96, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 97..109, + value: Some( + Compare( + ExprCompare { + range: 104..109, + left: NumberLiteral( + ExprNumberLiteral { + range: 104..105, + value: Int( + 1, + ), + }, + ), + ops: [ + Lt, + ], + comparators: [ + NumberLiteral( + ExprNumberLiteral { + range: 108..109, + value: Int( + 2, + ), + }, + ), + ], + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 110..122, + value: Some( + Tuple( + ExprTuple { + range: 117..122, + elts: [ + NumberLiteral( + ExprNumberLiteral { + range: 117..118, + value: Int( + 1, + ), + }, + ), + NumberLiteral( + ExprNumberLiteral { + range: 120..121, + value: Int( + 2, + ), + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 123..136, + value: Some( + Call( + ExprCall { + range: 130..136, + func: Name( + ExprName { + range: 130..134, + id: "call", + ctx: Load, + }, + ), + arguments: Arguments { + range: 134..136, + args: [], + keywords: [], + }, + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 137..156, + value: Some( + Call( + ExprCall { + range: 144..156, + func: Attribute( + ExprAttribute { + range: 144..154, + value: Name( + ExprName { + range: 144..148, + id: "attr", + ctx: Load, + }, + ), + attr: Identifier { + id: "value", + range: 149..154, + }, + ctx: Load, + }, + ), + arguments: Arguments { + range: 154..156, + args: [], + keywords: [], + }, + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 157..171, + value: Some( + Await( + ExprAwait { + range: 164..171, + value: Name( + ExprName { + range: 170..171, + id: "x", + ctx: Load, + }, + ), + }, + ), + ), + }, + ), + Return( + StmtReturn { + range: 172..190, + value: Some( + Lambda( + ExprLambda { + range: 179..190, + parameters: Some( + Parameters { + range: 186..187, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 186..187, + parameter: Parameter { + range: 186..187, + name: Identifier { + id: "x", + range: 186..187, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 189..190, + id: "y", + ctx: Load, + }, + ), + }, + ), + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__simple.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__simple.py.snap new file mode 100644 index 0000000000..257c1d0bc4 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__simple.py.snap @@ -0,0 +1,248 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/simple.py +--- +## AST + +``` +Module( + ModModule { + range: 0..172, + body: [ + Continue( + StmtContinue { + range: 61..69, + }, + ), + Break( + StmtBreak { + range: 70..75, + }, + ), + If( + StmtIf { + range: 77..86, + test: Name( + ExprName { + range: 80..81, + id: "x", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 83..86, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 83..86, + }, + ), + }, + ), + ], + elif_else_clauses: [], + }, + ), + If( + StmtIf { + range: 87..100, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 90..94, + value: true, + }, + ), + body: [ + Pass( + StmtPass { + range: 96..100, + }, + ), + ], + elif_else_clauses: [], + }, + ), + Expr( + StmtExpr { + range: 101..102, + value: NumberLiteral( + ExprNumberLiteral { + range: 101..102, + value: Int( + 1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 104..105, + value: NumberLiteral( + ExprNumberLiteral { + range: 104..105, + value: Int( + 2, + ), + }, + ), + }, + ), + Pass( + StmtPass { + range: 107..111, + }, + ), + Expr( + StmtExpr { + range: 112..113, + value: NumberLiteral( + ExprNumberLiteral { + range: 112..113, + value: Int( + 1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 115..118, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 115..118, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 120..133, + value: If( + ExprIf { + range: 120..133, + test: Name( + ExprName { + range: 125..126, + id: "b", + ctx: Load, + }, + ), + body: Name( + ExprName { + range: 120..121, + id: "a", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 132..133, + id: "c", + ctx: Load, + }, + ), + }, + ), + }, + ), + If( + StmtIf { + range: 135..157, + test: Name( + ExprName { + range: 138..139, + id: "c", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 141..142, + value: Name( + ExprName { + range: 141..142, + id: "B", + ctx: Load, + }, + ), + }, + ), + Delete( + StmtDelete { + range: 144..149, + targets: [ + Name( + ExprName { + range: 148..149, + id: "A", + ctx: Del, + }, + ), + ], + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 150..157, + test: None, + body: [ + Expr( + StmtExpr { + range: 156..157, + value: Name( + ExprName { + range: 156..157, + id: "C", + ctx: Load, + }, + ), + }, + ), + ], + }, + ], + }, + ), + If( + StmtIf { + range: 158..171, + test: Name( + ExprName { + range: 161..162, + id: "x", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 164..171, + value: Yield( + ExprYield { + range: 164..171, + value: Some( + Name( + ExprName { + range: 170..171, + id: "x", + ctx: Load, + }, + ), + ), + }, + ), + }, + ), + ], + elif_else_clauses: [], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__try.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__try.py.snap new file mode 100644 index 0000000000..c7da1fecb2 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__try.py.snap @@ -0,0 +1,1561 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/try.py +--- +## AST + +``` +Module( + ModModule { + range: 0..1223, + body: [ + Try( + StmtTry { + range: 0..28, + body: [ + Expr( + StmtExpr { + range: 9..12, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 9..12, + }, + ), + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 13..28, + type_: None, + name: None, + body: [ + Expr( + StmtExpr { + range: 25..28, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 25..28, + }, + ), + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: false, + }, + ), + Try( + StmtTry { + range: 30..106, + body: [ + Expr( + StmtExpr { + range: 39..42, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 39..42, + }, + ), + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 43..74, + type_: Some( + Name( + ExprName { + range: 50..60, + id: "Exception1", + ctx: Load, + }, + ), + ), + name: Some( + Identifier { + id: "e", + range: 64..65, + }, + ), + body: [ + Expr( + StmtExpr { + range: 71..74, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 71..74, + }, + ), + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 75..106, + type_: Some( + Name( + ExprName { + range: 82..92, + id: "Exception2", + ctx: Load, + }, + ), + ), + name: Some( + Identifier { + id: "e", + range: 96..97, + }, + ), + body: [ + Expr( + StmtExpr { + range: 103..106, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 103..106, + }, + ), + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: false, + }, + ), + Try( + StmtTry { + range: 108..184, + body: [ + Expr( + StmtExpr { + range: 117..120, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 117..120, + }, + ), + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 121..151, + type_: Some( + Name( + ExprName { + range: 128..137, + id: "Exception", + ctx: Load, + }, + ), + ), + name: Some( + Identifier { + id: "e", + range: 141..142, + }, + ), + body: [ + Expr( + StmtExpr { + range: 148..151, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 148..151, + }, + ), + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 152..167, + type_: None, + name: None, + body: [ + Expr( + StmtExpr { + range: 164..167, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 164..167, + }, + ), + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [ + Expr( + StmtExpr { + range: 181..184, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 181..184, + }, + ), + }, + ), + ], + is_star: false, + }, + ), + Try( + StmtTry { + range: 186..228, + body: [ + Expr( + StmtExpr { + range: 195..198, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 195..198, + }, + ), + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 199..214, + type_: None, + name: None, + body: [ + Expr( + StmtExpr { + range: 211..214, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 211..214, + }, + ), + }, + ), + ], + }, + ), + ], + orelse: [ + Expr( + StmtExpr { + range: 225..228, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 225..228, + }, + ), + }, + ), + ], + finalbody: [], + is_star: false, + }, + ), + Try( + StmtTry { + range: 230..289, + body: [ + Expr( + StmtExpr { + range: 239..242, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 239..242, + }, + ), + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 243..258, + type_: None, + name: None, + body: [ + Expr( + StmtExpr { + range: 255..258, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 255..258, + }, + ), + }, + ), + ], + }, + ), + ], + orelse: [ + Expr( + StmtExpr { + range: 269..272, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 269..272, + }, + ), + }, + ), + ], + finalbody: [ + Expr( + StmtExpr { + range: 286..289, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 286..289, + }, + ), + }, + ), + ], + is_star: false, + }, + ), + Try( + StmtTry { + range: 291..320, + body: [ + Expr( + StmtExpr { + range: 300..303, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 300..303, + }, + ), + }, + ), + ], + handlers: [], + orelse: [], + finalbody: [ + Expr( + StmtExpr { + range: 317..320, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 317..320, + }, + ), + }, + ), + ], + is_star: false, + }, + ), + Try( + StmtTry { + range: 322..365, + body: [ + Expr( + StmtExpr { + range: 331..334, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 331..334, + }, + ), + }, + ), + ], + handlers: [], + orelse: [ + Expr( + StmtExpr { + range: 345..348, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 345..348, + }, + ), + }, + ), + ], + finalbody: [ + Expr( + StmtExpr { + range: 362..365, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 362..365, + }, + ), + }, + ), + ], + is_star: false, + }, + ), + Try( + StmtTry { + range: 367..441, + body: [ + Expr( + StmtExpr { + range: 376..379, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 376..379, + }, + ), + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 380..409, + type_: Some( + Name( + ExprName { + range: 388..394, + id: "GroupA", + ctx: Load, + }, + ), + ), + name: Some( + Identifier { + id: "eg", + range: 398..400, + }, + ), + body: [ + Expr( + StmtExpr { + range: 406..409, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 406..409, + }, + ), + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 410..441, + type_: Some( + Name( + ExprName { + range: 418..432, + id: "ExceptionGroup", + ctx: Load, + }, + ), + ), + name: None, + body: [ + Expr( + StmtExpr { + range: 438..441, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 438..441, + }, + ), + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: true, + }, + ), + Try( + StmtTry { + range: 443..577, + body: [ + Raise( + StmtRaise { + range: 452..471, + exc: Some( + Call( + ExprCall { + range: 458..471, + func: Name( + ExprName { + range: 458..468, + id: "ValueError", + ctx: Load, + }, + ), + arguments: Arguments { + range: 468..471, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 469..470, + value: Int( + 1, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ), + cause: None, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 472..525, + type_: Some( + Name( + ExprName { + range: 479..488, + id: "TypeError", + ctx: Load, + }, + ), + ), + name: Some( + Identifier { + id: "e", + range: 492..493, + }, + ), + body: [ + Expr( + StmtExpr { + range: 499..525, + value: Call( + ExprCall { + range: 499..525, + func: Name( + ExprName { + range: 499..504, + id: "print", + ctx: Load, + }, + ), + arguments: Arguments { + range: 504..525, + args: [ + FString( + ExprFString { + range: 505..524, + value: FStringValue { + inner: Single( + FString( + FString { + range: 505..524, + elements: [ + Literal( + FStringLiteralElement { + range: 507..514, + value: "caught ", + }, + ), + Expression( + FStringExpressionElement { + range: 514..523, + expression: Call( + ExprCall { + range: 515..522, + func: Name( + ExprName { + range: 515..519, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 519..522, + args: [ + Name( + ExprName { + range: 520..521, + id: "e", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 526..577, + type_: Some( + Name( + ExprName { + range: 533..540, + id: "OSError", + ctx: Load, + }, + ), + ), + name: Some( + Identifier { + id: "e", + range: 544..545, + }, + ), + body: [ + Expr( + StmtExpr { + range: 551..577, + value: Call( + ExprCall { + range: 551..577, + func: Name( + ExprName { + range: 551..556, + id: "print", + ctx: Load, + }, + ), + arguments: Arguments { + range: 556..577, + args: [ + FString( + ExprFString { + range: 557..576, + value: FStringValue { + inner: Single( + FString( + FString { + range: 557..576, + elements: [ + Literal( + FStringLiteralElement { + range: 559..566, + value: "caught ", + }, + ), + Expression( + FStringExpressionElement { + range: 566..575, + expression: Call( + ExprCall { + range: 567..574, + func: Name( + ExprName { + range: 567..571, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 571..574, + args: [ + Name( + ExprName { + range: 572..573, + id: "e", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: false, + }, + ), + Try( + StmtTry { + range: 579..831, + body: [ + Raise( + StmtRaise { + range: 588..669, + exc: Some( + Call( + ExprCall { + range: 594..669, + func: Name( + ExprName { + range: 594..608, + id: "ExceptionGroup", + ctx: Load, + }, + ), + arguments: Arguments { + range: 608..669, + args: [ + StringLiteral( + ExprStringLiteral { + range: 609..613, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 609..613, + value: "eg", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + List( + ExprList { + range: 615..668, + elts: [ + Call( + ExprCall { + range: 616..629, + func: Name( + ExprName { + range: 616..626, + id: "ValueError", + ctx: Load, + }, + ), + arguments: Arguments { + range: 626..629, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 627..628, + value: Int( + 1, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + Call( + ExprCall { + range: 631..643, + func: Name( + ExprName { + range: 631..640, + id: "TypeError", + ctx: Load, + }, + ), + arguments: Arguments { + range: 640..643, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 641..642, + value: Int( + 2, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + Call( + ExprCall { + range: 645..655, + func: Name( + ExprName { + range: 645..652, + id: "OSError", + ctx: Load, + }, + ), + arguments: Arguments { + range: 652..655, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 653..654, + value: Int( + 3, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + Call( + ExprCall { + range: 657..667, + func: Name( + ExprName { + range: 657..664, + id: "OSError", + ctx: Load, + }, + ), + arguments: Arguments { + range: 664..667, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 665..666, + value: Int( + 4, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ], + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + ), + cause: None, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 670..751, + type_: Some( + Name( + ExprName { + range: 678..687, + id: "TypeError", + ctx: Load, + }, + ), + ), + name: Some( + Identifier { + id: "e", + range: 691..692, + }, + ), + body: [ + Expr( + StmtExpr { + range: 698..751, + value: Call( + ExprCall { + range: 698..751, + func: Name( + ExprName { + range: 698..703, + id: "print", + ctx: Load, + }, + ), + arguments: Arguments { + range: 703..751, + args: [ + FString( + ExprFString { + range: 704..750, + value: FStringValue { + inner: Single( + FString( + FString { + range: 704..750, + elements: [ + Literal( + FStringLiteralElement { + range: 706..713, + value: "caught ", + }, + ), + Expression( + FStringExpressionElement { + range: 713..722, + expression: Call( + ExprCall { + range: 714..721, + func: Name( + ExprName { + range: 714..718, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 718..721, + args: [ + Name( + ExprName { + range: 719..720, + id: "e", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 722..735, + value: " with nested ", + }, + ), + Expression( + FStringExpressionElement { + range: 735..749, + expression: Attribute( + ExprAttribute { + range: 736..748, + value: Name( + ExprName { + range: 736..737, + id: "e", + ctx: Load, + }, + ), + attr: Identifier { + id: "exceptions", + range: 738..748, + }, + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 752..831, + type_: Some( + Name( + ExprName { + range: 760..767, + id: "OSError", + ctx: Load, + }, + ), + ), + name: Some( + Identifier { + id: "e", + range: 771..772, + }, + ), + body: [ + Expr( + StmtExpr { + range: 778..831, + value: Call( + ExprCall { + range: 778..831, + func: Name( + ExprName { + range: 778..783, + id: "print", + ctx: Load, + }, + ), + arguments: Arguments { + range: 783..831, + args: [ + FString( + ExprFString { + range: 784..830, + value: FStringValue { + inner: Single( + FString( + FString { + range: 784..830, + elements: [ + Literal( + FStringLiteralElement { + range: 786..793, + value: "caught ", + }, + ), + Expression( + FStringExpressionElement { + range: 793..802, + expression: Call( + ExprCall { + range: 794..801, + func: Name( + ExprName { + range: 794..798, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 798..801, + args: [ + Name( + ExprName { + range: 799..800, + id: "e", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + Literal( + FStringLiteralElement { + range: 802..815, + value: " with nested ", + }, + ), + Expression( + FStringExpressionElement { + range: 815..829, + expression: Attribute( + ExprAttribute { + range: 816..828, + value: Name( + ExprName { + range: 816..817, + id: "e", + ctx: Load, + }, + ), + attr: Identifier { + id: "exceptions", + range: 818..828, + }, + ctx: Load, + }, + ), + debug_text: None, + conversion: None, + format_spec: None, + }, + ), + ], + flags: FStringFlags { + quote_style: Double, + prefix: Regular, + triple_quoted: false, + }, + }, + ), + ), + }, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: true, + }, + ), + Try( + StmtTry { + range: 833..1075, + body: [ + Pass( + StmtPass { + range: 842..846, + }, + ), + ], + handlers: [ + ExceptHandler( + ExceptHandlerExceptHandler { + range: 847..875, + type_: Some( + StringLiteral( + ExprStringLiteral { + range: 854..865, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 854..865, + value: "exception", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 871..875, + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 876..894, + type_: Some( + NumberLiteral( + ExprNumberLiteral { + range: 883..884, + value: Int( + 1, + ), + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 890..894, + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 895..916, + type_: Some( + BooleanLiteral( + ExprBooleanLiteral { + range: 902..906, + value: true, + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 912..916, + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 917..939, + type_: Some( + BinOp( + ExprBinOp { + range: 924..929, + left: NumberLiteral( + ExprNumberLiteral { + range: 924..925, + value: Int( + 1, + ), + }, + ), + op: Add, + right: NumberLiteral( + ExprNumberLiteral { + range: 928..929, + value: Int( + 1, + ), + }, + ), + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 935..939, + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 940..962, + type_: Some( + BinOp( + ExprBinOp { + range: 947..952, + left: Name( + ExprName { + range: 947..948, + id: "a", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 951..952, + id: "b", + ctx: Load, + }, + ), + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 958..962, + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 963..987, + type_: Some( + BoolOp( + ExprBoolOp { + range: 970..977, + op: And, + values: [ + Name( + ExprName { + range: 970..971, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 976..977, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 983..987, + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 988..1012, + type_: Some( + Await( + ExprAwait { + range: 995..1002, + value: Name( + ExprName { + range: 1001..1002, + id: "x", + ctx: Load, + }, + ), + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 1008..1012, + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 1013..1041, + type_: Some( + Lambda( + ExprLambda { + range: 1020..1031, + parameters: Some( + Parameters { + range: 1027..1028, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 1027..1028, + parameter: Parameter { + range: 1027..1028, + name: Identifier { + id: "x", + range: 1027..1028, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 1030..1031, + id: "x", + ctx: Load, + }, + ), + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 1037..1041, + }, + ), + ], + }, + ), + ExceptHandler( + ExceptHandlerExceptHandler { + range: 1042..1075, + type_: Some( + If( + ExprIf { + range: 1049..1065, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 1054..1058, + value: true, + }, + ), + body: Name( + ExprName { + range: 1049..1050, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 1064..1065, + id: "y", + ctx: Load, + }, + ), + }, + ), + ), + name: None, + body: [ + Pass( + StmtPass { + range: 1071..1075, + }, + ), + ], + }, + ), + ], + orelse: [], + finalbody: [], + is_star: false, + }, + ), + If( + StmtIf { + range: 1077..1222, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 1080..1084, + value: true, + }, + ), + body: [ + Try( + StmtTry { + range: 1090..1133, + body: [ + Pass( + StmtPass { + range: 1103..1107, + }, + ), + ], + handlers: [], + orelse: [], + finalbody: [ + Pass( + StmtPass { + range: 1129..1133, + }, + ), + ], + is_star: false, + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 1208..1222, + test: None, + body: [ + Pass( + StmtPass { + range: 1218..1222, + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__type.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__type.py.snap new file mode 100644 index 0000000000..1b5e45c466 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__type.py.snap @@ -0,0 +1,2372 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/type.py +--- +## AST + +``` +Module( + ModModule { + range: 0..1661, + body: [ + TypeAlias( + StmtTypeAlias { + range: 0..12, + name: Name( + ExprName { + range: 5..6, + id: "X", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 9..12, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 13..31, + name: Name( + ExprName { + range: 18..19, + id: "X", + ctx: Store, + }, + ), + type_params: None, + value: BinOp( + ExprBinOp { + range: 22..31, + left: Name( + ExprName { + range: 22..25, + id: "int", + ctx: Load, + }, + ), + op: BitOr, + right: Name( + ExprName { + range: 28..31, + id: "str", + ctx: Load, + }, + ), + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 32..60, + name: Name( + ExprName { + range: 37..38, + id: "X", + ctx: Store, + }, + ), + type_params: None, + value: BinOp( + ExprBinOp { + range: 41..60, + left: Name( + ExprName { + range: 41..44, + id: "int", + ctx: Load, + }, + ), + op: BitOr, + right: StringLiteral( + ExprStringLiteral { + range: 47..60, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 47..60, + value: "ForwardRefY", + flags: StringLiteralFlags { + quote_style: Double, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 61..87, + name: Name( + ExprName { + range: 66..67, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 67..70, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 68..69, + name: Identifier { + id: "T", + range: 68..69, + }, + bound: None, + }, + ), + ], + }, + ), + value: BinOp( + ExprBinOp { + range: 73..87, + left: Name( + ExprName { + range: 73..74, + id: "T", + ctx: Load, + }, + ), + op: BitOr, + right: Subscript( + ExprSubscript { + range: 77..87, + value: Name( + ExprName { + range: 77..81, + id: "list", + ctx: Load, + }, + ), + slice: Subscript( + ExprSubscript { + range: 82..86, + value: Name( + ExprName { + range: 82..83, + id: "X", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 84..85, + id: "T", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 101..116, + name: Name( + ExprName { + range: 106..107, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 107..110, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 108..109, + name: Identifier { + id: "T", + range: 108..109, + }, + bound: None, + }, + ), + ], + }, + ), + value: Name( + ExprName { + range: 113..116, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 117..145, + name: Name( + ExprName { + range: 122..123, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 123..126, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 124..125, + name: Identifier { + id: "T", + range: 124..125, + }, + bound: None, + }, + ), + ], + }, + ), + value: BinOp( + ExprBinOp { + range: 129..145, + left: Subscript( + ExprSubscript { + range: 129..136, + value: Name( + ExprName { + range: 129..133, + id: "list", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 134..135, + id: "T", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + op: BitOr, + right: Subscript( + ExprSubscript { + range: 139..145, + value: Name( + ExprName { + range: 139..142, + id: "set", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 143..144, + id: "T", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 146..178, + name: Name( + ExprName { + range: 151..152, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 152..165, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 153..154, + name: Identifier { + id: "T", + range: 153..154, + }, + bound: None, + }, + ), + TypeVarTuple( + TypeParamTypeVarTuple { + range: 156..159, + name: Identifier { + id: "Ts", + range: 157..159, + }, + }, + ), + ParamSpec( + TypeParamParamSpec { + range: 161..164, + name: Identifier { + id: "P", + range: 163..164, + }, + }, + ), + ], + }, + ), + value: Tuple( + ExprTuple { + range: 168..178, + elts: [ + Name( + ExprName { + range: 169..170, + id: "T", + ctx: Load, + }, + ), + Name( + ExprName { + range: 172..174, + id: "Ts", + ctx: Load, + }, + ), + Name( + ExprName { + range: 176..177, + id: "P", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 179..216, + name: Name( + ExprName { + range: 184..185, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 185..203, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 186..192, + name: Identifier { + id: "T", + range: 186..187, + }, + bound: Some( + Name( + ExprName { + range: 189..192, + id: "int", + ctx: Load, + }, + ), + ), + }, + ), + TypeVarTuple( + TypeParamTypeVarTuple { + range: 194..197, + name: Identifier { + id: "Ts", + range: 195..197, + }, + }, + ), + ParamSpec( + TypeParamParamSpec { + range: 199..202, + name: Identifier { + id: "P", + range: 201..202, + }, + }, + ), + ], + }, + ), + value: Tuple( + ExprTuple { + range: 206..216, + elts: [ + Name( + ExprName { + range: 207..208, + id: "T", + ctx: Load, + }, + ), + Name( + ExprName { + range: 210..212, + id: "Ts", + ctx: Load, + }, + ), + Name( + ExprName { + range: 214..215, + id: "P", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 217..261, + name: Name( + ExprName { + range: 222..223, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 223..248, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 224..237, + name: Identifier { + id: "T", + range: 224..225, + }, + bound: Some( + Tuple( + ExprTuple { + range: 227..237, + elts: [ + Name( + ExprName { + range: 228..231, + id: "int", + ctx: Load, + }, + ), + Name( + ExprName { + range: 233..236, + id: "str", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ), + }, + ), + TypeVarTuple( + TypeParamTypeVarTuple { + range: 239..242, + name: Identifier { + id: "Ts", + range: 240..242, + }, + }, + ), + ParamSpec( + TypeParamParamSpec { + range: 244..247, + name: Identifier { + id: "P", + range: 246..247, + }, + }, + ), + ], + }, + ), + value: Tuple( + ExprTuple { + range: 251..261, + elts: [ + Name( + ExprName { + range: 252..253, + id: "T", + ctx: Load, + }, + ), + Name( + ExprName { + range: 255..257, + id: "Ts", + ctx: Load, + }, + ), + Name( + ExprName { + range: 259..260, + id: "P", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 292..307, + name: Name( + ExprName { + range: 297..301, + id: "type", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 304..307, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 308..324, + name: Name( + ExprName { + range: 313..318, + id: "match", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 321..324, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 325..340, + name: Name( + ExprName { + range: 330..334, + id: "case", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 337..340, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 366..381, + name: Name( + ExprName { + range: 371..374, + id: "foo", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 377..381, + id: "type", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 382..398, + name: Name( + ExprName { + range: 387..390, + id: "foo", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 393..398, + id: "match", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 399..414, + name: Name( + ExprName { + range: 404..407, + id: "foo", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 410..414, + id: "case", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 438..453, + name: Name( + ExprName { + range: 446..447, + id: "X", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 450..453, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 454..469, + name: Name( + ExprName { + range: 459..460, + id: "X", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 466..469, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 470..485, + name: Name( + ExprName { + range: 475..476, + id: "X", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 482..485, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 486..506, + name: Name( + ExprName { + range: 491..492, + id: "X", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 501..504, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 507..526, + name: Name( + ExprName { + range: 518..519, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 519..522, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 520..521, + name: Identifier { + id: "T", + range: 520..521, + }, + bound: None, + }, + ), + ], + }, + ), + value: Name( + ExprName { + range: 525..526, + id: "T", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 527..547, + name: Name( + ExprName { + range: 532..533, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 540..543, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 541..542, + name: Identifier { + id: "T", + range: 541..542, + }, + bound: None, + }, + ), + ], + }, + ), + value: Name( + ExprName { + range: 546..547, + id: "T", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 548..567, + name: Name( + ExprName { + range: 553..554, + id: "X", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 554..557, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 555..556, + name: Identifier { + id: "T", + range: 555..556, + }, + bound: None, + }, + ), + ], + }, + ), + value: Name( + ExprName { + range: 566..567, + id: "T", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 589..601, + name: Name( + ExprName { + range: 594..595, + id: "X", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 598..601, + id: "int", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 603..615, + name: Name( + ExprName { + range: 608..609, + id: "X", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 612..615, + id: "str", + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 617..630, + name: Name( + ExprName { + range: 622..623, + id: "X", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 626..630, + id: "type", + ctx: Load, + }, + ), + }, + ), + ClassDef( + StmtClassDef { + range: 631..652, + decorator_list: [], + name: Identifier { + id: "X", + range: 637..638, + }, + type_params: None, + arguments: None, + body: [ + TypeAlias( + StmtTypeAlias { + range: 640..652, + name: Name( + ExprName { + range: 645..646, + id: "X", + ctx: Store, + }, + ), + type_params: None, + value: Name( + ExprName { + range: 649..652, + id: "int", + ctx: Load, + }, + ), + }, + ), + ], + }, + ), + TypeAlias( + StmtTypeAlias { + range: 654..686, + name: Name( + ExprName { + range: 659..664, + id: "Point", + ctx: Store, + }, + ), + type_params: None, + value: Subscript( + ExprSubscript { + range: 667..686, + value: Name( + ExprName { + range: 667..672, + id: "tuple", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 673..685, + elts: [ + Name( + ExprName { + range: 673..678, + id: "float", + ctx: Load, + }, + ), + Name( + ExprName { + range: 680..685, + id: "float", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 687..714, + name: Name( + ExprName { + range: 692..697, + id: "Point", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 697..700, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 698..699, + name: Identifier { + id: "T", + range: 698..699, + }, + bound: None, + }, + ), + ], + }, + ), + value: Subscript( + ExprSubscript { + range: 703..714, + value: Name( + ExprName { + range: 703..708, + id: "tuple", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 709..713, + elts: [ + Name( + ExprName { + range: 709..710, + id: "T", + ctx: Load, + }, + ), + Name( + ExprName { + range: 712..713, + id: "T", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 715..751, + name: Name( + ExprName { + range: 720..727, + id: "IntFunc", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 727..732, + type_params: [ + ParamSpec( + TypeParamParamSpec { + range: 728..731, + name: Identifier { + id: "P", + range: 730..731, + }, + }, + ), + ], + }, + ), + value: Subscript( + ExprSubscript { + range: 735..751, + value: Name( + ExprName { + range: 735..743, + id: "Callable", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 744..750, + elts: [ + Name( + ExprName { + range: 744..745, + id: "P", + ctx: Load, + }, + ), + Name( + ExprName { + range: 747..750, + id: "int", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 765..805, + name: Name( + ExprName { + range: 770..782, + id: "LabeledTuple", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 782..787, + type_params: [ + TypeVarTuple( + TypeParamTypeVarTuple { + range: 783..786, + name: Identifier { + id: "Ts", + range: 784..786, + }, + }, + ), + ], + }, + ), + value: Subscript( + ExprSubscript { + range: 790..805, + value: Name( + ExprName { + range: 790..795, + id: "tuple", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 796..804, + elts: [ + Name( + ExprName { + range: 796..799, + id: "str", + ctx: Load, + }, + ), + Starred( + ExprStarred { + range: 801..804, + value: Name( + ExprName { + range: 802..804, + id: "Ts", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 822..870, + name: Name( + ExprName { + range: 827..843, + id: "HashableSequence", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 843..856, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 844..855, + name: Identifier { + id: "T", + range: 844..845, + }, + bound: Some( + Name( + ExprName { + range: 847..855, + id: "Hashable", + ctx: Load, + }, + ), + ), + }, + ), + ], + }, + ), + value: Subscript( + ExprSubscript { + range: 859..870, + value: Name( + ExprName { + range: 859..867, + id: "Sequence", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 868..869, + id: "T", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + TypeAlias( + StmtTypeAlias { + range: 893..943, + name: Name( + ExprName { + range: 898..914, + id: "IntOrStrSequence", + ctx: Store, + }, + ), + type_params: Some( + TypeParams { + range: 914..929, + type_params: [ + TypeVar( + TypeParamTypeVar { + range: 915..928, + name: Identifier { + id: "T", + range: 915..916, + }, + bound: Some( + Tuple( + ExprTuple { + range: 918..928, + elts: [ + Name( + ExprName { + range: 919..922, + id: "int", + ctx: Load, + }, + ), + Name( + ExprName { + range: 924..927, + id: "str", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ), + }, + ), + ], + }, + ), + value: Subscript( + ExprSubscript { + range: 932..943, + value: Name( + ExprName { + range: 932..940, + id: "Sequence", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 941..942, + id: "T", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 997..1011, + value: Tuple( + ExprTuple { + range: 997..1011, + elts: [ + BinOp( + ExprBinOp { + range: 997..1008, + left: BinOp( + ExprBinOp { + range: 997..1004, + left: Name( + ExprName { + range: 997..1001, + id: "type", + ctx: Load, + }, + ), + op: Mult, + right: Name( + ExprName { + range: 1003..1004, + id: "a", + ctx: Load, + }, + ), + }, + ), + op: Add, + right: Name( + ExprName { + range: 1007..1008, + id: "b", + ctx: Load, + }, + ), + }, + ), + Name( + ExprName { + range: 1010..1011, + id: "c", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1036..1052, + value: Tuple( + ExprTuple { + range: 1036..1052, + elts: [ + BinOp( + ExprBinOp { + range: 1036..1049, + left: Name( + ExprName { + range: 1036..1040, + id: "type", + ctx: Load, + }, + ), + op: Mult, + right: BinOp( + ExprBinOp { + range: 1043..1048, + left: Name( + ExprName { + range: 1043..1044, + id: "a", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 1047..1048, + id: "b", + ctx: Load, + }, + ), + }, + ), + }, + ), + Name( + ExprName { + range: 1051..1052, + id: "c", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1077..1093, + value: Call( + ExprCall { + range: 1077..1093, + func: Name( + ExprName { + range: 1077..1081, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1082..1093, + args: [ + Starred( + ExprStarred { + range: 1083..1089, + value: BinOp( + ExprBinOp { + range: 1084..1089, + left: Name( + ExprName { + range: 1084..1085, + id: "a", + ctx: Load, + }, + ), + op: Add, + right: Name( + ExprName { + range: 1088..1089, + id: "b", + ctx: Load, + }, + ), + }, + ), + ctx: Load, + }, + ), + Name( + ExprName { + range: 1091..1092, + id: "c", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1119..1134, + value: BinOp( + ExprBinOp { + range: 1119..1134, + left: BinOp( + ExprBinOp { + range: 1119..1130, + left: Name( + ExprName { + range: 1119..1123, + id: "type", + ctx: Load, + }, + ), + op: Sub, + right: BinOp( + ExprBinOp { + range: 1125..1130, + left: Name( + ExprName { + range: 1125..1126, + id: "a", + ctx: Load, + }, + ), + op: Mult, + right: Name( + ExprName { + range: 1129..1130, + id: "b", + ctx: Load, + }, + ), + }, + ), + }, + ), + op: Add, + right: Name( + ExprName { + range: 1133..1134, + id: "c", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1160..1177, + value: BinOp( + ExprBinOp { + range: 1160..1177, + left: BinOp( + ExprBinOp { + range: 1160..1173, + left: Name( + ExprName { + range: 1160..1164, + id: "type", + ctx: Load, + }, + ), + op: Sub, + right: BinOp( + ExprBinOp { + range: 1167..1172, + left: Name( + ExprName { + range: 1167..1168, + id: "a", + ctx: Load, + }, + ), + op: Mult, + right: Name( + ExprName { + range: 1171..1172, + id: "b", + ctx: Load, + }, + ), + }, + ), + }, + ), + op: Add, + right: Name( + ExprName { + range: 1176..1177, + id: "c", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1203..1220, + value: BinOp( + ExprBinOp { + range: 1203..1220, + left: BinOp( + ExprBinOp { + range: 1203..1216, + left: Call( + ExprCall { + range: 1203..1212, + func: Name( + ExprName { + range: 1203..1207, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1208..1212, + args: [ + UnaryOp( + ExprUnaryOp { + range: 1209..1211, + op: USub, + operand: Name( + ExprName { + range: 1210..1211, + id: "a", + ctx: Load, + }, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + op: Mult, + right: Name( + ExprName { + range: 1215..1216, + id: "b", + ctx: Load, + }, + ), + }, + ), + op: Add, + right: Name( + ExprName { + range: 1219..1220, + id: "c", + ctx: Load, + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1247..1256, + value: Attribute( + ExprAttribute { + range: 1247..1256, + value: Call( + ExprCall { + range: 1247..1254, + func: Name( + ExprName { + range: 1247..1251, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1252..1254, + args: [], + keywords: [], + }, + }, + ), + attr: Identifier { + id: "a", + range: 1255..1256, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1272..1283, + value: Attribute( + ExprAttribute { + range: 1272..1283, + value: Call( + ExprCall { + range: 1272..1281, + func: Name( + ExprName { + range: 1272..1276, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1277..1281, + args: [ + Tuple( + ExprTuple { + range: 1278..1280, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + ], + keywords: [], + }, + }, + ), + attr: Identifier { + id: "a", + range: 1282..1283, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1301..1313, + value: Attribute( + ExprAttribute { + range: 1301..1313, + value: Call( + ExprCall { + range: 1301..1311, + func: Name( + ExprName { + range: 1301..1305, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1306..1311, + args: [ + Tuple( + ExprTuple { + range: 1307..1309, + elts: [], + ctx: Load, + parenthesized: true, + }, + ), + ], + keywords: [], + }, + }, + ), + attr: Identifier { + id: "a", + range: 1312..1313, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1331..1341, + value: Attribute( + ExprAttribute { + range: 1331..1341, + value: Subscript( + ExprSubscript { + range: 1331..1339, + value: Name( + ExprName { + range: 1331..1335, + id: "type", + ctx: Load, + }, + ), + slice: Name( + ExprName { + range: 1337..1338, + id: "a", + ctx: Load, + }, + ), + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 1340..1341, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1358..1369, + value: Attribute( + ExprAttribute { + range: 1358..1369, + value: Subscript( + ExprSubscript { + range: 1358..1367, + value: Name( + ExprName { + range: 1358..1362, + id: "type", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 1364..1366, + elts: [ + Name( + ExprName { + range: 1364..1365, + id: "a", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: false, + }, + ), + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 1368..1369, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1408..1421, + value: Attribute( + ExprAttribute { + range: 1408..1421, + value: Subscript( + ExprSubscript { + range: 1408..1419, + value: Name( + ExprName { + range: 1408..1412, + id: "type", + ctx: Load, + }, + ), + slice: Tuple( + ExprTuple { + range: 1414..1418, + elts: [ + Name( + ExprName { + range: 1415..1416, + id: "a", + ctx: Load, + }, + ), + ], + ctx: Load, + parenthesized: true, + }, + ), + ctx: Load, + }, + ), + attr: Identifier { + id: "b", + range: 1420..1421, + }, + ctx: Load, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1441..1457, + value: Subscript( + ExprSubscript { + range: 1441..1457, + value: Call( + ExprCall { + range: 1441..1447, + func: Name( + ExprName { + range: 1441..1445, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1445..1447, + args: [], + keywords: [], + }, + }, + ), + slice: Slice( + ExprSlice { + range: 1448..1456, + lower: Some( + Name( + ExprName { + range: 1448..1449, + id: "a", + ctx: Load, + }, + ), + ), + upper: Some( + Name( + ExprName { + range: 1455..1456, + id: "b", + ctx: Load, + }, + ), + ), + step: None, + }, + ), + ctx: Load, + }, + ), + }, + ), + If( + StmtIf { + range: 1476..1494, + test: Named( + ExprNamed { + range: 1479..1488, + target: Name( + ExprName { + range: 1479..1483, + id: "type", + ctx: Store, + }, + ), + value: NumberLiteral( + ExprNumberLiteral { + range: 1487..1488, + value: Int( + 1, + ), + }, + ), + }, + ), + body: [ + Pass( + StmtPass { + range: 1490..1494, + }, + ), + ], + elif_else_clauses: [], + }, + ), + Assign( + StmtAssign { + range: 1495..1530, + targets: [ + Name( + ExprName { + range: 1495..1499, + id: "type", + ctx: Store, + }, + ), + ], + value: Lambda( + ExprLambda { + range: 1502..1530, + parameters: Some( + Parameters { + range: 1509..1514, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 1509..1514, + parameter: Parameter { + range: 1509..1514, + name: Identifier { + id: "query", + range: 1509..1514, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Compare( + ExprCompare { + range: 1516..1530, + left: Name( + ExprName { + range: 1516..1521, + id: "query", + ctx: Load, + }, + ), + ops: [ + Eq, + ], + comparators: [ + Name( + ExprName { + range: 1525..1530, + id: "event", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1531..1546, + value: Call( + ExprCall { + range: 1531..1546, + func: Name( + ExprName { + range: 1531..1536, + id: "print", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1536..1546, + args: [ + Call( + ExprCall { + range: 1537..1545, + func: Name( + ExprName { + range: 1537..1541, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1541..1545, + args: [ + NumberLiteral( + ExprNumberLiteral { + range: 1542..1544, + value: Int( + 12, + ), + }, + ), + ], + keywords: [], + }, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1547..1557, + value: Call( + ExprCall { + range: 1547..1557, + func: Name( + ExprName { + range: 1547..1551, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1551..1557, + args: [ + Name( + ExprName { + range: 1552..1556, + id: "type", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 1558..1576, + targets: [ + Name( + ExprName { + range: 1558..1559, + id: "a", + ctx: Store, + }, + ), + ], + value: Compare( + ExprCompare { + range: 1565..1574, + left: Name( + ExprName { + range: 1565..1569, + id: "type", + ctx: Load, + }, + ), + ops: [ + In, + ], + comparators: [ + Name( + ExprName { + range: 1573..1574, + id: "C", + ctx: Load, + }, + ), + ], + }, + ), + }, + ), + Assign( + StmtAssign { + range: 1577..1593, + targets: [ + Name( + ExprName { + range: 1577..1578, + id: "a", + ctx: Store, + }, + ), + ], + value: Call( + ExprCall { + range: 1584..1591, + func: Name( + ExprName { + range: 1584..1588, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1588..1591, + args: [ + Name( + ExprName { + range: 1589..1590, + id: "b", + ctx: Load, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1594..1611, + value: Call( + ExprCall { + range: 1594..1611, + func: Name( + ExprName { + range: 1594..1598, + id: "type", + ctx: Load, + }, + ), + arguments: Arguments { + range: 1599..1611, + args: [], + keywords: [ + Keyword { + range: 1602..1609, + arg: Some( + Identifier { + id: "X", + range: 1602..1603, + }, + ), + value: Name( + ExprName { + range: 1606..1609, + id: "int", + ctx: Load, + }, + ), + }, + ], + }, + }, + ), + }, + ), + Assign( + StmtAssign { + range: 1612..1620, + targets: [ + Name( + ExprName { + range: 1612..1616, + id: "type", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1619..1620, + value: Int( + 1, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 1621..1633, + targets: [ + Name( + ExprName { + range: 1621..1625, + id: "type", + ctx: Store, + }, + ), + Name( + ExprName { + range: 1628..1629, + id: "x", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1632..1633, + value: Int( + 1, + ), + }, + ), + }, + ), + Assign( + StmtAssign { + range: 1634..1646, + targets: [ + Name( + ExprName { + range: 1634..1635, + id: "x", + ctx: Store, + }, + ), + Name( + ExprName { + range: 1638..1642, + id: "type", + ctx: Store, + }, + ), + ], + value: NumberLiteral( + ExprNumberLiteral { + range: 1645..1646, + value: Int( + 1, + ), + }, + ), + }, + ), + Expr( + StmtExpr { + range: 1647..1661, + value: Lambda( + ExprLambda { + range: 1647..1661, + parameters: Some( + Parameters { + range: 1654..1655, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 1654..1655, + parameter: Parameter { + range: 1654..1655, + name: Identifier { + id: "x", + range: 1654..1655, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 1657..1661, + id: "type", + ctx: Load, + }, + ), + }, + ), + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__while.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__while.py.snap new file mode 100644 index 0000000000..c0c307dccd --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__while.py.snap @@ -0,0 +1,461 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/while.py +--- +## AST + +``` +Module( + ModModule { + range: 0..314, + body: [ + While( + StmtWhile { + range: 0..16, + test: Name( + ExprName { + range: 6..7, + id: "x", + ctx: Load, + }, + ), + body: [ + Expr( + StmtExpr { + range: 13..16, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 13..16, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + While( + StmtWhile { + range: 18..61, + test: BoolOp( + ExprBoolOp { + range: 24..37, + op: And, + values: [ + Compare( + ExprCompare { + range: 25..30, + left: Name( + ExprName { + range: 25..26, + id: "x", + ctx: Load, + }, + ), + ops: [ + Gt, + ], + comparators: [ + NumberLiteral( + ExprNumberLiteral { + range: 29..30, + value: Int( + 1, + ), + }, + ), + ], + }, + ), + Name( + ExprName { + range: 36..37, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + body: [ + Pass( + StmtPass { + range: 43..47, + }, + ), + ], + orelse: [ + Expr( + StmtExpr { + range: 58..61, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 58..61, + }, + ), + }, + ), + ], + }, + ), + While( + StmtWhile { + range: 63..152, + test: BoolOp( + ExprBoolOp { + range: 69..76, + op: And, + values: [ + Name( + ExprName { + range: 69..70, + id: "x", + ctx: Load, + }, + ), + Name( + ExprName { + range: 75..76, + id: "y", + ctx: Load, + }, + ), + ], + }, + ), + body: [ + Expr( + StmtExpr { + range: 82..85, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 82..85, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 90..111, + value: Call( + ExprCall { + range: 90..111, + func: Name( + ExprName { + range: 90..95, + id: "print", + ctx: Load, + }, + ), + arguments: Arguments { + range: 95..111, + args: [ + StringLiteral( + ExprStringLiteral { + range: 96..110, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 96..110, + value: "Hello World!", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + ], + orelse: [ + Expr( + StmtExpr { + range: 123..144, + value: Call( + ExprCall { + range: 123..144, + func: Name( + ExprName { + range: 123..128, + id: "print", + ctx: Load, + }, + ), + arguments: Arguments { + range: 128..144, + args: [ + StringLiteral( + ExprStringLiteral { + range: 129..143, + value: StringLiteralValue { + inner: Single( + StringLiteral { + range: 129..143, + value: "Olá, Mundo!", + flags: StringLiteralFlags { + quote_style: Single, + prefix: Empty, + triple_quoted: false, + }, + }, + ), + }, + }, + ), + ], + keywords: [], + }, + }, + ), + }, + ), + Expr( + StmtExpr { + range: 149..152, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 149..152, + }, + ), + }, + ), + ], + }, + ), + While( + StmtWhile { + range: 154..171, + test: Named( + ExprNamed { + range: 160..166, + target: Name( + ExprName { + range: 160..161, + id: "a", + ctx: Store, + }, + ), + value: Name( + ExprName { + range: 165..166, + id: "b", + ctx: Load, + }, + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 168..171, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 168..171, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + While( + StmtWhile { + range: 172..197, + test: BoolOp( + ExprBoolOp { + range: 178..192, + op: And, + values: [ + Named( + ExprNamed { + range: 179..185, + target: Name( + ExprName { + range: 179..180, + id: "a", + ctx: Store, + }, + ), + value: Name( + ExprName { + range: 184..185, + id: "b", + ctx: Load, + }, + ), + }, + ), + Name( + ExprName { + range: 191..192, + id: "c", + ctx: Load, + }, + ), + ], + }, + ), + body: [ + Expr( + StmtExpr { + range: 194..197, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 194..197, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + While( + StmtWhile { + range: 198..220, + test: Lambda( + ExprLambda { + range: 204..215, + parameters: Some( + Parameters { + range: 211..212, + posonlyargs: [], + args: [ + ParameterWithDefault { + range: 211..212, + parameter: Parameter { + range: 211..212, + name: Identifier { + id: "x", + range: 211..212, + }, + annotation: None, + }, + default: None, + }, + ], + vararg: None, + kwonlyargs: [], + kwarg: None, + }, + ), + body: Name( + ExprName { + range: 214..215, + id: "x", + ctx: Load, + }, + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 217..220, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 217..220, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + While( + StmtWhile { + range: 221..239, + test: Await( + ExprAwait { + range: 227..234, + value: Name( + ExprName { + range: 233..234, + id: "x", + ctx: Load, + }, + ), + }, + ), + body: [ + Expr( + StmtExpr { + range: 236..239, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 236..239, + }, + ), + }, + ), + ], + orelse: [], + }, + ), + If( + StmtIf { + range: 241..313, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 244..248, + value: true, + }, + ), + body: [ + While( + StmtWhile { + range: 254..298, + test: Name( + ExprName { + range: 260..261, + id: "x", + ctx: Load, + }, + ), + body: [ + Pass( + StmtPass { + range: 271..275, + }, + ), + ], + orelse: [ + Pass( + StmtPass { + range: 294..298, + }, + ), + ], + }, + ), + ], + elif_else_clauses: [ + ElifElseClause { + range: 299..313, + test: None, + body: [ + Pass( + StmtPass { + range: 309..313, + }, + ), + ], + }, + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__with.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__with.py.snap new file mode 100644 index 0000000000..cbd06ce993 --- /dev/null +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__with.py.snap @@ -0,0 +1,399 @@ +--- +source: crates/ruff_python_parser/tests/fixtures.rs +input_file: crates/ruff_python_parser/resources/valid/statement/with.py +--- +## AST + +``` +Module( + ModModule { + range: 0..361, + body: [ + With( + StmtWith { + range: 137..151, + is_async: false, + items: [ + WithItem { + range: 142..146, + context_expr: Name( + ExprName { + range: 142..146, + id: "item", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 148..151, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 148..151, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 152..171, + is_async: false, + items: [ + WithItem { + range: 157..166, + context_expr: Name( + ExprName { + range: 157..161, + id: "item", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 165..166, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 168..171, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 168..171, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 172..194, + is_async: false, + items: [ + WithItem { + range: 177..182, + context_expr: Name( + ExprName { + range: 177..182, + id: "item1", + ctx: Load, + }, + ), + optional_vars: None, + }, + WithItem { + range: 184..189, + context_expr: Name( + ExprName { + range: 184..189, + id: "item2", + ctx: Load, + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 191..194, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 191..194, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 195..229, + is_async: false, + items: [ + WithItem { + range: 200..211, + context_expr: Name( + ExprName { + range: 200..205, + id: "item1", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 209..211, + id: "f1", + ctx: Store, + }, + ), + ), + }, + WithItem { + range: 213..224, + context_expr: Name( + ExprName { + range: 213..218, + id: "item2", + ctx: Load, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 222..224, + id: "f2", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 226..229, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 226..229, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 231..257, + is_async: false, + items: [ + WithItem { + range: 236..252, + context_expr: If( + ExprIf { + range: 236..252, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 241..245, + value: true, + }, + ), + body: Name( + ExprName { + range: 236..237, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 251..252, + id: "y", + ctx: Load, + }, + ), + }, + ), + optional_vars: None, + }, + ], + body: [ + Expr( + StmtExpr { + range: 254..257, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 254..257, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 258..289, + is_async: false, + items: [ + WithItem { + range: 263..284, + context_expr: If( + ExprIf { + range: 263..279, + test: BooleanLiteral( + ExprBooleanLiteral { + range: 268..272, + value: true, + }, + ), + body: Name( + ExprName { + range: 263..264, + id: "x", + ctx: Load, + }, + ), + orelse: Name( + ExprName { + range: 278..279, + id: "y", + ctx: Load, + }, + ), + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 283..284, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 286..289, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 286..289, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 313..334, + is_async: false, + items: [ + WithItem { + range: 318..329, + context_expr: Call( + ExprCall { + range: 318..324, + func: Name( + ExprName { + range: 318..322, + id: "open", + ctx: Load, + }, + ), + arguments: Arguments { + range: 322..324, + args: [], + keywords: [], + }, + }, + ), + optional_vars: Some( + Name( + ExprName { + range: 328..329, + id: "f", + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 331..334, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 331..334, + }, + ), + }, + ), + ], + }, + ), + With( + StmtWith { + range: 335..361, + is_async: false, + items: [ + WithItem { + range: 340..356, + context_expr: Call( + ExprCall { + range: 340..346, + func: Name( + ExprName { + range: 340..344, + id: "open", + ctx: Load, + }, + ), + arguments: Arguments { + range: 344..346, + args: [], + keywords: [], + }, + }, + ), + optional_vars: Some( + Attribute( + ExprAttribute { + range: 350..356, + value: Name( + ExprName { + range: 350..351, + id: "f", + ctx: Load, + }, + ), + attr: Identifier { + id: "attr", + range: 352..356, + }, + ctx: Store, + }, + ), + ), + }, + ], + body: [ + Expr( + StmtExpr { + range: 358..361, + value: EllipsisLiteral( + ExprEllipsisLiteral { + range: 358..361, + }, + ), + }, + ), + ], + }, + ), + ], + }, +) +``` diff --git a/crates/ruff_python_semantic/src/analyze/terminal.rs b/crates/ruff_python_semantic/src/analyze/terminal.rs index acb9483ba2..4702ac439a 100644 --- a/crates/ruff_python_semantic/src/analyze/terminal.rs +++ b/crates/ruff_python_semantic/src/analyze/terminal.rs @@ -339,6 +339,7 @@ fn is_wildcard(pattern: &ast::MatchCase) -> bool { | ast::Pattern::MatchMapping(_) | ast::Pattern::MatchClass(_) | ast::Pattern::MatchStar(_) => false, + ast::Pattern::MatchAs(ast::PatternMatchAs { pattern, .. }) => pattern.is_none(), ast::Pattern::MatchOr(ast::PatternMatchOr { patterns, .. }) => { patterns.iter().all(is_wildcard_pattern) diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 93dd398730..28183f438d 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -20,6 +20,7 @@ cargo-fuzz = true ruff_linter = { path = "../crates/ruff_linter" } ruff_python_ast = { path = "../crates/ruff_python_ast" } ruff_python_codegen = { path = "../crates/ruff_python_codegen" } +ruff_python_index = { path = "../crates/ruff_python_index" } ruff_python_parser = { path = "../crates/ruff_python_parser" } ruff_source_file = { path = "../crates/ruff_source_file" } ruff_python_formatter = { path = "../crates/ruff_python_formatter"} diff --git a/fuzz/corpus/ruff_new_parser_equiv b/fuzz/corpus/ruff_new_parser_equiv new file mode 120000 index 0000000000..38dc5bc1ea --- /dev/null +++ b/fuzz/corpus/ruff_new_parser_equiv @@ -0,0 +1 @@ +ruff_fix_validity \ No newline at end of file diff --git a/fuzz/fuzz_targets/ruff_parse_simple.rs b/fuzz/fuzz_targets/ruff_parse_simple.rs index 24a998336b..657e8c1449 100644 --- a/fuzz/fuzz_targets/ruff_parse_simple.rs +++ b/fuzz/fuzz_targets/ruff_parse_simple.rs @@ -17,8 +17,8 @@ fn do_fuzz(case: &[u8]) -> Corpus { let locator = Locator::new(code); let python_ast = match parse_suite(code) { Ok(stmts) => stmts, - Err(ParseError { offset, .. }) => { - let offset = offset.to_usize(); + Err(ParseError { location, .. }) => { + let offset = location.start().to_usize(); assert!( code.is_char_boundary(offset), "Invalid error location {} (not at char boundary)", @@ -47,7 +47,7 @@ fn do_fuzz(case: &[u8]) -> Corpus { ); } Err(err) => { - let offset = err.location().to_usize(); + let offset = err.location().start().to_usize(); assert!( code.is_char_boundary(offset), "Invalid error location {} (not at char boundary)", diff --git a/pyproject.toml b/pyproject.toml index 7e5196a56f..9495a37bf7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,8 @@ include = [ extend-exclude = [ "crates/ruff/resources/", "crates/ruff_linter/resources/", - "crates/ruff_python_formatter/resources/" + "crates/ruff_python_formatter/resources/", + "crates/ruff_python_parser/resources/" ] [tool.ruff.lint] @@ -74,6 +75,7 @@ force-exclude = ''' /( | crates/ruff_linter/resources | crates/ruff_python_formatter/resources + | crates/ruff_python_parser/resources )/ '''